diff --git a/.gitignore b/.gitignore index 0743489f8ec..b6b4a1a559a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ NashornProfile.txt **/JTreport/** **/JTwork/** /src/utils/LogCompilation/target/ +/src/utils/LogCompilation/logc.jar /.project/ /.settings/ /compile_commands.json diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html index 362245cd00a..c7126622c7d 100644 --- a/doc/hotspot-style.html +++ b/doc/hotspot-style.html @@ -965,9 +965,8 @@ rather than NULL. See the paper for reasons to avoid NULL.

Don't use (constant expression or literal) 0 for pointers. Note that C++14 removed non-literal 0 constants from null pointer -constants, though some compilers continue to treat them as such. -For historical reasons there may be lingering uses of 0 as a -pointer.

+constants, though some compilers continue to treat them as +such.

<atomic>

Do not use facilities provided by the <atomic> header ( echo "#trala:=" +Unquote = $(subst $(QQ),$(Q),$(subst $(SpaceQ),$(SPACE),$(subst $(AssignQ),:=,$1))) + +# $(call QuoteAppend,name,some value) -> name#+some#svalue +# $(call QuoteAppend,bad+=name,some value) -> error +QuoteAppend = $(if $(findstring +=,$1),$(error you can not have += in a variable name: "$1"),$(call Quote,$1)$(AppendQ)$(call Quote,$2)) + +# $(call UnquoteAppendIndex,name#+some#svalue,1) -> name +# $(call UnquoteAppendIndex,name#+some#svalue,2) -> some value +UnquoteAppendIndex = $(call Unquote,$(word $2,$(subst $(AppendQ),$(SPACE),$1))) + +# $(call FilterFiles,dir,%.cpp) -> file1.cpp file2.cpp (without path) +FilterFiles = $(filter $2,$(notdir $(call FindFiles,$1))) + +# $(call Unpack module_,file1.cpp_CXXFLAGS#+-Wconversion file2.cpp_CXXFLAGS#+-Wconversion) -> module_file1.cpp_CXXFLAGS += -Wconversion +# module_file2.cpp_CXXFLAGS += -Wconversion +Unpack = $(foreach pair,$2,$1$(call UnquoteAppendIndex,$(pair),1) += $(call UnquoteAppendIndex,$(pair),2)$(NEWLINE)) + +# This macro takes four arguments: +# $1: directory where to find files (striped), example: $(TOPDIR)/src/hotspot/share/gc/g1 +# $2: filter to match what to keep (striped), example: g1Concurrent%.cpp +# $3: what flags to override (striped), example: _CXXFLAGS +# $4: what value to append to the flag (striped), example: $(CFLAGS_CONVERSION_WARNINGS) +# +# The result will be a quoted string that can be unpacked to a list of +# variable appendings (see macro Unpack above). You do not need to take +# care of unpacking, it is done in NamedParamsMacroTemplate. +# +# This feature should only be used for warnings that we want to +# incrementally add to the rest of the code base. +# +# $(call ExtendFlags,dir,%.cpp,_CXXFLAGS,-Wconversion) -> file1.cpp_CXXFLAGS#+-Wconversion file2.cpp_CXXFLAGS#+-Wconversion +ExtendFlags = $(foreach file,$(call FilterFiles,$(strip $1),$(strip $2)),$(call QuoteAppend,$(file)$(strip $3),$(strip $4))) + ################################################################################ MAX_PARAMS := 96 @@ -166,7 +226,10 @@ define NamedParamsMacroTemplate Too many named arguments to macro, please update MAX_PARAMS in MakeBase.gmk)) # Iterate over 2 3 4... and evaluate the named parameters with $1_ as prefix $(foreach i, $(PARAM_SEQUENCE), $(if $(strip $($i)), \ - $(strip $1)_$(strip $(call EscapeHash, $(call DoubleDollar, $($i))))$(NEWLINE))) + $(if $(findstring :=,$($i)), \ + $(strip $1)_$(strip $(call EscapeHash, $(call DoubleDollar, $($i))))$(NEWLINE), \ + $(call Unpack,$(strip $1)_,$($i))))) + # Debug print all named parameter names and values $(if $(findstring $(LOG_LEVEL), trace), \ $(info $0 $(strip $1) $(foreach i, $(PARAM_SEQUENCE), \ diff --git a/make/conf/github-actions.conf b/make/conf/github-actions.conf index bd73e909062..ebfc9191535 100644 --- a/make/conf/github-actions.conf +++ b/make/conf/github-actions.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2026, 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,7 +26,7 @@ # Versions and download locations for dependencies used by GitHub Actions (GHA) GTEST_VERSION=1.14.0 -JTREG_VERSION=8.1+1 +JTREG_VERSION=8.2.1+1 LINUX_X64_BOOT_JDK_EXT=tar.gz LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk25/bd75d5f9689641da8e1daabeccb5528b/36/GPL/openjdk-25_linux-x64_bin.tar.gz diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 93aeebc0dd6..76a94b7789e 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "jpg", product: "jtreg", - version: "8.1", + version: "8.2.1", build_number: "1", - file: "bundles/jtreg-8.1+1.zip", + file: "bundles/jtreg-8.2.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/make/devkit/Tools.gmk b/make/devkit/Tools.gmk index db77f2f3f74..74c6d861777 100644 --- a/make/devkit/Tools.gmk +++ b/make/devkit/Tools.gmk @@ -78,7 +78,7 @@ else ifeq ($(BASE_OS), Fedora) endif BASE_URL := http://fedora.riscv.rocks/repos-dist/f$(BASE_OS_VERSION)/latest/$(ARCH)/Packages/ else - LATEST_ARCHIVED_OS_VERSION := 36 + LATEST_ARCHIVED_OS_VERSION := 41 ifeq ($(filter aarch64 armhfp x86_64, $(ARCH)), ) FEDORA_TYPE := fedora-secondary else diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk index 39a549b7db0..f41693e05fb 100644 --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2026, 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 @@ -105,7 +105,7 @@ DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \ DISABLED_WARNINGS_clang := delete-non-abstract-non-virtual-dtor \ invalid-offsetof missing-braces \ sometimes-uninitialized unknown-pragmas unused-but-set-variable \ - unused-function unused-local-typedef unused-private-field unused-variable + unused-local-typedef unused-private-field unused-variable ifneq ($(DEBUG_LEVEL), release) # Assert macro gives warning @@ -190,6 +190,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \ abstract_vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \ arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \ whitebox.cpp_CXXFLAGS := $(CFLAGS_SHIP_DEBUGINFO), \ + $(call ExtendFlags, $(TOPDIR)/src/hotspot/share/gc/g1, \ + g1Numa.cpp, _CXXFLAGS, $(CFLAGS_CONVERSION_WARNINGS)), \ DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc), \ DISABLED_WARNINGS_gcc_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp := nonnull, \ DISABLED_WARNINGS_gcc_bytecodeInterpreter.cpp := unused-label, \ diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index 55dd6a8d6ad..ab878a4d2a5 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 @@ -293,8 +293,10 @@ public class CLDRConverter { bundleGenerator = new ResourceBundleGenerator(); // Parse data independent of locales - parseSupplemental(); + // parseBCP47() must precede parseSupplemental(). The latter depends + // on IANA alias map, which is produced by the former. parseBCP47(); + parseSupplemental(); // rules maps pluralRules = generateRules(handlerPlurals); @@ -536,6 +538,12 @@ public class CLDRConverter { // canonical tz name map // alias -> primary + // + // Note that CLDR meta zones do not necessarily align with IANA's + // current time zone identifiers. For example, the CLDR "India" + // meta zone maps to "Asia/Calcutta", whereas IANA now uses + // "Asia/Kolkata" for the zone. Accordingly, "canonical" here is + // defined in terms of CLDR's zone mappings. handlerTimeZone.getData().forEach((k, v) -> { String[] ids = ((String)v).split("\\s"); for (int i = 1; i < ids.length; i++) { diff --git a/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java index 66e94e5ca06..8203a9f0b91 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,9 @@ package build.tools.cldrconverter; import java.io.File; import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import org.xml.sax.Attributes; import org.xml.sax.InputSource; @@ -40,6 +43,10 @@ import org.xml.sax.SAXException; class TimeZoneParseHandler extends AbstractLDMLHandler { private static final String PREF_PREFIX = "preferred:"; + // CLDR aliases to IANA ids map. The initial capacity is estimated + // from the number of aliases in timezone.xml as of CLDR v48 + private final Map ianaAliasMap = HashMap.newHashMap(32); + @Override public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException { // avoid HTTP traffic to unicode.org @@ -61,7 +68,16 @@ class TimeZoneParseHandler extends AbstractLDMLHandler { put(attributes.getValue("name"), PREF_PREFIX + preferred); } } else { - put(attributes.getValue("name"), attributes.getValue("alias")); + var alias = attributes.getValue("alias"); + var iana = attributes.getValue("iana"); + if (iana != null) { + for (var a : alias.split("\\s+")) { + if (!a.equals(iana)) { + ianaAliasMap.put(a, iana); + } + } + } + put(attributes.getValue("name"), alias); } } break; @@ -80,4 +96,8 @@ class TimeZoneParseHandler extends AbstractLDMLHandler { .forEach(e -> map.put(e.getKey(), map.get(e.getValue().toString().substring(PREF_PREFIX.length())))); } + + Map getIanaAliasMap() { + return ianaAliasMap; + } } diff --git a/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java index a584358f0cb..343e143b6ad 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/WinZonesParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,6 +56,7 @@ class WinZonesParseHandler extends AbstractLDMLHandler { String zoneName = attributes.getValue("other"); String territory = attributes.getValue("territory"); String javatz = attributes.getValue("type").replaceFirst("\\s.*", ""); + javatz = CLDRConverter.handlerTimeZone.getIanaAliasMap().getOrDefault(javatz, javatz); put(zoneName + ":" + territory, javatz); pushIgnoredContainer(qName); break; diff --git a/make/modules/java.base/Copy.gmk b/make/modules/java.base/Copy.gmk index b8c1f2c05fa..43b9db651e0 100644 --- a/make/modules/java.base/Copy.gmk +++ b/make/modules/java.base/Copy.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2026, 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 @@ -172,6 +172,10 @@ ifeq ($(USE_EXTERNAL_LIBZ), true) LEGAL_EXCLUDES += zlib.md endif +ifneq ($(TOOLCHAIN_TYPE), gcc) + LEGAL_EXCLUDES += gcc.md +endif + $(eval $(call SetupCopyLegalFiles, COPY_LEGAL, \ EXCLUDES := $(LEGAL_EXCLUDES), \ )) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index a9ca91d9309..9734c6845ea 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -3403,11 +3403,13 @@ encode %{ } else if (rtype == relocInfo::metadata_type) { __ mov_metadata(dst_reg, (Metadata*)con); } else { - assert(rtype == relocInfo::none, "unexpected reloc type"); + assert(rtype == relocInfo::none || rtype == relocInfo::external_word_type, "unexpected reloc type"); + // load fake address constants using a normal move if (! __ is_valid_AArch64_address(con) || con < (address)(uintptr_t)os::vm_page_size()) { __ mov(dst_reg, con); } else { + // no reloc so just use adrp and add uint64_t offset; __ adrp(dst_reg, con, offset); __ add(dst_reg, dst_reg, offset); @@ -4535,6 +4537,18 @@ operand immP_1() interface(CONST_INTER); %} +// AOT Runtime Constants Address +operand immAOTRuntimeConstantsAddress() +%{ + // Check if the address is in the range of AOT Runtime Constants + predicate(AOTRuntimeConstants::contains((address)(n->get_ptr()))); + match(ConP); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // Float and Double operands // Double Immediate operand immD() @@ -6898,6 +6912,20 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con) ins_pipe(ialu_imm); %} +instruct loadAOTRCAddress(iRegPNoSp dst, immAOTRuntimeConstantsAddress con) +%{ + match(Set dst con); + + ins_cost(INSN_COST); + format %{ "adr $dst, $con\t# AOT Runtime Constants Address" %} + + ins_encode %{ + __ load_aotrc_address($dst$$Register, (address)$con$$constant); + %} + + ins_pipe(ialu_imm); +%} + // Load Narrow Pointer Constant instruct loadConN(iRegNNoSp dst, immN con) diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index c0621cbd5c2..30048a2079d 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -33,6 +33,7 @@ #include "c1/c1_ValueStack.hpp" #include "ci/ciArrayKlass.hpp" #include "ci/ciInstance.hpp" +#include "code/aotCodeCache.hpp" #include "code/compiledIC.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gc_globals.hpp" @@ -532,6 +533,15 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod case T_LONG: { assert(patch_code == lir_patch_none, "no patching handled here"); +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + address b = c->as_pointer(); + if (AOTRuntimeConstants::contains(b)) { + __ load_aotrc_address(dest->as_register_lo(), b); + break; + } + } +#endif __ mov(dest->as_register_lo(), (intptr_t)c->as_jlong()); break; } diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp index 958855c7685..dc0b9eb9546 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp @@ -30,7 +30,9 @@ #include "opto/matcher.hpp" #include "opto/output.hpp" #include "opto/subnode.hpp" +#include "runtime/objectMonitorTable.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/powerOfTwo.hpp" @@ -221,37 +223,52 @@ void C2_MacroAssembler::fast_lock(Register obj, Register box, Register t1, if (!UseObjectMonitorTable) { assert(t1_monitor == t1_mark, "should be the same here"); } else { + const Register t1_hash = t1; Label monitor_found; - // Load cache address - lea(t3_t, Address(rthread, JavaThread::om_cache_oops_offset())); + // Save the mark, we might need it to extract the hash. + mov(t3, t1_mark); - const int num_unrolled = 2; + // Look for the monitor in the om_cache. + + ByteSize cache_offset = JavaThread::om_cache_oops_offset(); + ByteSize monitor_offset = OMCache::oop_to_monitor_difference(); + const int num_unrolled = OMCache::CAPACITY; for (int i = 0; i < num_unrolled; i++) { - ldr(t1, Address(t3_t)); - cmp(obj, t1); + ldr(t1_monitor, Address(rthread, cache_offset + monitor_offset)); + ldr(t2, Address(rthread, cache_offset)); + cmp(obj, t2); br(Assembler::EQ, monitor_found); - increment(t3_t, in_bytes(OMCache::oop_to_oop_difference())); + cache_offset = cache_offset + OMCache::oop_to_oop_difference(); } - Label loop; + // Look for the monitor in the table. - // Search for obj in cache. - bind(loop); + // Get the hash code. + ubfx(t1_hash, t3, markWord::hash_shift, markWord::hash_bits); - // Check for match. - ldr(t1, Address(t3_t)); - cmp(obj, t1); - br(Assembler::EQ, monitor_found); + // Get the table and calculate the bucket's address + lea(t3, ExternalAddress(ObjectMonitorTable::current_table_address())); + ldr(t3, Address(t3)); + ldr(t2, Address(t3, ObjectMonitorTable::table_capacity_mask_offset())); + ands(t1_hash, t1_hash, t2); + ldr(t3, Address(t3, ObjectMonitorTable::table_buckets_offset())); - // Search until null encountered, guaranteed _null_sentinel at end. - increment(t3_t, in_bytes(OMCache::oop_to_oop_difference())); - cbnz(t1, loop); - // Cache Miss, NE set from cmp above, cbnz does not set flags - b(slow_path); + // Read the monitor from the bucket. + ldr(t1_monitor, Address(t3, t1_hash, Address::lsl(LogBytesPerWord))); + + // Check if the monitor in the bucket is special (empty, tombstone or removed). + cmp(t1_monitor, (unsigned char)ObjectMonitorTable::SpecialPointerValues::below_is_special); + br(Assembler::LO, slow_path); + + // Check if object matches. + ldr(t3, Address(t1_monitor, ObjectMonitor::object_offset())); + BarrierSetAssembler* bs_asm = BarrierSet::barrier_set()->barrier_set_assembler(); + bs_asm->try_resolve_weak_handle_in_c2(this, t3, t2, slow_path); + cmp(t3, obj); + br(Assembler::NE, slow_path); bind(monitor_found); - ldr(t1_monitor, Address(t3_t, OMCache::oop_to_monitor_difference())); } const Register t2_owner_addr = t2; diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp index d7884c27a2c..68291720208 100644 --- a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp @@ -23,6 +23,7 @@ */ #include "asm/macroAssembler.inline.hpp" +#include "code/aotCodeCache.hpp" #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BarrierSetAssembler.hpp" #include "gc/g1/g1BarrierSetRuntime.hpp" @@ -243,9 +244,25 @@ static void generate_post_barrier(MacroAssembler* masm, assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, noreg, rscratch1); // Does store cross heap regions? - __ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value - __ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) - __ cbz(tmp1, done); + #if INCLUDE_CDS + // AOT code needs to load the barrier grain shift from the aot + // runtime constants area in the code cache otherwise we can compile + // it as an immediate operand + if (AOTCodeCache::is_on_for_dump()) { + address grain_shift_address = (address)AOTRuntimeConstants::grain_shift_address(); + __ eor(tmp1, store_addr, new_val); + __ lea(tmp2, ExternalAddress(grain_shift_address)); + __ ldrb(tmp2, tmp2); + __ lsrv(tmp1, tmp1, tmp2); + __ cbz(tmp1, done); + } else +#endif + { + __ eor(tmp1, store_addr, new_val); // tmp1 := store address ^ new value + __ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) + __ cbz(tmp1, done); + } + // Crosses regions, storing null? if (new_val_may_be_null) { __ cbz(new_val, done); diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp index 021af3e5698..2a78d688097 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -441,6 +441,11 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na return opto_reg; } +void BarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + // Load the oop from the weak handle. + __ ldr(obj, Address(obj)); +} + #undef __ #define __ _masm-> diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp index e69be999f00..c2581b2f962 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -135,6 +135,7 @@ public: OptoReg::Name opto_reg); OptoReg::Name refine_register(const Node* node, OptoReg::Name opto_reg); + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path); #endif // COMPILER2 }; diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp index ad7bac4e067..2f7707227b4 100644 --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -442,6 +443,30 @@ void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler __ bind(done); } +#ifdef COMPILER2 +void ShenandoahBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, + Register tmp, Label& slow_path) { + assert_different_registers(obj, tmp); + + Label done; + + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, tmp, slow_path); + + // Check if the reference is null, and if it is, take the fast path. + __ cbz(obj, done); + + Address gc_state(rthread, ShenandoahThreadLocalData::gc_state_offset()); + __ lea(tmp, gc_state); + __ ldrb(tmp, __ legitimize_address(gc_state, 1, tmp)); + + // Check if the heap is under weak-reference/roots processing, in + // which case we need to take the slow path. + __ tbnz(tmp, ShenandoahHeap::WEAK_ROOTS_BITPOS, slow_path); + __ bind(done); +} +#endif + // Special Shenandoah CAS implementation that handles false negatives due // to concurrent evacuation. The service is more complex than a // traditional CAS operation because the CAS operation is intended to diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp index 362fcae1ccd..d5d5ce8950e 100644 --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,6 +80,9 @@ public: Address dst, Register val, Register tmp1, Register tmp2, Register tmp3); virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); +#ifdef COMPILER2 + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path); +#endif void cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val, bool acquire, bool release, bool is_cae, Register result); }; diff --git a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp index 07a2d6fbfa0..4f0977a414f 100644 --- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ -1326,6 +1326,23 @@ void ZStoreBarrierStubC2Aarch64::emit_code(MacroAssembler& masm) { register_stub(this); } +#undef __ +#define __ masm-> + +void ZBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, tmp, slow_path); + + // Check if the oop is bad, in which case we need to take the slow path. + __ relocate(barrier_Relocation::spec(), ZBarrierRelocationFormatMarkBadBeforeMov); + __ movzw(tmp, barrier_Relocation::unpatched); + __ tst(obj, tmp); + __ br(Assembler::NE, slow_path); + + // Oop is okay, so we uncolor it. + __ lsr(obj, obj, ZPointerLoadShift); +} + #undef __ #endif // COMPILER2 diff --git a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp index 487970ab0c5..fbbc5c1b517 100644 --- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ -191,6 +191,7 @@ public: ZLoadBarrierStubC2* stub) const; void generate_c2_store_barrier_stub(MacroAssembler* masm, ZStoreBarrierStubC2* stub) const; + void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path); #endif // COMPILER2 void check_oop(MacroAssembler* masm, Register obj, Register tmp1, Register tmp2, Label& error); diff --git a/src/hotspot/cpu/aarch64/globals_aarch64.hpp b/src/hotspot/cpu/aarch64/globals_aarch64.hpp index 8e520314c8b..a59e83c4b69 100644 --- a/src/hotspot/cpu/aarch64/globals_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/globals_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2019, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -39,7 +39,7 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI); define_pd_global(size_t, CodeCacheSegmentSize, 64); -define_pd_global(intx, CodeEntryAlignment, 64); +define_pd_global(uint, CodeEntryAlignment, 64); define_pd_global(intx, OptoLoopAlignment, 16); #define DEFAULT_STACK_YELLOW_PAGES (2) diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 409343b6b8d..3e3e95be07e 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -406,7 +406,6 @@ public: offset <<= shift; uint64_t target_page = ((uint64_t)insn_addr) + offset; target_page &= ((uint64_t)-1) << shift; - uint32_t insn2 = insn_at(insn_addr, 1); target = address(target_page); precond(inner != nullptr); inner(insn_addr, target); @@ -520,13 +519,6 @@ int MacroAssembler::patch_narrow_klass(address insn_addr, narrowKlass n) { return 2 * NativeInstruction::instruction_size; } -address MacroAssembler::target_addr_for_insn_or_null(address insn_addr) { - if (NativeInstruction::is_ldrw_to_zr(insn_addr)) { - return nullptr; - } - return MacroAssembler::target_addr_for_insn(insn_addr); -} - void MacroAssembler::safepoint_poll(Label& slow_path, bool at_return, bool in_nmethod, Register tmp) { ldr(tmp, Address(rthread, JavaThread::polling_word_offset())); if (at_return) { @@ -1960,9 +1952,7 @@ void MacroAssembler::verify_secondary_supers_table(Register r_sub_klass, const Register r_array_base = temp1, - r_array_length = temp2, - r_array_index = noreg, // unused - r_bitmap = noreg; // unused + r_array_length = temp2; BLOCK_COMMENT("verify_secondary_supers_table {"); @@ -3611,9 +3601,8 @@ extern "C" void findpc(intptr_t x); void MacroAssembler::debug64(char* msg, int64_t pc, int64_t regs[]) { // In order to get locks to work, we need to fake a in_VM state - if (ShowMessageBoxOnError ) { + if (ShowMessageBoxOnError) { JavaThread* thread = JavaThread::current(); - JavaThreadState saved_state = thread->thread_state(); thread->set_thread_state(_thread_in_vm); #ifndef PRODUCT if (CountBytecodes || TraceBytecodes || StopInterpreterAt) { @@ -5738,7 +5727,6 @@ address MacroAssembler::read_polling_page(Register r, relocInfo::relocType rtype } void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_offset) { - relocInfo::relocType rtype = dest.rspec().reloc()->type(); uint64_t low_page = (uint64_t)CodeCache::low_bound() >> 12; uint64_t high_page = (uint64_t)(CodeCache::high_bound()-1) >> 12; uint64_t dest_page = (uint64_t)dest.target() >> 12; @@ -5766,6 +5754,14 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_off } void MacroAssembler::load_byte_map_base(Register reg) { +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + address byte_map_base_adr = AOTRuntimeConstants::card_table_base_address(); + lea(reg, ExternalAddress(byte_map_base_adr)); + ldr(reg, Address(reg)); + return; + } +#endif CardTableBarrierSet* ctbs = CardTableBarrierSet::barrier_set(); // Strictly speaking the card table base isn't an address at all, and it might @@ -5773,6 +5769,20 @@ void MacroAssembler::load_byte_map_base(Register reg) { mov(reg, (uint64_t)ctbs->card_table_base_const()); } +void MacroAssembler::load_aotrc_address(Register reg, address a) { +#if INCLUDE_CDS + assert(AOTRuntimeConstants::contains(a), "address out of range for data area"); + if (AOTCodeCache::is_on_for_dump()) { + // all aotrc field addresses should be registered in the AOTCodeCache address table + lea(reg, ExternalAddress(a)); + } else { + mov(reg, (uint64_t)a); + } +#else + ShouldNotReachHere(); +#endif +} + void MacroAssembler::build_frame(int framesize) { assert(framesize >= 2 * wordSize, "framesize must include space for FP/LR"); assert(framesize % (2*wordSize) == 0, "must preserve 2*wordSize alignment"); @@ -6114,7 +6124,6 @@ void MacroAssembler::string_equals(Register a1, Register a2, Label SAME, DONE, SHORT, NEXT_WORD; Register tmp1 = rscratch1; Register tmp2 = rscratch2; - Register cnt2 = tmp2; // cnt2 only used in array length compare assert_different_registers(a1, a2, result, cnt1, rscratch1, rscratch2); diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index 7eb6cea0614..fa32f3055b9 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -678,7 +678,6 @@ public: static bool uses_implicit_null_check(void* address); static address target_addr_for_insn(address insn_addr); - static address target_addr_for_insn_or_null(address insn_addr); // Required platform-specific helpers for Label::patch_instructions. // They _shadow_ the declarations in AbstractAssembler, which are undefined. @@ -1477,6 +1476,9 @@ public: // Load the base of the cardtable byte map into reg. void load_byte_map_base(Register reg); + // Load a constant address in the AOT Runtime Constants area + void load_aotrc_address(Register reg, address a); + // Prolog generator routines to support switch between x86 code and // generated ARM code diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp index 0cdf36f0bc5..8b76b96d345 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -192,7 +192,6 @@ int NativeMovRegMem::offset() const { void NativeMovRegMem::set_offset(int x) { address pc = instruction_address(); - unsigned insn = *(unsigned*)pc; if (maybe_cpool_ref(pc)) { address addr = MacroAssembler::target_addr_for_insn(pc); *(int64_t*)addr = x; @@ -204,7 +203,7 @@ void NativeMovRegMem::set_offset(int x) { void NativeMovRegMem::verify() { #ifdef ASSERT - address dest = MacroAssembler::target_addr_for_insn_or_null(instruction_address()); + MacroAssembler::target_addr_for_insn(instruction_address()); #endif } @@ -213,7 +212,7 @@ void NativeMovRegMem::verify() { void NativeJump::verify() { ; } address NativeJump::jump_destination() const { - address dest = MacroAssembler::target_addr_for_insn_or_null(instruction_address()); + address dest = MacroAssembler::target_addr_for_insn(instruction_address()); // We use jump to self as the unresolved address which the inline // cache code (and relocs) know about diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp index 15b6c9ff215..fc7274714ad 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2025, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -78,7 +78,6 @@ public: inline bool is_nop() const; bool is_jump(); bool is_general_jump(); - inline bool is_jump_or_nop(); inline bool is_cond_jump(); bool is_safepoint_poll(); bool is_movz(); @@ -420,10 +419,6 @@ inline bool NativeInstruction::is_jump() { return false; } -inline bool NativeInstruction::is_jump_or_nop() { - return is_nop() || is_jump(); -} - // Call trampoline stubs. class NativeCallTrampolineStub : public NativeInstruction { public: diff --git a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp index 5d4f7103a84..69769fb8441 100644 --- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp @@ -96,10 +96,6 @@ static inline Address aaddress(Register r) { return iaddress(r); } -static inline Address at_rsp() { - return Address(esp, 0); -} - // At top of Java expression stack which may be different than esp(). It // isn't for category 1 objects. static inline Address at_tos () { diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index 0a7bc5a8962..9b85733ed08 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2020, Red Hat Inc. All rights reserved. * Copyright 2025 Arm Limited and/or its affiliates. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -446,7 +446,9 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * VM_Version::zva_length()); } } else if (UseBlockZeroing) { - warning("DC ZVA is not available on this CPU"); + if (!FLAG_IS_DEFAULT(UseBlockZeroing)) { + warning("DC ZVA is not available on this CPU"); + } FLAG_SET_DEFAULT(UseBlockZeroing, false); } @@ -664,16 +666,52 @@ void VM_Version::initialize() { void VM_Version::insert_features_names(uint64_t features, stringStream& ss) { int i = 0; ss.join([&]() { - while (i < MAX_CPU_FEATURES) { - if (supports_feature((VM_Version::Feature_Flag)i)) { - return _features_names[i++]; + const char* str = nullptr; + while ((i < MAX_CPU_FEATURES) && (str == nullptr)) { + if (supports_feature(features, (VM_Version::Feature_Flag)i)) { + str = _features_names[i]; } i += 1; } - return (const char*)nullptr; + return str; }, ", "); } +void VM_Version::get_cpu_features_name(void* features_buffer, stringStream& ss) { + uint64_t features = *(uint64_t*)features_buffer; + insert_features_names(features, ss); +} + +void VM_Version::get_missing_features_name(void* features_set1, void* features_set2, stringStream& ss) { + uint64_t vm_features_set1 = *(uint64_t*)features_set1; + uint64_t vm_features_set2 = *(uint64_t*)features_set2; + int i = 0; + ss.join([&]() { + const char* str = nullptr; + while ((i < MAX_CPU_FEATURES) && (str == nullptr)) { + Feature_Flag flag = (Feature_Flag)i; + if (supports_feature(vm_features_set1, flag) && !supports_feature(vm_features_set2, flag)) { + str = _features_names[i]; + } + i += 1; + } + return str; + }, ", "); +} + +int VM_Version::cpu_features_size() { + return sizeof(_features); +} + +void VM_Version::store_cpu_features(void* buf) { + *(uint64_t*)buf = _features; +} + +bool VM_Version::supports_features(void* features_buffer) { + uint64_t features_to_test = *(uint64_t*)features_buffer; + return (_features & features_to_test) == features_to_test; +} + #if defined(LINUX) static bool check_info_file(const char* fpath, const char* virt1, VirtualizationType vt1, diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp index 38b112d9936..0213872852b 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -184,6 +184,9 @@ public: static bool supports_feature(Feature_Flag flag) { return (_features & BIT_MASK(flag)) != 0; } + static bool supports_feature(uint64_t features, Feature_Flag flag) { + return (features & BIT_MASK(flag)) != 0; + } static int cpu_family() { return _cpu; } static int cpu_model() { return _model; } @@ -204,7 +207,7 @@ public: return false; } - static bool is_zva_enabled() { return 0 <= _zva_length; } + static bool is_zva_enabled() { return 0 < _zva_length; } static int zva_length() { assert(is_zva_enabled(), "ZVA not available"); return _zva_length; @@ -244,6 +247,20 @@ public: static bool use_neon_for_vector(int vector_length_in_bytes) { return vector_length_in_bytes <= 16; } + + static void get_cpu_features_name(void* features_buffer, stringStream& ss); + + // Returns names of features present in features_set1 but not in features_set2 + static void get_missing_features_name(void* features_set1, void* features_set2, stringStream& ss); + + // Returns number of bytes required to store cpu features representation + static int cpu_features_size(); + + // Stores cpu features representation in the provided buffer. This representation is arch dependent. + // Size of the buffer must be same as returned by cpu_features_size() + static void store_cpu_features(void* buf); + + static bool supports_features(void* features_to_test); }; #endif // CPU_AARCH64_VM_VERSION_AARCH64_HPP diff --git a/src/hotspot/cpu/arm/globals_arm.hpp b/src/hotspot/cpu/arm/globals_arm.hpp index 363a9a2c25c..c568ea04122 100644 --- a/src/hotspot/cpu/arm/globals_arm.hpp +++ b/src/hotspot/cpu/arm/globals_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2026, 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 @@ -37,7 +37,7 @@ define_pd_global(bool, TrapBasedNullChecks, false); // Not needed define_pd_global(bool, DelayCompilerStubsGeneration, false); // No need - only few compiler's stubs define_pd_global(size_t, CodeCacheSegmentSize, 64); -define_pd_global(intx, CodeEntryAlignment, 16); +define_pd_global(uint, CodeEntryAlignment, 16); define_pd_global(intx, OptoLoopAlignment, 16); #define DEFAULT_STACK_YELLOW_PAGES (2) diff --git a/src/hotspot/cpu/ppc/assembler_ppc.hpp b/src/hotspot/cpu/ppc/assembler_ppc.hpp index 23775a3a52e..da2daffd579 100644 --- a/src/hotspot/cpu/ppc/assembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/assembler_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2025 SAP SE. All rights reserved. + * Copyright (c) 2002, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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 @@ -599,6 +599,9 @@ class Assembler : public AbstractAssembler { XVMAXSP_OPCODE = (60u << OPCODE_SHIFT | 192u << 3), XVMAXDP_OPCODE = (60u << OPCODE_SHIFT | 224u << 3), + XSMINJDP_OPCODE = (60u << OPCODE_SHIFT | 152u << 3), + XSMAXJDP_OPCODE = (60u << OPCODE_SHIFT | 144u << 3), + // Deliver A Random Number (introduced with POWER9) DARN_OPCODE = (31u << OPCODE_SHIFT | 755u << 1), @@ -2455,6 +2458,9 @@ class Assembler : public AbstractAssembler { inline void xvrdpim( VectorSRegister d, VectorSRegister b); inline void xvrdpip( VectorSRegister d, VectorSRegister b); + inline void xsminjdp( VectorSRegister d, VectorSRegister a, VectorSRegister b); // Requires Power 9 + inline void xsmaxjdp( VectorSRegister d, VectorSRegister a, VectorSRegister b); // Requires Power 9 + // The following functions do not match exactly the Java.math semantics. inline void xvminsp( VectorSRegister d, VectorSRegister a, VectorSRegister b); inline void xvmindp( VectorSRegister d, VectorSRegister a, VectorSRegister b); diff --git a/src/hotspot/cpu/ppc/assembler_ppc.inline.hpp b/src/hotspot/cpu/ppc/assembler_ppc.inline.hpp index 4cda782067e..bd6f3300606 100644 --- a/src/hotspot/cpu/ppc/assembler_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/assembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2025 SAP SE. All rights reserved. + * Copyright (c) 2002, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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 @@ -908,6 +908,9 @@ inline void Assembler::xvrdpic( VectorSRegister d, VectorSRegister b) inline void Assembler::xvrdpim( VectorSRegister d, VectorSRegister b) { emit_int32( XVRDPIM_OPCODE | vsrt(d) | vsrb(b)); } inline void Assembler::xvrdpip( VectorSRegister d, VectorSRegister b) { emit_int32( XVRDPIP_OPCODE | vsrt(d) | vsrb(b)); } +inline void Assembler::xsminjdp(VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XSMINJDP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); } +inline void Assembler::xsmaxjdp(VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XSMAXJDP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); } + inline void Assembler::xvminsp(VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XVMINSP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); } inline void Assembler::xvmindp(VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XVMINDP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); } inline void Assembler::xvmaxsp(VectorSRegister d, VectorSRegister a, VectorSRegister b) { emit_int32( XVMAXSP_OPCODE | vsrt(d) | vsra(a) | vsrb(b)); } diff --git a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp index 73b6b132895..8bbffc22c54 100644 --- a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp @@ -1,5 +1,6 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026 SAP SE. 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 @@ -600,19 +601,21 @@ void C2_MacroAssembler::count_positives(Register src, Register cnt, Register res orr(tmp0, tmp2, tmp0); and_(tmp0, tmp0, tmp1); - bne(CR0, Lslow); // Found negative byte. + bne(CR0, Lslow); // Found negative byte. addi(result, result, 16); bdnz(Lfastloop); bind(Lslow); // Fallback to slow version. subf(tmp0, src, result); // Bytes known positive. - subf_(tmp0, tmp0, cnt); // Remaining Bytes. + clrldi(tmp1, cnt, 32); // Clear garbage from upper 32 bits. + subf_(tmp0, tmp0, tmp1); // Remaining Bytes. beq(CR0, Ldone); mtctr(tmp0); + bind(Lloop); lbz(tmp0, 0, result); andi_(tmp0, tmp0, 0x80); - bne(CR0, Ldone); // Found negative byte. + bne(CR0, Ldone); // Found negative byte. addi(result, result, 1); bdnz(Lloop); diff --git a/src/hotspot/cpu/ppc/c2_globals_ppc.hpp b/src/hotspot/cpu/ppc/c2_globals_ppc.hpp index d5a0ff10994..caef322d4a1 100644 --- a/src/hotspot/cpu/ppc/c2_globals_ppc.hpp +++ b/src/hotspot/cpu/ppc/c2_globals_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2019 SAP SE. All rights reserved. + * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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,7 @@ define_pd_global(intx, CompileThreshold, 10000); define_pd_global(intx, OnStackReplacePercentage, 140); define_pd_global(intx, ConditionalMoveLimit, 3); -define_pd_global(intx, FreqInlineSize, 175); +define_pd_global(intx, FreqInlineSize, 325); define_pd_global(intx, MinJumpTableSize, 10); define_pd_global(intx, InteriorEntryAlignment, 16); define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K)); diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp index 8712c75711d..82d06f6c685 100644 --- a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2025 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -275,6 +275,11 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na return opto_reg; } +void BarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + // Load the oop from the weak handle. + __ ld(obj, 0, obj); +} + #undef __ #define __ _masm-> diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp index 2bf26bd5010..d78071f2ee0 100644 --- a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -81,6 +81,8 @@ public: #ifdef COMPILER2 OptoReg::Name refine_register(const Node* node, OptoReg::Name opto_reg) const; + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, + Register tmp, Label& slow_path); #endif // COMPILER2 }; diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp index c3bb1811031..e1f0416d65d 100644 --- a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2025, Red Hat, Inc. All rights reserved. * Copyright (c) 2012, 2025 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -662,6 +663,33 @@ void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler __ block_comment("} try_resolve_jobject_in_native (shenandoahgc)"); } +#ifdef COMPILER2 +void ShenandoahBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler *masm, Register obj, + Register tmp, Label &slow_path) { + __ block_comment("try_resolve_weak_handle_in_c2 (shenandoahgc) {"); + + assert_different_registers(obj, tmp); + + Label done; + + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, tmp, slow_path); + + // Check if the reference is null, and if it is, take the fast path. + __ cmpdi(CR0, obj, 0); + __ beq(CR0, done); + + // Check if the heap is under weak-reference/roots processing, in + // which case we need to take the slow path. + __ lbz(tmp, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), R16_thread); + __ andi_(tmp, tmp, ShenandoahHeap::WEAK_ROOTS); + __ bne(CR0, slow_path); + __ bind(done); + + __ block_comment("} try_resolve_weak_handle_in_c2 (shenandoahgc)"); +} +#endif + // Special shenandoah CAS implementation that handles false negatives due // to concurrent evacuation. That is, the CAS operation is intended to succeed in // the following scenarios (success criteria): diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp index 52615a740af..672f8122bcb 100644 --- a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved. * Copyright (c) 2012, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -121,6 +122,9 @@ public: virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register dst, Register jni_env, Register obj, Register tmp, Label& slowpath); +#ifdef COMPILER2 + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path); +#endif }; #endif // CPU_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP diff --git a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp index 0aa5858c8e6..bfa3c87c179 100644 --- a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2025 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -950,6 +950,19 @@ void ZBarrierSetAssembler::generate_c2_store_barrier_stub(MacroAssembler* masm, __ b(*stub->continuation()); } +void ZBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, tmp, slow_path); + + // Check if the oop is bad, in which case we need to take the slow path. + __ relocate(barrier_Relocation::spec(), ZBarrierRelocationFormatMarkBadMask); + __ andi_(R0, obj, barrier_Relocation::unpatched); + __ bne(CR0, slow_path); + + // Oop is okay, so we uncolor it. + __ srdi(obj, obj, ZPointerLoadShift); +} + #undef __ #endif // COMPILER2 diff --git a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.hpp index 27203e7b01c..e31817370d9 100644 --- a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -108,6 +108,8 @@ public: void generate_c2_load_barrier_stub(MacroAssembler* masm, ZLoadBarrierStubC2* stub) const; void generate_c2_store_barrier_stub(MacroAssembler* masm, ZStoreBarrierStubC2* stub) const; + + void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path); #endif // COMPILER2 void store_barrier_fast(MacroAssembler* masm, diff --git a/src/hotspot/cpu/ppc/globals_ppc.hpp b/src/hotspot/cpu/ppc/globals_ppc.hpp index 41a8e821ada..927a8cc2be3 100644 --- a/src/hotspot/cpu/ppc/globals_ppc.hpp +++ b/src/hotspot/cpu/ppc/globals_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -60,7 +60,7 @@ define_pd_global(bool, VMContinuations, true); // Use large code-entry alignment. define_pd_global(size_t, CodeCacheSegmentSize, 128); -define_pd_global(intx, CodeEntryAlignment, 64); +define_pd_global(uint, CodeEntryAlignment, 64); define_pd_global(intx, OptoLoopAlignment, 16); define_pd_global(intx, InlineSmallCode, 1500); diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index 809285afddb..986dd335816 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2025 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -42,6 +42,7 @@ #include "runtime/icache.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/objectMonitor.hpp" +#include "runtime/objectMonitorTable.hpp" #include "runtime/os.hpp" #include "runtime/safepoint.hpp" #include "runtime/safepointMechanism.hpp" @@ -2756,39 +2757,54 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register addi(owner_addr, mark, in_bytes(ObjectMonitor::owner_offset()) - monitor_tag); mark = noreg; } else { + const Register tmp3_bucket = tmp3; + const Register tmp2_hash = tmp2; Label monitor_found; - Register cache_addr = tmp2; - // Load cache address - addi(cache_addr, R16_thread, in_bytes(JavaThread::om_cache_oops_offset())); + // Save the mark, we might need it to extract the hash. + mr(tmp2_hash, mark); - const int num_unrolled = 2; + // Look for the monitor in the om_cache. + + ByteSize cache_offset = JavaThread::om_cache_oops_offset(); + ByteSize monitor_offset = OMCache::oop_to_monitor_difference(); + const int num_unrolled = OMCache::CAPACITY; for (int i = 0; i < num_unrolled; i++) { - ld(R0, 0, cache_addr); + ld(R0, in_bytes(cache_offset), R16_thread); + ld(monitor, in_bytes(cache_offset + monitor_offset), R16_thread); cmpd(CR0, R0, obj); beq(CR0, monitor_found); - addi(cache_addr, cache_addr, in_bytes(OMCache::oop_to_oop_difference())); + cache_offset = cache_offset + OMCache::oop_to_oop_difference(); } - Label loop; + // Look for the monitor in the table. - // Search for obj in cache. - bind(loop); + // Get the hash code. + srdi(tmp2_hash, tmp2_hash, markWord::hash_shift); - // Check for match. - ld(R0, 0, cache_addr); - cmpd(CR0, R0, obj); - beq(CR0, monitor_found); + // Get the table and calculate the bucket's address + int simm16_rest = load_const_optimized(tmp3, ObjectMonitorTable::current_table_address(), R0, true); + ld_ptr(tmp3, simm16_rest, tmp3); + ld(tmp1, in_bytes(ObjectMonitorTable::table_capacity_mask_offset()), tmp3); + andr(tmp2_hash, tmp2_hash, tmp1); + ld(tmp3_bucket, in_bytes(ObjectMonitorTable::table_buckets_offset()), tmp3); - // Search until null encountered, guaranteed _null_sentinel at end. - addi(cache_addr, cache_addr, in_bytes(OMCache::oop_to_oop_difference())); - cmpdi(CR1, R0, 0); - bne(CR1, loop); - // Cache Miss, CR0.NE set from cmp above - b(slow_path); + // Read the monitor from the bucket. + sldi(tmp2_hash, tmp2_hash, LogBytesPerWord); + ldx(monitor, tmp3_bucket, tmp2_hash); + + // Check if the monitor in the bucket is special (empty, tombstone or removed). + cmpldi(CR0, monitor, ObjectMonitorTable::SpecialPointerValues::below_is_special); + blt(CR0, slow_path); + + // Check if object matches. + ld(tmp3, in_bytes(ObjectMonitor::object_offset()), monitor); + BarrierSetAssembler* bs_asm = BarrierSet::barrier_set()->barrier_set_assembler(); + bs_asm->try_resolve_weak_handle_in_c2(this, tmp3, tmp2, slow_path); + cmpd(CR0, tmp3, obj); + bne(CR0, slow_path); bind(monitor_found); - ld(monitor, in_bytes(OMCache::oop_to_monitor_difference()), cache_addr); // Compute owner address. addi(owner_addr, monitor, in_bytes(ObjectMonitor::owner_offset())); diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp index 875602cae58..58dec702d7a 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2025 SAP SE. All rights reserved. + * Copyright (c) 2002, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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 diff --git a/src/hotspot/cpu/ppc/matcher_ppc.hpp b/src/hotspot/cpu/ppc/matcher_ppc.hpp index b50de6323de..2ddbec3e48c 100644 --- a/src/hotspot/cpu/ppc/matcher_ppc.hpp +++ b/src/hotspot/cpu/ppc/matcher_ppc.hpp @@ -1,5 +1,6 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026 SAP SE. 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 diff --git a/src/hotspot/cpu/ppc/methodHandles_ppc.cpp b/src/hotspot/cpu/ppc/methodHandles_ppc.cpp index 803bb6bfe69..45537e0ea96 100644 --- a/src/hotspot/cpu/ppc/methodHandles_ppc.cpp +++ b/src/hotspot/cpu/ppc/methodHandles_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2025 SAP SE. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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,11 +49,6 @@ #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") -// Workaround for C++ overloading nastiness on '0' for RegisterOrConstant. -inline static RegisterOrConstant constant(int value) { - return RegisterOrConstant(value); -} - void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg) { if (VerifyMethodHandles) { diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index d926fabd353..4cb9f8820a0 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -1,6 +1,6 @@ // -// Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. -// Copyright (c) 2012, 2025 SAP SE. All rights reserved. +// Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2012, 2026 SAP SE. 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 @@ -2234,6 +2234,12 @@ bool Matcher::match_rule_supported(int opcode) { case Op_FmaVD: return (SuperwordUseVSX && UseFMA); + case Op_MinF: + case Op_MaxF: + case Op_MinD: + case Op_MaxD: + return (PowerArchitecturePPC64 >= 9); + case Op_Digit: return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isDigit); case Op_LowerCase: @@ -12313,6 +12319,58 @@ instruct maxI_reg_reg_isel(iRegIdst dst, iRegIsrc src1, iRegIsrc src2, flagsRegC ins_pipe(pipe_class_default); %} +instruct minF(regF dst, regF src1, regF src2) %{ + match(Set dst (MinF src1 src2)); + predicate(PowerArchitecturePPC64 >= 9); + ins_cost(DEFAULT_COST); + + format %{ "MinF $dst, $src1, $src2" %} + size(4); + ins_encode %{ + __ xsminjdp($dst$$FloatRegister->to_vsr(), $src1$$FloatRegister->to_vsr(), $src2$$FloatRegister->to_vsr()); + %} + ins_pipe(pipe_class_default); +%} + +instruct minD(regD dst, regD src1, regD src2) %{ + match(Set dst (MinD src1 src2)); + predicate(PowerArchitecturePPC64 >= 9); + ins_cost(DEFAULT_COST); + + format %{ "MinD $dst, $src1, $src2" %} + size(4); + ins_encode %{ + __ xsminjdp($dst$$FloatRegister->to_vsr(), $src1$$FloatRegister->to_vsr(), $src2$$FloatRegister->to_vsr()); + %} + ins_pipe(pipe_class_default); +%} + +instruct maxF(regF dst, regF src1, regF src2) %{ + match(Set dst (MaxF src1 src2)); + predicate(PowerArchitecturePPC64 >= 9); + ins_cost(DEFAULT_COST); + + format %{ "MaxF $dst, $src1, $src2" %} + size(4); + ins_encode %{ + __ xsmaxjdp($dst$$FloatRegister->to_vsr(), $src1$$FloatRegister->to_vsr(), $src2$$FloatRegister->to_vsr()); + %} + ins_pipe(pipe_class_default); +%} + +instruct maxD(regD dst, regD src1, regD src2) %{ + match(Set dst (MaxD src1 src2)); + predicate(PowerArchitecturePPC64 >= 9); + ins_cost(DEFAULT_COST); + + format %{ "MaxD $dst, $src1, $src2" %} + size(4); + ins_encode %{ + __ xsmaxjdp($dst$$FloatRegister->to_vsr(), $src1$$FloatRegister->to_vsr(), $src2$$FloatRegister->to_vsr()); + %} + ins_pipe(pipe_class_default); +%} + //---------- Population Count Instructions ------------------------------------ instruct popCountI(iRegIdst dst, iRegIsrc src) %{ diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp index e77a2067e89..63e2fd015d7 100644 --- a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp @@ -1041,31 +1041,10 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) { __ bind(*op->stub()->continuation()); } -void LIR_Assembler::type_profile_helper(Register mdo, ciMethodData *md, ciProfileData *data, - Register recv, Label* update_done) { - for (uint i = 0; i < ReceiverTypeData::row_limit(); i++) { - Label next_test; - // See if the receiver is receiver[n]. - __ ld(t1, Address(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)))); - __ bne(recv, t1, next_test); - Address data_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i))); - __ increment(data_addr, DataLayout::counter_increment); - __ j(*update_done); - __ bind(next_test); - } - - // Didn't find receiver; find next empty slot and fill it in - for (uint i = 0; i < ReceiverTypeData::row_limit(); i++) { - Label next_test; - Address recv_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i))); - __ ld(t1, recv_addr); - __ bnez(t1, next_test); - __ sd(recv, recv_addr); - __ mv(t1, DataLayout::counter_increment); - __ sd(t1, Address(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)))); - __ j(*update_done); - __ bind(next_test); - } +void LIR_Assembler::type_profile_helper(Register mdo, ciMethodData *md, + ciProfileData *data, Register recv) { + int mdp_offset = md->byte_offset_of_slot(data, in_ByteSize(0)); + __ profile_receiver_type(recv, mdo, mdp_offset); } void LIR_Assembler::data_check(LIR_OpTypeCheck *op, ciMethodData **md, ciProfileData **data) { @@ -1139,14 +1118,9 @@ void LIR_Assembler::profile_object(ciMethodData* md, ciProfileData* data, Regist __ j(*obj_is_null); __ bind(not_null); - Label update_done; Register recv = k_RInfo; __ load_klass(recv, obj); - type_profile_helper(mdo, md, data, recv, &update_done); - Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset())); - __ increment(counter_addr, DataLayout::counter_increment); - - __ bind(update_done); + type_profile_helper(mdo, md, data, recv); } void LIR_Assembler::typecheck_loaded(LIR_OpTypeCheck *op, ciKlass* k, Register k_RInfo) { @@ -1554,11 +1528,8 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { // We know the type that will be seen at this call site; we can // statically update the MethodData* rather than needing to do // dynamic tests on the receiver type - // NOTE: we should probably put a lock around this search to - // avoid collisions by concurrent compilations ciVirtualCallData* vc_data = (ciVirtualCallData*) data; - uint i; - for (i = 0; i < VirtualCallData::row_limit(); i++) { + for (uint i = 0; i < VirtualCallData::row_limit(); i++) { ciKlass* receiver = vc_data->receiver(i); if (known_klass->equals(receiver)) { Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i))); @@ -1566,32 +1537,13 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { return; } } - - // Receiver type not found in profile data; select an empty slot - // Note that this is less efficient than it should be because it - // always does a write to the receiver part of the - // VirtualCallData rather than just the first time - for (i = 0; i < VirtualCallData::row_limit(); i++) { - ciKlass* receiver = vc_data->receiver(i); - if (receiver == nullptr) { - Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i))); - __ mov_metadata(t1, known_klass->constant_encoding()); - __ sd(t1, recv_addr); - Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i))); - __ increment(data_addr, DataLayout::counter_increment); - return; - } - } + // Receiver type is not found in profile data. + // Fall back to runtime helper to handle the rest at runtime. + __ mov_metadata(recv, known_klass->constant_encoding()); } else { __ load_klass(recv, recv); - Label update_done; - type_profile_helper(mdo, md, data, recv, &update_done); - // Receiver did not match any saved receiver and there is no empty row for it. - // Increment total counter to indicate polymorphic case. - __ increment(counter_addr, DataLayout::counter_increment); - - __ bind(update_done); } + type_profile_helper(mdo, md, data, recv); } else { // Static call __ increment(counter_addr, DataLayout::counter_increment); diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp index 1e466e90d37..90b6b3ee4f4 100644 --- a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp @@ -54,9 +54,8 @@ private: Address stack_slot_address(int index, uint shift, int adjust = 0); // Record the type of the receiver in ReceiverTypeData - void type_profile_helper(Register mdo, - ciMethodData *md, ciProfileData *data, - Register recv, Label* update_done); + void type_profile_helper(Register mdo, ciMethodData *md, + ciProfileData *data, Register recv); void casw(Register addr, Register newval, Register cmpval); void caswu(Register addr, Register newval, Register cmpval); diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp index b4e0ba69042..72a90ddde1f 100644 --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp @@ -30,7 +30,9 @@ #include "opto/intrinsicnode.hpp" #include "opto/output.hpp" #include "opto/subnode.hpp" +#include "runtime/objectMonitorTable.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" #include "utilities/globalDefinitions.hpp" #ifdef PRODUCT @@ -123,35 +125,52 @@ void C2_MacroAssembler::fast_lock(Register obj, Register box, if (!UseObjectMonitorTable) { assert(tmp1_monitor == tmp1_mark, "should be the same here"); } else { + const Register tmp2_hash = tmp2; + const Register tmp3_bucket = tmp3; Label monitor_found; - // Load cache address - la(tmp3_t, Address(xthread, JavaThread::om_cache_oops_offset())); + // Save the mark, we might need it to extract the hash. + mv(tmp2_hash, tmp1_mark); - const int num_unrolled = 2; + // Look for the monitor in the om_cache. + + ByteSize cache_offset = JavaThread::om_cache_oops_offset(); + ByteSize monitor_offset = OMCache::oop_to_monitor_difference(); + const int num_unrolled = OMCache::CAPACITY; for (int i = 0; i < num_unrolled; i++) { - ld(tmp1, Address(tmp3_t)); - beq(obj, tmp1, monitor_found); - add(tmp3_t, tmp3_t, in_bytes(OMCache::oop_to_oop_difference())); + ld(tmp1_monitor, Address(xthread, cache_offset + monitor_offset)); + ld(tmp4, Address(xthread, cache_offset)); + beq(obj, tmp4, monitor_found); + cache_offset = cache_offset + OMCache::oop_to_oop_difference(); } - Label loop; + // Look for the monitor in the table. - // Search for obj in cache. - bind(loop); + // Get the hash code. + srli(tmp2_hash, tmp2_hash, markWord::hash_shift); - // Check for match. - ld(tmp1, Address(tmp3_t)); - beq(obj, tmp1, monitor_found); + // Get the table and calculate the bucket's address. + la(tmp3_t, ExternalAddress(ObjectMonitorTable::current_table_address())); + ld(tmp3_t, Address(tmp3_t)); + ld(tmp1, Address(tmp3_t, ObjectMonitorTable::table_capacity_mask_offset())); + andr(tmp2_hash, tmp2_hash, tmp1); + ld(tmp3_t, Address(tmp3_t, ObjectMonitorTable::table_buckets_offset())); - // Search until null encountered, guaranteed _null_sentinel at end. - add(tmp3_t, tmp3_t, in_bytes(OMCache::oop_to_oop_difference())); - bnez(tmp1, loop); - // Cache Miss. Take the slowpath. - j(slow_path); + // Read the monitor from the bucket. + shadd(tmp3_bucket, tmp2_hash, tmp3_t, tmp4, LogBytesPerWord); + ld(tmp1_monitor, Address(tmp3_bucket)); + + // Check if the monitor in the bucket is special (empty, tombstone or removed). + mv(tmp2, ObjectMonitorTable::SpecialPointerValues::below_is_special); + bltu(tmp1_monitor, tmp2, slow_path); + + // Check if object matches. + ld(tmp3, Address(tmp1_monitor, ObjectMonitor::object_offset())); + BarrierSetAssembler* bs_asm = BarrierSet::barrier_set()->barrier_set_assembler(); + bs_asm->try_resolve_weak_handle_in_c2(this, tmp3, tmp2, slow_path); + bne(tmp3, obj, slow_path); bind(monitor_found); - ld(tmp1_monitor, Address(tmp3_t, OMCache::oop_to_monitor_difference())); } const Register tmp2_owner_addr = tmp2; diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp index f5916000890..aeb9df06de6 100644 --- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -369,6 +369,11 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na return opto_reg; } +void BarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + // Load the oop from the weak handle. + __ ld(obj, Address(obj)); +} + #undef __ #define __ _masm-> diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp index e50fa1dae36..bbb2a5af824 100644 --- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -110,6 +110,8 @@ public: #ifdef COMPILER2 OptoReg::Name refine_register(const Node* node, OptoReg::Name opto_reg); + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, + Register tmp, Label& slow_path); #endif // COMPILER2 }; diff --git a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp index 3cbbb783258..8d530d15ee5 100644 --- a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -461,6 +462,30 @@ void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler __ bind(done); } +#ifdef COMPILER2 +void ShenandoahBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler *masm, Register obj, + Register tmp, Label& slow_path) { + assert_different_registers(obj, tmp); + + Label done; + + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, tmp, slow_path); + + // Check if the reference is null, and if it is, take the fast path. + __ beqz(obj, done); + + Address gc_state(xthread, ShenandoahThreadLocalData::gc_state_offset()); + __ lbu(tmp, gc_state); + + // Check if the heap is under weak-reference/roots processing, in + // which case we need to take the slow path. + __ test_bit(tmp, tmp, ShenandoahHeap::WEAK_ROOTS_BITPOS); + __ bnez(tmp, slow_path); + __ bind(done); +} +#endif + // Special Shenandoah CAS implementation that handles false negatives due // to concurrent evacuation. The service is more complex than a // traditional CAS operation because the CAS operation is intended to diff --git a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.hpp b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.hpp index 5085be26b2e..e35e09c93da 100644 --- a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.hpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,7 +85,9 @@ public: virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); - +#ifdef COMPILER2 + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path); +#endif void cmpxchg_oop(MacroAssembler* masm, Register addr, Register expected, Register new_val, Assembler::Aqrl acquire, Assembler::Aqrl release, bool is_cae, Register result); }; diff --git a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp index 09dea62b6d1..163271a2f11 100644 --- a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -602,6 +602,27 @@ void ZBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, BLOCK_COMMENT("} ZBarrierSetAssembler::try_resolve_jobject_in_native"); } +#ifdef COMPILER2 +void ZBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + BLOCK_COMMENT("ZBarrierSetAssembler::try_resolve_weak_handle_in_c2 {"); + + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, tmp, slow_path); + + // Check if the oop is bad, in which case we need to take the slow path. + __ relocate(barrier_Relocation::spec(), [&] { + __ li16u(tmp, barrier_Relocation::unpatched); + }, ZBarrierRelocationFormatMarkBadMask); + __ andr(tmp, obj, tmp); + __ bnez(tmp, slow_path); + + // Oop is okay, so we uncolor it. + __ srli(obj, obj, ZPointerLoadShift); + + BLOCK_COMMENT("} ZBarrierSetAssembler::try_resolve_weak_handle_in_c2"); +} +#endif + static uint16_t patch_barrier_relocation_value(int format) { switch (format) { case ZBarrierRelocationFormatLoadBadMask: diff --git a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.hpp b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.hpp index 190d81acd0c..648cb3bf63d 100644 --- a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -170,6 +170,10 @@ public: ZLoadBarrierStubC2* stub) const; void generate_c2_store_barrier_stub(MacroAssembler* masm, ZStoreBarrierStubC2* stub) const; + void try_resolve_weak_handle_in_c2(MacroAssembler* masm, + Register obj, + Register tmp, + Label& slow_path); #endif // COMPILER2 void check_oop(MacroAssembler* masm, Register obj, Register tmp1, Register tmp2, Label& error); diff --git a/src/hotspot/cpu/riscv/globals_riscv.hpp b/src/hotspot/cpu/riscv/globals_riscv.hpp index 390ed2daeb9..21b119266e2 100644 --- a/src/hotspot/cpu/riscv/globals_riscv.hpp +++ b/src/hotspot/cpu/riscv/globals_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -39,7 +39,7 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI); define_pd_global(size_t, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRESENT(+64)); // Tiered compilation has large code-entry alignment. -define_pd_global(intx, CodeEntryAlignment, 64); +define_pd_global(uint, CodeEntryAlignment, 64); define_pd_global(intx, OptoLoopAlignment, 16); #define DEFAULT_STACK_YELLOW_PAGES (2) diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp index 189c7c93d07..744590bec2b 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp @@ -237,15 +237,14 @@ void InterpreterMacroAssembler::load_resolved_klass_at_offset( // Rsub_klass: subklass // // Kills: -// x12, x15 +// x12 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Label& ok_is_subtype) { assert(Rsub_klass != x10, "x10 holds superklass"); assert(Rsub_klass != x12, "x12 holds 2ndary super array length"); - assert(Rsub_klass != x15, "x15 holds 2ndary super array scan ptr"); // Profile the not-null value's klass. - profile_typecheck(x12, Rsub_klass, x15); // blows x12, reloads x15 + profile_typecheck(x12, Rsub_klass); // blows x12 // Do the check. check_klass_subtype(Rsub_klass, x10, x12, ok_is_subtype); // blows x12 @@ -1042,7 +1041,6 @@ void InterpreterMacroAssembler::profile_final_call(Register mdp) { void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register mdp, - Register reg2, bool receiver_can_be_null) { if (ProfileInterpreter) { Label profile_continue; @@ -1060,7 +1058,7 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, } // Record the receiver type. - record_klass_in_profile(receiver, mdp, reg2); + profile_receiver_type(receiver, mdp, 0); bind(skip_receiver_profile); // The method data pointer needs to be updated to reflect the new target. @@ -1072,153 +1070,6 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, } } -// This routine creates a state machine for updating the multi-row -// type profile at a virtual call site (or other type-sensitive bytecode). -// The machine visits each row (of receiver/count) until the receiver type -// is found, or until it runs out of rows. At the same time, it remembers -// the location of the first empty row. (An empty row records null for its -// receiver, and can be allocated for a newly-observed receiver type.) -// Because there are two degrees of freedom in the state, a simple linear -// search will not work; it must be a decision tree. Hence this helper -// function is recursive, to generate the required tree structured code. -// It's the interpreter, so we are trading off code space for speed. -// See below for example code. -void InterpreterMacroAssembler::record_klass_in_profile_helper( - Register receiver, Register mdp, - Register reg2, Label& done) { - if (TypeProfileWidth == 0) { - increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); - } else { - record_item_in_profile_helper(receiver, mdp, reg2, 0, done, TypeProfileWidth, - &VirtualCallData::receiver_offset, &VirtualCallData::receiver_count_offset); - } -} - -void InterpreterMacroAssembler::record_item_in_profile_helper(Register item, Register mdp, - Register reg2, int start_row, Label& done, int total_rows, - OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn) { - int last_row = total_rows - 1; - assert(start_row <= last_row, "must be work left to do"); - // Test this row for both the item and for null. - // Take any of three different outcomes: - // 1. found item => increment count and goto done - // 2. found null => keep looking for case 1, maybe allocate this cell - // 3. found something else => keep looking for cases 1 and 2 - // Case 3 is handled by a recursive call. - for (int row = start_row; row <= last_row; row++) { - Label next_test; - bool test_for_null_also = (row == start_row); - - // See if the item is item[n]. - int item_offset = in_bytes(item_offset_fn(row)); - test_mdp_data_at(mdp, item_offset, item, - (test_for_null_also ? reg2 : noreg), - next_test); - // (Reg2 now contains the item from the CallData.) - - // The item is item[n]. Increment count[n]. - int count_offset = in_bytes(item_count_offset_fn(row)); - increment_mdp_data_at(mdp, count_offset); - j(done); - bind(next_test); - - if (test_for_null_also) { - Label found_null; - // Failed the equality check on item[n]... Test for null. - if (start_row == last_row) { - // The only thing left to do is handle the null case. - beqz(reg2, found_null); - // Item did not match any saved item and there is no empty row for it. - // Increment total counter to indicate polymorphic case. - increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); - j(done); - bind(found_null); - break; - } - // Since null is rare, make it be the branch-taken case. - beqz(reg2, found_null); - - // Put all the "Case 3" tests here. - record_item_in_profile_helper(item, mdp, reg2, start_row + 1, done, total_rows, - item_offset_fn, item_count_offset_fn); - - // Found a null. Keep searching for a matching item, - // but remember that this is an empty (unused) slot. - bind(found_null); - } - } - - // In the fall-through case, we found no matching item, but we - // observed the item[start_row] is null. - // Fill in the item field and increment the count. - int item_offset = in_bytes(item_offset_fn(start_row)); - set_mdp_data_at(mdp, item_offset, item); - int count_offset = in_bytes(item_count_offset_fn(start_row)); - mv(reg2, DataLayout::counter_increment); - set_mdp_data_at(mdp, count_offset, reg2); - if (start_row > 0) { - j(done); - } -} - -// Example state machine code for three profile rows: -// # main copy of decision tree, rooted at row[1] -// if (row[0].rec == rec) then [ -// row[0].incr() -// goto done -// ] -// if (row[0].rec != nullptr) then [ -// # inner copy of decision tree, rooted at row[1] -// if (row[1].rec == rec) then [ -// row[1].incr() -// goto done -// ] -// if (row[1].rec != nullptr) then [ -// # degenerate decision tree, rooted at row[2] -// if (row[2].rec == rec) then [ -// row[2].incr() -// goto done -// ] -// if (row[2].rec != nullptr) then [ -// count.incr() -// goto done -// ] # overflow -// row[2].init(rec) -// goto done -// ] else [ -// # remember row[1] is empty -// if (row[2].rec == rec) then [ -// row[2].incr() -// goto done -// ] -// row[1].init(rec) -// goto done -// ] -// else [ -// # remember row[0] is empty -// if (row[1].rec == rec) then [ -// row[1].incr() -// goto done -// ] -// if (row[2].rec == rec) then [ -// row[2].incr() -// goto done -// ] -// row[0].init(rec) -// goto done -// ] -// done: - -void InterpreterMacroAssembler::record_klass_in_profile(Register receiver, - Register mdp, Register reg2) { - assert(ProfileInterpreter, "must be profiling"); - Label done; - - record_klass_in_profile_helper(receiver, mdp, reg2, done); - - bind(done); -} - void InterpreterMacroAssembler::profile_ret(Register return_bci, Register mdp) { if (ProfileInterpreter) { Label profile_continue; @@ -1274,7 +1125,7 @@ void InterpreterMacroAssembler::profile_null_seen(Register mdp) { } } -void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, Register reg2) { +void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass) { if (ProfileInterpreter) { Label profile_continue; @@ -1287,7 +1138,7 @@ void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size()); // Record the object type. - record_klass_in_profile(klass, mdp, reg2); + profile_receiver_type(klass, mdp, 0); } update_mdp_by_constant(mdp, mdp_delta); diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.hpp b/src/hotspot/cpu/riscv/interp_masm_riscv.hpp index a9df09d656a..59cc76b022f 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.hpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.hpp @@ -262,14 +262,6 @@ class InterpreterMacroAssembler: public MacroAssembler { Register test_value_out, Label& not_equal_continue); - void record_klass_in_profile(Register receiver, Register mdp, - Register reg2); - void record_klass_in_profile_helper(Register receiver, Register mdp, - Register reg2, Label& done); - void record_item_in_profile_helper(Register item, Register mdp, - Register reg2, int start_row, Label& done, int total_rows, - OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn); - void update_mdp_by_offset(Register mdp_in, int offset_of_offset); void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp); void update_mdp_by_constant(Register mdp_in, int constant); @@ -283,11 +275,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void profile_call(Register mdp); void profile_final_call(Register mdp); void profile_virtual_call(Register receiver, Register mdp, - Register t1, bool receiver_can_be_null = false); void profile_ret(Register return_bci, Register mdp); void profile_null_seen(Register mdp); - void profile_typecheck(Register mdp, Register klass, Register temp); + void profile_typecheck(Register mdp, Register klass); void profile_typecheck_failed(Register mdp); void profile_switch_default(Register mdp); void profile_switch_case(Register index_in_scratch, Register mdp, diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index fb30f64e9ed..4f5e7afc166 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -543,6 +543,160 @@ void MacroAssembler::_verify_oop(Register reg, const char* s, const char* file, BLOCK_COMMENT("} verify_oop"); } +// Handle the receiver type profile update given the "recv" klass. +// +// Normally updates the ReceiverData (RD) that starts at "mdp" + "mdp_offset". +// If there are no matching or claimable receiver entries in RD, updates +// the polymorphic counter. +// +// This code expected to run by either the interpreter or JIT-ed code, without +// extra synchronization. For safety, receiver cells are claimed atomically, which +// avoids grossly misrepresenting the profiles under concurrent updates. For speed, +// counter updates are not atomic. +// +void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_offset) { + assert_different_registers(recv, mdp, t0, t1); + + int base_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(0)); + int end_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(ReceiverTypeData::row_limit())); + int poly_count_offset = in_bytes(CounterData::count_offset()); + int receiver_step = in_bytes(ReceiverTypeData::receiver_offset(1)) - base_receiver_offset; + int receiver_to_count_step = in_bytes(ReceiverTypeData::receiver_count_offset(0)) - base_receiver_offset; + + // Adjust for MDP offsets. Slots are pointer-sized, so is the global offset. + base_receiver_offset += mdp_offset; + end_receiver_offset += mdp_offset; + poly_count_offset += mdp_offset; + +#ifdef ASSERT + // We are about to walk the MDO slots without asking for offsets. + // Check that our math hits all the right spots. + for (uint c = 0; c < ReceiverTypeData::row_limit(); c++) { + int real_recv_offset = mdp_offset + in_bytes(ReceiverTypeData::receiver_offset(c)); + int real_count_offset = mdp_offset + in_bytes(ReceiverTypeData::receiver_count_offset(c)); + int offset = base_receiver_offset + receiver_step*c; + int count_offset = offset + receiver_to_count_step; + assert(offset == real_recv_offset, "receiver slot math"); + assert(count_offset == real_count_offset, "receiver count math"); + } + int real_poly_count_offset = mdp_offset + in_bytes(CounterData::count_offset()); + assert(poly_count_offset == real_poly_count_offset, "poly counter math"); +#endif + + // Corner case: no profile table. Increment poly counter and exit. + if (ReceiverTypeData::row_limit() == 0) { + increment(Address(mdp, poly_count_offset), DataLayout::counter_increment); + return; + } + + Register offset = t1; + + Label L_loop_search_receiver, L_loop_search_empty; + Label L_restart, L_found_recv, L_found_empty, L_polymorphic, L_count_update; + + // The code here recognizes three major cases: + // A. Fastest: receiver found in the table + // B. Fast: no receiver in the table, and the table is full + // C. Slow: no receiver in the table, free slots in the table + // + // The case A performance is most important, as perfectly-behaved code would end up + // there, especially with larger TypeProfileWidth. The case B performance is + // important as well, this is where bulk of code would land for normally megamorphic + // cases. The case C performance is not essential, its job is to deal with installation + // races, we optimize for code density instead. Case C needs to make sure that receiver + // rows are only claimed once. This makes sure we never overwrite a row for another + // receiver and never duplicate the receivers in the list, making profile type-accurate. + // + // It is very tempting to handle these cases in a single loop, and claim the first slot + // without checking the rest of the table. But, profiling code should tolerate free slots + // in the table, as class unloading can clear them. After such cleanup, the receiver + // we need might be _after_ the free slot. Therefore, we need to let at least full scan + // to complete, before trying to install new slots. Splitting the code in several tight + // loops also helpfully optimizes for cases A and B. + // + // This code is effectively: + // + // restart: + // // Fastest: receiver is already installed + // for (i = 0; i < receiver_count(); i++) { + // if (receiver(i) == recv) goto found_recv(i); + // } + // + // // Fast: no receiver, but profile is full + // for (i = 0; i < receiver_count(); i++) { + // if (receiver(i) == null) goto found_null(i); + // } + // goto polymorphic + // + // // Slow: try to install receiver + // found_null(i): + // CAS(&receiver(i), null, recv); + // goto restart + // + // polymorphic: + // count++; + // return + // + // found_recv(i): + // *receiver_count(i)++ + // + + bind(L_restart); + + // Fastest: receiver is already installed + mv(offset, base_receiver_offset); + bind(L_loop_search_receiver); + add(t0, mdp, offset); + ld(t0, Address(t0)); + beq(recv, t0, L_found_recv); + add(offset, offset, receiver_step); + sub(t0, offset, end_receiver_offset); + bnez(t0, L_loop_search_receiver); + + // Fast: no receiver, but profile is full + mv(offset, base_receiver_offset); + bind(L_loop_search_empty); + add(t0, mdp, offset); + ld(t0, Address(t0)); + beqz(t0, L_found_empty); + add(offset, offset, receiver_step); + sub(t0, offset, end_receiver_offset); + bnez(t0, L_loop_search_empty); + j(L_polymorphic); + + // Slow: try to install receiver + bind(L_found_empty); + + // Atomically swing receiver slot: null -> recv. + // + // The update uses CAS, which clobbers t0. Therefore, t1 + // is used to hold the destination address. This is safe because the + // offset is no longer needed after the address is computed. + add(t1, mdp, offset); + weak_cmpxchg(/*addr*/ t1, /*expected*/ zr, /*new*/ recv, Assembler::int64, + /*acquire*/ Assembler::relaxed, /*release*/ Assembler::relaxed, /*result*/ t0); + + // CAS success means the slot now has the receiver we want. CAS failure means + // something had claimed the slot concurrently: it can be the same receiver we want, + // or something else. Since this is a slow path, we can optimize for code density, + // and just restart the search from the beginning. + j(L_restart); + + // Counter updates: + // Increment polymorphic counter instead of receiver slot. + bind(L_polymorphic); + mv(offset, poly_count_offset); + j(L_count_update); + + // Found a receiver, convert its slot offset to corresponding count offset. + bind(L_found_recv); + add(offset, offset, receiver_to_count_step); + + bind(L_count_update); + add(t1, mdp, offset); + increment(Address(t1), DataLayout::counter_increment); +} + void MacroAssembler::_verify_oop_addr(Address addr, const char* s, const char* file, int line) { if (!VerifyOops) { return; diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index 3b021388fa5..f5e985c28a2 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -390,6 +390,8 @@ class MacroAssembler: public Assembler { Address argument_address(RegisterOrConstant arg_slot, int extra_slot_offset = 0); + void profile_receiver_type(Register recv, Register mdp, int mdp_offset); + // only if +VerifyOops void _verify_oop(Register reg, const char* s, const char* file, int line); void _verify_oop_addr(Address addr, const char* s, const char* file, int line); diff --git a/src/hotspot/cpu/riscv/templateTable_riscv.cpp b/src/hotspot/cpu/riscv/templateTable_riscv.cpp index 0fb529d1683..5cc725e3af4 100644 --- a/src/hotspot/cpu/riscv/templateTable_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateTable_riscv.cpp @@ -3279,7 +3279,7 @@ void TemplateTable::invokevirtual_helper(Register index, __ load_klass(x10, recv); // profile this call - __ profile_virtual_call(x10, xlocals, x13); + __ profile_virtual_call(x10, xlocals); // get target Method & entry point __ lookup_virtual_method(x10, index, method); @@ -3406,7 +3406,7 @@ void TemplateTable::invokeinterface(int byte_no) { /*return_method=*/false); // profile this call - __ profile_virtual_call(x13, x30, x9); + __ profile_virtual_call(x13, x30); // Get declaring interface class from method, and itable index __ load_method_holder(x10, xmethod); diff --git a/src/hotspot/cpu/s390/c2_globals_s390.hpp b/src/hotspot/cpu/s390/c2_globals_s390.hpp index 431a36cda07..125b317588d 100644 --- a/src/hotspot/cpu/s390/c2_globals_s390.hpp +++ b/src/hotspot/cpu/s390/c2_globals_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -44,7 +44,7 @@ define_pd_global(intx, CompileThreshold, 10000); define_pd_global(intx, OnStackReplacePercentage, 140); define_pd_global(intx, ConditionalMoveLimit, 4); -define_pd_global(intx, FreqInlineSize, 175); +define_pd_global(intx, FreqInlineSize, 325); define_pd_global(intx, InteriorEntryAlignment, 4); define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K)); define_pd_global(intx, RegisterCostAreaRatio, 12000); diff --git a/src/hotspot/cpu/s390/compiledIC_s390.cpp b/src/hotspot/cpu/s390/compiledIC_s390.cpp index 8501a0cb346..43f5d80250e 100644 --- a/src/hotspot/cpu/s390/compiledIC_s390.cpp +++ b/src/hotspot/cpu/s390/compiledIC_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,9 +29,6 @@ #include "memory/resourceArea.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" -#ifdef COMPILER2 -#include "opto/matcher.hpp" -#endif // ---------------------------------------------------------------------------- @@ -39,7 +36,6 @@ #define __ masm-> address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address mark/* = nullptr*/) { -#ifdef COMPILER2 // Stub is fixed up when the corresponding call is converted from calling // compiled code to calling interpreted code. if (mark == nullptr) { @@ -55,7 +51,7 @@ address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address ma __ relocate(static_stub_Relocation::spec(mark)); AddressLiteral meta = __ allocate_metadata_address(nullptr); - bool success = __ load_const_from_toc(as_Register(Matcher::inline_cache_reg_encode()), meta); + bool success = __ load_const_from_toc(Z_inline_cache, meta); __ set_inst_mark(); AddressLiteral a((address)-1); @@ -67,10 +63,6 @@ address CompiledDirectCall::emit_to_interp_stub(MacroAssembler *masm, address ma __ z_br(Z_R1); __ end_a_stub(); // Update current stubs pointer and restore insts_end. return stub; -#else - ShouldNotReachHere(); - return nullptr; -#endif } #undef __ diff --git a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp index 272136fc28c..617bc7cd00c 100644 --- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -129,6 +129,57 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas } } +static void generate_post_barrier(MacroAssembler* masm, + const Register store_addr, + const Register new_val, + const Register thread, + const Register tmp1, + const Register tmp2, + Label& done, + bool new_val_may_be_null) { + + __ block_comment("generate_post_barrier {"); + + assert(thread == Z_thread, "must be"); + assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, noreg); + + // Does store cross heap regions? + if (VM_Version::has_DistinctOpnds()) { + __ z_xgrk(tmp1, store_addr, new_val); // tmp1 := store address ^ new value + } else { + __ z_lgr(tmp1, store_addr); + __ z_xgr(tmp1, new_val); + } + __ z_srag(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) + __ branch_optimized(Assembler::bcondEqual, done); + + // Crosses regions, storing null? + if (new_val_may_be_null) { + __ z_ltgr(new_val, new_val); + __ z_bre(done); + } else { +#ifdef ASSERT + __ z_ltgr(new_val, new_val); + __ asm_assert(Assembler::bcondNotZero, "null oop not allowed (G1 post)", 0x322); // Checked by caller. +#endif + } + + __ z_srag(tmp1, store_addr, CardTable::card_shift()); + + Address card_table_addr(thread, in_bytes(G1ThreadLocalData::card_table_base_offset())); + __ z_alg(tmp1, card_table_addr); // tmp1 := card address + + if(UseCondCardMark) { + __ z_cli(0, tmp1, G1CardTable::clean_card_val()); + __ branch_optimized(Assembler::bcondNotEqual, done); + } + + static_assert(G1CardTable::dirty_card_val() == 0, "must be to use z_mvi"); + __ z_mvi(0, tmp1, G1CardTable::dirty_card_val()); // *(card address) := dirty_card_val + + __ block_comment("} generate_post_barrier"); +} + #if defined(COMPILER2) #undef __ @@ -204,57 +255,6 @@ void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm, BLOCK_COMMENT("} generate_c2_pre_barrier_stub"); } -static void generate_post_barrier(MacroAssembler* masm, - const Register store_addr, - const Register new_val, - const Register thread, - const Register tmp1, - const Register tmp2, - Label& done, - bool new_val_may_be_null) { - - __ block_comment("generate_post_barrier {"); - - assert(thread == Z_thread, "must be"); - assert_different_registers(store_addr, new_val, thread, tmp1, tmp2, noreg); - - // Does store cross heap regions? - if (VM_Version::has_DistinctOpnds()) { - __ z_xgrk(tmp1, store_addr, new_val); // tmp1 := store address ^ new value - } else { - __ z_lgr(tmp1, store_addr); - __ z_xgr(tmp1, new_val); - } - __ z_srag(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes); // tmp1 := ((store address ^ new value) >> LogOfHRGrainBytes) - __ branch_optimized(Assembler::bcondEqual, done); - - // Crosses regions, storing null? - if (new_val_may_be_null) { - __ z_ltgr(new_val, new_val); - __ z_bre(done); - } else { -#ifdef ASSERT - __ z_ltgr(new_val, new_val); - __ asm_assert(Assembler::bcondNotZero, "null oop not allowed (G1 post)", 0x322); // Checked by caller. -#endif - } - - __ z_srag(tmp1, store_addr, CardTable::card_shift()); - - Address card_table_addr(thread, in_bytes(G1ThreadLocalData::card_table_base_offset())); - __ z_alg(tmp1, card_table_addr); // tmp1 := card address - - if(UseCondCardMark) { - __ z_cli(0, tmp1, G1CardTable::clean_card_val()); - __ branch_optimized(Assembler::bcondNotEqual, done); - } - - static_assert(G1CardTable::dirty_card_val() == 0, "must be to use z_mvi"); - __ z_mvi(0, tmp1, G1CardTable::dirty_card_val()); // *(card address) := dirty_card_val - - __ block_comment("} generate_post_barrier"); -} - void G1BarrierSetAssembler::g1_write_barrier_post_c2(MacroAssembler* masm, Register store_addr, Register new_val, diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp index c6f5a4e119c..7617c7a49e8 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -206,6 +206,11 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na return opto_reg; } +void BarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Register tmp, Label& slow_path) { + // Load the oop from the weak handle. + __ z_lg(obj, Address(obj)); +} + #undef __ #define __ _masm-> diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp index 65db915b672..d5682450414 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -65,6 +65,8 @@ public: #ifdef COMPILER2 OptoReg::Name refine_register(const Node* node, OptoReg::Name opto_reg) const; + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, + Register tmp, Label& slow_path); #endif // COMPILER2 static const int OFFSET_TO_PATCHABLE_DATA_INSTRUCTION = 6 + 6 + 6; // iihf(6) + iilf(6) + lg(6) diff --git a/src/hotspot/cpu/s390/globals_s390.hpp b/src/hotspot/cpu/s390/globals_s390.hpp index 07987ea3469..d110443adf8 100644 --- a/src/hotspot/cpu/s390/globals_s390.hpp +++ b/src/hotspot/cpu/s390/globals_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,7 @@ define_pd_global(size_t, CodeCacheSegmentSize, 256); // Ideally, this is 256 (cache line size). This keeps code end data // on separate lines. But we reduced it to 64 since 256 increased // code size significantly by padding nops between IVC and second UEP. -define_pd_global(intx, CodeEntryAlignment, 64); +define_pd_global(uint, CodeEntryAlignment, 64); define_pd_global(intx, OptoLoopAlignment, 2); define_pd_global(intx, InlineSmallCode, 2000); diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index f35e18c7398..78779a9098a 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2024 SAP SE. All rights reserved. * Copyright 2024 IBM Corporation. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,6 +44,7 @@ #include "runtime/icache.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/objectMonitor.hpp" +#include "runtime/objectMonitorTable.hpp" #include "runtime/os.hpp" #include "runtime/safepoint.hpp" #include "runtime/safepointMechanism.hpp" @@ -6372,45 +6373,55 @@ void MacroAssembler::compiler_fast_lock_object(Register obj, Register box, Regis if (!UseObjectMonitorTable) { assert(tmp1_monitor == mark, "should be the same here"); } else { + const Register tmp1_bucket = tmp1; + const Register hash = Z_R0_scratch; NearLabel monitor_found; - // load cache address - z_la(tmp1, Address(Z_thread, JavaThread::om_cache_oops_offset())); + // Save the mark, we might need it to extract the hash. + z_lgr(hash, mark); - const int num_unrolled = 2; + // Look for the monitor in the om_cache. + + ByteSize cache_offset = JavaThread::om_cache_oops_offset(); + ByteSize monitor_offset = OMCache::oop_to_monitor_difference(); + const int num_unrolled = OMCache::CAPACITY; for (int i = 0; i < num_unrolled; i++) { - z_cg(obj, Address(tmp1)); + z_lg(tmp1_monitor, Address(Z_thread, cache_offset + monitor_offset)); + z_cg(obj, Address(Z_thread, cache_offset)); z_bre(monitor_found); - add2reg(tmp1, in_bytes(OMCache::oop_to_oop_difference())); + cache_offset = cache_offset + OMCache::oop_to_oop_difference(); } - NearLabel loop; - // Search for obj in cache + // Get the hash code. + z_srlg(hash, hash, markWord::hash_shift); - bind(loop); + // Get the table and calculate the bucket's address. + load_const_optimized(tmp2, ObjectMonitorTable::current_table_address()); + z_lg(tmp2, Address(tmp2)); + z_ng(hash, Address(tmp2, ObjectMonitorTable::table_capacity_mask_offset())); + z_lg(tmp1_bucket, Address(tmp2, ObjectMonitorTable::table_buckets_offset())); + z_sllg(hash, hash, LogBytesPerWord); + z_agr(tmp1_bucket, hash); - // check for match. - z_cg(obj, Address(tmp1)); - z_bre(monitor_found); + // Read the monitor from the bucket. + z_lg(tmp1_monitor, Address(tmp1_bucket)); - // search until null encountered, guaranteed _null_sentinel at end. - add2reg(tmp1, in_bytes(OMCache::oop_to_oop_difference())); - z_cghsi(0, tmp1, 0); - z_brne(loop); // if not EQ to 0, go for another loop + // Check if the monitor in the bucket is special (empty, tombstone or removed). + z_clgfi(tmp1_monitor, ObjectMonitorTable::SpecialPointerValues::below_is_special); + z_brl(slow_path); - // we reached to the end, cache miss - z_ltgr(obj, obj); // set CC to NE - z_bru(slow_path); + // Check if object matches. + z_lg(tmp2, Address(tmp1_monitor, ObjectMonitor::object_offset())); + BarrierSetAssembler* bs_asm = BarrierSet::barrier_set()->barrier_set_assembler(); + bs_asm->try_resolve_weak_handle_in_c2(this, tmp2, Z_R0_scratch, slow_path); + z_cgr(obj, tmp2); + z_brne(slow_path); - // cache hit bind(monitor_found); - z_lg(tmp1_monitor, Address(tmp1, OMCache::oop_to_monitor_difference())); } NearLabel monitor_locked; // lock the monitor - // mark contains the tagged ObjectMonitor*. - const Register tagged_monitor = mark; const Register zero = tmp2; const ByteSize monitor_tag = in_ByteSize(UseObjectMonitorTable ? 0 : checked_cast(markWord::monitor_value)); diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index cbc5c6988d4..3c8defe62d9 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -7320,6 +7320,25 @@ void Assembler::ucomisd(XMMRegister dst, XMMRegister src) { emit_int16(0x2E, (0xC0 | encode)); } +void Assembler::vucomxsd(XMMRegister dst, Address src) { + assert(VM_Version::supports_avx10_2(), ""); + InstructionMark im(this); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); + attributes.set_is_evex_instruction(); + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); + emit_int8(0x2E); + emit_operand(dst, src, 0); +} + +void Assembler::vucomxsd(XMMRegister dst, XMMRegister src) { + assert(VM_Version::supports_avx10_2(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); + emit_int16(0x2E, (0xC0 | encode)); +} + void Assembler::ucomiss(XMMRegister dst, Address src) { InstructionMark im(this); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); @@ -7335,6 +7354,25 @@ void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { emit_int16(0x2E, (0xC0 | encode)); } +void Assembler::vucomxss(XMMRegister dst, Address src) { + assert(VM_Version::supports_avx10_2(), ""); + InstructionMark im(this); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); + emit_int8(0x2E); + emit_operand(dst, src, 0); +} + +void Assembler::vucomxss(XMMRegister dst, XMMRegister src) { + assert(VM_Version::supports_avx10_2(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); + emit_int16(0x2E, (0xC0 | encode)); +} + void Assembler::xabort(int8_t imm8) { emit_int24((unsigned char)0xC6, (unsigned char)0xF8, (imm8 & 0xFF)); } diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 26c57fc2d80..97854f712cf 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -2331,10 +2331,14 @@ private: // Unordered Compare Scalar Double-Precision Floating-Point Values and set EFLAGS void ucomisd(XMMRegister dst, Address src); void ucomisd(XMMRegister dst, XMMRegister src); + void vucomxsd(XMMRegister dst, Address src); + void vucomxsd(XMMRegister dst, XMMRegister src); // Unordered Compare Scalar Single-Precision Floating-Point Values and set EFLAGS void ucomiss(XMMRegister dst, Address src); void ucomiss(XMMRegister dst, XMMRegister src); + void vucomxss(XMMRegister dst, Address src); + void vucomxss(XMMRegister dst, XMMRegister src); void xabort(int8_t imm8); diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index 37ee9451405..d9be0fdcc8d 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -32,6 +32,7 @@ #include "c1/c1_ValueStack.hpp" #include "ci/ciArrayKlass.hpp" #include "ci/ciInstance.hpp" +#include "code/aotCodeCache.hpp" #include "compiler/oopMap.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gc_globals.hpp" @@ -535,6 +536,15 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod case T_LONG: { assert(patch_code == lir_patch_none, "no patching handled here"); +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + address b = c->as_pointer(); + if (AOTRuntimeConstants::contains(b)) { + __ load_aotrc_address(dest->as_register_lo(), b); + break; + } + } +#endif __ movptr(dest->as_register_lo(), (intptr_t)c->as_jlong()); break; } diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index 8fc3d18abb1..a3ccc081b6b 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +34,9 @@ #include "opto/subnode.hpp" #include "runtime/globals.hpp" #include "runtime/objectMonitor.hpp" +#include "runtime/objectMonitorTable.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/synchronizer.hpp" #include "utilities/checkedCast.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/powerOfTwo.hpp" @@ -217,7 +219,6 @@ inline Assembler::AvxVectorLen C2_MacroAssembler::vector_length_encoding(int vle // In the case of failure, the node will branch directly to the // FailureLabel - // obj: object to lock // box: on-stack box address -- KILLED // rax: tmp -- KILLED @@ -286,7 +287,7 @@ void C2_MacroAssembler::fast_lock(Register obj, Register box, Register rax_reg, // After successful lock, push object on lock-stack. movptr(Address(thread, top), obj); addl(Address(thread, JavaThread::lock_stack_top_offset()), oopSize); - jmpb(locked); + jmp(locked); } { // Handle inflated monitor. @@ -297,38 +298,49 @@ void C2_MacroAssembler::fast_lock(Register obj, Register box, Register rax_reg, if (!UseObjectMonitorTable) { assert(mark == monitor, "should be the same here"); } else { - // Uses ObjectMonitorTable. Look for the monitor in the om_cache. - // Fetch ObjectMonitor* from the cache or take the slow-path. + const Register hash = t; Label monitor_found; - // Load cache address - lea(t, Address(thread, JavaThread::om_cache_oops_offset())); + // Look for the monitor in the om_cache. - const int num_unrolled = 2; + ByteSize cache_offset = JavaThread::om_cache_oops_offset(); + ByteSize monitor_offset = OMCache::oop_to_monitor_difference(); + const int num_unrolled = OMCache::CAPACITY; for (int i = 0; i < num_unrolled; i++) { - cmpptr(obj, Address(t)); + movptr(monitor, Address(thread, cache_offset + monitor_offset)); + cmpptr(obj, Address(thread, cache_offset)); jccb(Assembler::equal, monitor_found); - increment(t, in_bytes(OMCache::oop_to_oop_difference())); + cache_offset = cache_offset + OMCache::oop_to_oop_difference(); } - Label loop; + // Look for the monitor in the table. - // Search for obj in cache. - bind(loop); + // Get the hash code. + movptr(hash, Address(obj, oopDesc::mark_offset_in_bytes())); + shrq(hash, markWord::hash_shift); + andq(hash, markWord::hash_mask); - // Check for match. - cmpptr(obj, Address(t)); - jccb(Assembler::equal, monitor_found); + // Get the table and calculate the bucket's address. + lea(rax_reg, ExternalAddress(ObjectMonitorTable::current_table_address())); + movptr(rax_reg, Address(rax_reg)); + andq(hash, Address(rax_reg, ObjectMonitorTable::table_capacity_mask_offset())); + movptr(rax_reg, Address(rax_reg, ObjectMonitorTable::table_buckets_offset())); - // Search until null encountered, guaranteed _null_sentinel at end. - cmpptr(Address(t), 1); - jcc(Assembler::below, slow_path); // 0 check, but with ZF=0 when *t == 0 - increment(t, in_bytes(OMCache::oop_to_oop_difference())); - jmpb(loop); + // Read the monitor from the bucket. + movptr(monitor, Address(rax_reg, hash, Address::times_ptr)); + + // Check if the monitor in the bucket is special (empty, tombstone or removed) + cmpptr(monitor, ObjectMonitorTable::SpecialPointerValues::below_is_special); + jcc(Assembler::below, slow_path); + + // Check if object matches. + movptr(rax_reg, Address(monitor, ObjectMonitor::object_offset())); + BarrierSetAssembler* bs_asm = BarrierSet::barrier_set()->barrier_set_assembler(); + bs_asm->try_resolve_weak_handle_in_c2(this, rax_reg, slow_path); + cmpptr(rax_reg, obj); + jcc(Assembler::notEqual, slow_path); - // Cache hit. bind(monitor_found); - movptr(monitor, Address(t, OMCache::oop_to_monitor_difference())); } const ByteSize monitor_tag = in_ByteSize(UseObjectMonitorTable ? 0 : checked_cast(markWord::monitor_value)); const Address recursions_address(monitor, ObjectMonitor::recursions_offset() - monitor_tag); @@ -487,14 +499,14 @@ void C2_MacroAssembler::fast_unlock(Register obj, Register reg_rax, Register t, cmpl(top, in_bytes(JavaThread::lock_stack_base_offset())); jcc(Assembler::below, check_done); cmpptr(obj, Address(thread, top)); - jccb(Assembler::notEqual, inflated_check_lock_stack); + jcc(Assembler::notEqual, inflated_check_lock_stack); stop("Fast Unlock lock on stack"); bind(check_done); if (UseObjectMonitorTable) { movptr(mark, Address(obj, oopDesc::mark_offset_in_bytes())); } testptr(mark, markWord::monitor_value); - jccb(Assembler::notZero, inflated); + jcc(Assembler::notZero, inflated); stop("Fast Unlock not monitor"); #endif @@ -519,7 +531,7 @@ void C2_MacroAssembler::fast_unlock(Register obj, Register reg_rax, Register t, // Check if recursive. cmpptr(recursions_address, 0); - jccb(Assembler::notZero, recursive); + jcc(Assembler::notZero, recursive); // Set owner to null. // Release to satisfy the JMM @@ -530,11 +542,11 @@ void C2_MacroAssembler::fast_unlock(Register obj, Register reg_rax, Register t, // Check if the entry_list is empty. cmpptr(entry_list_address, NULL_WORD); - jccb(Assembler::zero, unlocked); // If so we are done. + jcc(Assembler::zero, unlocked); // If so we are done. // Check if there is a successor. cmpptr(succ_address, NULL_WORD); - jccb(Assembler::notZero, unlocked); // If so we are done. + jcc(Assembler::notZero, unlocked); // If so we are done. // Save the monitor pointer in the current thread, so we can try to // reacquire the lock in SharedRuntime::monitor_exit_helper(). @@ -1046,17 +1058,28 @@ void C2_MacroAssembler::signum_fp(int opcode, XMMRegister dst, XMMRegister zero, Label DONE_LABEL; + // Handle special cases +0.0/-0.0 and NaN, if argument is +0.0/-0.0 or NaN, return argument + // If AVX10.2 (or newer) floating point comparison instructions used, SF=1 for equal and unordered cases + // If other floating point comparison instructions used, ZF=1 for equal and unordered cases if (opcode == Op_SignumF) { - ucomiss(dst, zero); - jcc(Assembler::equal, DONE_LABEL); // handle special case +0.0/-0.0, if argument is +0.0/-0.0, return argument - jcc(Assembler::parity, DONE_LABEL); // handle special case NaN, if argument NaN, return NaN + if (VM_Version::supports_avx10_2()) { + vucomxss(dst, zero); + jcc(Assembler::negative, DONE_LABEL); + } else { + ucomiss(dst, zero); + jcc(Assembler::equal, DONE_LABEL); + } movflt(dst, one); jcc(Assembler::above, DONE_LABEL); xorps(dst, ExternalAddress(StubRoutines::x86::vector_float_sign_flip()), noreg); } else if (opcode == Op_SignumD) { - ucomisd(dst, zero); - jcc(Assembler::equal, DONE_LABEL); // handle special case +0.0/-0.0, if argument is +0.0/-0.0, return argument - jcc(Assembler::parity, DONE_LABEL); // handle special case NaN, if argument NaN, return NaN + if (VM_Version::supports_avx10_2()) { + vucomxsd(dst, zero); + jcc(Assembler::negative, DONE_LABEL); + } else { + ucomisd(dst, zero); + jcc(Assembler::equal, DONE_LABEL); + } movdbl(dst, one); jcc(Assembler::above, DONE_LABEL); xorpd(dst, ExternalAddress(StubRoutines::x86::vector_double_sign_flip()), noreg); diff --git a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp index 34de9403ccf..b20d7b5cd07 100644 --- a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp @@ -23,6 +23,7 @@ */ #include "asm/macroAssembler.inline.hpp" +#include "code/aotCodeCache.hpp" #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BarrierSetAssembler.hpp" #include "gc/g1/g1BarrierSetRuntime.hpp" @@ -268,6 +269,16 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, __ bind(done); } +#if INCLUDE_CDS +// return a register that differs from reg1, reg2, reg3 and reg4 + +static Register pick_different_reg(Register reg1, Register reg2 = noreg, Register reg3= noreg, Register reg4 = noreg) { + RegSet available = (RegSet::of(rscratch1, rscratch2, rax, rbx) + rdx - + RegSet::of(reg1, reg2, reg3, reg4)); + return *(available.begin()); +} +#endif // INCLUDE_CDS + static void generate_post_barrier(MacroAssembler* masm, const Register store_addr, const Register new_val, @@ -280,10 +291,32 @@ static void generate_post_barrier(MacroAssembler* masm, Label L_done; // Does store cross heap regions? - __ movptr(tmp1, store_addr); // tmp1 := store address - __ xorptr(tmp1, new_val); // tmp1 := store address ^ new value - __ shrptr(tmp1, G1HeapRegion::LogOfHRGrainBytes); // ((store address ^ new value) >> LogOfHRGrainBytes) == 0? - __ jccb(Assembler::equal, L_done); +#if INCLUDE_CDS + // AOT code needs to load the barrier grain shift from the aot + // runtime constants area in the code cache otherwise we can compile + // it as an immediate operand + + if (AOTCodeCache::is_on_for_dump()) { + address grain_shift_addr = AOTRuntimeConstants::grain_shift_address(); + Register save = pick_different_reg(rcx, tmp1, new_val, store_addr); + __ push(save); + __ movptr(save, store_addr); + __ xorptr(save, new_val); + __ push(rcx); + __ lea(rcx, ExternalAddress(grain_shift_addr)); + __ movl(rcx, Address(rcx, 0)); + __ shrptr(save); + __ pop(rcx); + __ pop(save); + __ jcc(Assembler::equal, L_done); + } else +#endif // INCLUDE_CDS + { + __ movptr(tmp1, store_addr); // tmp1 := store address + __ xorptr(tmp1, new_val); // tmp1 := store address ^ new value + __ shrptr(tmp1, G1HeapRegion::LogOfHRGrainBytes); // ((store address ^ new value) >> LogOfHRGrainBytes) == 0? + __ jccb(Assembler::equal, L_done); + } // Crosses regions, storing null? if (new_val_may_be_null) { diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp index 09c5d93dbb3..215dc30f7fd 100644 --- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -395,6 +395,11 @@ OptoReg::Name BarrierSetAssembler::refine_register(const Node* node, OptoReg::Na extern void vec_spill_helper(C2_MacroAssembler *masm, bool is_load, int stack_offset, int reg, uint ireg, outputStream* st); +void BarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Label& slowpath) { + // Load the oop from the weak handle. + __ movptr(obj, Address(obj)); +} + #undef __ #define __ _masm-> diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp index c5bf17c3b4e..6aff29850e3 100644 --- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -109,6 +109,8 @@ public: #ifdef COMPILER2 OptoReg::Name refine_register(const Node* node, OptoReg::Name opto_reg); + + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Label& slowpath); #endif // COMPILER2 }; diff --git a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp index 65e6b4e01fc..0ea769dd488 100644 --- a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp @@ -23,6 +23,7 @@ */ #include "asm/macroAssembler.inline.hpp" +#include "code/aotCodeCache.hpp" #include "gc/shared/barrierSet.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableBarrierSet.hpp" @@ -111,7 +112,15 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl __ shrptr(end, CardTable::card_shift()); __ subptr(end, addr); // end --> cards count - __ mov64(tmp, (intptr_t)ctbs->card_table_base_const()); +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + __ lea(tmp, ExternalAddress(AOTRuntimeConstants::card_table_base_address())); + __ movq(tmp, Address(tmp, 0)); + } else +#endif + { + __ mov64(tmp, (intptr_t)ctbs->card_table_base_const()); + } __ addptr(addr, tmp); __ BIND(L_loop); __ movb(Address(addr, count, Address::times_1), 0); @@ -121,7 +130,7 @@ __ BIND(L_loop); __ BIND(L_done); } -void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj, Address dst) { +void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj, Address dst, Register rscratch) { // Does a store check for the oop in register obj. The content of // register obj is destroyed afterwards. CardTableBarrierSet* ctbs = CardTableBarrierSet::barrier_set(); @@ -136,6 +145,13 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register ob // never need to be relocated. On 64bit however the value may be too // large for a 32bit displacement. intptr_t byte_map_base = (intptr_t)ctbs->card_table_base_const(); +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + __ lea(rscratch, ExternalAddress(AOTRuntimeConstants::card_table_base_address())); + __ movq(rscratch, Address(rscratch, 0)); + card_addr = Address(rscratch, obj, Address::times_1, 0); + } else +#endif if (__ is_simm32(byte_map_base)) { card_addr = Address(noreg, obj, Address::times_1, byte_map_base); } else { @@ -174,10 +190,10 @@ void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorS if (needs_post_barrier) { // flatten object address if needed if (!precise || (dst.index() == noreg && dst.disp() == 0)) { - store_check(masm, dst.base(), dst); + store_check(masm, dst.base(), dst, tmp2); } else { __ lea(tmp1, dst); - store_check(masm, tmp1, dst); + store_check(masm, tmp1, dst, tmp2); } } } diff --git a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp index 0a36571c757..201c11062f2 100644 --- a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp @@ -33,7 +33,7 @@ protected: virtual void gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count) {} - void store_check(MacroAssembler* masm, Register obj, Address dst); + void store_check(MacroAssembler* masm, Register obj, Address dst, Register rscratch); virtual void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count, Register tmp); diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp index 97829a10a3b..67510fac58f 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -618,6 +619,27 @@ void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler __ bind(done); } +#ifdef COMPILER2 +void ShenandoahBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Label& slowpath) { + Label done; + + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, slowpath); + + // Check if the reference is null, and if it is, take the fast path. + __ testptr(obj, obj); + __ jcc(Assembler::zero, done); + + Address gc_state(r15_thread, ShenandoahThreadLocalData::gc_state_offset()); + + // Check if the heap is under weak-reference/roots processing, in + // which case we need to take the slow path. + __ testb(gc_state, ShenandoahHeap::WEAK_ROOTS); + __ jcc(Assembler::notZero, slowpath); + __ bind(done); +} +#endif // COMPILER2 + // Special Shenandoah CAS implementation that handles false negatives // due to concurrent evacuation. void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler* masm, diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp index b5cc5c8d834..79540aa19e1 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,6 +78,9 @@ public: Address dst, Register val, Register tmp1, Register tmp2, Register tmp3); virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); +#ifdef COMPILER2 + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Label& slowpath); +#endif // COMPILER2 }; #endif // CPU_X86_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_X86_HPP diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp index ae93cca8c19..47a3dad54e7 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -1328,6 +1328,19 @@ void ZBarrierSetAssembler::generate_c2_store_barrier_stub(MacroAssembler* masm, __ jmp(slow_continuation); } +void ZBarrierSetAssembler::try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Label& slow_path) { + // Resolve weak handle using the standard implementation. + BarrierSetAssembler::try_resolve_weak_handle_in_c2(masm, obj, slow_path); + + // Check if the oop is bad, in which case we need to take the slow path. + __ testptr(obj, Address(r15_thread, ZThreadLocalData::mark_bad_mask_offset())); + __ jcc(Assembler::notZero, slow_path); + + // Oop is okay, so we uncolor it. + __ relocate(barrier_Relocation::spec(), ZBarrierRelocationFormatLoadGoodBeforeShl); + __ shrq(obj, barrier_Relocation::unpatched); +} + #undef __ #endif // COMPILER2 diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp index 19902500f93..e91e2b9ea20 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -167,6 +167,8 @@ public: ZLoadBarrierStubC2* stub) const; void generate_c2_store_barrier_stub(MacroAssembler* masm, ZStoreBarrierStubC2* stub) const; + + virtual void try_resolve_weak_handle_in_c2(MacroAssembler* masm, Register obj, Label& slow_path); #endif // COMPILER2 void store_barrier_fast(MacroAssembler* masm, diff --git a/src/hotspot/cpu/x86/globals_x86.hpp b/src/hotspot/cpu/x86/globals_x86.hpp index 103e22d0185..4f5b6d31e75 100644 --- a/src/hotspot/cpu/x86/globals_x86.hpp +++ b/src/hotspot/cpu/x86/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,9 +46,9 @@ define_pd_global(size_t, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRES // the uep and the vep doesn't get real alignment but just slops on by // only assured that the entry instruction meets the 5 byte size requirement. #if COMPILER2_OR_JVMCI -define_pd_global(intx, CodeEntryAlignment, 32); +define_pd_global(uint, CodeEntryAlignment, 32); #else -define_pd_global(intx, CodeEntryAlignment, 16); +define_pd_global(uint, CodeEntryAlignment, 16); #endif // COMPILER2_OR_JVMCI define_pd_global(intx, OptoLoopAlignment, 16); define_pd_global(intx, InlineSmallCode, 1000); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index b88f510401a..b54f6adc263 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -765,7 +765,7 @@ void MacroAssembler::align32() { void MacroAssembler::align(uint modulus) { // 8273459: Ensure alignment is possible with current segment alignment - assert(modulus <= (uintx)CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment"); + assert(modulus <= CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment"); align(modulus, offset()); } @@ -2656,6 +2656,17 @@ void MacroAssembler::ucomisd(XMMRegister dst, AddressLiteral src, Register rscra } } +void MacroAssembler::vucomxsd(XMMRegister dst, AddressLiteral src, Register rscratch) { + assert(rscratch != noreg || always_reachable(src), "missing"); + + if (reachable(src)) { + Assembler::vucomxsd(dst, as_Address(src)); + } else { + lea(rscratch, src); + Assembler::vucomxsd(dst, Address(rscratch, 0)); + } +} + void MacroAssembler::ucomiss(XMMRegister dst, AddressLiteral src, Register rscratch) { assert(rscratch != noreg || always_reachable(src), "missing"); @@ -2667,6 +2678,17 @@ void MacroAssembler::ucomiss(XMMRegister dst, AddressLiteral src, Register rscra } } +void MacroAssembler::vucomxss(XMMRegister dst, AddressLiteral src, Register rscratch) { + assert(rscratch != noreg || always_reachable(src), "missing"); + + if (reachable(src)) { + Assembler::vucomxss(dst, as_Address(src)); + } else { + lea(rscratch, src); + Assembler::vucomxss(dst, Address(rscratch, 0)); + } +} + void MacroAssembler::xorpd(XMMRegister dst, AddressLiteral src, Register rscratch) { assert(rscratch != noreg || always_reachable(src), "missing"); @@ -10012,6 +10034,20 @@ void MacroAssembler::restore_legacy_gprs() { addq(rsp, 16 * wordSize); } +void MacroAssembler::load_aotrc_address(Register reg, address a) { +#if INCLUDE_CDS + assert(AOTRuntimeConstants::contains(a), "address out of range for data area"); + if (AOTCodeCache::is_on_for_dump()) { + // all aotrc field addresses should be registered in the AOTCodeCache address table + lea(reg, ExternalAddress(a)); + } else { + mov64(reg, (uint64_t)a); + } +#else + ShouldNotReachHere(); +#endif +} + void MacroAssembler::setcc(Assembler::Condition comparison, Register dst) { if (VM_Version::supports_apx_f()) { esetzucc(comparison, dst); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 93e3529ac1e..5c049f710e2 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1313,10 +1313,18 @@ public: void ucomiss(XMMRegister dst, Address src) { Assembler::ucomiss(dst, src); } void ucomiss(XMMRegister dst, AddressLiteral src, Register rscratch = noreg); + void vucomxss(XMMRegister dst, XMMRegister src) { Assembler::vucomxss(dst, src); } + void vucomxss(XMMRegister dst, Address src) { Assembler::vucomxss(dst, src); } + void vucomxss(XMMRegister dst, AddressLiteral src, Register rscratch = noreg); + void ucomisd(XMMRegister dst, XMMRegister src) { Assembler::ucomisd(dst, src); } void ucomisd(XMMRegister dst, Address src) { Assembler::ucomisd(dst, src); } void ucomisd(XMMRegister dst, AddressLiteral src, Register rscratch = noreg); + void vucomxsd(XMMRegister dst, XMMRegister src) { Assembler::vucomxsd(dst, src); } + void vucomxsd(XMMRegister dst, Address src) { Assembler::vucomxsd(dst, src); } + void vucomxsd(XMMRegister dst, AddressLiteral src, Register rscratch = noreg); + // Bitwise Logical XOR of Packed Double-Precision Floating-Point Values void xorpd(XMMRegister dst, XMMRegister src); void xorpd(XMMRegister dst, Address src) { Assembler::xorpd(dst, src); } @@ -2062,6 +2070,7 @@ public: void save_legacy_gprs(); void restore_legacy_gprs(); + void load_aotrc_address(Register reg, address a); void setcc(Assembler::Condition comparison, Register dst); }; diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index c65c1c7d219..78d6dec08cf 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -48,7 +48,7 @@ int VM_Version::_stepping; bool VM_Version::_has_intel_jcc_erratum; VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; -#define DECLARE_CPU_FEATURE_NAME(id, name, bit) name, +#define DECLARE_CPU_FEATURE_NAME(id, name, bit) XSTR(name), const char* VM_Version::_features_names[] = { CPU_FEATURE_FLAGS(DECLARE_CPU_FEATURE_NAME)}; #undef DECLARE_CPU_FEATURE_NAME @@ -1659,41 +1659,40 @@ void VM_Version::get_processor_features() { if (FLAG_IS_DEFAULT(AllocatePrefetchInstr) && supports_3dnow_prefetch()) { FLAG_SET_DEFAULT(AllocatePrefetchInstr, 3); } -#ifdef COMPILER2 - if (UseAVX > 2) { - if (FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize) || - (!FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize) && - ArrayOperationPartialInlineSize != 0 && - ArrayOperationPartialInlineSize != 16 && - ArrayOperationPartialInlineSize != 32 && - ArrayOperationPartialInlineSize != 64)) { - int inline_size = 0; - if (MaxVectorSize >= 64 && AVX3Threshold == 0) { - inline_size = 64; - } else if (MaxVectorSize >= 32) { - inline_size = 32; - } else if (MaxVectorSize >= 16) { - inline_size = 16; - } - if(!FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize)) { - warning("Setting ArrayOperationPartialInlineSize as %d", inline_size); - } - ArrayOperationPartialInlineSize = inline_size; - } - - if (ArrayOperationPartialInlineSize > MaxVectorSize) { - ArrayOperationPartialInlineSize = MaxVectorSize >= 16 ? MaxVectorSize : 0; - if (ArrayOperationPartialInlineSize) { - warning("Setting ArrayOperationPartialInlineSize as MaxVectorSize=%zd", MaxVectorSize); - } else { - warning("Setting ArrayOperationPartialInlineSize as %zd", ArrayOperationPartialInlineSize); - } - } - } -#endif } #ifdef COMPILER2 + if (UseAVX > 2) { + if (FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize) || + (!FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize) && + ArrayOperationPartialInlineSize != 0 && + ArrayOperationPartialInlineSize != 16 && + ArrayOperationPartialInlineSize != 32 && + ArrayOperationPartialInlineSize != 64)) { + int inline_size = 0; + if (MaxVectorSize >= 64 && AVX3Threshold == 0) { + inline_size = 64; + } else if (MaxVectorSize >= 32) { + inline_size = 32; + } else if (MaxVectorSize >= 16) { + inline_size = 16; + } + if(!FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize)) { + warning("Setting ArrayOperationPartialInlineSize as %d", inline_size); + } + ArrayOperationPartialInlineSize = inline_size; + } + + if (ArrayOperationPartialInlineSize > MaxVectorSize) { + ArrayOperationPartialInlineSize = MaxVectorSize >= 16 ? MaxVectorSize : 0; + if (ArrayOperationPartialInlineSize) { + warning("Setting ArrayOperationPartialInlineSize as MaxVectorSize=%zd", MaxVectorSize); + } else { + warning("Setting ArrayOperationPartialInlineSize as %zd", ArrayOperationPartialInlineSize); + } + } + } + if (FLAG_IS_DEFAULT(OptimizeFill)) { if (MaxVectorSize < 32 || (!EnableX86ECoreOpts && !VM_Version::supports_avx512vlbw())) { OptimizeFill = false; @@ -3298,12 +3297,50 @@ bool VM_Version::is_intrinsic_supported(vmIntrinsicID id) { void VM_Version::insert_features_names(VM_Version::VM_Features features, stringStream& ss) { int i = 0; ss.join([&]() { - while (i < MAX_CPU_FEATURES) { - if (_features.supports_feature((VM_Version::Feature_Flag)i)) { - return _features_names[i++]; + const char* str = nullptr; + while ((i < MAX_CPU_FEATURES) && (str == nullptr)) { + if (features.supports_feature((VM_Version::Feature_Flag)i)) { + str = _features_names[i]; } i += 1; } - return (const char*)nullptr; + return str; }, ", "); } + +void VM_Version::get_cpu_features_name(void* features_buffer, stringStream& ss) { + VM_Features* features = (VM_Features*)features_buffer; + insert_features_names(*features, ss); +} + +void VM_Version::get_missing_features_name(void* features_set1, void* features_set2, stringStream& ss) { + VM_Features* vm_features_set1 = (VM_Features*)features_set1; + VM_Features* vm_features_set2 = (VM_Features*)features_set2; + int i = 0; + ss.join([&]() { + const char* str = nullptr; + while ((i < MAX_CPU_FEATURES) && (str == nullptr)) { + Feature_Flag flag = (Feature_Flag)i; + if (vm_features_set1->supports_feature(flag) && !vm_features_set2->supports_feature(flag)) { + str = _features_names[i]; + } + i += 1; + } + return str; + }, ", "); +} + +int VM_Version::cpu_features_size() { + return sizeof(VM_Features); +} + +void VM_Version::store_cpu_features(void* buf) { + VM_Features copy = _features; + copy.clear_feature(CPU_HT); // HT does not result in incompatibility of aot code cache + memcpy(buf, ©, sizeof(VM_Features)); +} + +bool VM_Version::supports_features(void* features_buffer) { + VM_Features* features_to_test = (VM_Features*)features_buffer; + return _features.supports_features(features_to_test); +} diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index a3f2a801198..e0a895737b7 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -377,84 +377,84 @@ protected: */ enum Feature_Flag { #define CPU_FEATURE_FLAGS(decl) \ - decl(CX8, "cx8", 0) /* next bits are from cpuid 1 (EDX) */ \ - decl(CMOV, "cmov", 1) \ - decl(FXSR, "fxsr", 2) \ - decl(HT, "ht", 3) \ + decl(CX8, cx8, 0) /* next bits are from cpuid 1 (EDX) */ \ + decl(CMOV, cmov, 1) \ + decl(FXSR, fxsr, 2) \ + decl(HT, ht, 3) \ \ - decl(MMX, "mmx", 4) \ - decl(3DNOW_PREFETCH, "3dnowpref", 5) /* Processor supports 3dnow prefetch and prefetchw instructions */ \ + decl(MMX, mmx, 4) \ + decl(3DNOW_PREFETCH, 3dnowpref, 5) /* Processor supports 3dnow prefetch and prefetchw instructions */ \ /* may not necessarily support other 3dnow instructions */ \ - decl(SSE, "sse", 6) \ - decl(SSE2, "sse2", 7) \ + decl(SSE, sse, 6) \ + decl(SSE2, sse2, 7) \ \ - decl(SSE3, "sse3", 8 ) /* SSE3 comes from cpuid 1 (ECX) */ \ - decl(SSSE3, "ssse3", 9 ) \ - decl(SSE4A, "sse4a", 10) \ - decl(SSE4_1, "sse4.1", 11) \ + decl(SSE3, sse3, 8 ) /* SSE3 comes from cpuid 1 (ECX) */ \ + decl(SSSE3, ssse3, 9 ) \ + decl(SSE4A, sse4a, 10) \ + decl(SSE4_1, sse4.1, 11) \ \ - decl(SSE4_2, "sse4.2", 12) \ - decl(POPCNT, "popcnt", 13) \ - decl(LZCNT, "lzcnt", 14) \ - decl(TSC, "tsc", 15) \ + decl(SSE4_2, sse4.2, 12) \ + decl(POPCNT, popcnt, 13) \ + decl(LZCNT, lzcnt, 14) \ + decl(TSC, tsc, 15) \ \ - decl(TSCINV_BIT, "tscinvbit", 16) \ - decl(TSCINV, "tscinv", 17) \ - decl(AVX, "avx", 18) \ - decl(AVX2, "avx2", 19) \ + decl(TSCINV_BIT, tscinvbit, 16) \ + decl(TSCINV, tscinv, 17) \ + decl(AVX, avx, 18) \ + decl(AVX2, avx2, 19) \ \ - decl(AES, "aes", 20) \ - decl(ERMS, "erms", 21) /* enhanced 'rep movsb/stosb' instructions */ \ - decl(CLMUL, "clmul", 22) /* carryless multiply for CRC */ \ - decl(BMI1, "bmi1", 23) \ + decl(AES, aes, 20) \ + decl(ERMS, erms, 21) /* enhanced 'rep movsb/stosb' instructions */ \ + decl(CLMUL, clmul, 22) /* carryless multiply for CRC */ \ + decl(BMI1, bmi1, 23) \ \ - decl(BMI2, "bmi2", 24) \ - decl(RTM, "rtm", 25) /* Restricted Transactional Memory instructions */ \ - decl(ADX, "adx", 26) \ - decl(AVX512F, "avx512f", 27) /* AVX 512bit foundation instructions */ \ + decl(BMI2, bmi2, 24) \ + decl(RTM, rtm, 25) /* Restricted Transactional Memory instructions */ \ + decl(ADX, adx, 26) \ + decl(AVX512F, avx512f, 27) /* AVX 512bit foundation instructions */ \ \ - decl(AVX512DQ, "avx512dq", 28) \ - decl(AVX512PF, "avx512pf", 29) \ - decl(AVX512ER, "avx512er", 30) \ - decl(AVX512CD, "avx512cd", 31) \ + decl(AVX512DQ, avx512dq, 28) \ + decl(AVX512PF, avx512pf, 29) \ + decl(AVX512ER, avx512er, 30) \ + decl(AVX512CD, avx512cd, 31) \ \ - decl(AVX512BW, "avx512bw", 32) /* Byte and word vector instructions */ \ - decl(AVX512VL, "avx512vl", 33) /* EVEX instructions with smaller vector length */ \ - decl(SHA, "sha", 34) /* SHA instructions */ \ - decl(FMA, "fma", 35) /* FMA instructions */ \ + decl(AVX512BW, avx512bw, 32) /* Byte and word vector instructions */ \ + decl(AVX512VL, avx512vl, 33) /* EVEX instructions with smaller vector length */ \ + decl(SHA, sha, 34) /* SHA instructions */ \ + decl(FMA, fma, 35) /* FMA instructions */ \ \ - decl(VZEROUPPER, "vzeroupper", 36) /* Vzeroupper instruction */ \ - decl(AVX512_VPOPCNTDQ, "avx512_vpopcntdq", 37) /* Vector popcount */ \ - decl(AVX512_VPCLMULQDQ, "avx512_vpclmulqdq", 38) /* Vector carryless multiplication */ \ - decl(AVX512_VAES, "avx512_vaes", 39) /* Vector AES instruction */ \ + decl(VZEROUPPER, vzeroupper, 36) /* Vzeroupper instruction */ \ + decl(AVX512_VPOPCNTDQ, avx512_vpopcntdq, 37) /* Vector popcount */ \ + decl(AVX512_VPCLMULQDQ, avx512_vpclmulqdq, 38) /* Vector carryless multiplication */ \ + decl(AVX512_VAES, avx512_vaes, 39) /* Vector AES instruction */ \ \ - decl(AVX512_VNNI, "avx512_vnni", 40) /* Vector Neural Network Instructions */ \ - decl(FLUSH, "clflush", 41) /* flush instruction */ \ - decl(FLUSHOPT, "clflushopt", 42) /* flusopth instruction */ \ - decl(CLWB, "clwb", 43) /* clwb instruction */ \ + decl(AVX512_VNNI, avx512_vnni, 40) /* Vector Neural Network Instructions */ \ + decl(FLUSH, clflush, 41) /* flush instruction */ \ + decl(FLUSHOPT, clflushopt, 42) /* flusopth instruction */ \ + decl(CLWB, clwb, 43) /* clwb instruction */ \ \ - decl(AVX512_VBMI2, "avx512_vbmi2", 44) /* VBMI2 shift left double instructions */ \ - decl(AVX512_VBMI, "avx512_vbmi", 45) /* Vector BMI instructions */ \ - decl(HV, "hv", 46) /* Hypervisor instructions */ \ - decl(SERIALIZE, "serialize", 47) /* CPU SERIALIZE */ \ - decl(RDTSCP, "rdtscp", 48) /* RDTSCP instruction */ \ - decl(RDPID, "rdpid", 49) /* RDPID instruction */ \ - decl(FSRM, "fsrm", 50) /* Fast Short REP MOV */ \ - decl(GFNI, "gfni", 51) /* Vector GFNI instructions */ \ - decl(AVX512_BITALG, "avx512_bitalg", 52) /* Vector sub-word popcount and bit gather instructions */\ - decl(F16C, "f16c", 53) /* Half-precision and single precision FP conversion instructions*/ \ - decl(PKU, "pku", 54) /* Protection keys for user-mode pages */ \ - decl(OSPKE, "ospke", 55) /* OS enables protection keys */ \ - decl(CET_IBT, "cet_ibt", 56) /* Control Flow Enforcement - Indirect Branch Tracking */ \ - decl(CET_SS, "cet_ss", 57) /* Control Flow Enforcement - Shadow Stack */ \ - decl(AVX512_IFMA, "avx512_ifma", 58) /* Integer Vector FMA instructions*/ \ - decl(AVX_IFMA, "avx_ifma", 59) /* 256-bit VEX-coded variant of AVX512-IFMA*/ \ - decl(APX_F, "apx_f", 60) /* Intel Advanced Performance Extensions*/ \ - decl(SHA512, "sha512", 61) /* SHA512 instructions*/ \ - decl(AVX512_FP16, "avx512_fp16", 62) /* AVX512 FP16 ISA support*/ \ - decl(AVX10_1, "avx10_1", 63) /* AVX10 512 bit vector ISA Version 1 support*/ \ - decl(AVX10_2, "avx10_2", 64) /* AVX10 512 bit vector ISA Version 2 support*/ \ - decl(HYBRID, "hybrid", 65) /* Hybrid architecture */ + decl(AVX512_VBMI2, avx512_vbmi2, 44) /* VBMI2 shift left double instructions */ \ + decl(AVX512_VBMI, avx512_vbmi, 45) /* Vector BMI instructions */ \ + decl(HV, hv, 46) /* Hypervisor instructions */ \ + decl(SERIALIZE, serialize, 47) /* CPU SERIALIZE */ \ + decl(RDTSCP, rdtscp, 48) /* RDTSCP instruction */ \ + decl(RDPID, rdpid, 49) /* RDPID instruction */ \ + decl(FSRM, fsrm, 50) /* Fast Short REP MOV */ \ + decl(GFNI, gfni, 51) /* Vector GFNI instructions */ \ + decl(AVX512_BITALG, avx512_bitalg, 52) /* Vector sub-word popcount and bit gather instructions */\ + decl(F16C, f16c, 53) /* Half-precision and single precision FP conversion instructions*/ \ + decl(PKU, pku, 54) /* Protection keys for user-mode pages */ \ + decl(OSPKE, ospke, 55) /* OS enables protection keys */ \ + decl(CET_IBT, cet_ibt, 56) /* Control Flow Enforcement - Indirect Branch Tracking */ \ + decl(CET_SS, cet_ss, 57) /* Control Flow Enforcement - Shadow Stack */ \ + decl(AVX512_IFMA, avx512_ifma, 58) /* Integer Vector FMA instructions*/ \ + decl(AVX_IFMA, avx_ifma, 59) /* 256-bit VEX-coded variant of AVX512-IFMA*/ \ + decl(APX_F, apx_f, 60) /* Intel Advanced Performance Extensions*/ \ + decl(SHA512, sha512, 61) /* SHA512 instructions*/ \ + decl(AVX512_FP16, avx512_fp16, 62) /* AVX512 FP16 ISA support*/ \ + decl(AVX10_1, avx10_1, 63) /* AVX10 512 bit vector ISA Version 1 support*/ \ + decl(AVX10_2, avx10_2, 64) /* AVX10 512 bit vector ISA Version 2 support*/ \ + decl(HYBRID, hybrid, 65) /* Hybrid architecture */ #define DECLARE_CPU_FEATURE_FLAG(id, name, bit) CPU_##id = (bit), CPU_FEATURE_FLAGS(DECLARE_CPU_FEATURE_FLAG) @@ -516,6 +516,15 @@ protected: int idx = index(feature); return (_features_bitmap[idx] & bit_mask(feature)) != 0; } + + bool supports_features(VM_Features* features_to_test) { + for (int i = 0; i < features_bitmap_element_count(); i++) { + if ((_features_bitmap[i] & features_to_test->_features_bitmap[i]) != features_to_test->_features_bitmap[i]) { + return false; + } + } + return true; + } }; // CPU feature flags vector, can be affected by VM settings. @@ -1103,6 +1112,20 @@ public: static bool supports_tscinv_ext(void); static void initialize_cpu_information(void); + + static void get_cpu_features_name(void* features_buffer, stringStream& ss); + + // Returns names of features present in features_set1 but not in features_set2 + static void get_missing_features_name(void* features_set1, void* features_set2, stringStream& ss); + + // Returns number of bytes required to store cpu features representation + static int cpu_features_size(); + + // Stores cpu features representation in the provided buffer. This representation is arch dependent. + // Size of the buffer must be same as returned by cpu_features_size() + static void store_cpu_features(void* buf); + + static bool supports_features(void* features_to_test); }; #endif // CPU_X86_VM_VERSION_X86_HPP diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 93b306c37d6..0ffa4c2031c 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -1699,9 +1699,10 @@ static void emit_cmpfp_fixup(MacroAssembler* masm) { } static void emit_cmpfp3(MacroAssembler* masm, Register dst) { + // If any floating point comparison instruction is used, unordered case always triggers jump + // for below condition, CF=1 is true when at least one input is NaN Label done; __ movl(dst, -1); - __ jcc(Assembler::parity, done); __ jcc(Assembler::below, done); __ setcc(Assembler::notEqual, dst); __ bind(done); @@ -5186,6 +5187,18 @@ operand immL_65535() interface(CONST_INTER); %} +// AOT Runtime Constants Address +operand immAOTRuntimeConstantsAddress() +%{ + // Check if the address is in the range of AOT Runtime Constants + predicate(AOTRuntimeConstants::contains((address)(n->get_ptr()))); + match(ConP); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + operand kReg() %{ constraint(ALLOC_IN_RC(vectmask_reg)); @@ -5529,12 +5542,21 @@ operand rFlagsRegU() operand rFlagsRegUCF() %{ constraint(ALLOC_IN_RC(int_flags)); match(RegFlags); - predicate(false); + predicate(!UseAPX || !VM_Version::supports_avx10_2()); format %{ "RFLAGS_U_CF" %} interface(REG_INTER); %} +operand rFlagsRegUCFE() %{ + constraint(ALLOC_IN_RC(int_flags)); + match(RegFlags); + predicate(UseAPX && VM_Version::supports_avx10_2()); + + format %{ "RFLAGS_U_CFE" %} + interface(REG_INTER); +%} + // Float register operands operand regF() %{ constraint(ALLOC_IN_RC(float_reg)); @@ -6027,10 +6049,10 @@ operand cmpOp() interface(COND_INTER) %{ equal(0x4, "e"); not_equal(0x5, "ne"); - less(0xC, "l"); - greater_equal(0xD, "ge"); - less_equal(0xE, "le"); - greater(0xF, "g"); + less(0xc, "l"); + greater_equal(0xd, "ge"); + less_equal(0xe, "le"); + greater(0xf, "g"); overflow(0x0, "o"); no_overflow(0x1, "no"); %} @@ -6062,11 +6084,12 @@ operand cmpOpU() // don't need to use cmpOpUCF2 for eq/ne operand cmpOpUCF() %{ match(Bool); - predicate(n->as_Bool()->_test._test == BoolTest::lt || - n->as_Bool()->_test._test == BoolTest::ge || - n->as_Bool()->_test._test == BoolTest::le || - n->as_Bool()->_test._test == BoolTest::gt || - n->in(1)->in(1) == n->in(1)->in(2)); + predicate((!UseAPX || !VM_Version::supports_avx10_2()) && + (n->as_Bool()->_test._test == BoolTest::lt || + n->as_Bool()->_test._test == BoolTest::ge || + n->as_Bool()->_test._test == BoolTest::le || + n->as_Bool()->_test._test == BoolTest::gt || + n->in(1)->in(1) == n->in(1)->in(2))); format %{ "" %} interface(COND_INTER) %{ equal(0xb, "np"); @@ -6084,7 +6107,8 @@ operand cmpOpUCF() %{ // Floating comparisons that can be fixed up with extra conditional jumps operand cmpOpUCF2() %{ match(Bool); - predicate((n->as_Bool()->_test._test == BoolTest::ne || + predicate((!UseAPX || !VM_Version::supports_avx10_2()) && + (n->as_Bool()->_test._test == BoolTest::ne || n->as_Bool()->_test._test == BoolTest::eq) && n->in(1)->in(1) != n->in(1)->in(2)); format %{ "" %} @@ -6100,6 +6124,37 @@ operand cmpOpUCF2() %{ %} %} + +// Floating point comparisons that set condition flags to test more directly, +// Unsigned tests are used for G (>) and GE (>=) conditions while signed tests +// are used for L (<) and LE (<=) conditions. It's important to convert these +// latter conditions to ones that use unsigned tests before passing into an +// instruction because the preceding comparison might be based on a three way +// comparison (CmpF3 or CmpD3) that also assigns unordered outcomes to -1. +operand cmpOpUCFE() +%{ + match(Bool); + predicate((UseAPX && VM_Version::supports_avx10_2()) && + (n->as_Bool()->_test._test == BoolTest::ne || + n->as_Bool()->_test._test == BoolTest::eq || + n->as_Bool()->_test._test == BoolTest::lt || + n->as_Bool()->_test._test == BoolTest::ge || + n->as_Bool()->_test._test == BoolTest::le || + n->as_Bool()->_test._test == BoolTest::gt)); + + format %{ "" %} + interface(COND_INTER) %{ + equal(0x4, "e"); + not_equal(0x5, "ne"); + less(0x2, "b"); + greater_equal(0x3, "ae"); + less_equal(0x6, "be"); + greater(0x7, "a"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); + %} +%} + // Operands for bound floating pointer register arguments operand rxmm0() %{ constraint(ALLOC_IN_RC(xmm0_reg)); @@ -7289,6 +7344,19 @@ instruct loadD(regD dst, memory mem) ins_pipe(pipe_slow); // XXX %} +instruct loadAOTRCAddress(rRegP dst, immAOTRuntimeConstantsAddress con) +%{ + match(Set dst con); + + format %{ "leaq $dst, $con\t# AOT Runtime Constants Address" %} + + ins_encode %{ + __ load_aotrc_address($dst$$Register, (address)$con$$constant); + %} + + ins_pipe(ialu_reg_fat); +%} + // max = java.lang.Math.max(float a, float b) instruct maxF_reg_avx10_2(regF dst, regF a, regF b) %{ predicate(VM_Version::supports_avx10_2()); @@ -9116,20 +9184,34 @@ instruct cmovI_imm_01UCF(rRegI dst, immI_1 src, rFlagsRegUCF cr, cmpOpUCF cop) ins_pipe(ialu_reg); %} +instruct cmovI_imm_01UCFE(rRegI dst, immI_1 src, rFlagsRegUCFE cr, cmpOpUCFE cop) +%{ + predicate(n->in(2)->in(2)->is_Con() && n->in(2)->in(2)->get_int() == 0); + match(Set dst (CMoveI (Binary cop cr) (Binary src dst))); + + ins_cost(100); // XXX + format %{ "setbn$cop $dst\t# signed, unsigned, int" %} + ins_encode %{ + Assembler::Condition cond = (Assembler::Condition)($cop$$cmpcode); + __ setb(MacroAssembler::negate_condition(cond), $dst$$Register); + %} + ins_pipe(ialu_reg); +%} + instruct cmovI_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, rRegI dst, rRegI src) %{ - predicate(!UseAPX); match(Set dst (CMoveI (Binary cop cr) (Binary dst src))); + ins_cost(200); expand %{ cmovI_regU(cop, cr, dst, src); %} %} -instruct cmovI_regUCF_ndd(rRegI dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegI src1, rRegI src2) %{ - predicate(UseAPX); +instruct cmovI_regUCFE_ndd(rRegI dst, cmpOpUCFE cop, rFlagsRegUCFE cr, rRegI src1, rRegI src2) %{ match(Set dst (CMoveI (Binary cop cr) (Binary src1 src2))); + ins_cost(200); - format %{ "ecmovl$cop $dst, $src1, $src2\t# unsigned, int ndd" %} + format %{ "ecmovl$cop $dst, $src1, $src2\t# signed, unsigned, int ndd" %} ins_encode %{ __ ecmovl((Assembler::Condition)($cop$$cmpcode), $dst$$Register, $src1$$Register, $src2$$Register); %} @@ -9137,7 +9219,7 @@ instruct cmovI_regUCF_ndd(rRegI dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegI src1, %} instruct cmovI_regUCF2_ne(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegI dst, rRegI src) %{ - predicate(!UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); + predicate(n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); match(Set dst (CMoveI (Binary cop cr) (Binary dst src))); ins_cost(200); // XXX @@ -9150,25 +9232,10 @@ instruct cmovI_regUCF2_ne(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegI dst, rRegI src) ins_pipe(pipe_cmov_reg); %} -instruct cmovI_regUCF2_ne_ndd(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegI dst, rRegI src1, rRegI src2) %{ - predicate(UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); - match(Set dst (CMoveI (Binary cop cr) (Binary src1 src2))); - effect(TEMP dst); - - ins_cost(200); - format %{ "ecmovpl $dst, $src1, $src2\n\t" - "cmovnel $dst, $src2" %} - ins_encode %{ - __ ecmovl(Assembler::parity, $dst$$Register, $src1$$Register, $src2$$Register); - __ cmovl(Assembler::notEqual, $dst$$Register, $src2$$Register); - %} - ins_pipe(pipe_cmov_reg); -%} - // Since (x == y) == !(x != y), we can flip the sense of the test by flipping the // inputs of the CMove instruct cmovI_regUCF2_eq(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegI dst, rRegI src) %{ - predicate(!UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); + predicate(n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); match(Set dst (CMoveI (Binary cop cr) (Binary src dst))); effect(TEMP dst); @@ -9182,23 +9249,6 @@ instruct cmovI_regUCF2_eq(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegI dst, rRegI src) ins_pipe(pipe_cmov_reg); %} -// We need this special handling for only eq / neq comparison since NaN == NaN is false, -// and parity flag bit is set if any of the operand is a NaN. -instruct cmovI_regUCF2_eq_ndd(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegI dst, rRegI src1, rRegI src2) %{ - predicate(UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); - match(Set dst (CMoveI (Binary cop cr) (Binary src2 src1))); - effect(TEMP dst); - - ins_cost(200); - format %{ "ecmovpl $dst, $src1, $src2\n\t" - "cmovnel $dst, $src2" %} - ins_encode %{ - __ ecmovl(Assembler::parity, $dst$$Register, $src1$$Register, $src2$$Register); - __ cmovl(Assembler::notEqual, $dst$$Register, $src2$$Register); - %} - ins_pipe(pipe_cmov_reg); -%} - // Conditional move instruct cmovI_mem(cmpOp cop, rFlagsReg cr, rRegI dst, memory src) %{ predicate(!UseAPX); @@ -9241,8 +9291,8 @@ instruct cmovI_memU(cmpOpU cop, rFlagsRegU cr, rRegI dst, memory src) %} instruct cmovI_memUCF(cmpOpUCF cop, rFlagsRegUCF cr, rRegI dst, memory src) %{ - predicate(!UseAPX); match(Set dst (CMoveI (Binary cop cr) (Binary dst (LoadI src)))); + ins_cost(250); expand %{ cmovI_memU(cop, cr, dst, src); @@ -9262,12 +9312,12 @@ instruct cmovI_rReg_rReg_memU_ndd(rRegI dst, cmpOpU cop, rFlagsRegU cr, rRegI sr ins_pipe(pipe_cmov_mem); %} -instruct cmovI_rReg_rReg_memUCF_ndd(rRegI dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegI src1, memory src2) +instruct cmovI_rReg_rReg_memUCFE_ndd(rRegI dst, cmpOpUCFE cop, rFlagsRegUCFE cr, rRegI src1, memory src2) %{ - predicate(UseAPX); match(Set dst (CMoveI (Binary cop cr) (Binary src1 (LoadI src2)))); + ins_cost(250); - format %{ "ecmovl$cop $dst, $src1, $src2\t# unsigned, int ndd" %} + format %{ "ecmovl$cop $dst, $src1, $src2\t# signed, unsigned, int ndd" %} ins_encode %{ __ ecmovl((Assembler::Condition)($cop$$cmpcode), $dst$$Register, $src1$$Register, $src2$$Address); %} @@ -9317,8 +9367,8 @@ instruct cmovN_regU(cmpOpU cop, rFlagsRegU cr, rRegN dst, rRegN src) %} instruct cmovN_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, rRegN dst, rRegN src) %{ - predicate(!UseAPX); match(Set dst (CMoveN (Binary cop cr) (Binary dst src))); + ins_cost(200); expand %{ cmovN_regU(cop, cr, dst, src); @@ -9339,11 +9389,11 @@ instruct cmovN_regU_ndd(rRegN dst, cmpOpU cop, rFlagsRegU cr, rRegN src1, rRegN ins_pipe(pipe_cmov_reg); %} -instruct cmovN_regUCF_ndd(rRegN dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegN src1, rRegN src2) %{ - predicate(UseAPX); +instruct cmovN_regUCFE_ndd(rRegN dst, cmpOpUCFE cop, rFlagsRegUCFE cr, rRegN src1, rRegN src2) %{ match(Set dst (CMoveN (Binary cop cr) (Binary src1 src2))); + ins_cost(200); - format %{ "ecmovl$cop $dst, $src1, $src2\t# unsigned, compressed ptr ndd" %} + format %{ "ecmovl$cop $dst, $src1, $src2\t# signed, unsigned, compressed ptr ndd" %} ins_encode %{ __ ecmovl((Assembler::Condition)($cop$$cmpcode), $dst$$Register, $src1$$Register, $src2$$Register); %} @@ -9437,19 +9487,19 @@ instruct cmovP_regU_ndd(rRegP dst, cmpOpU cop, rFlagsRegU cr, rRegP src1, rRegP %} instruct cmovP_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, rRegP dst, rRegP src) %{ - predicate(!UseAPX); match(Set dst (CMoveP (Binary cop cr) (Binary dst src))); + ins_cost(200); expand %{ cmovP_regU(cop, cr, dst, src); %} %} -instruct cmovP_regUCF_ndd(rRegP dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegP src1, rRegP src2) %{ - predicate(UseAPX); +instruct cmovP_regUCFE_ndd(rRegP dst, cmpOpUCFE cop, rFlagsRegUCFE cr, rRegP src1, rRegP src2) %{ match(Set dst (CMoveP (Binary cop cr) (Binary src1 src2))); + ins_cost(200); - format %{ "ecmovq$cop $dst, $src1, $src2\t# unsigned, ptr ndd" %} + format %{ "ecmovq$cop $dst, $src1, $src2\t# signed, unsigned, ptr ndd" %} ins_encode %{ __ ecmovq((Assembler::Condition)($cop$$cmpcode), $dst$$Register, $src1$$Register, $src2$$Register); %} @@ -9457,7 +9507,7 @@ instruct cmovP_regUCF_ndd(rRegP dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegP src1, %} instruct cmovP_regUCF2_ne(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegP dst, rRegP src) %{ - predicate(!UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); + predicate(n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); match(Set dst (CMoveP (Binary cop cr) (Binary dst src))); ins_cost(200); // XXX @@ -9470,25 +9520,10 @@ instruct cmovP_regUCF2_ne(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegP dst, rRegP src) ins_pipe(pipe_cmov_reg); %} -instruct cmovP_regUCF2_ne_ndd(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegP dst, rRegP src1, rRegP src2) %{ - predicate(UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); - match(Set dst (CMoveP (Binary cop cr) (Binary src1 src2))); - effect(TEMP dst); - - ins_cost(200); - format %{ "ecmovpq $dst, $src1, $src2\n\t" - "cmovneq $dst, $src2" %} - ins_encode %{ - __ ecmovq(Assembler::parity, $dst$$Register, $src1$$Register, $src2$$Register); - __ cmovq(Assembler::notEqual, $dst$$Register, $src2$$Register); - %} - ins_pipe(pipe_cmov_reg); -%} - // Since (x == y) == !(x != y), we can flip the sense of the test by flipping the // inputs of the CMove instruct cmovP_regUCF2_eq(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegP dst, rRegP src) %{ - predicate(!UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); + predicate(n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); match(Set dst (CMoveP (Binary cop cr) (Binary src dst))); ins_cost(200); // XXX @@ -9501,21 +9536,6 @@ instruct cmovP_regUCF2_eq(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegP dst, rRegP src) ins_pipe(pipe_cmov_reg); %} -instruct cmovP_regUCF2_eq_ndd(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegP dst, rRegP src1, rRegP src2) %{ - predicate(UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); - match(Set dst (CMoveP (Binary cop cr) (Binary src2 src1))); - effect(TEMP dst); - - ins_cost(200); - format %{ "ecmovpq $dst, $src1, $src2\n\t" - "cmovneq $dst, $src2" %} - ins_encode %{ - __ ecmovq(Assembler::parity, $dst$$Register, $src1$$Register, $src2$$Register); - __ cmovq(Assembler::notEqual, $dst$$Register, $src2$$Register); - %} - ins_pipe(pipe_cmov_reg); -%} - instruct cmovL_imm_01(rRegL dst, immL1 src, rFlagsReg cr, cmpOp cop) %{ predicate(n->in(2)->in(2)->is_Con() && n->in(2)->in(2)->get_long() == 0); @@ -9636,21 +9656,35 @@ instruct cmovL_imm_01UCF(rRegL dst, immL1 src, rFlagsRegUCF cr, cmpOpUCF cop) ins_pipe(ialu_reg); %} +instruct cmovL_imm_01UCFE(rRegL dst, immL1 src, rFlagsRegUCFE cr, cmpOpUCFE cop) +%{ + predicate(n->in(2)->in(2)->is_Con() && n->in(2)->in(2)->get_long() == 0); + match(Set dst (CMoveL (Binary cop cr) (Binary src dst))); + + ins_cost(100); // XXX + format %{ "setbn$cop $dst\t# signed, unsigned, long" %} + ins_encode %{ + Assembler::Condition cond = (Assembler::Condition)($cop$$cmpcode); + __ setb(MacroAssembler::negate_condition(cond), $dst$$Register); + %} + ins_pipe(ialu_reg); +%} + instruct cmovL_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, rRegL dst, rRegL src) %{ - predicate(!UseAPX); match(Set dst (CMoveL (Binary cop cr) (Binary dst src))); + ins_cost(200); expand %{ cmovL_regU(cop, cr, dst, src); %} %} -instruct cmovL_regUCF_ndd(rRegL dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegL src1, rRegL src2) +instruct cmovL_regUCFE_ndd(rRegL dst, cmpOpUCFE cop, rFlagsRegUCFE cr, rRegL src1, rRegL src2) %{ - predicate(UseAPX); match(Set dst (CMoveL (Binary cop cr) (Binary src1 src2))); + ins_cost(200); - format %{ "ecmovq$cop $dst, $src1, $src2\t# unsigned, long ndd" %} + format %{ "ecmovq$cop $dst, $src1, $src2\t# signed, unsigned, long ndd" %} ins_encode %{ __ ecmovq((Assembler::Condition)($cop$$cmpcode), $dst$$Register, $src1$$Register, $src2$$Register); %} @@ -9658,7 +9692,7 @@ instruct cmovL_regUCF_ndd(rRegL dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegL src1, %} instruct cmovL_regUCF2_ne(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegL dst, rRegL src) %{ - predicate(!UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); + predicate(n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); match(Set dst (CMoveL (Binary cop cr) (Binary dst src))); ins_cost(200); // XXX @@ -9671,25 +9705,10 @@ instruct cmovL_regUCF2_ne(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegL dst, rRegL src) ins_pipe(pipe_cmov_reg); %} -instruct cmovL_regUCF2_ne_ndd(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegL dst, rRegL src1, rRegL src2) %{ - predicate(UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::ne); - match(Set dst (CMoveL (Binary cop cr) (Binary src1 src2))); - effect(TEMP dst); - - ins_cost(200); - format %{ "ecmovpq $dst, $src1, $src2\n\t" - "cmovneq $dst, $src2" %} - ins_encode %{ - __ ecmovq(Assembler::parity, $dst$$Register, $src1$$Register, $src2$$Register); - __ cmovq(Assembler::notEqual, $dst$$Register, $src2$$Register); - %} - ins_pipe(pipe_cmov_reg); -%} - // Since (x == y) == !(x != y), we can flip the sense of the test by flipping the // inputs of the CMove instruct cmovL_regUCF2_eq(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegL dst, rRegL src) %{ - predicate(!UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); + predicate(n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); match(Set dst (CMoveL (Binary cop cr) (Binary src dst))); ins_cost(200); // XXX @@ -9702,21 +9721,6 @@ instruct cmovL_regUCF2_eq(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegL dst, rRegL src) ins_pipe(pipe_cmov_reg); %} -instruct cmovL_regUCF2_eq_ndd(cmpOpUCF2 cop, rFlagsRegUCF cr, rRegL dst, rRegL src1, rRegL src2) %{ - predicate(UseAPX && n->in(1)->in(1)->as_Bool()->_test._test == BoolTest::eq); - match(Set dst (CMoveL (Binary cop cr) (Binary src2 src1))); - effect(TEMP dst); - - ins_cost(200); - format %{ "ecmovpq $dst, $src1, $src2\n\t" - "cmovneq $dst, $src2" %} - ins_encode %{ - __ ecmovq(Assembler::parity, $dst$$Register, $src1$$Register, $src2$$Register); - __ cmovq(Assembler::notEqual, $dst$$Register, $src2$$Register); - %} - ins_pipe(pipe_cmov_reg); -%} - instruct cmovL_memU(cmpOpU cop, rFlagsRegU cr, rRegL dst, memory src) %{ predicate(!UseAPX); @@ -9731,8 +9735,8 @@ instruct cmovL_memU(cmpOpU cop, rFlagsRegU cr, rRegL dst, memory src) %} instruct cmovL_memUCF(cmpOpUCF cop, rFlagsRegUCF cr, rRegL dst, memory src) %{ - predicate(!UseAPX); match(Set dst (CMoveL (Binary cop cr) (Binary dst (LoadL src)))); + ins_cost(200); expand %{ cmovL_memU(cop, cr, dst, src); @@ -9752,12 +9756,12 @@ instruct cmovL_rReg_rReg_memU_ndd(rRegL dst, cmpOpU cop, rFlagsRegU cr, rRegL sr ins_pipe(pipe_cmov_mem); %} -instruct cmovL_rReg_rReg_memUCF_ndd(rRegL dst, cmpOpUCF cop, rFlagsRegUCF cr, rRegL src1, memory src2) +instruct cmovL_rReg_rReg_memUCFE_ndd(rRegL dst, cmpOpUCFE cop, rFlagsRegUCFE cr, rRegL src1, memory src2) %{ - predicate(UseAPX); match(Set dst (CMoveL (Binary cop cr) (Binary src1 (LoadL src2)))); + ins_cost(200); - format %{ "ecmovq$cop $dst, $src1, $src2\t# unsigned, long ndd" %} + format %{ "ecmovq$cop $dst, $src1, $src2\t# signed, unsigned, long ndd" %} ins_encode %{ __ ecmovq((Assembler::Condition)($cop$$cmpcode), $dst$$Register, $src1$$Register, $src2$$Address); %} @@ -9802,12 +9806,31 @@ instruct cmovF_regU(cmpOpU cop, rFlagsRegU cr, regF dst, regF src) instruct cmovF_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, regF dst, regF src) %{ match(Set dst (CMoveF (Binary cop cr) (Binary dst src))); + ins_cost(200); expand %{ cmovF_regU(cop, cr, dst, src); %} %} +instruct cmovF_regUCFE(cmpOpUCFE cop, rFlagsRegUCFE cr, regF dst, regF src) +%{ + match(Set dst (CMoveF (Binary cop cr) (Binary dst src))); + + ins_cost(200); // XXX + format %{ "jn$cop skip\t# signed, unsigned cmove float\n\t" + "movss $dst, $src\n" + "skip:" %} + ins_encode %{ + Label Lskip; + // Invert sense of branch from sense of CMOV + __ jccb((Assembler::Condition)($cop$$cmpcode^1), Lskip); + __ movflt($dst$$XMMRegister, $src$$XMMRegister); + __ bind(Lskip); + %} + ins_pipe(pipe_slow); +%} + instruct cmovD_reg(cmpOp cop, rFlagsReg cr, regD dst, regD src) %{ match(Set dst (CMoveD (Binary cop cr) (Binary dst src))); @@ -9846,12 +9869,31 @@ instruct cmovD_regU(cmpOpU cop, rFlagsRegU cr, regD dst, regD src) instruct cmovD_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, regD dst, regD src) %{ match(Set dst (CMoveD (Binary cop cr) (Binary dst src))); + ins_cost(200); expand %{ cmovD_regU(cop, cr, dst, src); %} %} +instruct cmovD_regUCFE(cmpOpUCFE cop, rFlagsRegUCFE cr, regD dst, regD src) +%{ + match(Set dst (CMoveD (Binary cop cr) (Binary dst src))); + + ins_cost(200); // XXX + format %{ "jn$cop skip\t# signed, unsigned cmove double\n\t" + "movsd $dst, $src\n" + "skip:" %} + ins_encode %{ + Label Lskip; + // Invert sense of branch from sense of CMOV + __ jccb((Assembler::Condition)($cop$$cmpcode^1), Lskip); + __ movdbl($dst$$XMMRegister, $src$$XMMRegister); + __ bind(Lskip); + %} + ins_pipe(pipe_slow); +%} + //----------Arithmetic Instructions-------------------------------------------- //----------Addition Instructions---------------------------------------------- @@ -14319,7 +14361,7 @@ instruct cmpF_cc_reg(rFlagsRegU cr, regF src1, regF src2) ins_pipe(pipe_slow); %} -instruct cmpF_cc_reg_CF(rFlagsRegUCF cr, regF src1, regF src2) %{ +instruct cmpF_cc_regCF(rFlagsRegUCF cr, regF src1, regF src2) %{ match(Set cr (CmpF src1 src2)); ins_cost(100); @@ -14330,6 +14372,17 @@ instruct cmpF_cc_reg_CF(rFlagsRegUCF cr, regF src1, regF src2) %{ ins_pipe(pipe_slow); %} +instruct cmpF_cc_regCFE(rFlagsRegUCFE cr, regF src1, regF src2) %{ + match(Set cr (CmpF src1 src2)); + + ins_cost(100); + format %{ "vucomxss $src1, $src2" %} + ins_encode %{ + __ vucomxss($src1$$XMMRegister, $src2$$XMMRegister); + %} + ins_pipe(pipe_slow); +%} + instruct cmpF_cc_memCF(rFlagsRegUCF cr, regF src1, memory src2) %{ match(Set cr (CmpF src1 (LoadF src2))); @@ -14341,8 +14394,20 @@ instruct cmpF_cc_memCF(rFlagsRegUCF cr, regF src1, memory src2) %{ ins_pipe(pipe_slow); %} +instruct cmpF_cc_memCFE(rFlagsRegUCFE cr, regF src1, memory src2) %{ + match(Set cr (CmpF src1 (LoadF src2))); + + ins_cost(100); + format %{ "vucomxss $src1, $src2" %} + ins_encode %{ + __ vucomxss($src1$$XMMRegister, $src2$$Address); + %} + ins_pipe(pipe_slow); +%} + instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src, immF con) %{ match(Set cr (CmpF src con)); + ins_cost(100); format %{ "ucomiss $src, [$constantaddress]\t# load from constant table: float=$con" %} ins_encode %{ @@ -14351,6 +14416,17 @@ instruct cmpF_cc_immCF(rFlagsRegUCF cr, regF src, immF con) %{ ins_pipe(pipe_slow); %} +instruct cmpF_cc_immCFE(rFlagsRegUCFE cr, regF src, immF con) %{ + match(Set cr (CmpF src con)); + + ins_cost(100); + format %{ "vucomxss $src, [$constantaddress]\t# load from constant table: float=$con" %} + ins_encode %{ + __ vucomxss($src$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); +%} + // Really expensive, avoid instruct cmpD_cc_reg(rFlagsRegU cr, regD src1, regD src2) %{ @@ -14370,7 +14446,7 @@ instruct cmpD_cc_reg(rFlagsRegU cr, regD src1, regD src2) ins_pipe(pipe_slow); %} -instruct cmpD_cc_reg_CF(rFlagsRegUCF cr, regD src1, regD src2) %{ +instruct cmpD_cc_regCF(rFlagsRegUCF cr, regD src1, regD src2) %{ match(Set cr (CmpD src1 src2)); ins_cost(100); @@ -14381,6 +14457,17 @@ instruct cmpD_cc_reg_CF(rFlagsRegUCF cr, regD src1, regD src2) %{ ins_pipe(pipe_slow); %} +instruct cmpD_cc_regCFE(rFlagsRegUCFE cr, regD src1, regD src2) %{ + match(Set cr (CmpD src1 src2)); + + ins_cost(100); + format %{ "vucomxsd $src1, $src2 test" %} + ins_encode %{ + __ vucomxsd($src1$$XMMRegister, $src2$$XMMRegister); + %} + ins_pipe(pipe_slow); +%} + instruct cmpD_cc_memCF(rFlagsRegUCF cr, regD src1, memory src2) %{ match(Set cr (CmpD src1 (LoadD src2))); @@ -14392,6 +14479,17 @@ instruct cmpD_cc_memCF(rFlagsRegUCF cr, regD src1, memory src2) %{ ins_pipe(pipe_slow); %} +instruct cmpD_cc_memCFE(rFlagsRegUCFE cr, regD src1, memory src2) %{ + match(Set cr (CmpD src1 (LoadD src2))); + + ins_cost(100); + format %{ "vucomxsd $src1, $src2" %} + ins_encode %{ + __ vucomxsd($src1$$XMMRegister, $src2$$Address); + %} + ins_pipe(pipe_slow); +%} + instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src, immD con) %{ match(Set cr (CmpD src con)); ins_cost(100); @@ -14402,6 +14500,17 @@ instruct cmpD_cc_immCF(rFlagsRegUCF cr, regD src, immD con) %{ ins_pipe(pipe_slow); %} +instruct cmpD_cc_immCFE(rFlagsRegUCFE cr, regD src, immD con) %{ + match(Set cr (CmpD src con)); + + ins_cost(100); + format %{ "vucomxsd $src, [$constantaddress]\t# load from constant table: double=$con" %} + ins_encode %{ + __ vucomxsd($src$$XMMRegister, $constantaddress($con)); + %} + ins_pipe(pipe_slow); +%} + // Compare into -1,0,1 instruct cmpF_reg(rRegI dst, regF src1, regF src2, rFlagsReg cr) %{ @@ -16808,6 +16917,21 @@ instruct jmpConUCF2(cmpOpUCF2 cop, rFlagsRegUCF cmp, label labl) %{ ins_pipe(pipe_jcc); %} +// Jump Direct Conditional - using signed and unsigned comparison +instruct jmpConUCFE(cmpOpUCFE cop, rFlagsRegUCFE cmp, label labl) %{ + match(If cop cmp); + effect(USE labl); + + ins_cost(200); + format %{ "j$cop,su $labl" %} + size(6); + ins_encode %{ + Label* L = $labl$$label; + __ jcc((Assembler::Condition)($cop$$cmpcode), *L, false); // Always long jump + %} + ins_pipe(pipe_jcc); +%} + // ============================================================================ // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary // superklass array for an instance of the superklass. Set a hidden @@ -17026,6 +17150,22 @@ instruct jmpConUCF2_short(cmpOpUCF2 cop, rFlagsRegUCF cmp, label labl) %{ ins_short_branch(1); %} +// Jump Direct Conditional - using signed and unsigned comparison +instruct jmpConUCFE_short(cmpOpUCFE cop, rFlagsRegUCFE cmp, label labl) %{ + match(If cop cmp); + effect(USE labl); + + ins_cost(300); + format %{ "j$cop,sus $labl" %} + size(2); + ins_encode %{ + Label* L = $labl$$label; + __ jccb((Assembler::Condition)($cop$$cmpcode), *L); + %} + ins_pipe(pipe_jcc); + ins_short_branch(1); +%} + // ============================================================================ // inlined locking and unlocking diff --git a/src/hotspot/cpu/zero/bytecodeInterpreter_zero.inline.hpp b/src/hotspot/cpu/zero/bytecodeInterpreter_zero.inline.hpp index 4d813cd53c6..4c73368b673 100644 --- a/src/hotspot/cpu/zero/bytecodeInterpreter_zero.inline.hpp +++ b/src/hotspot/cpu/zero/bytecodeInterpreter_zero.inline.hpp @@ -26,6 +26,8 @@ #ifndef CPU_ZERO_BYTECODEINTERPRETER_ZERO_INLINE_HPP #define CPU_ZERO_BYTECODEINTERPRETER_ZERO_INLINE_HPP +#include "sanitizers/ub.hpp" + // Inline interpreter functions for zero inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { @@ -40,6 +42,7 @@ inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } +ATTRIBUTE_NO_UBSAN // IEEE-754 division by zero is well-defined inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } @@ -68,7 +71,7 @@ inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], } inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; + return java_add(op1, op2); } inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { @@ -82,7 +85,7 @@ inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { } inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; + return java_multiply(op1, op2); } inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { @@ -90,7 +93,7 @@ inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { } inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; + return java_subtract(op1, op2); } inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { @@ -104,19 +107,19 @@ inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { } inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - return ((unsigned long long) op1) >> (op2 & 0x3F); + return java_shift_right_unsigned(op1, op2); } inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); + return java_shift_right(op1, op2); } inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); + return java_shift_left(op1, op2); } inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; + return java_negate(op); } inline jlong BytecodeInterpreter::VMlongNot(jlong op) { @@ -183,8 +186,8 @@ inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { return op1 + op2; } +ATTRIBUTE_NO_UBSAN // IEEE-754 division by zero is well-defined inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ return op1 / op2; } @@ -228,7 +231,7 @@ inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { // Integer Arithmetic inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; + return java_add(op1, op2); } inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { @@ -242,11 +245,11 @@ inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { } inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; + return java_multiply(op1, op2); } inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; + return java_negate(op); } inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { @@ -260,19 +263,19 @@ inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { } inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << (op2 & 0x1F); + return java_shift_left(op1, op2); } inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1F); + return java_shift_right(op1, op2); } inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; + return java_subtract(op1, op2); } inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1F); + return java_shift_right_unsigned(op1, op2); } inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { diff --git a/src/hotspot/cpu/zero/globals_zero.hpp b/src/hotspot/cpu/zero/globals_zero.hpp index 6b6c6ea983c..6dc7d81275c 100644 --- a/src/hotspot/cpu/zero/globals_zero.hpp +++ b/src/hotspot/cpu/zero/globals_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -39,7 +39,7 @@ define_pd_global(bool, UncommonNullCast, true); define_pd_global(bool, DelayCompilerStubsGeneration, false); // Don't have compiler's stubs define_pd_global(size_t, CodeCacheSegmentSize, 64 COMPILER1_AND_COMPILER2_PRESENT(+64)); // Tiered compilation has large code-entry alignment. -define_pd_global(intx, CodeEntryAlignment, 32); +define_pd_global(uint, CodeEntryAlignment, 32); define_pd_global(intx, OptoLoopAlignment, 16); define_pd_global(intx, InlineSmallCode, 1000); diff --git a/src/hotspot/cpu/zero/register_zero.hpp b/src/hotspot/cpu/zero/register_zero.hpp index fd30f206762..846b649eebd 100644 --- a/src/hotspot/cpu/zero/register_zero.hpp +++ b/src/hotspot/cpu/zero/register_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -48,7 +48,6 @@ class RegisterImpl : public AbstractRegisterImpl { }; // construction - inline friend Register as_Register(int encoding); VMReg as_VMReg(); // derived registers, offsets, and addresses @@ -113,7 +112,6 @@ class ConcreteRegisterImpl : public AbstractRegisterImpl { static const int max_fpr; }; -CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1)); -#define noreg ((Register)(noreg_RegisterEnumValue)) +const Register noreg = as_Register(-1); #endif // CPU_ZERO_REGISTER_ZERO_HPP diff --git a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp index 28c2364315e..1b20761f6e4 100644 --- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp @@ -368,12 +368,15 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) { goto unlock_unwind_and_return; void **arguments; - void *mirror; { + // These locals must remain on stack until call completes + void *mirror; + void *env; + { arguments = (void **) stack->alloc(handler->argument_count() * sizeof(void **)); void **dst = arguments; - void *env = thread->jni_environment(); + env = thread->jni_environment(); *(dst++) = &env; if (method->is_static()) { diff --git a/src/hotspot/os/aix/globals_aix.hpp b/src/hotspot/os/aix/globals_aix.hpp index 14b956235e8..473d7759063 100644 --- a/src/hotspot/os/aix/globals_aix.hpp +++ b/src/hotspot/os/aix/globals_aix.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2024 SAP SE. All rights reserved. + * Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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,10 +61,6 @@ product(bool, OptimizePollingPageLocation, true, DIAGNOSTIC, \ "Optimize the location of the polling page used for Safepoints") \ \ - /* Use 64K pages for virtual memory (shmat). */ \ - product(bool, Use64KPages, true, DIAGNOSTIC, \ - "Use 64K pages if available.") \ - \ /* Normally AIX commits memory on touch, but sometimes it is helpful to have */ \ /* explicit commit behaviour. This flag, if true, causes the VM to touch */ \ /* memory on os::commit_memory() (which normally is a noop). */ \ @@ -79,7 +75,6 @@ // // UseLargePages means nothing, for now, on AIX. -// Use Use64KPages or Use16MPages instead. define_pd_global(size_t, PreTouchParallelChunkSize, 1 * G); define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, false); diff --git a/src/hotspot/os/aix/libodm_aix.cpp b/src/hotspot/os/aix/libodm_aix.cpp index 38e8067181a..57eee47c098 100644 --- a/src/hotspot/os/aix/libodm_aix.cpp +++ b/src/hotspot/os/aix/libodm_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015, 2019 SAP SE. All rights reserved. + * Copyright (c) 2015, 2026 SAP SE. 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,13 +63,12 @@ dynamicOdm::~dynamicOdm() { void odmWrapper::clean_data() { if (_data) { permit_forbidden_function::free(_data); _data = nullptr; } } -int odmWrapper::class_offset(const char *field, bool is_aix_5) +int odmWrapper::class_offset(const char *field) { assert(has_class(), "initialization"); for (int i = 0; i < odm_class()->nelem; i++) { if (strcmp(odm_class()->elem[i].elemname, field) == 0) { int offset = odm_class()->elem[i].offset; - if (is_aix_5) { offset += LINK_VAL_OFFSET; } return offset; } } @@ -88,11 +87,10 @@ void odmWrapper::determine_os_kernel_version(uint32_t* p_ver) { return; } int voff, roff, moff, foff; - bool is_aix_5 = (major_aix_version == 5); - voff = odm.class_offset("ver", is_aix_5); - roff = odm.class_offset("rel", is_aix_5); - moff = odm.class_offset("mod", is_aix_5); - foff = odm.class_offset("fix", is_aix_5); + voff = odm.class_offset("ver"); + roff = odm.class_offset("rel"); + moff = odm.class_offset("mod"); + foff = odm.class_offset("fix"); if (voff == -1 || roff == -1 || moff == -1 || foff == -1) { trcVerbose("try_determine_os_kernel_version: could not get offsets"); return; diff --git a/src/hotspot/os/aix/libodm_aix.hpp b/src/hotspot/os/aix/libodm_aix.hpp index 924ccaf8c51..11e67a4f5ae 100644 --- a/src/hotspot/os/aix/libodm_aix.hpp +++ b/src/hotspot/os/aix/libodm_aix.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015, 2024 SAP SE. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026 SAP SE. 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 @@ -82,7 +82,7 @@ class odmWrapper : private dynamicOdm { CLASS_SYMBOL odm_class() { return _odm_class; } bool has_class() { return odm_class() != (CLASS_SYMBOL)-1; } - int class_offset(const char *field, bool is_aix_5); + int class_offset(const char *field); char* data() { return _data; } char* retrieve_obj(const char* name = nullptr) { diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 0a8efbece8d..af743dc7484 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2025 SAP SE. All rights reserved. + * Copyright (c) 2012, 2026 SAP SE. 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 @@ -122,12 +122,6 @@ extern "C" int mread_real_time(timebasestruct_t *t, size_t size_of_timebasestruct_t); -#if !defined(_AIXVERSION_610) -extern "C" int getthrds64(pid_t, struct thrdentry64*, int, tid64_t*, int); -extern "C" int getprocs64(procentry64*, int, fdsinfo*, int, pid_t*, int); -extern "C" int getargs(procsinfo*, int, char*, int); -#endif - #define MAX_PATH (2 * K) // for multipage initialization error analysis (in 'g_multipage_error') @@ -216,7 +210,7 @@ static address g_brk_at_startup = nullptr; // shmctl(). Different shared memory regions can have different page // sizes. // -// More information can be found at AIBM info center: +// More information can be found at IBM info center: // http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/multiple_page_size_app_support.htm // static struct { @@ -1753,10 +1747,9 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) { return true; } -bool os::remove_stack_guard_pages(char* addr, size_t size) { +void os::remove_stack_guard_pages(char* addr, size_t size) { // Do not call this; no need to commit stack pages on AIX. ShouldNotReachHere(); - return true; } void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) { @@ -1957,11 +1950,6 @@ char* os::pd_reserve_memory_special(size_t bytes, size_t alignment, size_t page_ return nullptr; } -bool os::pd_release_memory_special(char* base, size_t bytes) { - fatal("os::release_memory_special should not be called on AIX."); - return false; -} - size_t os::large_page_size() { return _large_page_size; } @@ -2143,46 +2131,12 @@ void os::init(void) { // 64k no --- AIX 5.2 ? --- // 64k yes 64k new systems and standard java loader (we set datapsize=64k when linking) - // We explicitly leave no option to change page size, because only upgrading would work, - // not downgrading (if stack page size is 64k you cannot pretend its 4k). - - if (g_multipage_support.datapsize == 4*K) { - // datapsize = 4K. Data segment, thread stacks are 4K paged. - if (g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages) { - // .. but we are able to use 64K pages dynamically. - // This would be typical for java launchers which are not linked - // with datapsize=64K (like, any other launcher but our own). - // - // In this case it would be smart to allocate the java heap with 64K - // to get the performance benefit, and to fake 64k pages for the - // data segment (when dealing with thread stacks). - // - // However, leave a possibility to downgrade to 4K, using - // -XX:-Use64KPages. - if (Use64KPages) { - trcVerbose("64K page mode (faked for data segment)"); - set_page_size(64*K); - } else { - trcVerbose("4K page mode (Use64KPages=off)"); - set_page_size(4*K); - } - } else { - // .. and not able to allocate 64k pages dynamically. Here, just - // fall back to 4K paged mode and use mmap for everything. - trcVerbose("4K page mode"); - set_page_size(4*K); - FLAG_SET_ERGO(Use64KPages, false); - } - } else { - // datapsize = 64k. Data segment, thread stacks are 64k paged. - // This normally means that we can allocate 64k pages dynamically. - // (There is one special case where this may be false: EXTSHM=on. - // but we decided to not support that mode). - assert0(g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages); - set_page_size(64*K); - trcVerbose("64K page mode"); - FLAG_SET_ERGO(Use64KPages, true); - } + // datapsize = 64k. Data segment, thread stacks are 64k paged. + // This normally means that we can allocate 64k pages dynamically. + // (There is one special case where this may be false: EXTSHM=on. + // but we decided to not support that mode). + assert0(g_multipage_support.can_use_64K_pages || g_multipage_support.can_use_64K_mmap_pages); + set_page_size(64*K); // For now UseLargePages is just ignored. FLAG_SET_ERGO(UseLargePages, false); @@ -2565,23 +2519,18 @@ void os::Aix::initialize_os_info() { assert(minor > 0, "invalid OS release"); _os_version = (major << 24) | (minor << 16); char ver_str[20] = {0}; - const char* name_str = "unknown OS"; - if (strcmp(uts.sysname, "AIX") == 0) { - // We run on AIX. We do not support versions older than AIX 7.1. - // Determine detailed AIX version: Version, Release, Modification, Fix Level. - odmWrapper::determine_os_kernel_version(&_os_version); - if (os_version_short() < 0x0701) { - log_warning(os)("AIX releases older than AIX 7.1 are not supported."); - assert(false, "AIX release too old."); - } - name_str = "AIX"; - jio_snprintf(ver_str, sizeof(ver_str), "%u.%u.%u.%u", - major, minor, (_os_version >> 8) & 0xFF, _os_version & 0xFF); - } else { - assert(false, "%s", name_str); + // We do not support versions older than AIX 7.2 TL 5. + // Determine detailed AIX version: Version, Release, Modification, Fix Level. + odmWrapper::determine_os_kernel_version(&_os_version); + if (_os_version < 0x07020500) { + log_warning(os)("AIX releases older than AIX 7.2 TL 5 are not supported."); + assert(false, "AIX release too old."); } - log_info(os)("We run on %s %s", name_str, ver_str); + + jio_snprintf(ver_str, sizeof(ver_str), "%u.%u.%u.%u", + major, minor, (_os_version >> 8) & 0xFF, _os_version & 0xFF); + log_info(os)("We run on AIX %s", ver_str); } guarantee(_os_version, "Could not determine AIX release"); diff --git a/src/hotspot/os/aix/os_perf_aix.cpp b/src/hotspot/os/aix/os_perf_aix.cpp index aa8819d035f..cbf78083483 100644 --- a/src/hotspot/os/aix/os_perf_aix.cpp +++ b/src/hotspot/os/aix/os_perf_aix.cpp @@ -143,12 +143,6 @@ static OSReturn get_jvm_load(double* jvm_uload, double* jvm_sload) { return OS_OK; } -static void update_prev_time(jvm_time_store_t* from, jvm_time_store_t* to) { - if (from && to) { - memcpy(to, from, sizeof(jvm_time_store_t)); - } -} - static void update_prev_ticks(cpu_tick_store_t* from, cpu_tick_store_t* to) { if (from && to) { memcpy(to, from, sizeof(cpu_tick_store_t)); diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 81320b4f1aa..29ebe65e0db 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -1782,10 +1782,8 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) { return os::commit_memory(addr, size, !ExecMem); } -// If this is a growable mapping, remove the guard pages entirely by -// munmap()ping them. If not, just call uncommit_memory(). -bool os::remove_stack_guard_pages(char* addr, size_t size) { - return os::uncommit_memory(addr, size); +void os::remove_stack_guard_pages(char* addr, size_t size) { + os::uncommit_memory(addr, size); } // 'requested_addr' is only treated as a hint, the return value may or @@ -1887,11 +1885,6 @@ char* os::pd_reserve_memory_special(size_t bytes, size_t alignment, size_t page_ return nullptr; } -bool os::pd_release_memory_special(char* base, size_t bytes) { - fatal("os::release_memory_special should not be called on BSD."); - return false; -} - size_t os::large_page_size() { return _large_page_size; } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 7190845a8ba..9c2fbab7535 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -3523,6 +3523,9 @@ bool os::pd_uncommit_memory(char* addr, size_t size, bool exec) { log_trace(os, map)("mmap failed: " RANGEFMT " errno=(%s)", RANGEFMTARGS(addr, size), os::strerror(ep.saved_errno())); + if (ep.saved_errno() == ENOMEM) { + fatal("Failed to uncommit " RANGEFMT ". It is possible that the process's maximum number of mappings would have been exceeded. Try increasing the limit.", RANGEFMTARGS(addr, size)); + } return false; } return true; @@ -3633,14 +3636,16 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) { // It's safe to always unmap guard pages for primordial thread because we // always place it right after end of the mapped region. -bool os::remove_stack_guard_pages(char* addr, size_t size) { - uintptr_t stack_extent, stack_base; +void os::remove_stack_guard_pages(char* addr, size_t size) { if (os::is_primordial_thread()) { - return ::munmap(addr, size) == 0; + if (::munmap(addr, size) != 0) { + fatal("Failed to munmap " RANGEFMT, RANGEFMTARGS(addr, size)); + } + return; } - return os::uncommit_memory(addr, size); + os::uncommit_memory(addr, size); } // 'requested_addr' is only treated as a hint, the return value may or @@ -4203,12 +4208,6 @@ char* os::pd_reserve_memory_special(size_t bytes, size_t alignment, size_t page_ return addr; } -bool os::pd_release_memory_special(char* base, size_t bytes) { - assert(UseLargePages, "only for large pages"); - // Plain munmap is sufficient - return pd_release_memory(base, bytes); -} - size_t os::large_page_size() { return _large_page_size; } diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 5412e2bc92d..f147ed4be93 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -906,8 +906,25 @@ FILE* os::fdopen(int fd, const char* mode) { ssize_t os::pd_write(int fd, const void *buf, size_t nBytes) { ssize_t res; +#ifdef __APPLE__ + // macOS fails for individual write operations > 2GB. + // See https://gitlab.haskell.org/ghc/ghc/-/issues/17414 + ssize_t total = 0; + while (nBytes > 0) { + size_t bytes_to_write = MIN2(nBytes, (size_t)INT_MAX); + RESTARTABLE(::write(fd, buf, bytes_to_write), res); + if (res == OS_ERR) { + return OS_ERR; + } + buf = (const char*)buf + res; + nBytes -= res; + total += res; + } + return total; +#else RESTARTABLE(::write(fd, buf, nBytes), res); return res; +#endif } ssize_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) { diff --git a/src/hotspot/os/posix/perfMemory_posix.cpp b/src/hotspot/os/posix/perfMemory_posix.cpp index ce9c2a4f031..d9bde6fa825 100644 --- a/src/hotspot/os/posix/perfMemory_posix.cpp +++ b/src/hotspot/os/posix/perfMemory_posix.cpp @@ -494,6 +494,7 @@ static char* get_user_name(uid_t uid) { return user_name; } +#ifndef __APPLE__ // return the name of the user that owns the process identified by vmid. // // This method uses a slow directory search algorithm to find the backing @@ -657,6 +658,7 @@ static char* get_user_name(int vmid, int *nspid, TRAPS) { #endif return result; } +#endif // return the file name of the backing store file for the named // shared memory region for the given user name and vmid. diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index b0b7ae18106..76f47640e5a 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -3281,11 +3281,10 @@ static char* map_or_reserve_memory_aligned(size_t size, size_t alignment, int fi // Do manual alignment aligned_base = align_up(extra_base, alignment); - bool rc = (file_desc != -1) ? os::unmap_memory(extra_base, extra_size) : - os::release_memory(extra_base, extra_size); - assert(rc, "release failed"); - if (!rc) { - return nullptr; + if (file_desc != -1) { + os::unmap_memory(extra_base, extra_size); + } else { + os::release_memory(extra_base, extra_size); } // Attempt to map, into the just vacated space, the slightly smaller aligned area. @@ -3518,11 +3517,6 @@ char* os::pd_reserve_memory_special(size_t bytes, size_t alignment, size_t page_ return reserve_large_pages(bytes, addr, exec); } -bool os::pd_release_memory_special(char* base, size_t bytes) { - assert(base != nullptr, "Sanity check"); - return pd_release_memory(base, bytes); -} - static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec) { int err = os::get_last_error(); char buf[256]; @@ -3681,8 +3675,8 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) { return os::commit_memory(addr, size, !ExecMem); } -bool os::remove_stack_guard_pages(char* addr, size_t size) { - return os::uncommit_memory(addr, size); +void os::remove_stack_guard_pages(char* addr, size_t size) { + os::uncommit_memory(addr, size); } static bool protect_pages_individually(char* addr, size_t bytes, unsigned int p, DWORD *old_status) { diff --git a/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp b/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp index a20feadcba4..93beb549366 100644 --- a/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp +++ b/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp @@ -27,22 +27,30 @@ #include "runtime/vm_version.hpp" int VM_Version::get_current_sve_vector_length() { - assert(_features & CPU_SVE, "should not call this"); + assert(VM_Version::supports_sve(), "should not call this"); ShouldNotReachHere(); return 0; } int VM_Version::set_and_get_current_sve_vector_length(int length) { - assert(_features & CPU_SVE, "should not call this"); + assert(VM_Version::supports_sve(), "should not call this"); ShouldNotReachHere(); return 0; } void VM_Version::get_os_cpu_info() { - if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) _features |= CPU_CRC32; - if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) _features |= CPU_AES | CPU_SHA1 | CPU_SHA2; - if (IsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE)) _features |= CPU_ASIMD; + if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) { + set_feature(CPU_CRC32); + } + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) { + set_feature(CPU_AES); + set_feature(CPU_SHA1); + set_feature(CPU_SHA2); + } + if (IsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE)) { + set_feature(CPU_ASIMD); + } // No check for CPU_PMULL, CPU_SVE, CPU_SVE2 __int64 dczid_el0 = _ReadStatusReg(0x5807 /* ARM64_DCZID_EL0 */); diff --git a/src/hotspot/share/adlc/adlArena.cpp b/src/hotspot/share/adlc/adlArena.cpp index ebd1f74911d..e3ae60e91a9 100644 --- a/src/hotspot/share/adlc/adlArena.cpp +++ b/src/hotspot/share/adlc/adlArena.cpp @@ -136,9 +136,9 @@ void *AdlArena::Acalloc( size_t items, size_t x ) { } //------------------------------realloc---------------------------------------- -static size_t pointer_delta(const void *left, const void *right) { - assert(left >= right, "pointer delta underflow"); - return (uintptr_t)left - (uintptr_t)right; +static size_t pointer_delta(const void* high, const void* low) { + assert(high >= low, "pointer delta underflow"); + return (uintptr_t)high - (uintptr_t)low; } // Reallocate storage in AdlArena. diff --git a/src/hotspot/share/adlc/main.cpp b/src/hotspot/share/adlc/main.cpp index 4e8a96617e8..8e6ea5bbec9 100644 --- a/src/hotspot/share/adlc/main.cpp +++ b/src/hotspot/share/adlc/main.cpp @@ -213,6 +213,7 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._VM_file._name)); AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._HPP_file._name)); AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp"); + AD.addInclude(AD._CPP_file, "code/aotCodeCache.hpp"); AD.addInclude(AD._CPP_file, "code/codeCache.hpp"); AD.addInclude(AD._CPP_file, "code/compiledIC.hpp"); AD.addInclude(AD._CPP_file, "code/nativeInst.hpp"); @@ -257,6 +258,7 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_PEEPHOLE_file, "adfiles", get_basename(AD._HPP_file._name)); AD.addInclude(AD._CPP_PIPELINE_file, "adfiles", get_basename(AD._HPP_file._name)); AD.addInclude(AD._DFA_file, "adfiles", get_basename(AD._HPP_file._name)); + AD.addInclude(AD._DFA_file, "code/aotCodeCache.hpp"); AD.addInclude(AD._DFA_file, "oops/compressedOops.hpp"); AD.addInclude(AD._DFA_file, "opto/cfgnode.hpp"); // Use PROB_MAX in predicate. AD.addInclude(AD._DFA_file, "opto/intrinsicnode.hpp"); diff --git a/src/hotspot/share/asm/codeBuffer.cpp b/src/hotspot/share/asm/codeBuffer.cpp index d94f52c18f6..ba525588f32 100644 --- a/src/hotspot/share/asm/codeBuffer.cpp +++ b/src/hotspot/share/asm/codeBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -468,9 +468,7 @@ void CodeBuffer::compute_final_layout(CodeBuffer* dest) const { assert(!_finalize_stubs, "non-finalized stubs"); { - // not sure why this is here, but why not... - int alignSize = MAX2((intx) sizeof(jdouble), CodeEntryAlignment); - assert( (dest->_total_start - _insts.start()) % alignSize == 0, "copy must preserve alignment"); + assert( (dest->_total_start - _insts.start()) % CodeEntryAlignment == 0, "copy must preserve alignment"); } const CodeSection* prev_cs = nullptr; diff --git a/src/hotspot/share/asm/register.hpp b/src/hotspot/share/asm/register.hpp index f406995b8ac..95c7c7922cf 100644 --- a/src/hotspot/share/asm/register.hpp +++ b/src/hotspot/share/asm/register.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,15 +49,7 @@ class AbstractRegisterImpl { // Macros to help define all kinds of registers -#ifndef USE_POINTERS_TO_REGISTER_IMPL_ARRAY - -#define AS_REGISTER(type,name) ((type)name##_##type##EnumValue) - -#define CONSTANT_REGISTER_DECLARATION(type, name, value) \ -const type name = ((type)value); \ -enum { name##_##type##EnumValue = (value) } - -#else // USE_POINTERS_TO_REGISTER_IMPL_ARRAY +#ifdef USE_POINTERS_TO_REGISTER_IMPL_ARRAY #define REGISTER_IMPL_DECLARATION(type, impl_type, reg_count) \ inline constexpr type as_ ## type(int encoding) { \ @@ -69,16 +61,8 @@ inline constexpr type impl_type::first() { return all_ ## type ## s + 1; } #define REGISTER_IMPL_DEFINITION(type, impl_type, reg_count) \ impl_type all_ ## type ## s[reg_count + 1]; -#define CONSTANT_REGISTER_DECLARATION(type, name, value) \ -constexpr type name = as_ ## type(value); - #endif // USE_POINTERS_TO_REGISTER_IMPL_ARRAY - -#define REGISTER_DECLARATION(type, name, value) \ -const type name = ((type)value) - - // For definitions of RegisterImpl* instances. To be redefined in an // OS-specific way. #ifdef __GNUC__ diff --git a/src/hotspot/share/cds/aotClassLocation.cpp b/src/hotspot/share/cds/aotClassLocation.cpp index f77aac3540c..9275b914ef9 100644 --- a/src/hotspot/share/cds/aotClassLocation.cpp +++ b/src/hotspot/share/cds/aotClassLocation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -426,7 +426,8 @@ bool AOTClassLocation::check(const char* runtime_path, bool has_aot_linked_class bool size_differs = _filesize != st.st_size; bool time_differs = _check_time && (_timestamp != st.st_mtime); if (size_differs || time_differs) { - aot_log_warning(aot)("This file is not the one used while building the shared archive file: '%s'%s%s", + aot_log_warning(aot)("This file is not the one used while building the %s: '%s'%s%s", + CDSConfig::type_of_archive_being_loaded(), runtime_path, time_differs ? ", timestamp has changed" : "", size_differs ? ", size has changed" : ""); @@ -448,6 +449,13 @@ void AOTClassLocationConfig::dumptime_init(JavaThread* current) { java_lang_Throwable::print(current->pending_exception(), tty); vm_exit_during_initialization("AOTClassLocationConfig::dumptime_init_helper() failed unexpectedly"); } + + if (CDSConfig::is_dumping_final_static_archive()) { + // The _max_used_index is usually updated by ClassLoader::record_result(). However, + // when dumping the final archive, the classes are loaded from their images in + // the AOT config file, so we don't go through ClassLoader::record_result(). + dumptime_update_max_used_index(runtime()->_max_used_index); // Same value as recorded in the training run. + } } void AOTClassLocationConfig::dumptime_init_helper(TRAPS) { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java b/src/hotspot/share/cds/aotCompressedPointers.cpp similarity index 75% rename from src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java rename to src/hotspot/share/cds/aotCompressedPointers.cpp index 0a8bf4721e4..c3efa7a7185 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java +++ b/src/hotspot/share/cds/aotCompressedPointers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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,14 +22,9 @@ * */ -package sun.jvm.hotspot.oops; +#include "cds/aotCompressedPointers.hpp" +#include "cds/archiveBuilder.hpp" -public interface CallTypeDataInterface { - int numberOfArguments(); - boolean hasArguments(); - K argumentType(int i); - boolean hasReturn(); - K returnType(); - int argumentTypeIndex(int i); - int returnTypeIndex(); +size_t AOTCompressedPointers::compute_byte_offset(address p) { + return ArchiveBuilder::current()->any_to_offset(p); } diff --git a/src/hotspot/share/cds/aotCompressedPointers.hpp b/src/hotspot/share/cds/aotCompressedPointers.hpp new file mode 100644 index 00000000000..a3919fb95a9 --- /dev/null +++ b/src/hotspot/share/cds/aotCompressedPointers.hpp @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2026, 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. + * + */ + +#ifndef SHARE_CDS_AOTCOMPRESSEDPOINTERS_HPP +#define SHARE_CDS_AOTCOMPRESSEDPOINTERS_HPP + +#include "cds/cds_globals.hpp" +#include "memory/allStatic.hpp" +#include "memory/metaspace.hpp" +#include "metaprogramming/enableIf.hpp" +#include "utilities/align.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +class AOTCompressedPointers: public AllStatic { +public: + // For space saving, we can encode the location of metadata objects in the "rw" and "ro" + // regions using a 32-bit offset from the bottom of the mapped AOT metaspace. Since metadata + // objects are 8-byte aligned, we store scaled offset units (offset_bytes >> 3) to address + // up to ~32GB on 64-bit platforms. We currently limit the MaxMetadataOffsetBytes to about + // 3.5 GB to be compatible with +CompactObjectHeaders. + enum class narrowPtr : u4; + static constexpr size_t MetadataOffsetShift = LP64_ONLY(3) NOT_LP64(0); + static constexpr size_t MaxMetadataOffsetBytes = LP64_ONLY(3584ULL * M) NOT_LP64(0x7FFFFFFF); + + // Convert the encoded narrowPtr to a byte offset by applying the shift. + inline static size_t get_byte_offset(narrowPtr narrowp) { + return ((size_t)checked_cast(narrowp)) << MetadataOffsetShift; + } + + inline static narrowPtr null() { + return static_cast(0); + } + + // Encoding ------ + + // ptr can point to one of the following + // - an object in the ArchiveBuilder's buffer. + // - an object in the currently mapped AOT cache rw/ro regions. + // - an object that has been copied into the ArchiveBuilder's buffer. + template + static narrowPtr encode_not_null(T ptr) { + address p = reinterpret_cast
(ptr); + return encode_byte_offset(compute_byte_offset(p)); + } + + template + static narrowPtr encode(T ptr) { // may be null + if (ptr == nullptr) { + return null(); + } else { + return encode_not_null(ptr); + } + } + + // ptr must be in the currently mapped AOT cache rw/ro regions. + template + static narrowPtr encode_address_in_cache(T ptr) { + assert(Metaspace::in_aot_cache(ptr), "must be"); + address p = reinterpret_cast
(ptr); + address base = reinterpret_cast
(SharedBaseAddress); + return encode_byte_offset(pointer_delta(p, base, 1)); + } + + template + static narrowPtr encode_address_in_cache_or_null(T ptr) { + if (ptr == nullptr) { + return null(); + } else { + return encode_address_in_cache(ptr); + } + } + + // Decoding ----- + + // If base_address is null, decode an address within the mapped aot cache range. + template + static T decode_not_null(narrowPtr narrowp, address base_address = nullptr) { + assert(narrowp != null(), "sanity"); + if (base_address == nullptr) { + T p = reinterpret_cast(reinterpret_cast
(SharedBaseAddress) + get_byte_offset(narrowp)); + assert(Metaspace::in_aot_cache(p), "must be"); + return p; + } else { + // This is usually called before the cache is fully mapped. + return reinterpret_cast(base_address + get_byte_offset(narrowp)); + } + } + + template + static T decode(narrowPtr narrowp, address base_address = nullptr) { // may be null + if (narrowp == null()) { + return nullptr; + } else { + return decode_not_null(narrowp, base_address); + } + } + +private: + static size_t compute_byte_offset(address p); + + static narrowPtr encode_byte_offset(size_t offset) { + assert(offset != 0, "offset 0 is in protection zone"); + precond(offset <= MaxMetadataOffsetBytes); + assert(is_aligned(offset, (size_t)1 << MetadataOffsetShift), "offset not aligned"); + return checked_cast(offset >> MetadataOffsetShift); + } +}; + +// Type casts -- declared as global functions to save a few keystrokes + +// A simple type cast. No change in numerical value. +inline AOTCompressedPointers::narrowPtr cast_from_u4(u4 narrowp) { + return checked_cast(narrowp); +} + +// A simple type cast. No change in numerical value. +// !!!DO NOT CALL THIS if you want a byte offset!!! +inline u4 cast_to_u4(AOTCompressedPointers::narrowPtr narrowp) { + return checked_cast(narrowp); +} + +#endif // SHARE_CDS_AOTCOMPRESSEDPOINTERS_HPP diff --git a/src/hotspot/share/cds/aotMapLogger.cpp b/src/hotspot/share/cds/aotMapLogger.cpp index 5e4e0956824..fa769aee1bf 100644 --- a/src/hotspot/share/cds/aotMapLogger.cpp +++ b/src/hotspot/share/cds/aotMapLogger.cpp @@ -88,7 +88,7 @@ void AOTMapLogger::ergo_initialize() { } void AOTMapLogger::dumptime_log(ArchiveBuilder* builder, FileMapInfo* mapinfo, - ArchiveMappedHeapInfo* mapped_heap_info, ArchiveStreamedHeapInfo* streamed_heap_info, + AOTMappedHeapInfo* mapped_heap_info, AOTStreamedHeapInfo* streamed_heap_info, char* bitmap, size_t bitmap_size_in_bytes) { _is_runtime_logging = false; _buffer_to_requested_delta = ArchiveBuilder::current()->buffer_to_requested_delta(); @@ -823,7 +823,7 @@ public: } }; // AOTMapLogger::ArchivedFieldPrinter -void AOTMapLogger::dumptime_log_mapped_heap_region(ArchiveMappedHeapInfo* heap_info) { +void AOTMapLogger::dumptime_log_mapped_heap_region(AOTMappedHeapInfo* heap_info) { MemRegion r = heap_info->buffer_region(); address buffer_start = address(r.start()); // start of the current oop inside the buffer address buffer_end = address(r.end()); @@ -835,7 +835,7 @@ void AOTMapLogger::dumptime_log_mapped_heap_region(ArchiveMappedHeapInfo* heap_i log_archived_objects(AOTMappedHeapWriter::oop_iterator(heap_info)); } -void AOTMapLogger::dumptime_log_streamed_heap_region(ArchiveStreamedHeapInfo* heap_info) { +void AOTMapLogger::dumptime_log_streamed_heap_region(AOTStreamedHeapInfo* heap_info) { MemRegion r = heap_info->buffer_region(); address buffer_start = address(r.start()); // start of the current oop inside the buffer address buffer_end = address(r.end()); diff --git a/src/hotspot/share/cds/aotMapLogger.hpp b/src/hotspot/share/cds/aotMapLogger.hpp index bf7ce0028b9..f495ed97f40 100644 --- a/src/hotspot/share/cds/aotMapLogger.hpp +++ b/src/hotspot/share/cds/aotMapLogger.hpp @@ -33,8 +33,8 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/growableArray.hpp" -class ArchiveMappedHeapInfo; -class ArchiveStreamedHeapInfo; +class AOTMappedHeapInfo; +class AOTStreamedHeapInfo; class CompileTrainingData; class DumpRegion; class FileMapInfo; @@ -157,8 +157,8 @@ private: #if INCLUDE_CDS_JAVA_HEAP - static void dumptime_log_mapped_heap_region(ArchiveMappedHeapInfo* mapped_heap_info); - static void dumptime_log_streamed_heap_region(ArchiveStreamedHeapInfo* streamed_heap_info); + static void dumptime_log_mapped_heap_region(AOTMappedHeapInfo* mapped_heap_info); + static void dumptime_log_streamed_heap_region(AOTStreamedHeapInfo* streamed_heap_info); static void runtime_log_heap_region(FileMapInfo* mapinfo); static void print_oop_info_cr(outputStream* st, FakeOop fake_oop, bool print_location = true); @@ -173,7 +173,7 @@ public: static bool is_logging_at_bootstrap() { return _is_logging_at_bootstrap; } static void dumptime_log(ArchiveBuilder* builder, FileMapInfo* mapinfo, - ArchiveMappedHeapInfo* mapped_heap_info, ArchiveStreamedHeapInfo* streamed_heap_info, + AOTMappedHeapInfo* mapped_heap_info, AOTStreamedHeapInfo* streamed_heap_info, char* bitmap, size_t bitmap_size_in_bytes); static void runtime_log(FileMapInfo* static_mapinfo, FileMapInfo* dynamic_mapinfo); }; diff --git a/src/hotspot/share/cds/aotMappedHeap.cpp b/src/hotspot/share/cds/aotMappedHeap.cpp new file mode 100644 index 00000000000..ba24c43eea1 --- /dev/null +++ b/src/hotspot/share/cds/aotMappedHeap.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2026, 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 "cds/aotMappedHeap.hpp" + +// Anything that goes in the header must be thoroughly purged from uninitialized memory +// as it will be written to disk. Therefore, the constructors memset the memory to 0. +// This is not the prettiest thing, but we need to know every byte is initialized, +// including potential padding between fields. + +AOTMappedHeapHeader::AOTMappedHeapHeader(size_t ptrmap_start_pos, + size_t oopmap_start_pos, + HeapRootSegments root_segments) { + memset((char*)this, 0, sizeof(*this)); + _ptrmap_start_pos = ptrmap_start_pos; + _oopmap_start_pos = oopmap_start_pos; + _root_segments = root_segments; +} + +AOTMappedHeapHeader::AOTMappedHeapHeader() { + memset((char*)this, 0, sizeof(*this)); +} + +AOTMappedHeapHeader AOTMappedHeapInfo::create_header() { + return AOTMappedHeapHeader{_ptrmap_start_pos, + _oopmap_start_pos, + _root_segments}; +} diff --git a/src/hotspot/share/cds/aotMappedHeap.hpp b/src/hotspot/share/cds/aotMappedHeap.hpp new file mode 100644 index 00000000000..307451b24d4 --- /dev/null +++ b/src/hotspot/share/cds/aotMappedHeap.hpp @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2026, 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. + * + */ + +#ifndef SHARE_CDS_AOTMAPPEDHEAP_HPP +#define SHARE_CDS_AOTMAPPEDHEAP_HPP + +#include "cds/aotMapLogger.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/macros.hpp" + +class AOTMappedHeapHeader { + size_t _ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the heap. + size_t _oopmap_start_pos; // The first bit in the oopmap corresponds to this position in the heap. + HeapRootSegments _root_segments; // Heap root segments info + +public: + AOTMappedHeapHeader(); + AOTMappedHeapHeader(size_t ptrmap_start_pos, + size_t oopmap_start_pos, + HeapRootSegments root_segments); + + size_t ptrmap_start_pos() const { return _ptrmap_start_pos; } + size_t oopmap_start_pos() const { return _oopmap_start_pos; } + HeapRootSegments root_segments() const { return _root_segments; } + + // This class is trivially copyable and assignable. + AOTMappedHeapHeader(const AOTMappedHeapHeader&) = default; + AOTMappedHeapHeader& operator=(const AOTMappedHeapHeader&) = default; +}; + +class AOTMappedHeapInfo { + MemRegion _buffer_region; // Contains the archived objects to be written into the CDS archive. + CHeapBitMap _oopmap; + CHeapBitMap _ptrmap; + HeapRootSegments _root_segments; + size_t _oopmap_start_pos; // How many zeros were removed from the beginning of the bit map? + size_t _ptrmap_start_pos; // How many zeros were removed from the beginning of the bit map? + +public: + AOTMappedHeapInfo() : + _buffer_region(), + _oopmap(128, mtClassShared), + _ptrmap(128, mtClassShared), + _root_segments(), + _oopmap_start_pos(), + _ptrmap_start_pos() {} + bool is_used() { return !_buffer_region.is_empty(); } + + MemRegion buffer_region() { return _buffer_region; } + void set_buffer_region(MemRegion r) { _buffer_region = r; } + + char* buffer_start() { return (char*)_buffer_region.start(); } + size_t buffer_byte_size() { return _buffer_region.byte_size(); } + + CHeapBitMap* oopmap() { return &_oopmap; } + CHeapBitMap* ptrmap() { return &_ptrmap; } + + void set_oopmap_start_pos(size_t start_pos) { _oopmap_start_pos = start_pos; } + void set_ptrmap_start_pos(size_t start_pos) { _ptrmap_start_pos = start_pos; } + + void set_root_segments(HeapRootSegments segments) { _root_segments = segments; }; + HeapRootSegments root_segments() { return _root_segments; } + + AOTMappedHeapHeader create_header(); +}; + +#if INCLUDE_CDS_JAVA_HEAP +class AOTMappedHeapOopIterator : public AOTMapLogger::OopDataIterator { +protected: + address _current; + address _next; + + address _buffer_start; + address _buffer_end; + uint64_t _buffer_start_narrow_oop; + intptr_t _buffer_to_requested_delta; + int _requested_shift; + + size_t _num_root_segments; + size_t _num_obj_arrays_logged; + +public: + AOTMappedHeapOopIterator(address buffer_start, + address buffer_end, + address requested_base, + address requested_start, + int requested_shift, + size_t num_root_segments) + : _current(nullptr), + _next(buffer_start), + _buffer_start(buffer_start), + _buffer_end(buffer_end), + _requested_shift(requested_shift), + _num_root_segments(num_root_segments), + _num_obj_arrays_logged(0) { + _buffer_to_requested_delta = requested_start - buffer_start; + _buffer_start_narrow_oop = 0xdeadbeed; + if (UseCompressedOops) { + _buffer_start_narrow_oop = (uint64_t)(pointer_delta(requested_start, requested_base, 1)) >> requested_shift; + assert(_buffer_start_narrow_oop < 0xffffffff, "sanity"); + } + } + + virtual AOTMapLogger::OopData capture(address buffered_addr) = 0; + + bool has_next() override { + return _next < _buffer_end; + } + + AOTMapLogger::OopData next() override { + _current = _next; + AOTMapLogger::OopData result = capture(_current); + if (result._klass->is_objArray_klass()) { + result._is_root_segment = _num_obj_arrays_logged++ < _num_root_segments; + } + _next = _current + result._size * BytesPerWord; + return result; + } + + AOTMapLogger::OopData obj_at(narrowOop* addr) override { + uint64_t n = (uint64_t)(*addr); + if (n == 0) { + return null_data(); + } else { + precond(n >= _buffer_start_narrow_oop); + address buffer_addr = _buffer_start + ((n - _buffer_start_narrow_oop) << _requested_shift); + return capture(buffer_addr); + } + } + + AOTMapLogger::OopData obj_at(oop* addr) override { + address requested_value = cast_from_oop
(*addr); + if (requested_value == nullptr) { + return null_data(); + } else { + address buffer_addr = requested_value - _buffer_to_requested_delta; + return capture(buffer_addr); + } + } + + GrowableArrayCHeap* roots() override { + return new GrowableArrayCHeap(); + } +}; +#endif // INCLUDE_CDS_JAVA_HEAP + +#endif // SHARE_CDS_AOTMAPPEDHEAP_HPP diff --git a/src/hotspot/share/cds/aotMappedHeapLoader.cpp b/src/hotspot/share/cds/aotMappedHeapLoader.cpp index 210867be70c..7a201d8297f 100644 --- a/src/hotspot/share/cds/aotMappedHeapLoader.cpp +++ b/src/hotspot/share/cds/aotMappedHeapLoader.cpp @@ -23,6 +23,7 @@ */ #include "cds/aotLogging.hpp" +#include "cds/aotMappedHeap.hpp" #include "cds/aotMappedHeapLoader.inline.hpp" #include "cds/aotMappedHeapWriter.hpp" #include "cds/aotMetaspace.hpp" @@ -221,7 +222,7 @@ void AOTMappedHeapLoader::patch_embedded_pointers(FileMapInfo* info, // the heap object may be loaded at a different address at run time. This structure is used // to translate the dump time addresses for all objects in FileMapInfo::space_at(region_index) // to their runtime addresses. -struct LoadedArchiveHeapRegion { +struct AOTMappedHeapRegion { int _region_index; // index for FileMapInfo::space_at(index) size_t _region_size; // number of bytes in this region uintptr_t _dumptime_base; // The dump-time (decoded) address of the first object in this region @@ -232,7 +233,7 @@ struct LoadedArchiveHeapRegion { } }; -void AOTMappedHeapLoader::init_loaded_heap_relocation(LoadedArchiveHeapRegion* loaded_region) { +void AOTMappedHeapLoader::init_loaded_heap_relocation(AOTMappedHeapRegion* loaded_region) { _dumptime_base = loaded_region->_dumptime_base; _dumptime_top = loaded_region->top(); _runtime_offset = loaded_region->_runtime_offset; @@ -249,7 +250,7 @@ class AOTMappedHeapLoader::PatchLoadedRegionPointers: public BitMapClosure { uintptr_t _top; public: - PatchLoadedRegionPointers(narrowOop* start, LoadedArchiveHeapRegion* loaded_region) + PatchLoadedRegionPointers(narrowOop* start, AOTMappedHeapRegion* loaded_region) : _start(start), _offset(loaded_region->_runtime_offset), _base(loaded_region->_dumptime_base), @@ -270,7 +271,7 @@ class AOTMappedHeapLoader::PatchLoadedRegionPointers: public BitMapClosure { } }; -bool AOTMappedHeapLoader::init_loaded_region(FileMapInfo* mapinfo, LoadedArchiveHeapRegion* loaded_region, +bool AOTMappedHeapLoader::init_loaded_region(FileMapInfo* mapinfo, AOTMappedHeapRegion* loaded_region, MemRegion& archive_space) { size_t total_bytes = 0; FileMapRegion* r = mapinfo->region_at(AOTMetaspace::hp); @@ -301,7 +302,7 @@ bool AOTMappedHeapLoader::init_loaded_region(FileMapInfo* mapinfo, LoadedArchive return true; } -bool AOTMappedHeapLoader::load_heap_region_impl(FileMapInfo* mapinfo, LoadedArchiveHeapRegion* loaded_region, +bool AOTMappedHeapLoader::load_heap_region_impl(FileMapInfo* mapinfo, AOTMappedHeapRegion* loaded_region, uintptr_t load_address) { uintptr_t bitmap_base = (uintptr_t)mapinfo->map_bitmap_region(); if (bitmap_base == 0) { @@ -340,7 +341,7 @@ bool AOTMappedHeapLoader::load_heap_region(FileMapInfo* mapinfo) { assert(can_load(), "loaded heap for must be supported"); init_narrow_oop_decoding(mapinfo->narrow_oop_base(), mapinfo->narrow_oop_shift()); - LoadedArchiveHeapRegion loaded_region; + AOTMappedHeapRegion loaded_region; memset(&loaded_region, 0, sizeof(loaded_region)); MemRegion archive_space; @@ -733,40 +734,22 @@ void AOTMappedHeapLoader::dealloc_heap_region(FileMapInfo* info) { } AOTMapLogger::OopDataIterator* AOTMappedHeapLoader::oop_iterator(FileMapInfo* info, address buffer_start, address buffer_end) { - class MappedLoaderOopIterator : public AOTMapLogger::OopDataIterator { - private: - address _current; - address _next; - - address _buffer_start; - address _buffer_end; - uint64_t _buffer_start_narrow_oop; - intptr_t _buffer_to_requested_delta; - int _requested_shift; - - size_t _num_root_segments; - size_t _num_obj_arrays_logged; - + class MappedLoaderOopIterator : public AOTMappedHeapOopIterator { public: MappedLoaderOopIterator(address buffer_start, address buffer_end, - uint64_t buffer_start_narrow_oop, - intptr_t buffer_to_requested_delta, + address requested_base, + address requested_start, int requested_shift, - size_t num_root_segments) - : _current(nullptr), - _next(buffer_start), - _buffer_start(buffer_start), - _buffer_end(buffer_end), - _buffer_start_narrow_oop(buffer_start_narrow_oop), - _buffer_to_requested_delta(buffer_to_requested_delta), - _requested_shift(requested_shift), - _num_root_segments(num_root_segments), - _num_obj_arrays_logged(0) { - } + size_t num_root_segments) : + AOTMappedHeapOopIterator(buffer_start, + buffer_end, + requested_base, + requested_start, + requested_shift, + num_root_segments) {} - - AOTMapLogger::OopData capture(address buffered_addr) { + AOTMapLogger::OopData capture(address buffered_addr) override { oopDesc* raw_oop = (oopDesc*)buffered_addr; size_t size = raw_oop->size(); address requested_addr = buffered_addr + _buffer_to_requested_delta; @@ -784,62 +767,17 @@ AOTMapLogger::OopDataIterator* AOTMappedHeapLoader::oop_iterator(FileMapInfo* in size, false }; } - - bool has_next() override { - return _next < _buffer_end; - } - - AOTMapLogger::OopData next() override { - _current = _next; - AOTMapLogger::OopData result = capture(_current); - if (result._klass->is_objArray_klass()) { - result._is_root_segment = _num_obj_arrays_logged++ < _num_root_segments; - } - _next = _current + result._size * BytesPerWord; - return result; - } - - AOTMapLogger::OopData obj_at(narrowOop* addr) override { - uint64_t n = (uint64_t)(*addr); - if (n == 0) { - return null_data(); - } else { - precond(n >= _buffer_start_narrow_oop); - address buffer_addr = _buffer_start + ((n - _buffer_start_narrow_oop) << _requested_shift); - return capture(buffer_addr); - } - } - - AOTMapLogger::OopData obj_at(oop* addr) override { - address requested_value = cast_from_oop
(*addr); - if (requested_value == nullptr) { - return null_data(); - } else { - address buffer_addr = requested_value - _buffer_to_requested_delta; - return capture(buffer_addr); - } - } - - GrowableArrayCHeap* roots() override { - return new GrowableArrayCHeap(); - } }; FileMapRegion* r = info->region_at(AOTMetaspace::hp); address requested_base = UseCompressedOops ? (address)info->narrow_oop_base() : heap_region_requested_address(info); address requested_start = requested_base + r->mapping_offset(); int requested_shift = info->narrow_oop_shift(); - intptr_t buffer_to_requested_delta = requested_start - buffer_start; - uint64_t buffer_start_narrow_oop = 0xdeadbeed; - if (UseCompressedOops) { - buffer_start_narrow_oop = (uint64_t)(pointer_delta(requested_start, requested_base, 1)) >> requested_shift; - assert(buffer_start_narrow_oop < 0xffffffff, "sanity"); - } return new MappedLoaderOopIterator(buffer_start, buffer_end, - buffer_start_narrow_oop, - buffer_to_requested_delta, + requested_base, + requested_start, requested_shift, info->mapped_heap()->root_segments().count()); } diff --git a/src/hotspot/share/cds/aotMappedHeapLoader.hpp b/src/hotspot/share/cds/aotMappedHeapLoader.hpp index d344d7b0b0a..7c5ca1b1f9e 100644 --- a/src/hotspot/share/cds/aotMappedHeapLoader.hpp +++ b/src/hotspot/share/cds/aotMappedHeapLoader.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -37,8 +37,8 @@ #include "utilities/growableArray.hpp" #include "utilities/macros.hpp" +struct AOTMappedHeapRegion; class FileMapInfo; -struct LoadedArchiveHeapRegion; class AOTMappedHeapLoader : AllStatic { friend class AOTMapLogger; @@ -93,7 +93,7 @@ public: // function instead. inline static oop decode_from_archive(narrowOop v) NOT_CDS_JAVA_HEAP_RETURN_(nullptr); - // More efficient version, but works only when ArchiveHeap is mapped. + // More efficient version, but works only when is_mapped() inline static oop decode_from_mapped_archive(narrowOop v) NOT_CDS_JAVA_HEAP_RETURN_(nullptr); static void patch_compressed_embedded_pointers(BitMapView bm, @@ -113,7 +113,7 @@ private: static bool _is_loaded; // Support for loaded archived heap. These are cached values from - // LoadedArchiveHeapRegion's. + // AOTMappedHeapRegion's. static uintptr_t _dumptime_base; static uintptr_t _dumptime_top; static intx _runtime_offset; @@ -141,10 +141,10 @@ private: static bool _heap_pointers_need_patching; static void init_narrow_oop_decoding(address base, int shift); - static bool init_loaded_region(FileMapInfo* mapinfo, LoadedArchiveHeapRegion* loaded_region, + static bool init_loaded_region(FileMapInfo* mapinfo, AOTMappedHeapRegion* loaded_region, MemRegion& archive_space); - static bool load_heap_region_impl(FileMapInfo* mapinfo, LoadedArchiveHeapRegion* loaded_region, uintptr_t buffer); - static void init_loaded_heap_relocation(LoadedArchiveHeapRegion* reloc_info); + static bool load_heap_region_impl(FileMapInfo* mapinfo, AOTMappedHeapRegion* loaded_region, uintptr_t buffer); + static void init_loaded_heap_relocation(AOTMappedHeapRegion* reloc_info); static void patch_native_pointers(); static void finish_loaded_heap(); static void verify_loaded_heap(); diff --git a/src/hotspot/share/cds/aotMappedHeapWriter.cpp b/src/hotspot/share/cds/aotMappedHeapWriter.cpp index e73b980614a..64c0e3c40e8 100644 --- a/src/hotspot/share/cds/aotMappedHeapWriter.cpp +++ b/src/hotspot/share/cds/aotMappedHeapWriter.cpp @@ -22,7 +22,7 @@ * */ -#include "cds/aotMappedHeapLoader.hpp" +#include "cds/aotMappedHeap.hpp" #include "cds/aotMappedHeapWriter.hpp" #include "cds/aotReferenceObjSupport.hpp" #include "cds/cdsConfig.hpp" @@ -151,7 +151,7 @@ void AOTMappedHeapWriter::add_source_obj(oop src_obj) { } void AOTMappedHeapWriter::write(GrowableArrayCHeap* roots, - ArchiveMappedHeapInfo* heap_info) { + AOTMappedHeapInfo* heap_info) { assert(CDSConfig::is_dumping_heap(), "sanity"); allocate_buffer(); copy_source_objs_to_buffer(roots); @@ -598,7 +598,7 @@ size_t AOTMappedHeapWriter::copy_one_source_obj_to_buffer(oop src_obj) { // // So we just hard code it to NOCOOPS_REQUESTED_BASE. // -void AOTMappedHeapWriter::set_requested_address_range(ArchiveMappedHeapInfo* info) { +void AOTMappedHeapWriter::set_requested_address_range(AOTMappedHeapInfo* info) { assert(!info->is_used(), "only set once"); size_t heap_region_byte_size = _buffer_used; @@ -792,7 +792,7 @@ static void log_bitmap_usage(const char* which, BitMap* bitmap, size_t total_bit // Update all oop fields embedded in the buffered objects void AOTMappedHeapWriter::relocate_embedded_oops(GrowableArrayCHeap* roots, - ArchiveMappedHeapInfo* heap_info) { + AOTMappedHeapInfo* heap_info) { size_t oopmap_unit = (UseCompressedOops ? sizeof(narrowOop) : sizeof(oop)); size_t heap_region_byte_size = _buffer_used; heap_info->oopmap()->resize(heap_region_byte_size / oopmap_unit); @@ -862,7 +862,7 @@ void AOTMappedHeapWriter::mark_native_pointers(oop orig_obj) { }); } -void AOTMappedHeapWriter::compute_ptrmap(ArchiveMappedHeapInfo* heap_info) { +void AOTMappedHeapWriter::compute_ptrmap(AOTMappedHeapInfo* heap_info) { int num_non_null_ptrs = 0; Metadata** bottom = (Metadata**) _requested_bottom; Metadata** top = (Metadata**) _requested_top; // exclusive @@ -909,40 +909,23 @@ void AOTMappedHeapWriter::compute_ptrmap(ArchiveMappedHeapInfo* heap_info) { num_non_null_ptrs, size_t(heap_info->ptrmap()->size())); } -AOTMapLogger::OopDataIterator* AOTMappedHeapWriter::oop_iterator(ArchiveMappedHeapInfo* heap_info) { - class MappedWriterOopIterator : public AOTMapLogger::OopDataIterator { - private: - address _current; - address _next; - - address _buffer_start; - address _buffer_end; - uint64_t _buffer_start_narrow_oop; - intptr_t _buffer_to_requested_delta; - int _requested_shift; - - size_t _num_root_segments; - size_t _num_obj_arrays_logged; - +AOTMapLogger::OopDataIterator* AOTMappedHeapWriter::oop_iterator(AOTMappedHeapInfo* heap_info) { + class MappedWriterOopIterator : public AOTMappedHeapOopIterator { public: MappedWriterOopIterator(address buffer_start, address buffer_end, - uint64_t buffer_start_narrow_oop, - intptr_t buffer_to_requested_delta, + address requested_base, + address requested_start, int requested_shift, - size_t num_root_segments) - : _current(nullptr), - _next(buffer_start), - _buffer_start(buffer_start), - _buffer_end(buffer_end), - _buffer_start_narrow_oop(buffer_start_narrow_oop), - _buffer_to_requested_delta(buffer_to_requested_delta), - _requested_shift(requested_shift), - _num_root_segments(num_root_segments), - _num_obj_arrays_logged(0) { - } + size_t num_root_segments) : + AOTMappedHeapOopIterator(buffer_start, + buffer_end, + requested_base, + requested_start, + requested_shift, + num_root_segments) {} - AOTMapLogger::OopData capture(address buffered_addr) { + AOTMapLogger::OopData capture(address buffered_addr) override { oopDesc* raw_oop = (oopDesc*)buffered_addr; size_t size = size_of_buffered_oop(buffered_addr); address requested_addr = buffered_addr_to_requested_addr(buffered_addr); @@ -960,45 +943,6 @@ AOTMapLogger::OopDataIterator* AOTMappedHeapWriter::oop_iterator(ArchiveMappedHe size, false }; } - - bool has_next() override { - return _next < _buffer_end; - } - - AOTMapLogger::OopData next() override { - _current = _next; - AOTMapLogger::OopData result = capture(_current); - if (result._klass->is_objArray_klass()) { - result._is_root_segment = _num_obj_arrays_logged++ < _num_root_segments; - } - _next = _current + result._size * BytesPerWord; - return result; - } - - AOTMapLogger::OopData obj_at(narrowOop* addr) override { - uint64_t n = (uint64_t)(*addr); - if (n == 0) { - return null_data(); - } else { - precond(n >= _buffer_start_narrow_oop); - address buffer_addr = _buffer_start + ((n - _buffer_start_narrow_oop) << _requested_shift); - return capture(buffer_addr); - } - } - - AOTMapLogger::OopData obj_at(oop* addr) override { - address requested_value = cast_from_oop
(*addr); - if (requested_value == nullptr) { - return null_data(); - } else { - address buffer_addr = requested_value - _buffer_to_requested_delta; - return capture(buffer_addr); - } - } - - GrowableArrayCHeap* roots() override { - return new GrowableArrayCHeap(); - } }; MemRegion r = heap_info->buffer_region(); @@ -1008,17 +952,11 @@ AOTMapLogger::OopDataIterator* AOTMappedHeapWriter::oop_iterator(ArchiveMappedHe address requested_base = UseCompressedOops ? AOTMappedHeapWriter::narrow_oop_base() : (address)AOTMappedHeapWriter::NOCOOPS_REQUESTED_BASE; address requested_start = UseCompressedOops ? AOTMappedHeapWriter::buffered_addr_to_requested_addr(buffer_start) : requested_base; int requested_shift = AOTMappedHeapWriter::narrow_oop_shift(); - intptr_t buffer_to_requested_delta = requested_start - buffer_start; - uint64_t buffer_start_narrow_oop = 0xdeadbeed; - if (UseCompressedOops) { - buffer_start_narrow_oop = (uint64_t)(pointer_delta(requested_start, requested_base, 1)) >> requested_shift; - assert(buffer_start_narrow_oop < 0xffffffff, "sanity"); - } return new MappedWriterOopIterator(buffer_start, buffer_end, - buffer_start_narrow_oop, - buffer_to_requested_delta, + requested_base, + requested_start, requested_shift, heap_info->root_segments().count()); } diff --git a/src/hotspot/share/cds/aotMappedHeapWriter.hpp b/src/hotspot/share/cds/aotMappedHeapWriter.hpp index eafd38ac8bb..7481e7922a0 100644 --- a/src/hotspot/share/cds/aotMappedHeapWriter.hpp +++ b/src/hotspot/share/cds/aotMappedHeapWriter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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 @@ -196,10 +196,10 @@ private: static int filler_array_length(size_t fill_bytes); static HeapWord* init_filler_array_at_buffer_top(int array_length, size_t fill_bytes); - static void set_requested_address_range(ArchiveMappedHeapInfo* info); + static void set_requested_address_range(AOTMappedHeapInfo* info); static void mark_native_pointers(oop orig_obj); - static void relocate_embedded_oops(GrowableArrayCHeap* roots, ArchiveMappedHeapInfo* info); - static void compute_ptrmap(ArchiveMappedHeapInfo *info); + static void relocate_embedded_oops(GrowableArrayCHeap* roots, AOTMappedHeapInfo* info); + static void compute_ptrmap(AOTMappedHeapInfo *info); static bool is_in_requested_range(oop o); static oop requested_obj_from_buffer_offset(size_t offset); @@ -229,7 +229,7 @@ public: static bool is_string_too_large_to_archive(oop string); static bool is_dumped_interned_string(oop o); static void add_to_dumped_interned_strings(oop string); - static void write(GrowableArrayCHeap*, ArchiveMappedHeapInfo* heap_info); + static void write(GrowableArrayCHeap*, AOTMappedHeapInfo* heap_info); static address requested_address(); // requested address of the lowest achived heap object static size_t get_filler_size_at(address buffered_addr); @@ -240,7 +240,7 @@ public: static Klass* real_klass_of_buffered_oop(address buffered_addr); static size_t size_of_buffered_oop(address buffered_addr); - static AOTMapLogger::OopDataIterator* oop_iterator(ArchiveMappedHeapInfo* heap_info); + static AOTMapLogger::OopDataIterator* oop_iterator(AOTMappedHeapInfo* heap_info); }; #endif // INCLUDE_CDS_JAVA_HEAP #endif // SHARE_CDS_AOTMAPPEDHEAPWRITER_HPP diff --git a/src/hotspot/share/cds/aotMetaspace.cpp b/src/hotspot/share/cds/aotMetaspace.cpp index 894a35183ca..b75d7628aa9 100644 --- a/src/hotspot/share/cds/aotMetaspace.cpp +++ b/src/hotspot/share/cds/aotMetaspace.cpp @@ -661,8 +661,8 @@ void AOTMetaspace::rewrite_bytecodes_and_calculate_fingerprints(Thread* thread, class VM_PopulateDumpSharedSpace : public VM_Operation { private: - ArchiveMappedHeapInfo _mapped_heap_info; - ArchiveStreamedHeapInfo _streamed_heap_info; + AOTMappedHeapInfo _mapped_heap_info; + AOTStreamedHeapInfo _streamed_heap_info; FileMapInfo* _map_info; StaticArchiveBuilder& _builder; @@ -682,8 +682,8 @@ public: bool skip_operation() const { return false; } VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; } - ArchiveMappedHeapInfo* mapped_heap_info() { return &_mapped_heap_info; } - ArchiveStreamedHeapInfo* streamed_heap_info() { return &_streamed_heap_info; } + AOTMappedHeapInfo* mapped_heap_info() { return &_mapped_heap_info; } + AOTStreamedHeapInfo* streamed_heap_info() { return &_streamed_heap_info; } void doit(); // outline because gdb sucks bool allow_nested_vm_operations() const { return true; } }; // class VM_PopulateDumpSharedSpace @@ -1148,7 +1148,7 @@ void AOTMetaspace::dump_static_archive_impl(StaticArchiveBuilder& builder, TRAPS if (CDSConfig::is_dumping_full_module_graph()) { ClassLoaderDataShared::ensure_module_entry_tables_exist(); ClassLoaderDataShared::build_tables(CHECK); - HeapShared::reset_archived_object_states(CHECK); + HeapShared::prepare_for_archiving(CHECK); } AOTReferenceObjSupport::initialize(CHECK); @@ -1212,8 +1212,8 @@ void AOTMetaspace::dump_static_archive_impl(StaticArchiveBuilder& builder, TRAPS bool AOTMetaspace::write_static_archive(ArchiveBuilder* builder, FileMapInfo* map_info, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info) { + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info) { // relocate the data so that it can be mapped to AOTMetaspace::requested_base_address() // without runtime relocation. builder->relocate_to_requested(); @@ -2106,7 +2106,7 @@ MapArchiveResult AOTMetaspace::map_archive(FileMapInfo* mapinfo, char* mapped_ba // Currently, only static archive uses early serialized data. char* buffer = mapinfo->early_serialized_data(); intptr_t* array = (intptr_t*)buffer; - ReadClosure rc(&array, (intptr_t)mapped_base_address); + ReadClosure rc(&array, (address)mapped_base_address); early_serialize(&rc); } @@ -2152,7 +2152,7 @@ void AOTMetaspace::initialize_shared_spaces() { // shared string/symbol tables. char* buffer = static_mapinfo->serialized_data(); intptr_t* array = (intptr_t*)buffer; - ReadClosure rc(&array, (intptr_t)SharedBaseAddress); + ReadClosure rc(&array, (address)SharedBaseAddress); serialize(&rc); // Finish initializing the heap dump mode used in the archive @@ -2164,7 +2164,7 @@ void AOTMetaspace::initialize_shared_spaces() { if (dynamic_mapinfo != nullptr) { intptr_t* buffer = (intptr_t*)dynamic_mapinfo->serialized_data(); - ReadClosure rc(&buffer, (intptr_t)SharedBaseAddress); + ReadClosure rc(&buffer, (address)SharedBaseAddress); DynamicArchive::serialize(&rc); } diff --git a/src/hotspot/share/cds/aotMetaspace.hpp b/src/hotspot/share/cds/aotMetaspace.hpp index ab78787288f..4607a936abe 100644 --- a/src/hotspot/share/cds/aotMetaspace.hpp +++ b/src/hotspot/share/cds/aotMetaspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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,8 +33,8 @@ #include "utilities/macros.hpp" class ArchiveBuilder; -class ArchiveMappedHeapInfo; -class ArchiveStreamedHeapInfo; +class AOTMappedHeapInfo; +class AOTStreamedHeapInfo; class FileMapInfo; class Method; class outputStream; @@ -192,8 +192,8 @@ private: static void open_output_mapinfo(); static bool write_static_archive(ArchiveBuilder* builder, FileMapInfo* map_info, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info); + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info); static FileMapInfo* open_static_archive(); static FileMapInfo* open_dynamic_archive(); // use_requested_addr: If true (default), attempt to map at the address the diff --git a/src/hotspot/share/cds/aotStreamedHeap.cpp b/src/hotspot/share/cds/aotStreamedHeap.cpp new file mode 100644 index 00000000000..3378924bf32 --- /dev/null +++ b/src/hotspot/share/cds/aotStreamedHeap.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2026, 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 "cds/aotStreamedHeap.hpp" + +// Anything that goes in the header must be thoroughly purged from uninitialized memory +// as it will be written to disk. Therefore, the constructors memset the memory to 0. +// This is not the prettiest thing, but we need to know every byte is initialized, +// including potential padding between fields. + +AOTStreamedHeapHeader::AOTStreamedHeapHeader(size_t forwarding_offset, + size_t roots_offset, + size_t num_roots, + size_t root_highest_object_index_table_offset, + size_t num_archived_objects) { + memset((char*)this, 0, sizeof(*this)); + _forwarding_offset = forwarding_offset; + _roots_offset = roots_offset; + _num_roots = num_roots; + _root_highest_object_index_table_offset = root_highest_object_index_table_offset; + _num_archived_objects = num_archived_objects; +} + +AOTStreamedHeapHeader::AOTStreamedHeapHeader() { + memset((char*)this, 0, sizeof(*this)); +} + +AOTStreamedHeapHeader AOTStreamedHeapInfo::create_header() { + return AOTStreamedHeapHeader{_forwarding_offset, + _roots_offset, + _num_roots, + _root_highest_object_index_table_offset, + _num_archived_objects}; +} diff --git a/src/hotspot/share/cds/aotStreamedHeap.hpp b/src/hotspot/share/cds/aotStreamedHeap.hpp new file mode 100644 index 00000000000..f06b1bcb4c6 --- /dev/null +++ b/src/hotspot/share/cds/aotStreamedHeap.hpp @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2026, 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. + * + */ + +#ifndef SHARE_CDS_AOTSTREAMEDHEAP_HPP +#define SHARE_CDS_AOTSTREAMEDHEAP_HPP + +#include "cds/aotMapLogger.hpp" +#include "utilities/growableArray.hpp" +#include "utilities/macros.hpp" + +class AOTStreamedHeapHeader { + size_t _forwarding_offset; // Offset of forwarding information in the heap region. + size_t _roots_offset; // Start position for the roots + size_t _root_highest_object_index_table_offset; // Offset of root dfs depth information + size_t _num_roots; // Number of embedded roots + size_t _num_archived_objects; // The number of archived heap objects + +public: + AOTStreamedHeapHeader(); + AOTStreamedHeapHeader(size_t forwarding_offset, + size_t roots_offset, + size_t num_roots, + size_t root_highest_object_index_table_offset, + size_t num_archived_objects); + + size_t forwarding_offset() const { return _forwarding_offset; } + size_t roots_offset() const { return _roots_offset; } + size_t num_roots() const { return _num_roots; } + size_t root_highest_object_index_table_offset() const { return _root_highest_object_index_table_offset; } + size_t num_archived_objects() const { return _num_archived_objects; } + + // This class is trivially copyable and assignable. + AOTStreamedHeapHeader(const AOTStreamedHeapHeader&) = default; + AOTStreamedHeapHeader& operator=(const AOTStreamedHeapHeader&) = default; +}; + +class AOTStreamedHeapInfo { + MemRegion _buffer_region; // Contains the archived objects to be written into the CDS archive. + CHeapBitMap _oopmap; + size_t _roots_offset; // Offset of the HeapShared::roots() object, from the bottom + // of the archived heap objects, in bytes. + size_t _num_roots; + + size_t _forwarding_offset; // Offset of forwarding information from the bottom + size_t _root_highest_object_index_table_offset; // Offset to root dfs depth information + size_t _num_archived_objects; // The number of archived objects written into the CDS archive. + +public: + AOTStreamedHeapInfo() + : _buffer_region(), + _oopmap(128, mtClassShared), + _roots_offset(), + _forwarding_offset(), + _root_highest_object_index_table_offset(), + _num_archived_objects() {} + + bool is_used() { return !_buffer_region.is_empty(); } + + void set_buffer_region(MemRegion r) { _buffer_region = r; } + MemRegion buffer_region() { return _buffer_region; } + char* buffer_start() { return (char*)_buffer_region.start(); } + size_t buffer_byte_size() { return _buffer_region.byte_size(); } + + CHeapBitMap* oopmap() { return &_oopmap; } + void set_roots_offset(size_t n) { _roots_offset = n; } + size_t roots_offset() { return _roots_offset; } + void set_num_roots(size_t n) { _num_roots = n; } + size_t num_roots() { return _num_roots; } + void set_forwarding_offset(size_t n) { _forwarding_offset = n; } + void set_root_highest_object_index_table_offset(size_t n) { _root_highest_object_index_table_offset = n; } + void set_num_archived_objects(size_t n) { _num_archived_objects = n; } + size_t num_archived_objects() { return _num_archived_objects; } + + AOTStreamedHeapHeader create_header(); +}; + +#if INCLUDE_CDS_JAVA_HEAP +class AOTStreamedHeapOopIterator : public AOTMapLogger::OopDataIterator { +protected: + int _current; + int _next; + address _buffer_start; + int _num_archived_objects; + +public: + AOTStreamedHeapOopIterator(address buffer_start, + int num_archived_objects) + : _current(0), + _next(1), + _buffer_start(buffer_start), + _num_archived_objects(num_archived_objects) {} + + virtual AOTMapLogger::OopData capture(int dfs_index) = 0; + + bool has_next() override { + return _next <= _num_archived_objects; + } + + AOTMapLogger::OopData next() override { + _current = _next; + AOTMapLogger::OopData result = capture(_current); + _next = _current + 1; + return result; + } + + AOTMapLogger::OopData obj_at(narrowOop* addr) override { + int dfs_index = (int)(*addr); + if (dfs_index == 0) { + return null_data(); + } else { + return capture(dfs_index); + } + } + + AOTMapLogger::OopData obj_at(oop* addr) override { + int dfs_index = (int)cast_from_oop(*addr); + if (dfs_index == 0) { + return null_data(); + } else { + return capture(dfs_index); + } + } +}; +#endif // INCLUDE_CDS_JAVA_HEAP + +#endif // SHARE_CDS_AOTSTREAMEDHEAP_HPP diff --git a/src/hotspot/share/cds/aotStreamedHeapLoader.cpp b/src/hotspot/share/cds/aotStreamedHeapLoader.cpp index 6719f9bf898..39f735543cd 100644 --- a/src/hotspot/share/cds/aotStreamedHeapLoader.cpp +++ b/src/hotspot/share/cds/aotStreamedHeapLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -1102,25 +1102,13 @@ void AOTStreamedHeapLoader::finish_initialization(FileMapInfo* static_mapinfo) { } AOTMapLogger::OopDataIterator* AOTStreamedHeapLoader::oop_iterator(FileMapInfo* info, address buffer_start, address buffer_end) { - class StreamedLoaderOopIterator : public AOTMapLogger::OopDataIterator { - private: - int _current; - int _next; - - address _buffer_start; - - int _num_archived_objects; - + class StreamedLoaderOopIterator : public AOTStreamedHeapOopIterator { public: StreamedLoaderOopIterator(address buffer_start, int num_archived_objects) - : _current(0), - _next(1), - _buffer_start(buffer_start), - _num_archived_objects(num_archived_objects) { - } + : AOTStreamedHeapOopIterator(buffer_start, num_archived_objects) {} - AOTMapLogger::OopData capture(int dfs_index) { + AOTMapLogger::OopData capture(int dfs_index) override { size_t buffered_offset = buffer_offset_for_object_index(dfs_index); address buffered_addr = _buffer_start + buffered_offset; oopDesc* raw_oop = (oopDesc*)buffered_addr; @@ -1142,35 +1130,6 @@ AOTMapLogger::OopDataIterator* AOTStreamedHeapLoader::oop_iterator(FileMapInfo* false }; } - bool has_next() override { - return _next <= _num_archived_objects; - } - - AOTMapLogger::OopData next() override { - _current = _next; - AOTMapLogger::OopData result = capture(_current); - _next = _current + 1; - return result; - } - - AOTMapLogger::OopData obj_at(narrowOop* addr) override { - int dfs_index = (int)(*addr); - if (dfs_index == 0) { - return null_data(); - } else { - return capture(dfs_index); - } - } - - AOTMapLogger::OopData obj_at(oop* addr) override { - int dfs_index = (int)cast_from_oop(*addr); - if (dfs_index == 0) { - return null_data(); - } else { - return capture(dfs_index); - } - } - GrowableArrayCHeap* roots() override { GrowableArrayCHeap* result = new GrowableArrayCHeap(); diff --git a/src/hotspot/share/cds/aotStreamedHeapWriter.cpp b/src/hotspot/share/cds/aotStreamedHeapWriter.cpp index 16acebc7d8d..f52532b2f2a 100644 --- a/src/hotspot/share/cds/aotStreamedHeapWriter.cpp +++ b/src/hotspot/share/cds/aotStreamedHeapWriter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -163,7 +163,7 @@ void AOTStreamedHeapWriter::order_source_objs(GrowableArrayCHeap* roots, - ArchiveStreamedHeapInfo* heap_info) { + AOTStreamedHeapInfo* heap_info) { assert(CDSConfig::is_dumping_heap(), "sanity"); allocate_buffer(); order_source_objs(roots); @@ -453,7 +453,7 @@ static void log_bitmap_usage(const char* which, BitMap* bitmap, size_t total_bit } // Update all oop fields embedded in the buffered objects -void AOTStreamedHeapWriter::map_embedded_oops(ArchiveStreamedHeapInfo* heap_info) { +void AOTStreamedHeapWriter::map_embedded_oops(AOTStreamedHeapInfo* heap_info) { size_t oopmap_unit = (UseCompressedOops ? sizeof(narrowOop) : sizeof(oop)); size_t heap_region_byte_size = _buffer_used; heap_info->oopmap()->resize(heap_region_byte_size / oopmap_unit); @@ -497,7 +497,7 @@ oop AOTStreamedHeapWriter::buffered_addr_to_source_obj(address buffered_addr) { return buffered_offset_to_source_obj(buffered_address_to_offset(buffered_addr)); } -void AOTStreamedHeapWriter::populate_archive_heap_info(ArchiveStreamedHeapInfo* info) { +void AOTStreamedHeapWriter::populate_archive_heap_info(AOTStreamedHeapInfo* info) { assert(!info->is_used(), "only set once"); size_t heap_region_byte_size = _buffer_used; @@ -512,15 +512,9 @@ void AOTStreamedHeapWriter::populate_archive_heap_info(ArchiveStreamedHeapInfo* info->set_num_archived_objects((size_t)_source_objs->length()); } -AOTMapLogger::OopDataIterator* AOTStreamedHeapWriter::oop_iterator(ArchiveStreamedHeapInfo* heap_info) { - class StreamedWriterOopIterator : public AOTMapLogger::OopDataIterator { +AOTMapLogger::OopDataIterator* AOTStreamedHeapWriter::oop_iterator(AOTStreamedHeapInfo* heap_info) { + class StreamedWriterOopIterator : public AOTStreamedHeapOopIterator { private: - int _current; - int _next; - - address _buffer_start; - - int _num_archived_objects; int _num_archived_roots; int* _roots; @@ -529,15 +523,11 @@ AOTMapLogger::OopDataIterator* AOTStreamedHeapWriter::oop_iterator(ArchiveStream int num_archived_objects, int num_archived_roots, int* roots) - : _current(0), - _next(1), - _buffer_start(buffer_start), - _num_archived_objects(num_archived_objects), + : AOTStreamedHeapOopIterator(buffer_start, num_archived_objects), _num_archived_roots(num_archived_roots), - _roots(roots) { - } + _roots(roots) {} - AOTMapLogger::OopData capture(int dfs_index) { + AOTMapLogger::OopData capture(int dfs_index) override { size_t buffered_offset = _dfs_to_archive_object_table[dfs_index]; address buffered_addr = _buffer_start + buffered_offset; oop src_obj = AOTStreamedHeapWriter::buffered_offset_to_source_obj(buffered_offset); @@ -561,35 +551,6 @@ AOTMapLogger::OopDataIterator* AOTStreamedHeapWriter::oop_iterator(ArchiveStream false }; } - bool has_next() override { - return _next <= _num_archived_objects; - } - - AOTMapLogger::OopData next() override { - _current = _next; - AOTMapLogger::OopData result = capture(_current); - _next = _current + 1; - return result; - } - - AOTMapLogger::OopData obj_at(narrowOop* addr) override { - int dfs_index = (int)(*addr); - if (dfs_index == 0) { - return null_data(); - } else { - return capture(dfs_index); - } - } - - AOTMapLogger::OopData obj_at(oop* addr) override { - int dfs_index = (int)cast_from_oop(*addr); - if (dfs_index == 0) { - return null_data(); - } else { - return capture(dfs_index); - } - } - GrowableArrayCHeap* roots() override { GrowableArrayCHeap* result = new GrowableArrayCHeap(); diff --git a/src/hotspot/share/cds/aotStreamedHeapWriter.hpp b/src/hotspot/share/cds/aotStreamedHeapWriter.hpp index bde82f8ce29..ab5aec0327b 100644 --- a/src/hotspot/share/cds/aotStreamedHeapWriter.hpp +++ b/src/hotspot/share/cds/aotStreamedHeapWriter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -117,7 +117,7 @@ class AOTStreamedHeapWriter : AllStatic { static void copy_forwarding_to_buffer(); static void copy_roots_max_dfs_to_buffer(int roots_length); - static void map_embedded_oops(ArchiveStreamedHeapInfo* info); + static void map_embedded_oops(AOTStreamedHeapInfo* info); static bool is_in_requested_range(oop o); static oop requested_obj_from_buffer_offset(size_t offset); @@ -131,14 +131,14 @@ class AOTStreamedHeapWriter : AllStatic { static void update_header_for_buffered_addr(address buffered_addr, oop src_obj, Klass* src_klass); - static void populate_archive_heap_info(ArchiveStreamedHeapInfo* info); + static void populate_archive_heap_info(AOTStreamedHeapInfo* info); public: static void init() NOT_CDS_JAVA_HEAP_RETURN; static void delete_tables_with_raw_oops(); static void add_source_obj(oop src_obj); - static void write(GrowableArrayCHeap*, ArchiveStreamedHeapInfo* heap_info); + static void write(GrowableArrayCHeap*, AOTStreamedHeapInfo* heap_info); static address buffered_heap_roots_addr() { return offset_to_buffered_address
(_roots_offset); } @@ -156,7 +156,7 @@ public: static oop buffered_offset_to_source_obj(size_t buffered_offset); static oop buffered_addr_to_source_obj(address buffered_addr); - static AOTMapLogger::OopDataIterator* oop_iterator(ArchiveStreamedHeapInfo* heap_info); + static AOTMapLogger::OopDataIterator* oop_iterator(AOTStreamedHeapInfo* heap_info); }; #endif // INCLUDE_CDS_JAVA_HEAP #endif // SHARE_CDS_AOTSTREAMEDHEAPWRITER_HPP diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp index 9161980c4be..0ea5d6c6ecb 100644 --- a/src/hotspot/share/cds/archiveBuilder.cpp +++ b/src/hotspot/share/cds/archiveBuilder.cpp @@ -24,6 +24,7 @@ #include "cds/aotArtifactFinder.hpp" #include "cds/aotClassLinker.hpp" +#include "cds/aotCompressedPointers.hpp" #include "cds/aotLogging.hpp" #include "cds/aotMapLogger.hpp" #include "cds/aotMetaspace.hpp" @@ -175,10 +176,10 @@ ArchiveBuilder::ArchiveBuilder() : _mapped_static_archive_bottom(nullptr), _mapped_static_archive_top(nullptr), _buffer_to_requested_delta(0), - _pz_region("pz", MAX_SHARED_DELTA), // protection zone -- used only during dumping; does NOT exist in cds archive. - _rw_region("rw", MAX_SHARED_DELTA), - _ro_region("ro", MAX_SHARED_DELTA), - _ac_region("ac", MAX_SHARED_DELTA), + _pz_region("pz"), // protection zone -- used only during dumping; does NOT exist in cds archive. + _rw_region("rw"), + _ro_region("ro"), + _ac_region("ac"), _ptrmap(mtClassShared), _rw_ptrmap(mtClassShared), _ro_ptrmap(mtClassShared), @@ -320,8 +321,10 @@ void ArchiveBuilder::sort_klasses() { } address ArchiveBuilder::reserve_buffer() { - // AOTCodeCache::max_aot_code_size() accounts for aot code region. - size_t buffer_size = LP64_ONLY(CompressedClassSpaceSize) NOT_LP64(256 * M) + AOTCodeCache::max_aot_code_size(); + // On 64-bit: reserve address space for archives up to the max encoded offset limit. + // On 32-bit: use 256MB + AOT code size due to limited virtual address space. + size_t buffer_size = LP64_ONLY(AOTCompressedPointers::MaxMetadataOffsetBytes) + NOT_LP64(256 * M + AOTCodeCache::max_aot_code_size()); ReservedSpace rs = MemoryReserver::reserve(buffer_size, AOTMetaspace::core_region_alignment(), os::vm_page_size(), @@ -990,16 +993,15 @@ void ArchiveBuilder::make_training_data_shareable() { _src_obj_table.iterate_all(clean_td); } -uintx ArchiveBuilder::buffer_to_offset(address p) const { +size_t ArchiveBuilder::buffer_to_offset(address p) const { address requested_p = to_requested(p); - assert(requested_p >= _requested_static_archive_bottom, "must be"); - return requested_p - _requested_static_archive_bottom; + return pointer_delta(requested_p, _requested_static_archive_bottom, 1); } -uintx ArchiveBuilder::any_to_offset(address p) const { +size_t ArchiveBuilder::any_to_offset(address p) const { if (is_in_mapped_static_archive(p)) { assert(CDSConfig::is_dumping_dynamic_archive(), "must be"); - return p - _mapped_static_archive_bottom; + return pointer_delta(p, _mapped_static_archive_bottom, 1); } if (!is_in_buffer_space(p)) { // p must be a "source" address @@ -1008,7 +1010,7 @@ uintx ArchiveBuilder::any_to_offset(address p) const { return buffer_to_offset(p); } -address ArchiveBuilder::offset_to_buffered_address(u4 offset) const { +address ArchiveBuilder::offset_to_buffered_address(size_t offset) const { address requested_addr = _requested_static_archive_bottom + offset; address buffered_addr = requested_addr - _buffer_to_requested_delta; assert(is_in_buffer_space(buffered_addr), "bad offset"); @@ -1154,7 +1156,7 @@ void ArchiveBuilder::print_stats() { _alloc_stats.print_stats(int(_ro_region.used()), int(_rw_region.used())); } -void ArchiveBuilder::write_archive(FileMapInfo* mapinfo, ArchiveMappedHeapInfo* mapped_heap_info, ArchiveStreamedHeapInfo* streamed_heap_info) { +void ArchiveBuilder::write_archive(FileMapInfo* mapinfo, AOTMappedHeapInfo* mapped_heap_info, AOTStreamedHeapInfo* streamed_heap_info) { // Make sure NUM_CDS_REGIONS (exported in cds.h) agrees with // AOTMetaspace::n_regions (internal to hotspot). assert(NUM_CDS_REGIONS == AOTMetaspace::n_regions, "sanity"); @@ -1213,8 +1215,8 @@ void ArchiveBuilder::count_relocated_pointer(bool tagged, bool nulled) { } void ArchiveBuilder::print_region_stats(FileMapInfo *mapinfo, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info) { + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info) { // Print statistics of all the regions const size_t bitmap_used = mapinfo->region_at(AOTMetaspace::bm)->used(); const size_t bitmap_reserved = mapinfo->region_at(AOTMetaspace::bm)->used_aligned(); diff --git a/src/hotspot/share/cds/archiveBuilder.hpp b/src/hotspot/share/cds/archiveBuilder.hpp index 9de6c02edc5..b3667ea11b4 100644 --- a/src/hotspot/share/cds/archiveBuilder.hpp +++ b/src/hotspot/share/cds/archiveBuilder.hpp @@ -39,8 +39,8 @@ #include "utilities/hashTable.hpp" #include "utilities/resizableHashTable.hpp" -class ArchiveMappedHeapInfo; -class ArchiveStreamedHeapInfo; +class AOTMappedHeapInfo; +class AOTStreamedHeapInfo; class CHeapBitMap; class FileMapInfo; class Klass; @@ -247,8 +247,8 @@ private: } _relocated_ptr_info; void print_region_stats(FileMapInfo *map_info, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info); + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info); void print_bitmap_region_stats(size_t size, size_t total_size); void print_heap_region_stats(char* start, size_t size, size_t total_size); @@ -329,49 +329,22 @@ public: return current()->buffer_to_requested_delta(); } - inline static u4 to_offset_u4(uintx offset) { - guarantee(offset <= MAX_SHARED_DELTA, "must be 32-bit offset " INTPTR_FORMAT, offset); - return (u4)offset; - } - public: - static const uintx MAX_SHARED_DELTA = ArchiveUtils::MAX_SHARED_DELTA;; - // The address p points to an object inside the output buffer. When the archive is mapped // at the requested address, what's the offset of this object from _requested_static_archive_bottom? - uintx buffer_to_offset(address p) const; + size_t buffer_to_offset(address p) const; - // Same as buffer_to_offset, except that the address p points to either (a) an object - // inside the output buffer, or (b), an object in the currently mapped static archive. - uintx any_to_offset(address p) const; + // Same as buffer_to_offset, except that the address p points to one of the following: + // - an object in the ArchiveBuilder's buffer. + // - an object in the currently mapped AOT cache rw/ro regions. + // - an object that has been copied into the ArchiveBuilder's buffer. + size_t any_to_offset(address p) const; // The reverse of buffer_to_offset() - address offset_to_buffered_address(u4 offset) const; + address offset_to_buffered_address(size_t offset) const; template - u4 buffer_to_offset_u4(T p) const { - uintx offset = buffer_to_offset((address)p); - return to_offset_u4(offset); - } - - template - u4 any_to_offset_u4(T p) const { - assert(p != nullptr, "must not be null"); - uintx offset = any_to_offset((address)p); - return to_offset_u4(offset); - } - - template - u4 any_or_null_to_offset_u4(T p) const { - if (p == nullptr) { - return 0; - } else { - return any_to_offset_u4(p); - } - } - - template - T offset_to_buffered(u4 offset) const { + T offset_to_buffered(size_t offset) const { return (T)offset_to_buffered_address(offset); } @@ -438,8 +411,8 @@ public: void make_training_data_shareable(); void relocate_to_requested(); void write_archive(FileMapInfo* mapinfo, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info); + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info); void write_region(FileMapInfo* mapinfo, int region_idx, DumpRegion* dump_region, bool read_only, bool allow_exec); diff --git a/src/hotspot/share/cds/archiveUtils.cpp b/src/hotspot/share/cds/archiveUtils.cpp index 842668509cf..ea9bde8eb8d 100644 --- a/src/hotspot/share/cds/archiveUtils.cpp +++ b/src/hotspot/share/cds/archiveUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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,6 +22,7 @@ * */ +#include "cds/aotCompressedPointers.hpp" #include "cds/aotLogging.hpp" #include "cds/aotMetaspace.hpp" #include "cds/archiveBuilder.hpp" @@ -201,13 +202,13 @@ char* DumpRegion::expand_top_to(char* newtop) { commit_to(newtop); _top = newtop; - if (_max_delta > 0) { + if (ArchiveBuilder::is_active() && ArchiveBuilder::current()->is_in_buffer_space(_base)) { uintx delta = ArchiveBuilder::current()->buffer_to_offset((address)(newtop-1)); - if (delta > _max_delta) { + if (delta > AOTCompressedPointers::MaxMetadataOffsetBytes) { // This is just a sanity check and should not appear in any real world usage. This // happens only if you allocate more than 2GB of shared objects and would require // millions of shared classes. - aot_log_error(aot)("Out of memory in the CDS archive: Please reduce the number of shared classes."); + aot_log_error(aot)("Out of memory in the %s: Please reduce the number of shared classes.", CDSConfig::type_of_archive_being_written()); AOTMetaspace::unrecoverable_writing_error(); } } @@ -311,29 +312,15 @@ void DumpRegion::pack(DumpRegion* next) { } void WriteClosure::do_ptr(void** p) { - // Write ptr into the archive; ptr can be: - // (a) null -> written as 0 - // (b) a "buffered" address -> written as is - // (c) a "source" address -> convert to "buffered" and write - // The common case is (c). E.g., when writing the vmClasses into the archive. - // We have (b) only when we don't have a corresponding source object. E.g., - // the archived c++ vtable entries. address ptr = *(address*)p; - if (ptr != nullptr && !ArchiveBuilder::current()->is_in_buffer_space(ptr)) { - ptr = ArchiveBuilder::current()->get_buffered_addr(ptr); - } - // null pointers do not need to be converted to offsets - if (ptr != nullptr) { - ptr = (address)ArchiveBuilder::current()->buffer_to_offset(ptr); - } - _dump_region->append_intptr_t((intptr_t)ptr, false); + AOTCompressedPointers::narrowPtr narrowp = AOTCompressedPointers::encode(ptr); + _dump_region->append_intptr_t(checked_cast(narrowp), false); } void ReadClosure::do_ptr(void** p) { assert(*p == nullptr, "initializing previous initialized pointer."); - intptr_t obj = nextPtr(); - assert(obj >= 0, "sanity."); - *p = (obj != 0) ? (void*)(_base_address + obj) : (void*)obj; + u4 narrowp = checked_cast(nextPtr()); + *p = AOTCompressedPointers::decode(cast_from_u4(narrowp), _base_address); } void ReadClosure::do_u4(u4* p) { diff --git a/src/hotspot/share/cds/archiveUtils.hpp b/src/hotspot/share/cds/archiveUtils.hpp index 79d894f0144..e5d1efa5eab 100644 --- a/src/hotspot/share/cds/archiveUtils.hpp +++ b/src/hotspot/share/cds/archiveUtils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ -153,7 +153,6 @@ private: char* _base; char* _top; char* _end; - uintx _max_delta; bool _is_packed; ReservedSpace* _rs; VirtualSpace* _vs; @@ -161,9 +160,9 @@ private: void commit_to(char* newtop); public: - DumpRegion(const char* name, uintx max_delta = 0) + DumpRegion(const char* name) : _name(name), _base(nullptr), _top(nullptr), _end(nullptr), - _max_delta(max_delta), _is_packed(false), + _is_packed(false), _rs(nullptr), _vs(nullptr) {} char* expand_top_to(char* newtop); @@ -237,13 +236,13 @@ public: class ReadClosure : public SerializeClosure { private: intptr_t** _ptr_array; - intptr_t _base_address; + address _base_address; inline intptr_t nextPtr() { return *(*_ptr_array)++; } public: - ReadClosure(intptr_t** ptr_array, intptr_t base_address) : + ReadClosure(intptr_t** ptr_array, address base_address) : _ptr_array(ptr_array), _base_address(base_address) {} void do_ptr(void** p); @@ -260,7 +259,6 @@ class ArchiveUtils { template static Array* archive_ptr_array(GrowableArray* tmp_array); public: - static const uintx MAX_SHARED_DELTA = 0x7FFFFFFF; static void log_to_classlist(BootstrapInfo* bootstrap_specifier, TRAPS) NOT_CDS_RETURN; static bool has_aot_initialized_mirror(InstanceKlass* src_ik); @@ -273,50 +271,6 @@ public: static Array* archive_array(GrowableArray* tmp_array) { return archive_ptr_array(tmp_array); } - - // The following functions translate between a u4 offset and an address in the - // the range of the mapped CDS archive (e.g., Metaspace::in_aot_cache()). - // Since the first 16 bytes in this range are dummy data (see ArchiveBuilder::reserve_buffer()), - // we know that offset 0 never represents a valid object. As a result, an offset of 0 - // is used to encode a nullptr. - // - // Use the "archived_address_or_null" variants if a nullptr may be encoded. - - // offset must represent an object of type T in the mapped shared space. Return - // a direct pointer to this object. - template T static offset_to_archived_address(u4 offset) { - assert(offset != 0, "sanity"); - T p = (T)(SharedBaseAddress + offset); - assert(Metaspace::in_aot_cache(p), "must be"); - return p; - } - - template T static offset_to_archived_address_or_null(u4 offset) { - if (offset == 0) { - return nullptr; - } else { - return offset_to_archived_address(offset); - } - } - - // p must be an archived object. Get its offset from SharedBaseAddress - template static u4 archived_address_to_offset(T p) { - uintx pn = (uintx)p; - uintx base = (uintx)SharedBaseAddress; - assert(Metaspace::in_aot_cache(p), "must be"); - assert(pn > base, "sanity"); // No valid object is stored at 0 offset from SharedBaseAddress - uintx offset = pn - base; - assert(offset <= MAX_SHARED_DELTA, "range check"); - return static_cast(offset); - } - - template static u4 archived_address_or_null_to_offset(T p) { - if (p == nullptr) { - return 0; - } else { - return archived_address_to_offset(p); - } - } }; class HeapRootSegments { diff --git a/src/hotspot/share/cds/cppVtables.cpp b/src/hotspot/share/cds/cppVtables.cpp index da68fa70761..dc5a777d7b1 100644 --- a/src/hotspot/share/cds/cppVtables.cpp +++ b/src/hotspot/share/cds/cppVtables.cpp @@ -140,7 +140,7 @@ void CppVtableCloner::initialize(const char* name, CppVtableInfo* info) { // We already checked (and, if necessary, adjusted n) when the vtables were allocated, so we are // safe to do memcpy. - log_debug(aot, vtables)("Copying %3d vtable entries for %s", n, name); + log_debug(aot, vtables)("Copying %3d vtable entries for %s to " INTPTR_FORMAT, n, name, p2i(dstvtable)); memcpy(dstvtable, srcvtable, sizeof(intptr_t) * n); } diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index d39cf3775e4..cd6890555d3 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -25,6 +25,7 @@ #include "cds/aotArtifactFinder.hpp" #include "cds/aotClassLinker.hpp" #include "cds/aotClassLocation.hpp" +#include "cds/aotCompressedPointers.hpp" #include "cds/aotLogging.hpp" #include "cds/aotMetaspace.hpp" #include "cds/archiveBuilder.hpp" @@ -75,13 +76,13 @@ public: return 0; } - u4 a_offset = ArchiveBuilder::current()->any_to_offset_u4(a_name); - u4 b_offset = ArchiveBuilder::current()->any_to_offset_u4(b_name); + u4 a_narrowp = cast_to_u4(AOTCompressedPointers::encode_not_null(a_name)); + u4 b_narrowp = cast_to_u4(AOTCompressedPointers::encode_not_null(b_name)); - if (a_offset < b_offset) { + if (a_narrowp < b_narrowp) { return -1; } else { - assert(a_offset > b_offset, "must be"); + assert(a_narrowp > b_narrowp, "must be"); return 1; } } diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 0eeb96bb269..91fbce701e5 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -298,11 +298,11 @@ void FileMapHeader::print(outputStream* st) { st->print_cr("- compressed_class_ptrs: %d", _compressed_class_ptrs); st->print_cr("- narrow_klass_pointer_bits: %d", _narrow_klass_pointer_bits); st->print_cr("- narrow_klass_shift: %d", _narrow_klass_shift); - st->print_cr("- cloned_vtables_offset: 0x%zx", _cloned_vtables_offset); - st->print_cr("- early_serialized_data_offset: 0x%zx", _early_serialized_data_offset); - st->print_cr("- serialized_data_offset: 0x%zx", _serialized_data_offset); + st->print_cr("- cloned_vtables: %u", cast_to_u4(_cloned_vtables)); + st->print_cr("- early_serialized_data: %u", cast_to_u4(_early_serialized_data)); + st->print_cr("- serialized_data: %u", cast_to_u4(_serialized_data)); st->print_cr("- jvm_ident: %s", _jvm_ident); - st->print_cr("- class_location_config_offset: 0x%zx", _class_location_config_offset); + st->print_cr("- class_location_config: %d", cast_to_u4(_class_location_config)); st->print_cr("- verify_local: %d", _verify_local); st->print_cr("- verify_remote: %d", _verify_remote); st->print_cr("- has_platform_or_app_classes: %d", _has_platform_or_app_classes); @@ -717,8 +717,8 @@ bool FileMapInfo::init_from_file(int fd) { } void FileMapInfo::seek_to_position(size_t pos) { - if (os::lseek(_fd, (long)pos, SEEK_SET) < 0) { - aot_log_error(aot)("Unable to seek to position %zu", pos); + if (os::lseek(_fd, (jlong)pos, SEEK_SET) < 0) { + aot_log_error(aot)("Unable to seek to position %zu (errno=%d: %s)", pos, errno, os::strerror(errno)); AOTMetaspace::unrecoverable_loading_error(); } } @@ -974,8 +974,8 @@ size_t FileMapInfo::remove_bitmap_zeros(CHeapBitMap* map) { char* FileMapInfo::write_bitmap_region(CHeapBitMap* rw_ptrmap, CHeapBitMap* ro_ptrmap, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info, + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info, size_t &size_in_bytes) { size_t removed_rw_leading_zeros = remove_bitmap_zeros(rw_ptrmap); size_t removed_ro_leading_zeros = remove_bitmap_zeros(ro_ptrmap); @@ -1035,7 +1035,7 @@ char* FileMapInfo::write_bitmap_region(CHeapBitMap* rw_ptrmap, } #if INCLUDE_CDS_JAVA_HEAP -size_t FileMapInfo::write_mapped_heap_region(ArchiveMappedHeapInfo* heap_info) { +size_t FileMapInfo::write_mapped_heap_region(AOTMappedHeapInfo* heap_info) { char* buffer_start = heap_info->buffer_start(); size_t buffer_size = heap_info->buffer_byte_size(); write_region(AOTMetaspace::hp, buffer_start, buffer_size, false, false); @@ -1043,7 +1043,7 @@ size_t FileMapInfo::write_mapped_heap_region(ArchiveMappedHeapInfo* heap_info) { return buffer_size; } -size_t FileMapInfo::write_streamed_heap_region(ArchiveStreamedHeapInfo* heap_info) { +size_t FileMapInfo::write_streamed_heap_region(AOTStreamedHeapInfo* heap_info) { char* buffer_start = heap_info->buffer_start(); size_t buffer_size = heap_info->buffer_byte_size(); write_region(AOTMetaspace::hp, buffer_start, buffer_size, true, false); @@ -1325,9 +1325,7 @@ char* FileMapInfo::map_auxiliary_region(int region_index, bool read_only) { if (VerifySharedSpaces && !r->check_region_crc(mapped_base)) { aot_log_error(aot)("region %d CRC error", region_index); - if (!os::unmap_memory(mapped_base, r->used_aligned())) { - fatal("os::unmap_memory of region %d failed", region_index); - } + os::unmap_memory(mapped_base, r->used_aligned()); return nullptr; } @@ -1654,9 +1652,7 @@ void FileMapInfo::unmap_region(int i) { // is released. Zero it so that we don't accidentally read its content. aot_log_info(aot)("Region #%d (%s) is in a reserved space, it will be freed when the space is released", i, shared_region_name[i]); } else { - if (!os::unmap_memory(mapped_base, size)) { - fatal("os::unmap_memory failed"); - } + os::unmap_memory(mapped_base, size); } } r->set_mapped_base(nullptr); @@ -1767,10 +1763,6 @@ void FileMapInfo::print(outputStream* st) const { } } -void FileMapHeader::set_as_offset(char* p, size_t *offset) { - *offset = ArchiveBuilder::current()->any_to_offset((address)p); -} - int FileMapHeader::compute_crc() { char* start = (char*)this; // start computing from the field after _header_size to end of base archive name. diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index fbd3c8e1681..56b88df378a 100644 --- a/src/hotspot/share/cds/filemap.hpp +++ b/src/hotspot/share/cds/filemap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,10 @@ #ifndef SHARE_CDS_FILEMAP_HPP #define SHARE_CDS_FILEMAP_HPP +#include "cds/aotCompressedPointers.hpp" +#include "cds/aotMappedHeap.hpp" #include "cds/aotMetaspace.hpp" +#include "cds/aotStreamedHeap.hpp" #include "cds/archiveUtils.hpp" #include "cds/heapShared.hpp" #include "include/cds.h" @@ -102,7 +105,7 @@ public: class FileMapHeader: private CDSFileMapHeaderBase { friend class CDSConstants; friend class VMStructs; - + using narrowPtr = AOTCompressedPointers::narrowPtr; private: // The following fields record the states of the VM during dump time. // They are compared with the runtime states to see if the archive @@ -120,16 +123,16 @@ private: bool _compressed_class_ptrs; // save the flag UseCompressedClassPointers int _narrow_klass_pointer_bits; // save number of bits in narrowKlass int _narrow_klass_shift; // save shift width used to pre-compute narrowKlass IDs in archived heap objects - size_t _cloned_vtables_offset; // The address of the first cloned vtable - size_t _early_serialized_data_offset; // Data accessed using {ReadClosure,WriteClosure}::serialize() - size_t _serialized_data_offset; // Data accessed using {ReadClosure,WriteClosure}::serialize() + narrowPtr _cloned_vtables; // The address of the first cloned vtable + narrowPtr _early_serialized_data; // Data accessed using {ReadClosure,WriteClosure}::serialize() + narrowPtr _serialized_data; // Data accessed using {ReadClosure,WriteClosure}::serialize() // The following fields are all sanity checks for whether this archive // will function correctly with this JVM and the bootclasspath it's // invoked with. char _jvm_ident[JVM_IDENT_MAX]; // identifier string of the jvm that created this dump - size_t _class_location_config_offset; + narrowPtr _class_location_config; bool _verify_local; // BytecodeVerificationLocal setting bool _verify_remote; // BytecodeVerificationRemote setting @@ -144,8 +147,8 @@ private: size_t _rw_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the rw region size_t _ro_ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the ro region - ArchiveMappedHeapHeader _mapped_heap_header; - ArchiveStreamedHeapHeader _streamed_heap_header; + AOTMappedHeapHeader _mapped_heap_header; + AOTStreamedHeapHeader _streamed_heap_header; // The following are parameters that affect MethodData layout. u1 _compiler_type; @@ -158,12 +161,8 @@ private: bool _type_profile_casts; int _spec_trap_limit_extra_entries; - template T from_mapped_offset(size_t offset) const { - return (T)(mapped_base_address() + offset); - } - void set_as_offset(char* p, size_t *offset); - template void set_as_offset(T p, size_t *offset) { - set_as_offset((char*)p, offset); + template T decode(narrowPtr narrowp) const { + return AOTCompressedPointers::decode_not_null(narrowp, reinterpret_cast
(mapped_base_address())); } public: @@ -191,9 +190,9 @@ public: bool compact_headers() const { return _compact_headers; } uintx max_heap_size() const { return _max_heap_size; } CompressedOops::Mode narrow_oop_mode() const { return _narrow_oop_mode; } - char* cloned_vtables() const { return from_mapped_offset(_cloned_vtables_offset); } - char* early_serialized_data() const { return from_mapped_offset(_early_serialized_data_offset); } - char* serialized_data() const { return from_mapped_offset(_serialized_data_offset); } + char* cloned_vtables() const { return decode(_cloned_vtables); } + char* early_serialized_data() const { return decode(_early_serialized_data); } + char* serialized_data() const { return decode(_serialized_data); } bool object_streaming_mode() const { return _object_streaming_mode; } const char* jvm_ident() const { return _jvm_ident; } char* requested_base_address() const { return _requested_base_address; } @@ -209,16 +208,16 @@ public: size_t ro_ptrmap_start_pos() const { return _ro_ptrmap_start_pos; } // Heap archiving - const ArchiveMappedHeapHeader* mapped_heap() const { return &_mapped_heap_header; } - const ArchiveStreamedHeapHeader* streamed_heap() const { return &_streamed_heap_header; } + const AOTMappedHeapHeader* mapped_heap() const { return &_mapped_heap_header; } + const AOTStreamedHeapHeader* streamed_heap() const { return &_streamed_heap_header; } - void set_streamed_heap_header(ArchiveStreamedHeapHeader header) { _streamed_heap_header = header; } - void set_mapped_heap_header(ArchiveMappedHeapHeader header) { _mapped_heap_header = header; } + void set_streamed_heap_header(AOTStreamedHeapHeader header) { _streamed_heap_header = header; } + void set_mapped_heap_header(AOTMappedHeapHeader header) { _mapped_heap_header = header; } 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); } - void set_early_serialized_data(char* p) { set_as_offset(p, &_early_serialized_data_offset); } - void set_serialized_data(char* p) { set_as_offset(p, &_serialized_data_offset); } + void set_cloned_vtables(char* p) { _cloned_vtables = AOTCompressedPointers::encode_not_null(p); } + void set_early_serialized_data(char* p) { _early_serialized_data = AOTCompressedPointers::encode_not_null(p); } + void set_serialized_data(char* p) { _serialized_data = AOTCompressedPointers::encode_not_null(p); } void set_mapped_base_address(char* p) { _mapped_base_address = p; } void set_rw_ptrmap_start_pos(size_t n) { _rw_ptrmap_start_pos = n; } void set_ro_ptrmap_start_pos(size_t n) { _ro_ptrmap_start_pos = n; } @@ -226,11 +225,11 @@ public: void copy_base_archive_name(const char* name); void set_class_location_config(AOTClassLocationConfig* table) { - set_as_offset(table, &_class_location_config_offset); + _class_location_config = AOTCompressedPointers::encode_not_null(table); } AOTClassLocationConfig* class_location_config() { - return from_mapped_offset(_class_location_config_offset); + return decode(_class_location_config); } void set_requested_base(char* b) { @@ -309,8 +308,8 @@ public: uintx max_heap_size() const { return header()->max_heap_size(); } size_t core_region_alignment() const { return header()->core_region_alignment(); } - const ArchiveMappedHeapHeader* mapped_heap() const { return header()->mapped_heap(); } - const ArchiveStreamedHeapHeader* streamed_heap() const { return header()->streamed_heap(); } + const AOTMappedHeapHeader* mapped_heap() const { return header()->mapped_heap(); } + const AOTStreamedHeapHeader* streamed_heap() const { return header()->streamed_heap(); } bool object_streaming_mode() const { return header()->object_streaming_mode(); } CompressedOops::Mode narrow_oop_mode() const { return header()->narrow_oop_mode(); } @@ -372,11 +371,11 @@ public: size_t remove_bitmap_zeros(CHeapBitMap* map); char* write_bitmap_region(CHeapBitMap* rw_ptrmap, CHeapBitMap* ro_ptrmap, - ArchiveMappedHeapInfo* mapped_heap_info, - ArchiveStreamedHeapInfo* streamed_heap_info, + AOTMappedHeapInfo* mapped_heap_info, + AOTStreamedHeapInfo* streamed_heap_info, size_t &size_in_bytes); - size_t write_mapped_heap_region(ArchiveMappedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0); - size_t write_streamed_heap_region(ArchiveStreamedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0); + size_t write_mapped_heap_region(AOTMappedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0); + size_t write_streamed_heap_region(AOTStreamedHeapInfo* heap_info) NOT_CDS_JAVA_HEAP_RETURN_(0); void write_bytes(const void* buffer, size_t count); void write_bytes_aligned(const void* buffer, size_t count); size_t read_bytes(void* buffer, size_t count); diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index 143f9147853..0c0f70eac0a 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -25,6 +25,7 @@ #include "cds/aotArtifactFinder.hpp" #include "cds/aotClassInitializer.hpp" #include "cds/aotClassLocation.hpp" +#include "cds/aotCompressedPointers.hpp" #include "cds/aotLogging.hpp" #include "cds/aotMappedHeapLoader.hpp" #include "cds/aotMappedHeapWriter.hpp" @@ -95,55 +96,6 @@ struct ArchivableStaticFieldInfo { } }; -// Anything that goes in the header must be thoroughly purged from uninitialized memory -// as it will be written to disk. Therefore, the constructors memset the memory to 0. -// This is not the prettiest thing, but we need to know every byte is initialized, -// including potential padding between fields. - -ArchiveMappedHeapHeader::ArchiveMappedHeapHeader(size_t ptrmap_start_pos, - size_t oopmap_start_pos, - HeapRootSegments root_segments) { - memset((char*)this, 0, sizeof(*this)); - _ptrmap_start_pos = ptrmap_start_pos; - _oopmap_start_pos = oopmap_start_pos; - _root_segments = root_segments; -} - -ArchiveMappedHeapHeader::ArchiveMappedHeapHeader() { - memset((char*)this, 0, sizeof(*this)); -} - -ArchiveMappedHeapHeader ArchiveMappedHeapInfo::create_header() { - return ArchiveMappedHeapHeader{_ptrmap_start_pos, - _oopmap_start_pos, - _root_segments}; -} - -ArchiveStreamedHeapHeader::ArchiveStreamedHeapHeader(size_t forwarding_offset, - size_t roots_offset, - size_t num_roots, - size_t root_highest_object_index_table_offset, - size_t num_archived_objects) { - memset((char*)this, 0, sizeof(*this)); - _forwarding_offset = forwarding_offset; - _roots_offset = roots_offset; - _num_roots = num_roots; - _root_highest_object_index_table_offset = root_highest_object_index_table_offset; - _num_archived_objects = num_archived_objects; -} - -ArchiveStreamedHeapHeader::ArchiveStreamedHeapHeader() { - memset((char*)this, 0, sizeof(*this)); -} - -ArchiveStreamedHeapHeader ArchiveStreamedHeapInfo::create_header() { - return ArchiveStreamedHeapHeader{_forwarding_offset, - _roots_offset, - _num_roots, - _root_highest_object_index_table_offset, - _num_archived_objects}; -} - HeapArchiveMode HeapShared::_heap_load_mode = HeapArchiveMode::_uninitialized; HeapArchiveMode HeapShared::_heap_write_mode = HeapArchiveMode::_uninitialized; @@ -295,6 +247,28 @@ void HeapShared::reset_archived_object_states(TRAPS) { reset_states(boot_loader(), CHECK); } +void HeapShared::ensure_determinism(TRAPS) { + TempNewSymbol class_name = SymbolTable::new_symbol("jdk/internal/util/WeakReferenceKey"); + TempNewSymbol method_name = SymbolTable::new_symbol("ensureDeterministicAOTCache"); + + Klass* weak_ref_key_class = SystemDictionary::resolve_or_fail(class_name, true, CHECK); + precond(weak_ref_key_class != nullptr); + + log_debug(aot)("Calling WeakReferenceKey::ensureDeterministicAOTCache(Object.class)"); + JavaValue result(T_BOOLEAN); + JavaCalls::call_static(&result, + weak_ref_key_class, + method_name, + vmSymbols::void_boolean_signature(), + CHECK); + assert(result.get_jboolean() == false, "sanity"); +} + +void HeapShared::prepare_for_archiving(TRAPS) { + reset_archived_object_states(CHECK); + ensure_determinism(CHECK); +} + HeapShared::ArchivedObjectCache* HeapShared::_archived_object_cache = nullptr; bool HeapShared::is_archived_heap_in_use() { @@ -892,7 +866,7 @@ void HeapShared::end_scanning_for_oops() { delete_seen_objects_table(); } -void HeapShared::write_heap(ArchiveMappedHeapInfo* mapped_heap_info, ArchiveStreamedHeapInfo* streamed_heap_info) { +void HeapShared::write_heap(AOTMappedHeapInfo* mapped_heap_info, AOTStreamedHeapInfo* streamed_heap_info) { { NoSafepointVerifier nsv; CDSHeapVerifier::verify(); @@ -1197,8 +1171,7 @@ public: ArchivedKlassSubGraphInfoRecord* record = HeapShared::archive_subgraph_info(&info); Klass* buffered_k = ArchiveBuilder::get_buffered_klass(klass); unsigned int hash = SystemDictionaryShared::hash_for_shared_dictionary((address)buffered_k); - u4 delta = ArchiveBuilder::current()->any_to_offset_u4(record); - _writer->add(hash, delta); + _writer->add(hash, AOTCompressedPointers::encode_not_null(record)); } return true; // keep on iterating } diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp index 3c7068e96ab..2cb330160e4 100644 --- a/src/hotspot/share/cds/heapShared.hpp +++ b/src/hotspot/share/cds/heapShared.hpp @@ -142,129 +142,6 @@ enum class HeapArchiveMode { _streaming }; -class ArchiveMappedHeapHeader { - size_t _ptrmap_start_pos; // The first bit in the ptrmap corresponds to this position in the heap. - size_t _oopmap_start_pos; // The first bit in the oopmap corresponds to this position in the heap. - HeapRootSegments _root_segments; // Heap root segments info - -public: - ArchiveMappedHeapHeader(); - ArchiveMappedHeapHeader(size_t ptrmap_start_pos, - size_t oopmap_start_pos, - HeapRootSegments root_segments); - - size_t ptrmap_start_pos() const { return _ptrmap_start_pos; } - size_t oopmap_start_pos() const { return _oopmap_start_pos; } - HeapRootSegments root_segments() const { return _root_segments; } - - // This class is trivially copyable and assignable. - ArchiveMappedHeapHeader(const ArchiveMappedHeapHeader&) = default; - ArchiveMappedHeapHeader& operator=(const ArchiveMappedHeapHeader&) = default; -}; - - -class ArchiveStreamedHeapHeader { - size_t _forwarding_offset; // Offset of forwarding information in the heap region. - size_t _roots_offset; // Start position for the roots - size_t _root_highest_object_index_table_offset; // Offset of root dfs depth information - size_t _num_roots; // Number of embedded roots - size_t _num_archived_objects; // The number of archived heap objects - -public: - ArchiveStreamedHeapHeader(); - ArchiveStreamedHeapHeader(size_t forwarding_offset, - size_t roots_offset, - size_t num_roots, - size_t root_highest_object_index_table_offset, - size_t num_archived_objects); - - size_t forwarding_offset() const { return _forwarding_offset; } - size_t roots_offset() const { return _roots_offset; } - size_t num_roots() const { return _num_roots; } - size_t root_highest_object_index_table_offset() const { return _root_highest_object_index_table_offset; } - size_t num_archived_objects() const { return _num_archived_objects; } - - // This class is trivially copyable and assignable. - ArchiveStreamedHeapHeader(const ArchiveStreamedHeapHeader&) = default; - ArchiveStreamedHeapHeader& operator=(const ArchiveStreamedHeapHeader&) = default; -}; - -class ArchiveMappedHeapInfo { - MemRegion _buffer_region; // Contains the archived objects to be written into the CDS archive. - CHeapBitMap _oopmap; - CHeapBitMap _ptrmap; - HeapRootSegments _root_segments; - size_t _oopmap_start_pos; // How many zeros were removed from the beginning of the bit map? - size_t _ptrmap_start_pos; // How many zeros were removed from the beginning of the bit map? - -public: - ArchiveMappedHeapInfo() : - _buffer_region(), - _oopmap(128, mtClassShared), - _ptrmap(128, mtClassShared), - _root_segments(), - _oopmap_start_pos(), - _ptrmap_start_pos() {} - bool is_used() { return !_buffer_region.is_empty(); } - - MemRegion buffer_region() { return _buffer_region; } - void set_buffer_region(MemRegion r) { _buffer_region = r; } - - char* buffer_start() { return (char*)_buffer_region.start(); } - size_t buffer_byte_size() { return _buffer_region.byte_size(); } - - CHeapBitMap* oopmap() { return &_oopmap; } - CHeapBitMap* ptrmap() { return &_ptrmap; } - - void set_oopmap_start_pos(size_t start_pos) { _oopmap_start_pos = start_pos; } - void set_ptrmap_start_pos(size_t start_pos) { _ptrmap_start_pos = start_pos; } - - void set_root_segments(HeapRootSegments segments) { _root_segments = segments; }; - HeapRootSegments root_segments() { return _root_segments; } - - ArchiveMappedHeapHeader create_header(); -}; - -class ArchiveStreamedHeapInfo { - MemRegion _buffer_region; // Contains the archived objects to be written into the CDS archive. - CHeapBitMap _oopmap; - size_t _roots_offset; // Offset of the HeapShared::roots() object, from the bottom - // of the archived heap objects, in bytes. - size_t _num_roots; - - size_t _forwarding_offset; // Offset of forwarding information from the bottom - size_t _root_highest_object_index_table_offset; // Offset to root dfs depth information - size_t _num_archived_objects; // The number of archived objects written into the CDS archive. - -public: - ArchiveStreamedHeapInfo() - : _buffer_region(), - _oopmap(128, mtClassShared), - _roots_offset(), - _forwarding_offset(), - _root_highest_object_index_table_offset(), - _num_archived_objects() {} - - bool is_used() { return !_buffer_region.is_empty(); } - - void set_buffer_region(MemRegion r) { _buffer_region = r; } - MemRegion buffer_region() { return _buffer_region; } - char* buffer_start() { return (char*)_buffer_region.start(); } - size_t buffer_byte_size() { return _buffer_region.byte_size(); } - - CHeapBitMap* oopmap() { return &_oopmap; } - void set_roots_offset(size_t n) { _roots_offset = n; } - size_t roots_offset() { return _roots_offset; } - void set_num_roots(size_t n) { _num_roots = n; } - size_t num_roots() { return _num_roots; } - void set_forwarding_offset(size_t n) { _forwarding_offset = n; } - void set_root_highest_object_index_table_offset(size_t n) { _root_highest_object_index_table_offset = n; } - void set_num_archived_objects(size_t n) { _num_archived_objects = n; } - size_t num_archived_objects() { return _num_archived_objects; } - - ArchiveStreamedHeapHeader create_header(); -}; - class HeapShared: AllStatic { friend class VerifySharedOopClosure; @@ -505,8 +382,10 @@ private: static bool walk_one_object(PendingOopStack* stack, int level, KlassSubGraphInfo* subgraph_info, oop orig_obj, oop referrer); - public: static void reset_archived_object_states(TRAPS); + static void ensure_determinism(TRAPS); + public: + static void prepare_for_archiving(TRAPS); static void create_archived_object_cache() { _archived_object_cache = new (mtClass)ArchivedObjectCache(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE); @@ -575,7 +454,7 @@ private: public: static void finish_materialize_objects() NOT_CDS_JAVA_HEAP_RETURN; - static void write_heap(ArchiveMappedHeapInfo* mapped_heap_info, ArchiveStreamedHeapInfo* streamed_heap_info) NOT_CDS_JAVA_HEAP_RETURN; + static void write_heap(AOTMappedHeapInfo* mapped_heap_info, AOTStreamedHeapInfo* streamed_heap_info) NOT_CDS_JAVA_HEAP_RETURN; static objArrayOop scratch_resolved_references(ConstantPool* src); static void add_scratch_resolved_references(ConstantPool* src, objArrayOop dest) NOT_CDS_JAVA_HEAP_RETURN; static void init_dumping() NOT_CDS_JAVA_HEAP_RETURN; diff --git a/src/hotspot/share/cds/lambdaFormInvokers.cpp b/src/hotspot/share/cds/lambdaFormInvokers.cpp index 19dae28c5b5..3ff5705b79d 100644 --- a/src/hotspot/share/cds/lambdaFormInvokers.cpp +++ b/src/hotspot/share/cds/lambdaFormInvokers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,6 +23,7 @@ */ #include "cds/aotClassFilter.hpp" +#include "cds/aotCompressedPointers.hpp" #include "cds/aotMetaspace.hpp" #include "cds/archiveBuilder.hpp" #include "cds/cdsConfig.hpp" @@ -52,7 +53,7 @@ #include "runtime/mutexLocker.hpp" GrowableArrayCHeap* LambdaFormInvokers::_lambdaform_lines = nullptr; -Array* LambdaFormInvokers::_static_archive_invokers = nullptr; +Array* LambdaFormInvokers::_static_archive_invokers = nullptr; static bool _stop_appending = false; #define NUM_FILTER 4 @@ -252,7 +253,7 @@ void LambdaFormInvokers::dump_static_archive_invokers() { } } if (count > 0) { - _static_archive_invokers = ArchiveBuilder::new_ro_array(count); + _static_archive_invokers = ArchiveBuilder::new_ro_array(count); int index = 0; for (int i = 0; i < len; i++) { char* str = _lambdaform_lines->at(i); @@ -261,7 +262,7 @@ void LambdaFormInvokers::dump_static_archive_invokers() { Array* line = ArchiveBuilder::new_ro_array((int)str_len); strncpy(line->adr_at(0), str, str_len); - _static_archive_invokers->at_put(index, ArchiveBuilder::current()->any_to_offset_u4(line)); + _static_archive_invokers->at_put(index, AOTCompressedPointers::encode_not_null(line)); index++; } } @@ -274,8 +275,8 @@ void LambdaFormInvokers::dump_static_archive_invokers() { void LambdaFormInvokers::read_static_archive_invokers() { if (_static_archive_invokers != nullptr) { for (int i = 0; i < _static_archive_invokers->length(); i++) { - u4 offset = _static_archive_invokers->at(i); - Array* line = ArchiveUtils::offset_to_archived_address*>(offset); + narrowPtr encoded = _static_archive_invokers->at(i); + Array* line = AOTCompressedPointers::decode_not_null*>(encoded); char* str = line->adr_at(0); append(str); } diff --git a/src/hotspot/share/cds/lambdaFormInvokers.hpp b/src/hotspot/share/cds/lambdaFormInvokers.hpp index 583a863a1c2..9b91850f5b1 100644 --- a/src/hotspot/share/cds/lambdaFormInvokers.hpp +++ b/src/hotspot/share/cds/lambdaFormInvokers.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,8 @@ #ifndef SHARE_CDS_LAMBDAFORMINVOKERS_HPP #define SHARE_CDS_LAMBDAFORMINVOKERS_HPP + +#include "cds/aotCompressedPointers.hpp" #include "memory/allStatic.hpp" #include "oops/oopHandle.hpp" #include "runtime/handles.hpp" @@ -35,10 +37,11 @@ class Array; class SerializeClosure; class LambdaFormInvokers : public AllStatic { + using narrowPtr = AOTCompressedPointers::narrowPtr; private: static GrowableArrayCHeap* _lambdaform_lines; // For storing LF form lines (LF_RESOLVE only) in read only table. - static Array* _static_archive_invokers; + static Array* _static_archive_invokers; static void regenerate_class(char* name, ClassFileStream& st, TRAPS); public: static void append(char* line); diff --git a/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp b/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp index d091067c116..4d212dbf2c2 100644 --- a/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp +++ b/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,6 +23,7 @@ */ #include "cds/aotClassFilter.hpp" +#include "cds/aotCompressedPointers.hpp" #include "cds/archiveBuilder.hpp" #include "cds/cdsConfig.hpp" #include "cds/cdsProtectionDomain.hpp" @@ -49,11 +50,11 @@ unsigned int LambdaProxyClassKey::hash() const { } unsigned int RunTimeLambdaProxyClassKey::hash() const { - return primitive_hash(_caller_ik) + - primitive_hash(_invoked_name) + - primitive_hash(_invoked_type) + - primitive_hash(_method_type) + - primitive_hash(_instantiated_method_type); + return primitive_hash(cast_to_u4(_caller_ik)) + + primitive_hash(cast_to_u4(_invoked_name)) + + primitive_hash(cast_to_u4(_invoked_type)) + + primitive_hash(cast_to_u4(_method_type)) + + primitive_hash(cast_to_u4(_instantiated_method_type)); } #ifndef PRODUCT @@ -71,12 +72,12 @@ void LambdaProxyClassKey::print_on(outputStream* st) const { void RunTimeLambdaProxyClassKey::print_on(outputStream* st) const { ResourceMark rm; st->print_cr("LambdaProxyClassKey : " INTPTR_FORMAT " hash: %0x08x", p2i(this), hash()); - st->print_cr("_caller_ik : %d", _caller_ik); - st->print_cr("_instantiated_method_type : %d", _instantiated_method_type); - st->print_cr("_invoked_name : %d", _invoked_name); - st->print_cr("_invoked_type : %d", _invoked_type); - st->print_cr("_member_method : %d", _member_method); - st->print_cr("_method_type : %d", _method_type); + st->print_cr("_caller_ik : %d", cast_to_u4(_caller_ik)); + st->print_cr("_instantiated_method_type : %d", cast_to_u4(_instantiated_method_type)); + st->print_cr("_invoked_name : %d", cast_to_u4(_invoked_name)); + st->print_cr("_invoked_type : %d", cast_to_u4(_invoked_type)); + st->print_cr("_member_method : %d", cast_to_u4(_member_method)); + st->print_cr("_method_type : %d", cast_to_u4(_method_type)); } void RunTimeLambdaProxyClassInfo::print_on(outputStream* st) const { @@ -418,8 +419,7 @@ public: (RunTimeLambdaProxyClassInfo*)ArchiveBuilder::ro_region_alloc(byte_size); runtime_info->init(key, info); unsigned int hash = runtime_info->hash(); - u4 delta = _builder->any_to_offset_u4((void*)runtime_info); - _writer->add(hash, delta); + _writer->add(hash, AOTCompressedPointers::encode_not_null(runtime_info)); return true; } }; diff --git a/src/hotspot/share/cds/lambdaProxyClassDictionary.hpp b/src/hotspot/share/cds/lambdaProxyClassDictionary.hpp index 91e508bfdc5..dfb75532917 100644 --- a/src/hotspot/share/cds/lambdaProxyClassDictionary.hpp +++ b/src/hotspot/share/cds/lambdaProxyClassDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,8 +25,9 @@ #ifndef SHARE_CDS_LAMBDAPROXYCLASSINFO_HPP #define SHARE_CDS_LAMBDAPROXYCLASSINFO_HPP +#include "cds/aotCompressedPointers.hpp" #include "cds/aotMetaspace.hpp" -#include "cds/archiveBuilder.hpp" +#include "classfile/compactHashtable.hpp" #include "classfile/javaClasses.hpp" #include "memory/metaspaceClosure.hpp" #include "utilities/growableArray.hpp" @@ -132,19 +133,20 @@ public: }; class RunTimeLambdaProxyClassKey { - u4 _caller_ik; - u4 _invoked_name; - u4 _invoked_type; - u4 _method_type; - u4 _member_method; - u4 _instantiated_method_type; + using narrowPtr = AOTCompressedPointers::narrowPtr; + narrowPtr _caller_ik; + narrowPtr _invoked_name; + narrowPtr _invoked_type; + narrowPtr _method_type; + narrowPtr _member_method; + narrowPtr _instantiated_method_type; - RunTimeLambdaProxyClassKey(u4 caller_ik, - u4 invoked_name, - u4 invoked_type, - u4 method_type, - u4 member_method, - u4 instantiated_method_type) : + RunTimeLambdaProxyClassKey(narrowPtr caller_ik, + narrowPtr invoked_name, + narrowPtr invoked_type, + narrowPtr method_type, + narrowPtr member_method, + narrowPtr instantiated_method_type) : _caller_ik(caller_ik), _invoked_name(invoked_name), _invoked_type(invoked_type), @@ -154,15 +156,12 @@ class RunTimeLambdaProxyClassKey { public: static RunTimeLambdaProxyClassKey init_for_dumptime(LambdaProxyClassKey& key) { - assert(ArchiveBuilder::is_active(), "sanity"); - ArchiveBuilder* b = ArchiveBuilder::current(); - - u4 caller_ik = b->any_to_offset_u4(key.caller_ik()); - u4 invoked_name = b->any_to_offset_u4(key.invoked_name()); - u4 invoked_type = b->any_to_offset_u4(key.invoked_type()); - u4 method_type = b->any_to_offset_u4(key.method_type()); - u4 member_method = b->any_or_null_to_offset_u4(key.member_method()); // could be null - u4 instantiated_method_type = b->any_to_offset_u4(key.instantiated_method_type()); + narrowPtr caller_ik = AOTCompressedPointers::encode_not_null(key.caller_ik()); + narrowPtr invoked_name = AOTCompressedPointers::encode_not_null(key.invoked_name()); + narrowPtr invoked_type = AOTCompressedPointers::encode_not_null(key.invoked_type()); + narrowPtr method_type = AOTCompressedPointers::encode_not_null(key.method_type()); + narrowPtr member_method = AOTCompressedPointers::encode(key.member_method()); // could be null + narrowPtr instantiated_method_type = AOTCompressedPointers::encode_not_null(key.instantiated_method_type()); return RunTimeLambdaProxyClassKey(caller_ik, invoked_name, invoked_type, method_type, member_method, instantiated_method_type); @@ -176,12 +175,12 @@ public: Symbol* instantiated_method_type) { // All parameters must be in shared space, or else you'd get an assert in // ArchiveUtils::to_offset(). - return RunTimeLambdaProxyClassKey(ArchiveUtils::archived_address_to_offset(caller_ik), - ArchiveUtils::archived_address_to_offset(invoked_name), - ArchiveUtils::archived_address_to_offset(invoked_type), - ArchiveUtils::archived_address_to_offset(method_type), - ArchiveUtils::archived_address_or_null_to_offset(member_method), // could be null - ArchiveUtils::archived_address_to_offset(instantiated_method_type)); + return RunTimeLambdaProxyClassKey(AOTCompressedPointers::encode_address_in_cache(caller_ik), + AOTCompressedPointers::encode_address_in_cache(invoked_name), + AOTCompressedPointers::encode_address_in_cache(invoked_type), + AOTCompressedPointers::encode_address_in_cache(method_type), + AOTCompressedPointers::encode_address_in_cache_or_null(member_method), // could be null + AOTCompressedPointers::encode_address_in_cache(instantiated_method_type)); } unsigned int hash() const; diff --git a/src/hotspot/share/cds/runTimeClassInfo.cpp b/src/hotspot/share/cds/runTimeClassInfo.cpp index fe940ca6c18..a1f50ab4ffa 100644 --- a/src/hotspot/share/cds/runTimeClassInfo.cpp +++ b/src/hotspot/share/cds/runTimeClassInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,15 +22,15 @@ * */ +#include "cds/aotCompressedPointers.hpp" #include "cds/archiveBuilder.hpp" #include "cds/dumpTimeClassInfo.hpp" #include "cds/runTimeClassInfo.hpp" #include "classfile/systemDictionaryShared.hpp" void RunTimeClassInfo::init(DumpTimeClassInfo& info) { - ArchiveBuilder* builder = ArchiveBuilder::current(); InstanceKlass* k = info._klass; - _klass_offset = builder->any_to_offset_u4(k); + _klass = AOTCompressedPointers::encode_not_null(k); if (!SystemDictionaryShared::is_builtin(k)) { CrcInfo* c = crc(); @@ -50,8 +50,8 @@ void RunTimeClassInfo::init(DumpTimeClassInfo& info) { RTVerifierConstraint* vf_constraints = verifier_constraints(); char* flags = verifier_constraint_flags(); for (i = 0; i < _num_verifier_constraints; i++) { - vf_constraints[i]._name = builder->any_to_offset_u4(info._verifier_constraints->at(i).name()); - vf_constraints[i]._from_name = builder->any_or_null_to_offset_u4(info._verifier_constraints->at(i).from_name()); + vf_constraints[i]._name = AOTCompressedPointers::encode_not_null(info._verifier_constraints->at(i).name()); + vf_constraints[i]._from_name = AOTCompressedPointers::encode(info._verifier_constraints->at(i).from_name()); } for (i = 0; i < _num_verifier_constraints; i++) { flags[i] = info._verifier_constraint_flags->at(i); @@ -61,14 +61,14 @@ void RunTimeClassInfo::init(DumpTimeClassInfo& info) { if (_num_loader_constraints > 0) { RTLoaderConstraint* ld_constraints = loader_constraints(); for (i = 0; i < _num_loader_constraints; i++) { - ld_constraints[i]._name = builder->any_to_offset_u4(info._loader_constraints->at(i).name()); + ld_constraints[i]._name = AOTCompressedPointers::encode_not_null(info._loader_constraints->at(i).name()); ld_constraints[i]._loader_type1 = info._loader_constraints->at(i).loader_type1(); ld_constraints[i]._loader_type2 = info._loader_constraints->at(i).loader_type2(); } } if (k->is_hidden() && info.nest_host() != nullptr) { - _nest_host_offset = builder->any_to_offset_u4(info.nest_host()); + _nest_host = AOTCompressedPointers::encode_not_null(info.nest_host()); } if (k->has_archived_enum_objs()) { int num = info.num_enum_klass_static_fields(); @@ -83,11 +83,12 @@ void RunTimeClassInfo::init(DumpTimeClassInfo& info) { InstanceKlass* RunTimeClassInfo::klass() const { if (AOTMetaspace::in_aot_cache(this)) { // is inside a mmaped CDS archive. - return ArchiveUtils::offset_to_archived_address(_klass_offset); + return AOTCompressedPointers::decode_not_null(_klass); } else { // is a temporary copy of a RunTimeClassInfo that's being initialized // by the ArchiveBuilder. - return ArchiveBuilder::current()->offset_to_buffered(_klass_offset); + size_t byte_offset = AOTCompressedPointers::get_byte_offset(_klass); + return ArchiveBuilder::current()->offset_to_buffered(byte_offset); } } diff --git a/src/hotspot/share/cds/runTimeClassInfo.hpp b/src/hotspot/share/cds/runTimeClassInfo.hpp index 371924f9065..d63a04698bb 100644 --- a/src/hotspot/share/cds/runTimeClassInfo.hpp +++ b/src/hotspot/share/cds/runTimeClassInfo.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 @@ #ifndef SHARE_CDS_RUNTIMECLASSINFO_HPP #define SHARE_CDS_RUNTIMECLASSINFO_HPP +#include "cds/aotCompressedPointers.hpp" #include "cds/aotMetaspace.hpp" #include "cds/archiveBuilder.hpp" #include "cds/archiveUtils.hpp" @@ -41,8 +42,10 @@ class Method; class Symbol; class RunTimeClassInfo { - public: - enum : char { + using narrowPtr = AOTCompressedPointers::narrowPtr; + +public: + enum : char { FROM_FIELD_IS_PROTECTED = 1 << 0, FROM_IS_ARRAY = 1 << 1, FROM_IS_OBJECT = 1 << 2 @@ -56,19 +59,19 @@ class RunTimeClassInfo { // This is different than DumpTimeClassInfo::DTVerifierConstraint. We use // u4 instead of Symbol* to save space on 64-bit CPU. struct RTVerifierConstraint { - u4 _name; - u4 _from_name; - Symbol* name() { return ArchiveUtils::offset_to_archived_address(_name); } + narrowPtr _name; + narrowPtr _from_name; + Symbol* name() { return AOTCompressedPointers::decode_not_null(_name); } Symbol* from_name() { - return (_from_name == 0) ? nullptr : ArchiveUtils::offset_to_archived_address(_from_name); + return AOTCompressedPointers::decode(_from_name); } }; struct RTLoaderConstraint { - u4 _name; + narrowPtr _name; char _loader_type1; char _loader_type2; - Symbol* constraint_name() { return ArchiveUtils::offset_to_archived_address(_name); } + Symbol* constraint_name() { return AOTCompressedPointers::decode_not_null(_name); } }; struct RTEnumKlassStaticFields { int _num; @@ -76,8 +79,8 @@ class RunTimeClassInfo { }; private: - u4 _klass_offset; - u4 _nest_host_offset; + narrowPtr _klass; + narrowPtr _nest_host; int _num_verifier_constraints; int _num_loader_constraints; @@ -185,7 +188,7 @@ public: InstanceKlass* nest_host() { assert(!ArchiveBuilder::is_active(), "not called when dumping archive"); - return ArchiveUtils::offset_to_archived_address_or_null(_nest_host_offset); + return AOTCompressedPointers::decode(_nest_host); // may be null } RTLoaderConstraint* loader_constraints() { diff --git a/src/hotspot/share/ci/ciField.cpp b/src/hotspot/share/ci/ciField.cpp index e0c818f02fc..946fea5346f 100644 --- a/src/hotspot/share/ci/ciField.cpp +++ b/src/hotspot/share/ci/ciField.cpp @@ -213,7 +213,7 @@ ciField::ciField(fieldDescriptor *fd) : "bootstrap classes must not create & cache unshared fields"); } -static bool trust_final_non_static_fields(ciInstanceKlass* holder) { +static bool trust_final_nonstatic_fields(ciInstanceKlass* holder) { if (holder == nullptr) return false; if (holder->trust_final_fields()) { @@ -259,7 +259,7 @@ void ciField::initialize_from(fieldDescriptor* fd) { // An instance field can be constant if it's a final static field or if // it's a final non-static field of a trusted class (classes in // java.lang.invoke and sun.invoke packages and subpackages). - _is_constant = is_stable_field || trust_final_non_static_fields(_holder); + _is_constant = is_stable_field || trust_final_nonstatic_fields(_holder); } } else { // For CallSite objects treat the target field as a compile time constant. diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp index 33bcabc4566..6243258acd9 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.cpp +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp @@ -392,7 +392,7 @@ bool ciInstanceKlass::contains_field_offset(int offset) { return get_instanceKlass()->contains_field_offset(offset); } -ciField* ciInstanceKlass::get_non_static_field_by_offset(const int field_offset) { +ciField* ciInstanceKlass::get_nonstatic_field_by_offset(const int field_offset) { for (int i = 0, len = nof_nonstatic_fields(); i < len; i++) { ciField* field = _nonstatic_fields->at(i); int field_off = field->offset_in_bytes(); @@ -406,7 +406,7 @@ ciField* ciInstanceKlass::get_non_static_field_by_offset(const int field_offset) // ciInstanceKlass::get_field_by_offset ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) { if (!is_static) { - return get_non_static_field_by_offset(field_offset); + return get_nonstatic_field_by_offset(field_offset); } VM_ENTRY_MARK; InstanceKlass* k = get_instanceKlass(); @@ -437,7 +437,7 @@ ciField* ciInstanceKlass::get_field_by_name(ciSymbol* name, ciSymbol* signature, // except this does not require allocating memory for a new ciField BasicType ciInstanceKlass::get_field_type_by_offset(const int field_offset, const bool is_static) { if (!is_static) { - ciField* field = get_non_static_field_by_offset(field_offset); + ciField* field = get_nonstatic_field_by_offset(field_offset); return field != nullptr ? field->layout_type() : T_ILLEGAL; } diff --git a/src/hotspot/share/ci/ciInstanceKlass.hpp b/src/hotspot/share/ci/ciInstanceKlass.hpp index 8ccf1fadfb7..a84c63981c9 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.hpp +++ b/src/hotspot/share/ci/ciInstanceKlass.hpp @@ -83,7 +83,7 @@ private: bool compute_injected_fields_helper(); void compute_transitive_interfaces(); - ciField* get_non_static_field_by_offset(int field_offset); + ciField* get_nonstatic_field_by_offset(int field_offset); protected: ciInstanceKlass(Klass* k); diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 817d0c64d11..c1f00cbe536 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1017,7 +1017,8 @@ public: }; -static int skip_annotation_value(const u1*, int, int); // fwd decl +static int skip_annotation_value(const u1* buffer, int limit, int index, int recursion_depth); // fwd decl +static const int max_recursion_depth = 5; // Safely increment index by val if does not pass limit #define SAFE_ADD(index, limit, val) \ @@ -1025,23 +1026,29 @@ if (index >= limit - val) return limit; \ index += val; // Skip an annotation. Return >=limit if there is any problem. -static int skip_annotation(const u1* buffer, int limit, int index) { +static int skip_annotation(const u1* buffer, int limit, int index, int recursion_depth = 0) { assert(buffer != nullptr, "invariant"); + if (recursion_depth > max_recursion_depth) { + return limit; + } // annotation := atype:u2 do(nmem:u2) {member:u2 value} // value := switch (tag:u1) { ... } SAFE_ADD(index, limit, 4); // skip atype and read nmem int nmem = Bytes::get_Java_u2((address)buffer + index - 2); while (--nmem >= 0 && index < limit) { SAFE_ADD(index, limit, 2); // skip member - index = skip_annotation_value(buffer, limit, index); + index = skip_annotation_value(buffer, limit, index, recursion_depth + 1); } return index; } // Skip an annotation value. Return >=limit if there is any problem. -static int skip_annotation_value(const u1* buffer, int limit, int index) { +static int skip_annotation_value(const u1* buffer, int limit, int index, int recursion_depth) { assert(buffer != nullptr, "invariant"); + if (recursion_depth > max_recursion_depth) { + return limit; + } // value := switch (tag:u1) { // case B, C, I, S, Z, D, F, J, c: con:u2; // case e: e_class:u2 e_name:u2; @@ -1073,12 +1080,12 @@ static int skip_annotation_value(const u1* buffer, int limit, int index) { SAFE_ADD(index, limit, 2); // read nval int nval = Bytes::get_Java_u2((address)buffer + index - 2); while (--nval >= 0 && index < limit) { - index = skip_annotation_value(buffer, limit, index); + index = skip_annotation_value(buffer, limit, index, recursion_depth + 1); } } break; case '@': - index = skip_annotation(buffer, limit, index); + index = skip_annotation(buffer, limit, index, recursion_depth + 1); break; default: return limit; // bad tag byte diff --git a/src/hotspot/share/classfile/compactHashtable.cpp b/src/hotspot/share/classfile/compactHashtable.cpp index 6808ae7bb8f..de67971c403 100644 --- a/src/hotspot/share/classfile/compactHashtable.cpp +++ b/src/hotspot/share/classfile/compactHashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -96,14 +96,16 @@ void CompactHashtableWriter::allocate_table() { "Too many entries."); } - _compact_buckets = ArchiveBuilder::new_ro_array(_num_buckets + 1); - _compact_entries = ArchiveBuilder::new_ro_array(entries_space); + _num_compact_buckets = checked_cast(_num_buckets + 1); // extra slot for TABLEEND_BUCKET_TYPE + _num_compact_entries = checked_cast(entries_space); + _compact_buckets = (u4*)ArchiveBuilder::ro_region_alloc(_num_compact_buckets * sizeof(u4)); + _compact_entries = (u4*)ArchiveBuilder::ro_region_alloc(_num_compact_entries * sizeof(u4)); _stats->bucket_count = _num_buckets; - _stats->bucket_bytes = align_up(_compact_buckets->size() * BytesPerWord, + _stats->bucket_bytes = align_up(checked_cast(_num_compact_buckets * sizeof(u4)), SharedSpaceObjectAlignment); _stats->hashentry_count = _num_entries_written; - _stats->hashentry_bytes = align_up(_compact_entries->size() * BytesPerWord, + _stats->hashentry_bytes = align_up(checked_cast(_num_compact_entries * sizeof(u4)), SharedSpaceObjectAlignment); } @@ -114,21 +116,21 @@ void CompactHashtableWriter::dump_table(NumberSeq* summary) { GrowableArray* bucket = _buckets[index]; int bucket_size = bucket->length(); if (bucket_size == 1) { - _compact_buckets->at_put(index, BUCKET_INFO(offset, VALUE_ONLY_BUCKET_TYPE)); + compact_buckets_set(index, BUCKET_INFO(offset, VALUE_ONLY_BUCKET_TYPE)); Entry ent = bucket->at(0); // bucket with one entry is value_only and only has the encoded_value - _compact_entries->at_put(offset++, ent.encoded_value()); + compact_entries_set(offset++, ent.encoded_value()); _num_value_only_buckets++; } else { // regular bucket, it could contain zero or more than one entry, // each entry is a pair - _compact_buckets->at_put(index, BUCKET_INFO(offset, REGULAR_BUCKET_TYPE)); + compact_buckets_set(index, BUCKET_INFO(offset, REGULAR_BUCKET_TYPE)); for (int i=0; iat(i); - _compact_entries->at_put(offset++, u4(ent.hash())); // write entry hash - _compact_entries->at_put(offset++, ent.encoded_value()); // write entry encoded_value + compact_entries_set(offset++, u4(ent.hash())); // write entry hash + compact_entries_set(offset++, ent.encoded_value()); // write entry encoded_value } if (bucket_size == 0) { _num_empty_buckets++; @@ -140,10 +142,19 @@ void CompactHashtableWriter::dump_table(NumberSeq* summary) { } // Mark the end of the buckets - _compact_buckets->at_put(_num_buckets, BUCKET_INFO(offset, TABLEEND_BUCKET_TYPE)); - assert(offset == (u4)_compact_entries->length(), "sanity"); + compact_buckets_set(_num_buckets, BUCKET_INFO(offset, TABLEEND_BUCKET_TYPE)); + assert(offset == checked_cast(_num_compact_entries), "sanity"); } +void CompactHashtableWriter::compact_buckets_set(u4 index, u4 value) { + precond(index < _num_compact_buckets); + _compact_buckets[index] = value; +} + +void CompactHashtableWriter::compact_entries_set(u4 index, u4 value) { + precond(index < _num_compact_entries); + _compact_entries[index] = value; +} // Write the compact table void CompactHashtableWriter::dump(SimpleCompactHashtable *cht, const char* table_name) { @@ -154,7 +165,7 @@ void CompactHashtableWriter::dump(SimpleCompactHashtable *cht, const char* table int table_bytes = _stats->bucket_bytes + _stats->hashentry_bytes; address base_address = address(SharedBaseAddress); cht->init(base_address, _num_entries_written, _num_buckets, - _compact_buckets->data(), _compact_entries->data()); + _compact_buckets, _compact_entries); LogMessage(aot, hashtables) msg; if (msg.is_info()) { diff --git a/src/hotspot/share/classfile/compactHashtable.hpp b/src/hotspot/share/classfile/compactHashtable.hpp index 944fb876521..81f2951289d 100644 --- a/src/hotspot/share/classfile/compactHashtable.hpp +++ b/src/hotspot/share/classfile/compactHashtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ #ifndef SHARE_CLASSFILE_COMPACTHASHTABLE_HPP #define SHARE_CLASSFILE_COMPACTHASHTABLE_HPP +#include "cds/aotCompressedPointers.hpp" #include "cds/cds_globals.hpp" #include "oops/array.hpp" #include "oops/symbol.hpp" @@ -114,8 +115,13 @@ private: int _num_other_buckets; GrowableArray** _buckets; CompactHashtableStats* _stats; - Array* _compact_buckets; - Array* _compact_entries; + u4* _compact_buckets; + size_t _num_compact_buckets; + u4* _compact_entries; + size_t _num_compact_entries; + + void compact_buckets_set(u4 index, u4 value); + void compact_entries_set(u4 index, u4 value); public: // This is called at dump-time only @@ -123,6 +129,9 @@ public: ~CompactHashtableWriter(); void add(unsigned int hash, u4 encoded_value); + void add(unsigned int hash, AOTCompressedPointers::narrowPtr encoded_value) { + add(hash, cast_to_u4(encoded_value)); + } void dump(SimpleCompactHashtable *cht, const char* table_name); private: @@ -371,11 +380,11 @@ public: // // OffsetCompactHashtable -- This is used to store many types of objects // in the CDS archive. On 64-bit platforms, we save space by using a 32-bit -// offset from the CDS base address. +// narrowPtr from the CDS base address. template -inline V read_value_from_compact_hashtable(address base_address, u4 offset) { - return (V)(base_address + offset); +inline V read_value_from_compact_hashtable(address base_address, u4 narrowp) { + return AOTCompressedPointers::decode_not_null(cast_from_u4(narrowp), base_address); } template < diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index c6b0fcb90e0..ef1eeec14dd 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -1925,16 +1925,13 @@ oop java_lang_Thread::async_get_stack_trace(jobject jthread, TRAPS) { public: const Handle _thread_h; int _depth; - GrowableArray* _methods; - GrowableArray* _bcis; + enum InitLength { len = 64 }; // Minimum length that covers most cases + GrowableArrayCHeap _methods; + GrowableArrayCHeap _bcis; GetStackTraceHandshakeClosure(Handle thread_h) : HandshakeClosure("GetStackTraceHandshakeClosure"), _thread_h(thread_h), _depth(0), - _methods(nullptr), _bcis(nullptr) { - } - ~GetStackTraceHandshakeClosure() { - delete _methods; - delete _bcis; + _methods(InitLength::len), _bcis(InitLength::len) { } void do_thread(Thread* th) { @@ -1950,11 +1947,6 @@ oop java_lang_Thread::async_get_stack_trace(jobject jthread, TRAPS) { const int max_depth = MaxJavaStackTraceDepth; const bool skip_hidden = !ShowHiddenFrames; - // Pick minimum length that will cover most cases - int init_length = 64; - _methods = new (mtInternal) GrowableArray(init_length, mtInternal); - _bcis = new (mtInternal) GrowableArray(init_length, mtInternal); - int total_count = 0; vframeStream vfst(java_thread != nullptr ? vframeStream(java_thread, false, false, vthread_carrier) // we don't process frames as we don't care about oops @@ -1968,8 +1960,8 @@ oop java_lang_Thread::async_get_stack_trace(jobject jthread, TRAPS) { continue; } - _methods->push(vfst.method()); - _bcis->push(vfst.bci()); + _methods.push(vfst.method()); + _bcis.push(vfst.bci()); total_count++; } @@ -2001,9 +1993,9 @@ oop java_lang_Thread::async_get_stack_trace(jobject jthread, TRAPS) { objArrayHandle trace = oopFactory::new_objArray_handle(k, gsthc._depth, CHECK_NULL); for (int i = 0; i < gsthc._depth; i++) { - methodHandle method(THREAD, gsthc._methods->at(i)); + methodHandle method(THREAD, gsthc._methods.at(i)); oop element = java_lang_StackTraceElement::create(method, - gsthc._bcis->at(i), + gsthc._bcis.at(i), CHECK_NULL); trace->obj_at_put(i, element); } diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp index c49aa10fa0d..20aa7f0776d 100644 --- a/src/hotspot/share/classfile/symbolTable.cpp +++ b/src/hotspot/share/classfile/symbolTable.cpp @@ -22,6 +22,7 @@ * */ +#include "cds/aotCompressedPointers.hpp" #include "cds/archiveBuilder.hpp" #include "cds/cdsConfig.hpp" #include "cds/dynamicArchive.hpp" @@ -690,7 +691,7 @@ void SymbolTable::copy_shared_symbol_table(GrowableArray* symbols, assert(fixed_hash == hash_symbol((const char*)sym->bytes(), sym->utf8_length(), false), "must not rehash during dumping"); sym->set_permanent(); - writer->add(fixed_hash, builder->buffer_to_offset_u4((address)sym)); + writer->add(fixed_hash, AOTCompressedPointers::encode_not_null(sym)); } } diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index afc190c36cf..cfb20412ab8 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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 @@ #include "cds/aotClassFilter.hpp" #include "cds/aotClassLocation.hpp" +#include "cds/aotCompressedPointers.hpp" #include "cds/aotLogging.hpp" #include "cds/aotMetaspace.hpp" #include "cds/archiveBuilder.hpp" @@ -1282,11 +1283,10 @@ unsigned int SystemDictionaryShared::hash_for_shared_dictionary(address ptr) { class CopySharedClassInfoToArchive : StackObj { CompactHashtableWriter* _writer; bool _is_builtin; - ArchiveBuilder *_builder; public: CopySharedClassInfoToArchive(CompactHashtableWriter* writer, bool is_builtin) - : _writer(writer), _is_builtin(is_builtin), _builder(ArchiveBuilder::current()) {} + : _writer(writer), _is_builtin(is_builtin) {} void do_entry(InstanceKlass* k, DumpTimeClassInfo& info) { if (!info.is_excluded() && info.is_builtin() == _is_builtin) { @@ -1299,11 +1299,10 @@ public: Symbol* name = info._klass->name(); name = ArchiveBuilder::current()->get_buffered_addr(name); hash = SystemDictionaryShared::hash_for_shared_dictionary((address)name); - u4 delta = _builder->buffer_to_offset_u4((address)record); if (_is_builtin && info._klass->is_hidden()) { // skip } else { - _writer->add(hash, delta); + _writer->add(hash, AOTCompressedPointers::encode_not_null(record)); } if (log_is_enabled(Trace, aot, hashtables)) { ResourceMark rm; diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp index 30f147b9ae7..76d09161fdd 100644 --- a/src/hotspot/share/classfile/verifier.cpp +++ b/src/hotspot/share/classfile/verifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -620,9 +620,6 @@ TypeOrigin ClassVerifier::ref_ctx(const char* sig) { void ClassVerifier::verify_class(TRAPS) { log_info(verification)("Verifying class %s with new format", _klass->external_name()); - // Either verifying both local and remote classes or just remote classes. - assert(BytecodeVerificationRemote, "Should not be here"); - Array* methods = _klass->methods(); int num_methods = methods->length(); diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index 75592fd61c8..67817682ced 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -257,6 +257,7 @@ class methodHandle; do_intrinsic(_bitCount_i, java_lang_Integer, bitCount_name, int_int_signature, F_S) \ do_intrinsic(_bitCount_l, java_lang_Long, bitCount_name, long_int_signature, F_S) \ do_intrinsic(_compress_i, java_lang_Integer, compress_name, int2_int_signature, F_S) \ + do_name( compress_name, "compress") \ do_intrinsic(_compress_l, java_lang_Long, compress_name, long2_long_signature, F_S) \ do_intrinsic(_expand_i, java_lang_Integer, expand_name, int2_int_signature, F_S) \ do_intrinsic(_expand_l, java_lang_Long, expand_name, long2_long_signature, F_S) \ @@ -358,11 +359,11 @@ class methodHandle; do_name( vectorizedHashCode_name, "vectorizedHashCode") \ do_signature(vectorizedHashCode_signature, "(Ljava/lang/Object;IIII)I") \ \ - do_intrinsic(_compressStringC, java_lang_StringUTF16, compress_name, encodeISOArray_signature, F_S) \ - do_name( compress_name, "compress") \ - do_intrinsic(_compressStringB, java_lang_StringUTF16, compress_name, indexOfI_signature, F_S) \ + do_intrinsic(_compressStringC, java_lang_StringUTF16, compressString_name, encodeISOArray_signature, F_S) \ + do_name( compressString_name, "compress0") \ + do_intrinsic(_compressStringB, java_lang_StringUTF16, compressString_name, indexOfI_signature, F_S) \ do_intrinsic(_inflateStringC, java_lang_StringLatin1, inflate_name, inflateC_signature, F_S) \ - do_name( inflate_name, "inflate") \ + do_name( inflate_name, "inflate0") \ do_signature(inflateC_signature, "([BI[CII)V") \ do_intrinsic(_inflateStringB, java_lang_StringLatin1, inflate_name, inflateB_signature, F_S) \ do_signature(inflateB_signature, "([BI[BII)V") \ @@ -381,9 +382,9 @@ class methodHandle; do_intrinsic(_compareToLU, java_lang_StringLatin1,compareToLU_name, compareTo_indexOf_signature, F_S) \ do_intrinsic(_compareToUL, java_lang_StringUTF16, compareToUL_name, compareTo_indexOf_signature, F_S) \ do_signature(compareTo_indexOf_signature, "([B[B)I") \ - do_name( compareTo_name, "compareTo") \ - do_name( compareToLU_name, "compareToUTF16") \ - do_name( compareToUL_name, "compareToLatin1") \ + do_name( compareTo_name, "compareTo0") \ + do_name( compareToLU_name, "compareToUTF16_0") \ + do_name( compareToUL_name, "compareToLatin1_0") \ do_intrinsic(_indexOfL, java_lang_StringLatin1,indexOf_name, compareTo_indexOf_signature, F_S) \ do_intrinsic(_indexOfU, java_lang_StringUTF16, indexOf_name, compareTo_indexOf_signature, F_S) \ do_intrinsic(_indexOfUL, java_lang_StringUTF16, indexOfUL_name, compareTo_indexOf_signature, F_S) \ @@ -392,12 +393,13 @@ class methodHandle; do_intrinsic(_indexOfIUL, java_lang_StringUTF16, indexOfUL_name, indexOfI_signature, F_S) \ do_intrinsic(_indexOfU_char, java_lang_StringUTF16, indexOfChar_name, indexOfChar_signature, F_S) \ do_intrinsic(_indexOfL_char, java_lang_StringLatin1,indexOfChar_name, indexOfChar_signature, F_S) \ - do_name( indexOf_name, "indexOf") \ - do_name( indexOfChar_name, "indexOfChar") \ - do_name( indexOfUL_name, "indexOfLatin1") \ + do_name( indexOf_name, "indexOf0") \ + do_name( indexOfChar_name, "indexOfChar0") \ + do_name( indexOfUL_name, "indexOfLatin1_0") \ do_signature(indexOfI_signature, "([BI[BII)I") \ do_signature(indexOfChar_signature, "([BIII)I") \ - do_intrinsic(_equalsL, java_lang_StringLatin1,equals_name, equalsB_signature, F_S) \ + do_intrinsic(_equalsL, java_lang_StringLatin1,equalsString_name, equalsB_signature, F_S) \ + do_name( equalsString_name, "equals0") \ \ do_intrinsic(_isDigit, java_lang_CharacterDataLatin1, isDigit_name, int_bool_signature, F_R) \ do_name( isDigit_name, "isDigit") \ @@ -1027,7 +1029,7 @@ class methodHandle; do_intrinsic(_VectorUnaryLibOp, jdk_internal_vm_vector_VectorSupport, vector_unary_lib_op_name, vector_unary_lib_op_sig, F_S) \ do_signature(vector_unary_lib_op_sig,"(J" \ "Ljava/lang/Class;" \ - "Ljava/lang/Class;" \ + "I" \ "I" \ "Ljava/lang/String;" \ "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ @@ -1038,7 +1040,7 @@ class methodHandle; do_intrinsic(_VectorBinaryLibOp, jdk_internal_vm_vector_VectorSupport, vector_binary_lib_op_name, vector_binary_lib_op_sig, F_S) \ do_signature(vector_binary_lib_op_sig,"(J" \ "Ljava/lang/Class;" \ - "Ljava/lang/Class;" \ + "I" \ "I" \ "Ljava/lang/String;" \ "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;" \ diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp index 0054b7ba3f2..2ae42bebcfd 100644 --- a/src/hotspot/share/classfile/vmSymbols.hpp +++ b/src/hotspot/share/classfile/vmSymbols.hpp @@ -98,6 +98,7 @@ class SerializeClosure; template(jdk_internal_vm_vector_VectorMask, "jdk/internal/vm/vector/VectorSupport$VectorMask") \ template(jdk_internal_vm_vector_VectorShuffle, "jdk/internal/vm/vector/VectorSupport$VectorShuffle") \ template(payload_name, "payload") \ + template(CTYPE_name, "CTYPE") \ template(ETYPE_name, "ETYPE") \ template(VLENGTH_name, "VLENGTH") \ \ diff --git a/src/hotspot/share/code/aotCodeCache.cpp b/src/hotspot/share/code/aotCodeCache.cpp index f51c068f1e7..e5f68afc51d 100644 --- a/src/hotspot/share/code/aotCodeCache.cpp +++ b/src/hotspot/share/code/aotCodeCache.cpp @@ -29,9 +29,11 @@ #include "cds/cds_globals.hpp" #include "cds/cdsConfig.hpp" #include "cds/heapShared.hpp" +#include "ci/ciUtilities.hpp" #include "classfile/javaAssertions.hpp" #include "code/aotCodeCache.hpp" #include "code/codeCache.hpp" +#include "gc/shared/cardTableBarrierSet.hpp" #include "gc/shared/gcConfig.hpp" #include "logging/logStream.hpp" #include "memory/memoryReserver.hpp" @@ -53,6 +55,7 @@ #endif #if INCLUDE_G1GC #include "gc/g1/g1BarrierSetRuntime.hpp" +#include "gc/g1/g1HeapRegion.hpp" #endif #if INCLUDE_SHENANDOAHGC #include "gc/shenandoah/shenandoahRuntime.hpp" @@ -258,6 +261,9 @@ void AOTCodeCache::init2() { return; } + // initialize aot runtime constants as appropriate to this runtime + AOTRuntimeConstants::initialize_from_runtime(); + // initialize the table of external routines so we can save // generated code blobs that reference them AOTCodeAddressTable* table = opened_cache->_table; @@ -399,7 +405,7 @@ AOTCodeCache::~AOTCodeCache() { } } -void AOTCodeCache::Config::record() { +void AOTCodeCache::Config::record(uint cpu_features_offset) { _flags = 0; #ifdef ASSERT _flags |= debugVM; @@ -430,9 +436,50 @@ void AOTCodeCache::Config::record() { _compressedKlassShift = CompressedKlassPointers::shift(); _contendedPaddingWidth = ContendedPaddingWidth; _gc = (uint)Universe::heap()->kind(); + _cpu_features_offset = cpu_features_offset; } -bool AOTCodeCache::Config::verify() const { +bool AOTCodeCache::Config::verify_cpu_features(AOTCodeCache* cache) const { + LogStreamHandle(Debug, aot, codecache, init) log; + uint offset = _cpu_features_offset; + uint cpu_features_size = *(uint *)cache->addr(offset); + assert(cpu_features_size == (uint)VM_Version::cpu_features_size(), "must be"); + offset += sizeof(uint); + + void* cached_cpu_features_buffer = (void *)cache->addr(offset); + if (log.is_enabled()) { + ResourceMark rm; // required for stringStream::as_string() + stringStream ss; + VM_Version::get_cpu_features_name(cached_cpu_features_buffer, ss); + log.print_cr("CPU features recorded in AOTCodeCache: %s", ss.as_string()); + } + + if (VM_Version::supports_features(cached_cpu_features_buffer)) { + if (log.is_enabled()) { + ResourceMark rm; // required for stringStream::as_string() + stringStream ss; + char* runtime_cpu_features = NEW_RESOURCE_ARRAY(char, VM_Version::cpu_features_size()); + VM_Version::store_cpu_features(runtime_cpu_features); + VM_Version::get_missing_features_name(runtime_cpu_features, cached_cpu_features_buffer, ss); + if (!ss.is_empty()) { + log.print_cr("Additional runtime CPU features: %s", ss.as_string()); + } + } + } else { + if (log.is_enabled()) { + ResourceMark rm; // required for stringStream::as_string() + stringStream ss; + char* runtime_cpu_features = NEW_RESOURCE_ARRAY(char, VM_Version::cpu_features_size()); + VM_Version::store_cpu_features(runtime_cpu_features); + VM_Version::get_missing_features_name(cached_cpu_features_buffer, runtime_cpu_features, ss); + log.print_cr("AOT Code Cache disabled: required cpu features are missing: %s", ss.as_string()); + } + return false; + } + return true; +} + +bool AOTCodeCache::Config::verify(AOTCodeCache* cache) const { // First checks affect all cached AOT code #ifdef ASSERT if ((_flags & debugVM) == 0) { @@ -478,6 +525,9 @@ bool AOTCodeCache::Config::verify() const { AOTStubCaching = false; } + if (!verify_cpu_features(cache)) { + return false; + } return true; } @@ -679,6 +729,17 @@ extern "C" { } } +void AOTCodeCache::store_cpu_features(char*& buffer, uint buffer_size) { + uint* size_ptr = (uint *)buffer; + *size_ptr = buffer_size; + buffer += sizeof(uint); + + VM_Version::store_cpu_features(buffer); + log_debug(aot, codecache, exit)("CPU features recorded in AOTCodeCache: %s", VM_Version::features_string()); + buffer += buffer_size; + buffer = align_up(buffer, DATA_ALIGNMENT); +} + bool AOTCodeCache::finish_write() { if (!align_write()) { return false; @@ -698,23 +759,32 @@ bool AOTCodeCache::finish_write() { uint store_count = _store_entries_cnt; if (store_count > 0) { - uint header_size = (uint)align_up(sizeof(AOTCodeCache::Header), DATA_ALIGNMENT); + uint header_size = (uint)align_up(sizeof(AOTCodeCache::Header), DATA_ALIGNMENT); uint code_count = store_count; uint search_count = code_count * 2; uint search_size = search_count * sizeof(uint); uint entries_size = (uint)align_up(code_count * sizeof(AOTCodeEntry), DATA_ALIGNMENT); // In bytes // _write_position includes size of code and strings uint code_alignment = code_count * DATA_ALIGNMENT; // We align_up code size when storing it. - uint total_size = header_size + _write_position + code_alignment + search_size + entries_size; + uint cpu_features_size = VM_Version::cpu_features_size(); + uint total_cpu_features_size = sizeof(uint) + cpu_features_size; // sizeof(uint) to store cpu_features_size + uint total_size = header_size + _write_position + code_alignment + search_size + entries_size + + align_up(total_cpu_features_size, DATA_ALIGNMENT); assert(total_size < max_aot_code_size(), "AOT Code size (" UINT32_FORMAT " bytes) is greater than AOTCodeMaxSize(" UINT32_FORMAT " bytes).", total_size, max_aot_code_size()); - // Create ordered search table for entries [id, index]; - uint* search = NEW_C_HEAP_ARRAY(uint, search_count, mtCode); // Allocate in AOT Cache buffer char* buffer = (char *)AOTCacheAccess::allocate_aot_code_region(total_size + DATA_ALIGNMENT); char* start = align_up(buffer, DATA_ALIGNMENT); char* current = start + header_size; // Skip header + uint cpu_features_offset = current - start; + store_cpu_features(current, cpu_features_size); + assert(is_aligned(current, DATA_ALIGNMENT), "sanity check"); + assert(current < start + total_size, "sanity check"); + + // Create ordered search table for entries [id, index]; + uint* search = NEW_C_HEAP_ARRAY(uint, search_count, mtCode); + AOTCodeEntry* entries_address = _store_entries; // Pointer to latest entry uint adapters_count = 0; uint shared_blobs_count = 0; @@ -790,7 +860,7 @@ bool AOTCodeCache::finish_write() { header->init(size, (uint)strings_count, strings_offset, entries_count, new_entries_offset, adapters_count, shared_blobs_count, - C1_blobs_count, C2_blobs_count); + C1_blobs_count, C2_blobs_count, cpu_features_offset); log_info(aot, codecache, exit)("Wrote %d AOT code entries to AOT Code Cache", entries_count); } @@ -1383,6 +1453,12 @@ void AOTCodeAddressTable::init_extrs() { #endif #endif // ZERO + // addresses of fields in AOT runtime constants area + address* p = AOTRuntimeConstants::field_addresses_list(); + while (*p != nullptr) { + SET_ADDRESS(_extrs, *p++); + } + _extrs_complete = true; log_debug(aot, codecache, init)("External addresses recorded"); } @@ -1665,6 +1741,11 @@ int AOTCodeAddressTable::id_for_address(address addr, RelocIterator reloc, CodeB if (addr == (address)-1) { // Static call stub has jump to itself return id; } + // Check card_table_base address first since it can point to any address + BarrierSet* bs = BarrierSet::barrier_set(); + bool is_const_card_table_base = !UseG1GC && !UseShenandoahGC && bs->is_a(BarrierSet::CardTableBarrierSet); + guarantee(!is_const_card_table_base || addr != ci_card_table_address_const(), "sanity"); + // Seach for C string id = id_for_C_string(addr); if (id >= 0) { @@ -1734,6 +1815,44 @@ int AOTCodeAddressTable::id_for_address(address addr, RelocIterator reloc, CodeB return id; } +AOTRuntimeConstants AOTRuntimeConstants::_aot_runtime_constants; + +void AOTRuntimeConstants::initialize_from_runtime() { + BarrierSet* bs = BarrierSet::barrier_set(); + address card_table_base = nullptr; + uint grain_shift = 0; +#if INCLUDE_G1GC + if (bs->is_a(BarrierSet::G1BarrierSet)) { + grain_shift = G1HeapRegion::LogOfHRGrainBytes; + } else +#endif +#if INCLUDE_SHENANDOAHGC + if (bs->is_a(BarrierSet::ShenandoahBarrierSet)) { + grain_shift = 0; + } else +#endif + if (bs->is_a(BarrierSet::CardTableBarrierSet)) { + CardTable::CardValue* base = ci_card_table_address_const(); + assert(base != nullptr, "unexpected byte_map_base"); + card_table_base = base; + CardTableBarrierSet* ctbs = barrier_set_cast(bs); + grain_shift = ctbs->grain_shift(); + } + _aot_runtime_constants._card_table_base = card_table_base; + _aot_runtime_constants._grain_shift = grain_shift; +} + +address AOTRuntimeConstants::_field_addresses_list[] = { + ((address)&_aot_runtime_constants._card_table_base), + ((address)&_aot_runtime_constants._grain_shift), + nullptr +}; + +address AOTRuntimeConstants::card_table_base_address() { + assert(UseSerialGC || UseParallelGC, "Only these GCs have constant card table base"); + return (address)&_aot_runtime_constants._card_table_base; +} + // This is called after initialize() but before init2() // and _cache is not set yet. void AOTCodeCache::print_on(outputStream* st) { diff --git a/src/hotspot/share/code/aotCodeCache.hpp b/src/hotspot/share/code/aotCodeCache.hpp index 778ad34e448..85f8b47920f 100644 --- a/src/hotspot/share/code/aotCodeCache.hpp +++ b/src/hotspot/share/code/aotCodeCache.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ #ifndef SHARE_CODE_AOTCODECACHE_HPP #define SHARE_CODE_AOTCODECACHE_HPP +#include "gc/shared/gc_globals.hpp" #include "runtime/stubInfo.hpp" /* @@ -185,10 +186,12 @@ protected: restrictContendedPadding = 128 }; uint _flags; + uint _cpu_features_offset; // offset in the cache where cpu features are stored public: - void record(); - bool verify() const; + void record(uint cpu_features_offset); + bool verify_cpu_features(AOTCodeCache* cache) const; + bool verify(AOTCodeCache* cache) const; }; class Header : public CHeapObj { @@ -206,14 +209,15 @@ protected: uint _shared_blobs_count; uint _C1_blobs_count; uint _C2_blobs_count; - Config _config; + Config _config; // must be the last element as there is trailing data stored immediately after Config public: void init(uint cache_size, uint strings_count, uint strings_offset, uint entries_count, uint entries_offset, uint adapters_count, uint shared_blobs_count, - uint C1_blobs_count, uint C2_blobs_count) { + uint C1_blobs_count, uint C2_blobs_count, + uint cpu_features_offset) { _version = AOT_CODE_VERSION; _cache_size = cache_size; _strings_count = strings_count; @@ -224,7 +228,7 @@ protected: _shared_blobs_count = shared_blobs_count; _C1_blobs_count = C1_blobs_count; _C2_blobs_count = C2_blobs_count; - _config.record(); + _config.record(cpu_features_offset); } @@ -239,8 +243,8 @@ protected: uint C2_blobs_count() const { return _C2_blobs_count; } bool verify(uint load_size) const; - bool verify_config() const { // Called after Universe initialized - return _config.verify(); + bool verify_config(AOTCodeCache* cache) const { // Called after Universe initialized + return _config.verify(cache); } }; @@ -320,6 +324,8 @@ public: AOTCodeEntry* find_entry(AOTCodeEntry::Kind kind, uint id); + void store_cpu_features(char*& buffer, uint buffer_size); + bool finish_write(); bool write_relocations(CodeBlob& code_blob); @@ -361,7 +367,7 @@ private: static bool open_cache(bool is_dumping, bool is_using); bool verify_config() { if (for_use()) { - return _load_header->verify_config(); + return _load_header->verify_config(this); } return true; } @@ -417,4 +423,36 @@ public: #endif // PRODUCT }; +// code cache internal runtime constants area used by AOT code +class AOTRuntimeConstants { + friend class AOTCodeCache; + private: + address _card_table_base; + uint _grain_shift; + static address _field_addresses_list[]; + static AOTRuntimeConstants _aot_runtime_constants; + // private constructor for unique singleton + AOTRuntimeConstants() { } + // private for use by friend class AOTCodeCache + static void initialize_from_runtime(); + public: +#if INCLUDE_CDS + static bool contains(address adr) { + address base = (address)&_aot_runtime_constants; + address hi = base + sizeof(AOTRuntimeConstants); + return (base <= adr && adr < hi); + } + static address card_table_base_address(); + static address grain_shift_address() { return (address)&_aot_runtime_constants._grain_shift; } + static address* field_addresses_list() { + return _field_addresses_list; + } +#else + static bool contains(address adr) { return false; } + static address card_table_base_address() { return nullptr; } + static address grain_shift_address() { return nullptr; } + static address* field_addresses_list() { return nullptr; } +#endif +}; + #endif // SHARE_CODE_AOTCODECACHE_HPP diff --git a/src/hotspot/share/code/codeBlob.cpp b/src/hotspot/share/code/codeBlob.cpp index 094b4f82cf0..fcc0b42a461 100644 --- a/src/hotspot/share/code/codeBlob.cpp +++ b/src/hotspot/share/code/codeBlob.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -336,6 +336,7 @@ RuntimeBlob::RuntimeBlob( void RuntimeBlob::free(RuntimeBlob* blob) { assert(blob != nullptr, "caller must check for nullptr"); + MACOS_AARCH64_ONLY(os::thread_wx_enable_write()); ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock blob->purge(); { diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 481eb51bd5c..2a0256cc316 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -1139,7 +1139,7 @@ size_t CodeCache::freelists_length() { void icache_init(); void CodeCache::initialize() { - assert(CodeCacheSegmentSize >= (size_t)CodeEntryAlignment, "CodeCacheSegmentSize must be large enough to align entry points"); + assert(CodeCacheSegmentSize >= CodeEntryAlignment, "CodeCacheSegmentSize must be large enough to align entry points"); #ifdef COMPILER2 assert(CodeCacheSegmentSize >= (size_t)OptoLoopAlignment, "CodeCacheSegmentSize must be large enough to align inner loops"); #endif diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 13eb1ff1604..4c2f9157b99 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -938,7 +938,8 @@ address nmethod::continuation_for_implicit_exception(address pc, bool for_div0_c stringStream ss; ss.print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc)); print_on(&ss); - method()->print_codes_on(&ss); + // Buffering to a stringStream, disable internal buffering so it's not done twice. + method()->print_codes_on(&ss, 0, false); print_code_on(&ss); print_pcs_on(&ss); tty->print("%s", ss.as_string()); // print all at once diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index aed1edc0db5..9bd6e893bcd 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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 @@ -404,14 +404,12 @@ void CompilerConfig::set_compilation_policy_flags() { #endif if (CompilerConfig::is_tiered() && CompilerConfig::is_c2_enabled()) { -#ifdef COMPILER2 - // Some inlining tuning -#if defined(X86) || defined(AARCH64) || defined(RISCV64) +#if defined(COMPILER2) && defined(_LP64) + // LP64 specific inlining tuning for C2 if (FLAG_IS_DEFAULT(InlineSmallCode)) { FLAG_SET_DEFAULT(InlineSmallCode, 2500); } #endif -#endif // COMPILER2 } } diff --git a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp index 59ab69b2427..e32daa3d79e 100644 --- a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp +++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -34,7 +34,6 @@ #include "memory/metaspaceUtils.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/globals.hpp" #include "utilities/ostream.hpp" @@ -75,6 +74,10 @@ jint EpsilonHeap::initialize() { void EpsilonHeap::initialize_serviceability() { _pool = new EpsilonMemoryPool(this); _memory_manager.add_pool(_pool); +} + +void EpsilonHeap::post_initialize() { + CollectedHeap::post_initialize(); _monitoring_support->mark_ready(); } diff --git a/src/hotspot/share/gc/epsilon/epsilonHeap.hpp b/src/hotspot/share/gc/epsilon/epsilonHeap.hpp index 8d7aa7960fd..ef75f7c1bb9 100644 --- a/src/hotspot/share/gc/epsilon/epsilonHeap.hpp +++ b/src/hotspot/share/gc/epsilon/epsilonHeap.hpp @@ -69,6 +69,7 @@ public: jint initialize() override; void initialize_serviceability() override; + void post_initialize() override; GrowableArray memory_managers() override; GrowableArray memory_pools() override; diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp index ffb06a7d822..8bec6e7e86f 100644 --- a/src/hotspot/share/gc/g1/g1Arguments.cpp +++ b/src/hotspot/share/gc/g1/g1Arguments.cpp @@ -242,10 +242,6 @@ void G1Arguments::initialize() { FLAG_SET_DEFAULT(GCPauseIntervalMillis, MaxGCPauseMillis + 1); } - if (FLAG_IS_DEFAULT(ParallelRefProcEnabled) && ParallelGCThreads > 1) { - FLAG_SET_DEFAULT(ParallelRefProcEnabled, true); - } - #ifdef COMPILER2 // Enable loop strip mining to offer better pause time guarantees if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) { diff --git a/src/hotspot/share/gc/g1/g1BarrierSet.hpp b/src/hotspot/share/gc/g1/g1BarrierSet.hpp index 406096acf10..c5c7058471c 100644 --- a/src/hotspot/share/gc/g1/g1BarrierSet.hpp +++ b/src/hotspot/share/gc/g1/g1BarrierSet.hpp @@ -25,6 +25,7 @@ #ifndef SHARE_GC_G1_G1BARRIERSET_HPP #define SHARE_GC_G1_G1BARRIERSET_HPP +#include "gc/g1/g1HeapRegion.hpp" #include "gc/g1/g1SATBMarkQueueSet.hpp" #include "gc/shared/bufferNode.hpp" #include "gc/shared/cardTable.hpp" @@ -116,6 +117,8 @@ class G1BarrierSet: public CardTableBarrierSet { virtual void print_on(outputStream* st) const; + virtual uint grain_shift() { return G1HeapRegion::LogOfHRGrainBytes; } + // Callbacks for runtime accesses. template class AccessBarrier: public CardTableBarrierSet::AccessBarrier { diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp index 4653f96980d..fd70796251d 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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,10 +24,9 @@ #include "gc/g1/g1BlockOffsetTable.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" -#include "gc/g1/g1HeapRegion.inline.hpp" +#include "gc/g1/g1RegionToSpaceMapper.hpp" +#include "gc/shared/memset_with_concurrent_readers.hpp" #include "logging/log.hpp" -#include "oops/oop.inline.hpp" -#include "runtime/java.hpp" #include "runtime/os.hpp" size_t G1BlockOffsetTable::compute_size(size_t mem_region_words) { @@ -40,26 +39,32 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st MemRegion bot_reserved = storage->reserved(); - _offset_base = ((uint8_t*)bot_reserved.start() - (uintptr_t(_reserved.start()) >> CardTable::card_shift())); + _offset_base = ((Atomic*)bot_reserved.start() - (uintptr_t(_reserved.start()) >> CardTable::card_shift())); log_trace(gc, bot)("G1BlockOffsetTable::G1BlockOffsetTable: "); log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): %zu rs end(): " PTR_FORMAT, p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); } -void G1BlockOffsetTable::set_offset_array(uint8_t* addr, uint8_t offset) { +void G1BlockOffsetTable::set_offset_array(Atomic* addr, uint8_t offset) { check_address(addr, "Block offset table address out of range"); - AtomicAccess::store(addr, offset); + addr->store_relaxed(offset); } -void G1BlockOffsetTable::set_offset_array(uint8_t* addr, HeapWord* high, HeapWord* low) { +static void check_offset(size_t offset, const char* msg) { + assert(offset < CardTable::card_size_in_words(), + "%s - offset: %zu, N_words: %u", + msg, offset, CardTable::card_size_in_words()); +} + +void G1BlockOffsetTable::set_offset_array(Atomic* addr, HeapWord* high, HeapWord* low) { assert(high >= low, "addresses out of order"); size_t offset = pointer_delta(high, low); check_offset(offset, "offset too large"); set_offset_array(addr, (uint8_t)offset); } -void G1BlockOffsetTable::set_offset_array(uint8_t* left, uint8_t* right, uint8_t offset) { +void G1BlockOffsetTable::set_offset_array(Atomic* left, Atomic* right, uint8_t offset) { check_address(right, "Right block offset table address out of range"); assert(left <= right, "indexes out of order"); size_t num_cards = right - left + 1; @@ -67,9 +72,9 @@ void G1BlockOffsetTable::set_offset_array(uint8_t* left, uint8_t* right, uint8_t } #ifdef ASSERT -void G1BlockOffsetTable::check_address(uint8_t* addr, const char* msg) const { - uint8_t* start_addr = const_cast(_offset_base + (uintptr_t(_reserved.start()) >> CardTable::card_shift())); - uint8_t* end_addr = const_cast(_offset_base + (uintptr_t(_reserved.end()) >> CardTable::card_shift())); +void G1BlockOffsetTable::check_address(Atomic* addr, const char* msg) const { + Atomic* start_addr = const_cast*>(_offset_base + (uintptr_t(_reserved.start()) >> CardTable::card_shift())); + Atomic* end_addr = const_cast*>(_offset_base + (uintptr_t(_reserved.end()) >> CardTable::card_shift())); assert(addr >= start_addr && addr <= end_addr, "%s - offset address: " PTR_FORMAT ", start address: " PTR_FORMAT ", end address: " PTR_FORMAT, msg, (p2i(addr)), (p2i(start_addr)), (p2i(end_addr))); @@ -113,17 +118,17 @@ void G1BlockOffsetTable::check_address(uint8_t* addr, const char* msg) const { // Move back N (e.g., 8) entries and repeat with the // value of the new entry // -void G1BlockOffsetTable::set_remainder_to_point_to_start_incl(uint8_t* start_card, uint8_t* end_card) { +void G1BlockOffsetTable::set_remainder_to_point_to_start_incl(Atomic* start_card, Atomic* end_card) { assert(start_card <= end_card, "precondition"); assert(offset_array(start_card-1) < CardTable::card_size_in_words(), "Offset card has an unexpected value"); - uint8_t* start_card_for_region = start_card; + Atomic* start_card_for_region = start_card; uint8_t offset = UINT8_MAX; for (uint i = 0; i < BOTConstants::N_powers; i++) { // -1 so that the card with the actual offset is counted. Another -1 // so that the reach ends in this region and not at the start // of the next. - uint8_t* reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); + Atomic* reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); offset = CardTable::card_size_in_words() + i; if (reach >= end_card) { set_offset_array(start_card_for_region, end_card, offset); @@ -141,12 +146,12 @@ void G1BlockOffsetTable::set_remainder_to_point_to_start_incl(uint8_t* start_car // The card-interval [start_card, end_card] is a closed interval; this // is an expensive check -- use with care and only under protection of // suitable flag. -void G1BlockOffsetTable::check_all_cards(uint8_t* start_card, uint8_t* end_card) const { +void G1BlockOffsetTable::check_all_cards(Atomic* start_card, Atomic* end_card) const { if (end_card < start_card) { return; } guarantee(offset_array(start_card) == CardTable::card_size_in_words(), "Wrong value in second card"); - for (uint8_t* c = start_card + 1; c <= end_card; c++ /* yeah! */) { + for (Atomic* c = start_card + 1; c <= end_card; c++ /* yeah! */) { uint8_t entry = offset_array(c); if ((unsigned)(c - start_card) > BOTConstants::power_to_cards_back(1)) { guarantee(entry > CardTable::card_size_in_words(), @@ -157,7 +162,7 @@ void G1BlockOffsetTable::check_all_cards(uint8_t* start_card, uint8_t* end_card) (uint)entry, (uint)offset_array(c), CardTable::card_size_in_words()); } size_t backskip = BOTConstants::entry_to_cards_back(entry); - uint8_t* landing_card = c - backskip; + Atomic* landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { guarantee(offset_array(landing_card) <= entry, @@ -188,7 +193,7 @@ void G1BlockOffsetTable::check_all_cards(uint8_t* start_card, uint8_t* end_card) // void G1BlockOffsetTable::update_for_block_work(HeapWord* blk_start, HeapWord* blk_end) { HeapWord* const cur_card_boundary = align_up_by_card_size(blk_start); - uint8_t* const offset_card = entry_for_addr(cur_card_boundary); + Atomic* const offset_card = entry_for_addr(cur_card_boundary); assert(blk_start != nullptr && blk_end > blk_start, "phantom block"); @@ -209,7 +214,7 @@ void G1BlockOffsetTable::update_for_block_work(HeapWord* blk_start, HeapWord* bl // We need to now mark the subsequent cards that this block spans. // Index of card on which the block ends. - uint8_t* end_card = entry_for_addr(blk_end - 1); + Atomic* end_card = entry_for_addr(blk_end - 1); // Are there more cards left to be updated? if (offset_card + 1 <= end_card) { @@ -224,7 +229,7 @@ void G1BlockOffsetTable::update_for_block_work(HeapWord* blk_start, HeapWord* bl // The offset can be 0 if the block starts on a boundary. That // is checked by an assertion above. - uint8_t* previous_card = entry_for_addr(blk_start); + Atomic* previous_card = entry_for_addr(blk_start); HeapWord* boundary = addr_for_entry(previous_card); assert((offset_array(offset_card) == 0 && blk_start == boundary) || (offset_array(offset_card) > 0 && offset_array(offset_card) < CardTable::card_size_in_words()), @@ -240,7 +245,7 @@ void G1BlockOffsetTable::update_for_block_work(HeapWord* blk_start, HeapWord* bl } #ifdef ASSERT -void G1BlockOffsetTable::verify_offset(uint8_t* card_index, uint8_t upper_boundary) const { +void G1BlockOffsetTable::verify_offset(Atomic* card_index, uint8_t upper_boundary) const { assert(offset_array(card_index) <= upper_boundary, "Offset %u should not be larger than upper boundary %u.", (uint) offset_array(card_index), @@ -250,19 +255,19 @@ void G1BlockOffsetTable::verify_offset(uint8_t* card_index, uint8_t upper_bounda void G1BlockOffsetTable::verify_for_block(HeapWord* blk_start, HeapWord* blk_end) const { assert(is_crossing_card_boundary(blk_start, blk_end), "precondition"); - uint8_t* start_card = entry_for_addr(align_up_by_card_size(blk_start)); - uint8_t* end_card = entry_for_addr(blk_end - 1); + Atomic* start_card = entry_for_addr(align_up_by_card_size(blk_start)); + Atomic* end_card = entry_for_addr(blk_end - 1); // Check cards in [start_card, end_card] verify_offset(start_card, CardTable::card_size_in_words()); - for (uint8_t* current_card = start_card + 1; current_card <= end_card; ++current_card) { + for (Atomic* current_card = start_card + 1; current_card <= end_card; ++current_card) { assert(offset_array(current_card) > 0, "Offset %u is not larger than 0.", (uint) offset_array(current_card)); verify_offset(current_card, (uint8_t) (CardTable::card_size_in_words() + BOTConstants::N_powers - 1)); - uint8_t* prev = current_card - 1; - uint8_t* value = current_card; + Atomic* prev = current_card - 1; + Atomic* value = current_card; if (offset_array(prev) != offset_array(value)) { assert(offset_array(value) >= offset_array(prev), "monotonic"); size_t n_cards_back = BOTConstants::entry_to_cards_back(offset_array(value)); diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp index 3b97efc4f0f..21d447549a6 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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,7 @@ #include "gc/shared/blockOffsetTable.hpp" #include "gc/shared/cardTable.hpp" #include "memory/memRegion.hpp" +#include "runtime/atomic.hpp" #include "utilities/globalDefinitions.hpp" // This implementation of "G1BlockOffsetTable" divides the covered region @@ -36,47 +37,40 @@ // for each such subregion indicates how far back one must go to find the // start of the chunk that includes the first word of the subregion. class G1BlockOffsetTable : public CHeapObj { -private: // The reserved region covered by the table. MemRegion _reserved; // Biased array-start of BOT array for fast BOT entry translation - volatile uint8_t* _offset_base; - - void check_offset(size_t offset, const char* msg) const { - assert(offset < CardTable::card_size_in_words(), - "%s - offset: %zu, N_words: %u", - msg, offset, CardTable::card_size_in_words()); - } + Atomic* _offset_base; // Bounds checking accessors: // For performance these have to devolve to array accesses in product builds. - inline uint8_t offset_array(uint8_t* addr) const; + inline uint8_t offset_array(Atomic* addr) const; - inline void set_offset_array(uint8_t* addr, uint8_t offset); + inline void set_offset_array(Atomic* addr, uint8_t offset); - inline void set_offset_array(uint8_t* addr, HeapWord* high, HeapWord* low); + inline void set_offset_array(Atomic* addr, HeapWord* high, HeapWord* low); - inline void set_offset_array(uint8_t* left, uint8_t* right, uint8_t offset); + inline void set_offset_array(Atomic* left, Atomic* right, uint8_t offset); // Mapping from address to object start array entry - inline uint8_t* entry_for_addr(const void* const p) const; + inline Atomic* entry_for_addr(const void* const p) const; // Mapping from object start array entry to address of first word - inline HeapWord* addr_for_entry(const uint8_t* const p) const; + inline HeapWord* addr_for_entry(const Atomic* const p) const; - void check_address(uint8_t* addr, const char* msg) const NOT_DEBUG_RETURN; + void check_address(Atomic* addr, const char* msg) const NOT_DEBUG_RETURN; // Sets the entries corresponding to the cards starting at "start" and ending // at "end" to point back to the card before "start"; [start, end] - void set_remainder_to_point_to_start_incl(uint8_t* start, uint8_t* end); + void set_remainder_to_point_to_start_incl(Atomic* start, Atomic* end); // Update BOT entries corresponding to the mem range [blk_start, blk_end). void update_for_block_work(HeapWord* blk_start, HeapWord* blk_end); - void check_all_cards(uint8_t* left_card, uint8_t* right_card) const NOT_DEBUG_RETURN; + void check_all_cards(Atomic* left_card, Atomic* right_card) const NOT_DEBUG_RETURN; - void verify_offset(uint8_t* card_index, uint8_t upper) const NOT_DEBUG_RETURN; + void verify_offset(Atomic* card_index, uint8_t upper) const NOT_DEBUG_RETURN; void verify_for_block(HeapWord* blk_start, HeapWord* blk_end) const NOT_DEBUG_RETURN; static HeapWord* align_up_by_card_size(HeapWord* const addr) { @@ -84,7 +78,6 @@ private: } public: - // Return the number of slots needed for an offset array // that covers mem_region_words words. static size_t compute_size(size_t mem_region_words); @@ -98,22 +91,14 @@ public: // in the heap parameter. G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage); - static bool is_crossing_card_boundary(HeapWord* const obj_start, - HeapWord* const obj_end) { - HeapWord* cur_card_boundary = align_up_by_card_size(obj_start); - // strictly greater-than - return obj_end > cur_card_boundary; - } + inline static bool is_crossing_card_boundary(HeapWord* const obj_start, + HeapWord* const obj_end); // Returns the address of the start of the block reaching into the card containing // "addr". inline HeapWord* block_start_reaching_into_card(const void* addr) const; - void update_for_block(HeapWord* blk_start, HeapWord* blk_end) { - if (is_crossing_card_boundary(blk_start, blk_end)) { - update_for_block_work(blk_start, blk_end); - } - } + inline void update_for_block(HeapWord* blk_start, HeapWord* blk_end); }; #endif // SHARE_GC_G1_G1BLOCKOFFSETTABLE_HPP diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp index 900e9516c1a..b707e310781 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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,16 +27,12 @@ #include "gc/g1/g1BlockOffsetTable.hpp" -#include "gc/g1/g1HeapRegion.hpp" #include "gc/shared/cardTable.hpp" -#include "gc/shared/memset_with_concurrent_readers.hpp" -#include "oops/oop.inline.hpp" -#include "runtime/atomicAccess.hpp" inline HeapWord* G1BlockOffsetTable::block_start_reaching_into_card(const void* addr) const { assert(_reserved.contains(addr), "invalid address"); - uint8_t* entry = entry_for_addr(addr); + Atomic* entry = entry_for_addr(addr); uint8_t offset = offset_array(entry); while (offset >= CardTable::card_size_in_words()) { // The excess of the offset from N_words indicates a power of Base @@ -50,19 +46,19 @@ inline HeapWord* G1BlockOffsetTable::block_start_reaching_into_card(const void* return q - offset; } -uint8_t G1BlockOffsetTable::offset_array(uint8_t* addr) const { +uint8_t G1BlockOffsetTable::offset_array(Atomic* addr) const { check_address(addr, "Block offset table address out of range"); - return AtomicAccess::load(addr); + return addr->load_relaxed(); } -inline uint8_t* G1BlockOffsetTable::entry_for_addr(const void* const p) const { +inline Atomic* G1BlockOffsetTable::entry_for_addr(const void* const p) const { assert(_reserved.contains(p), "out of bounds access to block offset table"); - uint8_t* result = const_cast(&_offset_base[uintptr_t(p) >> CardTable::card_shift()]); + Atomic* result = const_cast*>(&_offset_base[uintptr_t(p) >> CardTable::card_shift()]); return result; } -inline HeapWord* G1BlockOffsetTable::addr_for_entry(const uint8_t* const p) const { +inline HeapWord* G1BlockOffsetTable::addr_for_entry(const Atomic* const p) const { // _offset_base can be "negative", so can't use pointer_delta(). size_t delta = p - _offset_base; HeapWord* result = (HeapWord*) (delta << CardTable::card_shift()); @@ -71,4 +67,17 @@ inline HeapWord* G1BlockOffsetTable::addr_for_entry(const uint8_t* const p) cons return result; } +inline bool G1BlockOffsetTable::is_crossing_card_boundary(HeapWord* const obj_start, + HeapWord* const obj_end) { + HeapWord* cur_card_boundary = align_up_by_card_size(obj_start); + // strictly greater-than + return obj_end > cur_card_boundary; +} + +inline void G1BlockOffsetTable::update_for_block(HeapWord* blk_start, HeapWord* blk_end) { + if (is_crossing_card_boundary(blk_start, blk_end)) { + update_for_block_work(blk_start, blk_end); + } +} + #endif // SHARE_GC_G1_G1BLOCKOFFSETTABLE_INLINE_HPP diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 9424a804bd8..3f5d674c443 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -138,6 +138,26 @@ void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_region reset_from_card_cache(start_idx, num_regions); } +// Collects commonly used scoped objects that are related to initial setup. +class G1GCMark : StackObj { + ResourceMark _rm; + IsSTWGCActiveMark _active_gc_mark; + GCIdMark _gc_id_mark; + SvcGCMarker _sgcm; + GCTraceCPUTime _tcpu; + +public: + G1GCMark(GCTracer* tracer, bool is_full_gc) : + _rm(), + _active_gc_mark(), + _gc_id_mark(), + _sgcm(is_full_gc ? SvcGCMarker::FULL : SvcGCMarker::MINOR), + _tcpu(tracer) { + + assert_at_safepoint_on_vm_thread(); + } +}; + void G1CollectedHeap::run_batch_task(G1BatchedTask* cl) { uint num_workers = MAX2(1u, MIN2(cl->num_workers_estimate(), workers()->active_workers())); cl->set_max_workers(num_workers); @@ -914,12 +934,11 @@ void G1CollectedHeap::verify_after_full_collection() { void G1CollectedHeap::do_full_collection(size_t allocation_word_size, bool clear_all_soft_refs, bool do_maximal_compaction) { - assert_at_safepoint_on_vm_thread(); - - G1FullGCMark gc_mark; + G1FullGCTracer tracer; + G1GCMark gc_mark(&tracer, true /* is_full_gc */); GCTraceTime(Info, gc) tm("Pause Full", nullptr, gc_cause(), true); - G1FullCollector collector(this, clear_all_soft_refs, do_maximal_compaction, gc_mark.tracer()); + G1FullCollector collector(this, clear_all_soft_refs, do_maximal_compaction, &tracer); collector.prepare_collection(); collector.collect(); collector.complete_collection(allocation_word_size); @@ -1704,8 +1723,7 @@ void G1CollectedHeap::ref_processing_init() { // * Reference discovery is MT (see below). // * Reference discovery requires a barrier (see below). // * Reference processing may or may not be MT - // (depending on the value of ParallelRefProcEnabled - // and ParallelGCThreads). + // (depending on the value of ParallelGCThreads). // * A full GC disables reference discovery by the CM // ref processor and abandons any entries on it's // discovered lists. @@ -2714,16 +2732,7 @@ void G1CollectedHeap::flush_region_pin_cache() { } void G1CollectedHeap::do_collection_pause_at_safepoint(size_t allocation_word_size) { - assert_at_safepoint_on_vm_thread(); - assert(!is_stw_gc_active(), "collection is not reentrant"); - - ResourceMark rm; - - IsSTWGCActiveMark active_gc_mark; - GCIdMark gc_id_mark; - SvcGCMarker sgcm(SvcGCMarker::MINOR); - - GCTraceCPUTime tcpu(_gc_tracer_stw); + G1GCMark gcm(_gc_tracer_stw, false /* is_full_gc */); _bytes_used_during_gc = 0; diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index 8f3cafe1f5b..ec5649f4fe2 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -24,6 +24,7 @@ #include "classfile/classLoaderData.hpp" #include "classfile/classLoaderDataGraph.hpp" +#include "cppstdlib/new.hpp" #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BatchedTask.hpp" #include "gc/g1/g1CardSetMemory.hpp" @@ -519,8 +520,8 @@ G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h, _max_concurrent_workers(0), _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats, _g1h->max_num_regions(), mtGC)), - _top_at_mark_starts(NEW_C_HEAP_ARRAY(HeapWord*, _g1h->max_num_regions(), mtGC)), - _top_at_rebuild_starts(NEW_C_HEAP_ARRAY(HeapWord*, _g1h->max_num_regions(), mtGC)), + _top_at_mark_starts(NEW_C_HEAP_ARRAY(Atomic, _g1h->max_num_regions(), mtGC)), + _top_at_rebuild_starts(NEW_C_HEAP_ARRAY(Atomic, _g1h->max_num_regions(), mtGC)), _needs_remembered_set_rebuild(false) { assert(G1CGC_lock != nullptr, "CGC_lock must be initialized"); @@ -564,6 +565,11 @@ void G1ConcurrentMark::fully_initialize() { _tasks[i] = new G1CMTask(i, this, task_queue, _region_mark_stats); } + uint max_num_regions = _g1h->max_num_regions(); + ::new (_region_mark_stats) G1RegionMarkStats[max_num_regions]{}; + ::new (_top_at_mark_starts) Atomic[max_num_regions]{}; + ::new (_top_at_rebuild_starts) Atomic[max_num_regions]{}; + reset_at_marking_complete(); } @@ -576,7 +582,7 @@ PartialArrayStateManager* G1ConcurrentMark::partial_array_state_manager() const } void G1ConcurrentMark::reset() { - _has_aborted = false; + _has_aborted.store_relaxed(false); reset_marking_for_restart(); @@ -587,8 +593,8 @@ void G1ConcurrentMark::reset() { } uint max_num_regions = _g1h->max_num_regions(); + ::new (_top_at_rebuild_starts) Atomic[max_num_regions]{}; for (uint i = 0; i < max_num_regions; i++) { - _top_at_rebuild_starts[i] = nullptr; _region_mark_stats[i].clear(); } @@ -600,7 +606,7 @@ void G1ConcurrentMark::clear_statistics(G1HeapRegion* r) { for (uint j = 0; j < _max_num_tasks; ++j) { _tasks[j]->clear_mark_stats_cache(region_idx); } - _top_at_rebuild_starts[region_idx] = nullptr; + _top_at_rebuild_starts[region_idx].store_relaxed(nullptr); _region_mark_stats[region_idx].clear(); } @@ -636,7 +642,7 @@ void G1ConcurrentMark::reset_marking_for_restart() { } clear_has_overflown(); - _finger = _heap.start(); + _finger.store_relaxed(_heap.start()); for (uint i = 0; i < _max_num_tasks; ++i) { _tasks[i]->reset_for_restart(); @@ -657,14 +663,14 @@ void G1ConcurrentMark::set_concurrency(uint active_tasks) { void G1ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) { set_concurrency(active_tasks); - _concurrent = concurrent; + _concurrent.store_relaxed(concurrent); if (!concurrent) { // At this point we should be in a STW phase, and completed marking. assert_at_safepoint_on_vm_thread(); assert(out_of_regions(), "only way to get here: _finger: " PTR_FORMAT ", _heap_end: " PTR_FORMAT, - p2i(_finger), p2i(_heap.end())); + p2i(finger()), p2i(_heap.end())); } } @@ -695,8 +701,8 @@ void G1ConcurrentMark::reset_at_marking_complete() { } G1ConcurrentMark::~G1ConcurrentMark() { - FREE_C_HEAP_ARRAY(HeapWord*, _top_at_mark_starts); - FREE_C_HEAP_ARRAY(HeapWord*, _top_at_rebuild_starts); + FREE_C_HEAP_ARRAY(Atomic, _top_at_mark_starts); + FREE_C_HEAP_ARRAY(Atomic, _top_at_rebuild_starts); FREE_C_HEAP_ARRAY(G1RegionMarkStats, _region_mark_stats); // The G1ConcurrentMark instance is never freed. ShouldNotReachHere(); @@ -921,6 +927,8 @@ public: bool do_heap_region(G1HeapRegion* r) override { if (r->is_old_or_humongous() && !r->is_collection_set_candidate() && !r->in_collection_set()) { _cm->update_top_at_mark_start(r); + } else { + _cm->reset_top_at_mark_start(r); } return false; } @@ -1163,7 +1171,7 @@ void G1ConcurrentMark::concurrent_cycle_start() { } uint G1ConcurrentMark::completed_mark_cycles() const { - return AtomicAccess::load(&_completed_mark_cycles); + return _completed_mark_cycles.load_relaxed(); } void G1ConcurrentMark::concurrent_cycle_end(bool mark_cycle_completed) { @@ -1172,7 +1180,7 @@ void G1ConcurrentMark::concurrent_cycle_end(bool mark_cycle_completed) { _g1h->trace_heap_after_gc(_gc_tracer_cm); if (mark_cycle_completed) { - AtomicAccess::inc(&_completed_mark_cycles, memory_order_relaxed); + _completed_mark_cycles.add_then_fetch(1u, memory_order_relaxed); } if (has_aborted()) { @@ -1186,7 +1194,7 @@ void G1ConcurrentMark::concurrent_cycle_end(bool mark_cycle_completed) { } void G1ConcurrentMark::mark_from_roots() { - _restart_for_overflow = false; + _restart_for_overflow.store_relaxed(false); uint active_workers = calc_active_marking_workers(); @@ -1355,7 +1363,7 @@ void G1ConcurrentMark::remark() { } } else { // We overflowed. Restart concurrent marking. - _restart_for_overflow = true; + _restart_for_overflow.store_relaxed(true); verify_during_pause(G1HeapVerifier::G1VerifyRemark, VerifyLocation::RemarkOverflow); @@ -1784,44 +1792,45 @@ void G1ConcurrentMark::clear_bitmap_for_region(G1HeapRegion* hr) { } G1HeapRegion* G1ConcurrentMark::claim_region(uint worker_id) { - // "checkpoint" the finger - HeapWord* finger = _finger; + // "Checkpoint" the finger. + HeapWord* local_finger = finger(); - while (finger < _heap.end()) { - assert(_g1h->is_in_reserved(finger), "invariant"); + while (local_finger < _heap.end()) { + assert(_g1h->is_in_reserved(local_finger), "invariant"); - G1HeapRegion* curr_region = _g1h->heap_region_containing_or_null(finger); + G1HeapRegion* curr_region = _g1h->heap_region_containing_or_null(local_finger); // Make sure that the reads below do not float before loading curr_region. OrderAccess::loadload(); // Above heap_region_containing may return null as we always scan claim // until the end of the heap. In this case, just jump to the next region. - HeapWord* end = curr_region != nullptr ? curr_region->end() : finger + G1HeapRegion::GrainWords; + HeapWord* end = curr_region != nullptr ? curr_region->end() : local_finger + G1HeapRegion::GrainWords; // Is the gap between reading the finger and doing the CAS too long? - HeapWord* res = AtomicAccess::cmpxchg(&_finger, finger, end); - if (res == finger && curr_region != nullptr) { - // we succeeded + HeapWord* res = _finger.compare_exchange(local_finger, end); + if (res == local_finger && curr_region != nullptr) { + // We succeeded. HeapWord* bottom = curr_region->bottom(); HeapWord* limit = top_at_mark_start(curr_region); log_trace(gc, marking)("Claim region %u bottom " PTR_FORMAT " tams " PTR_FORMAT, curr_region->hrm_index(), p2i(curr_region->bottom()), p2i(top_at_mark_start(curr_region))); - // notice that _finger == end cannot be guaranteed here since, - // someone else might have moved the finger even further - assert(_finger >= end, "the finger should have moved forward"); + // Notice that _finger == end cannot be guaranteed here since, + // someone else might have moved the finger even further. + assert(finger() >= end, "The finger should have moved forward"); if (limit > bottom) { return curr_region; } else { assert(limit == bottom, - "the region limit should be at bottom"); + "The region limit should be at bottom"); // We return null and the caller should try calling // claim_region() again. return nullptr; } } else { - assert(_finger > finger, "the finger should have moved forward"); - // read it again - finger = _finger; + // Read the finger again. + HeapWord* next_finger = finger(); + assert(next_finger > local_finger, "The finger should have moved forward " PTR_FORMAT " " PTR_FORMAT, p2i(local_finger), p2i(next_finger)); + local_finger = next_finger; } } @@ -1957,7 +1966,7 @@ bool G1ConcurrentMark::concurrent_cycle_abort() { void G1ConcurrentMark::abort_marking_threads() { assert(!_root_regions.scan_in_progress(), "still doing root region scan"); - _has_aborted = true; + _has_aborted.store_relaxed(true); _first_overflow_barrier_sync.abort(); _second_overflow_barrier_sync.abort(); } diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp index 0271e6a4208..11da6dae5b3 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp @@ -368,7 +368,7 @@ class G1ConcurrentMark : public CHeapObj { // For grey objects G1CMMarkStack _global_mark_stack; // Grey objects behind global finger - HeapWord* volatile _finger; // The global finger, region aligned, + Atomic _finger; // The global finger, region aligned, // always pointing to the end of the // last claimed region @@ -395,19 +395,19 @@ class G1ConcurrentMark : public CHeapObj { WorkerThreadsBarrierSync _second_overflow_barrier_sync; // Number of completed mark cycles. - volatile uint _completed_mark_cycles; + Atomic _completed_mark_cycles; // This is set by any task, when an overflow on the global data // structures is detected - volatile bool _has_overflown; + Atomic _has_overflown; // True: marking is concurrent, false: we're in remark - volatile bool _concurrent; + Atomic _concurrent; // Set at the end of a Full GC so that marking aborts - volatile bool _has_aborted; + Atomic _has_aborted; // Used when remark aborts due to an overflow to indicate that // another concurrent marking phase should start - volatile bool _restart_for_overflow; + Atomic _restart_for_overflow; ConcurrentGCTimer* _gc_timer_cm; @@ -461,8 +461,8 @@ class G1ConcurrentMark : public CHeapObj { void print_and_reset_taskqueue_stats(); - HeapWord* finger() { return _finger; } - bool concurrent() { return _concurrent; } + HeapWord* finger() { return _finger.load_relaxed(); } + bool concurrent() { return _concurrent.load_relaxed(); } uint active_tasks() { return _num_active_tasks; } TaskTerminator* terminator() { return &_terminator; } @@ -487,7 +487,7 @@ class G1ConcurrentMark : public CHeapObj { // to satisfy an allocation without doing a GC. This is fine, because all // objects in those regions will be considered live anyway because of // SATB guarantees (i.e. their TAMS will be equal to bottom). - bool out_of_regions() { return _finger >= _heap.end(); } + bool out_of_regions() { return finger() >= _heap.end(); } // Returns the task with the given id G1CMTask* task(uint id) { @@ -499,10 +499,10 @@ class G1ConcurrentMark : public CHeapObj { // Access / manipulation of the overflow flag which is set to // indicate that the global stack has overflown - bool has_overflown() { return _has_overflown; } - void set_has_overflown() { _has_overflown = true; } - void clear_has_overflown() { _has_overflown = false; } - bool restart_for_overflow() { return _restart_for_overflow; } + bool has_overflown() { return _has_overflown.load_relaxed(); } + void set_has_overflown() { _has_overflown.store_relaxed(true); } + void clear_has_overflown() { _has_overflown.store_relaxed(false); } + bool restart_for_overflow() { return _restart_for_overflow.load_relaxed(); } // Methods to enter the two overflow sync barriers void enter_first_sync_barrier(uint worker_id); @@ -516,12 +516,12 @@ class G1ConcurrentMark : public CHeapObj { G1RegionMarkStats* _region_mark_stats; // Top pointer for each region at the start of marking. Must be valid for all committed // regions. - HeapWord* volatile* _top_at_mark_starts; + Atomic* _top_at_mark_starts; // Top pointer for each region at the start of the rebuild remembered set process // for regions which remembered sets need to be rebuilt. A null for a given region // means that this region does not be scanned during the rebuilding remembered // set phase at all. - HeapWord* volatile* _top_at_rebuild_starts; + Atomic* _top_at_rebuild_starts; // True when Remark pause selected regions for rebuilding. bool _needs_remembered_set_rebuild; public: @@ -679,7 +679,7 @@ public: uint completed_mark_cycles() const; - bool has_aborted() { return _has_aborted; } + bool has_aborted() { return _has_aborted.load_relaxed(); } void print_summary_info(); diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp index 2f4824e4cae..21167d5cae9 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp @@ -194,11 +194,11 @@ inline void G1CMTask::process_array_chunk(objArrayOop obj, size_t start, size_t inline void G1ConcurrentMark::update_top_at_mark_start(G1HeapRegion* r) { uint const region = r->hrm_index(); assert(region < _g1h->max_num_regions(), "Tried to access TAMS for region %u out of bounds", region); - _top_at_mark_starts[region] = r->top(); + _top_at_mark_starts[region].store_relaxed(r->top()); } inline void G1ConcurrentMark::reset_top_at_mark_start(G1HeapRegion* r) { - _top_at_mark_starts[r->hrm_index()] = r->bottom(); + _top_at_mark_starts[r->hrm_index()].store_relaxed(r->bottom()); } inline HeapWord* G1ConcurrentMark::top_at_mark_start(const G1HeapRegion* r) const { @@ -207,7 +207,7 @@ inline HeapWord* G1ConcurrentMark::top_at_mark_start(const G1HeapRegion* r) cons inline HeapWord* G1ConcurrentMark::top_at_mark_start(uint region) const { assert(region < _g1h->max_num_regions(), "Tried to access TARS for region %u out of bounds", region); - return _top_at_mark_starts[region]; + return _top_at_mark_starts[region].load_relaxed(); } inline bool G1ConcurrentMark::obj_allocated_since_mark_start(oop obj) const { @@ -217,7 +217,7 @@ inline bool G1ConcurrentMark::obj_allocated_since_mark_start(oop obj) const { } inline HeapWord* G1ConcurrentMark::top_at_rebuild_start(G1HeapRegion* r) const { - return _top_at_rebuild_starts[r->hrm_index()]; + return _top_at_rebuild_starts[r->hrm_index()].load_relaxed(); } inline void G1ConcurrentMark::update_top_at_rebuild_start(G1HeapRegion* r) { @@ -225,10 +225,10 @@ inline void G1ConcurrentMark::update_top_at_rebuild_start(G1HeapRegion* r) { uint const region = r->hrm_index(); assert(region < _g1h->max_num_regions(), "Tried to access TARS for region %u out of bounds", region); - assert(_top_at_rebuild_starts[region] == nullptr, + assert(top_at_rebuild_start(r) == nullptr, "TARS for region %u has already been set to " PTR_FORMAT " should be null", - region, p2i(_top_at_rebuild_starts[region])); - _top_at_rebuild_starts[region] = r->top(); + region, p2i(top_at_rebuild_start(r))); + _top_at_rebuild_starts[region].store_relaxed(r->top()); } inline void G1CMTask::update_liveness(oop const obj, const size_t obj_size) { diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp index 5160d5ed036..7da0066e2f1 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp @@ -23,21 +23,8 @@ */ #include "gc/g1/g1ConcurrentRefineStats.inline.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/timer.hpp" -G1ConcurrentRefineStats::G1ConcurrentRefineStats() : - _sweep_duration(0), - _yield_during_sweep_duration(0), - _cards_scanned(0), - _cards_clean(0), - _cards_not_parsable(0), - _cards_already_refer_to_cset(0), - _cards_refer_to_cset(0), - _cards_no_cross_region(0), - _refine_duration(0) -{} - void G1ConcurrentRefineStats::add_atomic(G1ConcurrentRefineStats* other) { _sweep_duration.add_then_fetch(other->_sweep_duration.load_relaxed(), memory_order_relaxed); _yield_during_sweep_duration.add_then_fetch(other->yield_during_sweep_duration(), memory_order_relaxed); diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp index 5f57c56ba6c..a91ad0eb2e4 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp @@ -47,8 +47,6 @@ class G1ConcurrentRefineStats : public CHeapObj { Atomic _refine_duration; // Time spent during actual refinement. public: - G1ConcurrentRefineStats(); - // Time spent performing sweeping the refinement table (includes actual refinement, // but not yield time). inline jlong sweep_duration() const; diff --git a/src/hotspot/share/gc/g1/g1EvacStats.cpp b/src/hotspot/share/gc/g1/g1EvacStats.cpp index 1d54b184e64..d93f63383c4 100644 --- a/src/hotspot/share/gc/g1/g1EvacStats.cpp +++ b/src/hotspot/share/gc/g1/g1EvacStats.cpp @@ -48,11 +48,11 @@ void G1EvacStats::log_plab_allocation() { "used: %zuB, " "undo waste: %zuB, ", _description, - _allocated * HeapWordSize, - _wasted * HeapWordSize, - _unused * HeapWordSize, + allocated() * HeapWordSize, + wasted() * HeapWordSize, + unused() * HeapWordSize, used() * HeapWordSize, - _undo_wasted * HeapWordSize); + undo_wasted() * HeapWordSize); log_debug(gc, plab)("%s other allocation: " "region end waste: %zuB, " "regions filled: %u, " @@ -157,13 +157,13 @@ void G1EvacStats::adjust_desired_plab_size() { assert(is_object_aligned(max_size()) && min_size() <= max_size(), "PLAB clipping computation may be incorrect"); - assert(_allocated != 0 || _unused == 0, + assert(allocated() != 0 || unused() == 0, "Inconsistency in PLAB stats: " "_allocated: %zu, " "_wasted: %zu, " "_unused: %zu, " "_undo_wasted: %zu", - _allocated, _wasted, _unused, _undo_wasted); + allocated(), wasted(), unused(), undo_wasted()); size_t plab_size = compute_desired_plab_size(); // Take historical weighted average diff --git a/src/hotspot/share/gc/g1/g1FullCollector.cpp b/src/hotspot/share/gc/g1/g1FullCollector.cpp index 06db5f612a1..e8498250f85 100644 --- a/src/hotspot/share/gc/g1/g1FullCollector.cpp +++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp @@ -23,6 +23,7 @@ */ #include "classfile/classLoaderDataGraph.hpp" +#include "cppstdlib/new.hpp" #include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1FullCollector.inline.hpp" #include "gc/g1/g1FullGCAdjustTask.hpp" @@ -110,7 +111,7 @@ uint G1FullCollector::calc_active_workers() { G1FullCollector::G1FullCollector(G1CollectedHeap* heap, bool clear_soft_refs, bool do_maximal_compaction, - G1FullGCTracer* tracer) : + GCTracer* tracer) : _heap(heap), _scope(heap->monitoring_support(), clear_soft_refs, do_maximal_compaction, tracer), _num_workers(calc_active_workers()), @@ -134,12 +135,13 @@ G1FullCollector::G1FullCollector(G1CollectedHeap* heap, _compaction_points = NEW_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _num_workers, mtGC); _live_stats = NEW_C_HEAP_ARRAY(G1RegionMarkStats, _heap->max_num_regions(), mtGC); - _compaction_tops = NEW_C_HEAP_ARRAY(Atomic, _heap->max_num_regions(), mtGC); for (uint j = 0; j < heap->max_num_regions(); j++) { _live_stats[j].clear(); - ::new (&_compaction_tops[j]) Atomic{}; } + _compaction_tops = NEW_C_HEAP_ARRAY(Atomic, _heap->max_num_regions(), mtGC); + ::new (_compaction_tops) Atomic[heap->max_num_regions()]{}; + _partial_array_state_manager = new PartialArrayStateManager(_num_workers); for (uint i = 0; i < _num_workers; i++) { diff --git a/src/hotspot/share/gc/g1/g1FullCollector.hpp b/src/hotspot/share/gc/g1/g1FullCollector.hpp index 7e455b07013..605556a2ba6 100644 --- a/src/hotspot/share/gc/g1/g1FullCollector.hpp +++ b/src/hotspot/share/gc/g1/g1FullCollector.hpp @@ -58,18 +58,6 @@ public: } }; -// Full GC Mark that holds GC id and CPU time trace. Needs to be separate -// from the G1FullCollector and G1FullGCScope to allow the Full GC logging -// to have the same structure as the Young GC logging. -class G1FullGCMark : StackObj { - GCIdMark _gc_id; - G1FullGCTracer _tracer; - GCTraceCPUTime _cpu_time; -public: - G1FullGCMark() : _gc_id(), _tracer(), _cpu_time(&_tracer) { } - G1FullGCTracer* tracer() { return &_tracer; } -}; - // The G1FullCollector holds data associated with the current Full GC. class G1FullCollector : StackObj { G1CollectedHeap* _heap; @@ -102,7 +90,7 @@ public: G1FullCollector(G1CollectedHeap* heap, bool clear_soft_refs, bool do_maximal_compaction, - G1FullGCTracer* tracer); + GCTracer* tracer); ~G1FullCollector(); void prepare_collection(); diff --git a/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp b/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp index 0c201f0e43f..ef6344d349d 100644 --- a/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp +++ b/src/hotspot/share/gc/g1/g1FullCollector.inline.hpp @@ -30,7 +30,6 @@ #include "gc/g1/g1FullGCHeapRegionAttr.hpp" #include "gc/g1/g1HeapRegion.inline.hpp" #include "oops/oopsHierarchy.hpp" -#include "runtime/atomicAccess.hpp" bool G1FullCollector::is_compacting(oop obj) const { return _region_attr_table.is_compacting(cast_from_oop(obj)); diff --git a/src/hotspot/share/gc/g1/g1FullGCScope.cpp b/src/hotspot/share/gc/g1/g1FullGCScope.cpp index 083b77b44b7..cb4ebe423ff 100644 --- a/src/hotspot/share/gc/g1/g1FullGCScope.cpp +++ b/src/hotspot/share/gc/g1/g1FullGCScope.cpp @@ -38,14 +38,11 @@ G1FullGCJFRTracerMark::~G1FullGCJFRTracerMark() { G1FullGCScope::G1FullGCScope(G1MonitoringSupport* monitoring_support, bool clear_soft, bool do_maximal_compaction, - G1FullGCTracer* tracer) : - _rm(), + GCTracer* tracer) : _should_clear_soft_refs(clear_soft), _do_maximal_compaction(do_maximal_compaction), - _svc_marker(SvcGCMarker::FULL), _timer(), _tracer(tracer), - _active(), _tracer_mark(&_timer, _tracer), _monitoring_scope(monitoring_support), _heap_printer(G1CollectedHeap::heap()), @@ -57,7 +54,7 @@ STWGCTimer* G1FullGCScope::timer() { return &_timer; } -G1FullGCTracer* G1FullGCScope::tracer() { +GCTracer* G1FullGCScope::tracer() { return _tracer; } diff --git a/src/hotspot/share/gc/g1/g1FullGCScope.hpp b/src/hotspot/share/gc/g1/g1FullGCScope.hpp index 278a00cedbd..fc9d5a71f92 100644 --- a/src/hotspot/share/gc/g1/g1FullGCScope.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCScope.hpp @@ -46,13 +46,10 @@ public: // Class used to group scoped objects used in the Full GC together. class G1FullGCScope : public StackObj { - ResourceMark _rm; bool _should_clear_soft_refs; bool _do_maximal_compaction; - SvcGCMarker _svc_marker; STWGCTimer _timer; - G1FullGCTracer* _tracer; - IsSTWGCActiveMark _active; + GCTracer* _tracer; G1FullGCJFRTracerMark _tracer_mark; G1FullGCMonitoringScope _monitoring_scope; G1HeapPrinterMark _heap_printer; @@ -62,13 +59,13 @@ public: G1FullGCScope(G1MonitoringSupport* monitoring_support, bool clear_soft, bool do_maximal_compaction, - G1FullGCTracer* tracer); + GCTracer* tracer); bool should_clear_soft_refs() const { return _should_clear_soft_refs; } bool do_maximal_compaction() { return _do_maximal_compaction; } STWGCTimer* timer(); - G1FullGCTracer* tracer(); + GCTracer* tracer(); size_t region_compaction_threshold() const; }; diff --git a/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp b/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp index 44897c8a277..fdd3b919590 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp @@ -34,7 +34,6 @@ #include "jfr/jfrEvents.hpp" #include "logging/logStream.hpp" #include "memory/allocation.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/orderAccess.hpp" #include "utilities/bitMap.inline.hpp" diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp index 3f47d386015..a0013d27172 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp @@ -24,6 +24,7 @@ #include "compiler/oopMap.hpp" +#include "cppstdlib/new.hpp" #include "gc/g1/g1CardSetMemory.hpp" #include "gc/g1/g1CardTableEntryClosure.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" @@ -497,10 +498,6 @@ class G1PostEvacuateCollectionSetCleanupTask2::ProcessEvacuationFailedRegionsTas G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1ConcurrentMark* cm = g1h->concurrent_mark(); - HeapWord* top_at_mark_start = cm->top_at_mark_start(r); - assert(top_at_mark_start == r->bottom(), "TAMS must not have been set for region %u", r->hrm_index()); - assert(cm->live_bytes(r->hrm_index()) == 0, "Marking live bytes must not be set for region %u", r->hrm_index()); - // Concurrent mark does not mark through regions that we retain (they are root // regions wrt to marking), so we must clear their mark data (tams, bitmap, ...) // set eagerly or during evacuation failure. @@ -818,9 +815,7 @@ public: void set_max_workers(uint max_workers) override { _active_workers = max_workers; _worker_stats = NEW_C_HEAP_ARRAY(FreeCSetStats, max_workers, mtGC); - for (uint worker = 0; worker < _active_workers; worker++) { - ::new (&_worker_stats[worker]) FreeCSetStats(); - } + ::new (_worker_stats) FreeCSetStats[_active_workers]{}; _claimer.set_n_workers(_active_workers); } diff --git a/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp index c0870b7a726..936457659b6 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,6 +22,7 @@ * */ +#include "cppstdlib/new.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1RegionPinCache.inline.hpp" #include "gc/g1/g1ThreadLocalData.hpp" @@ -89,10 +90,7 @@ public: void set_max_workers(uint max_workers) override { _num_workers = max_workers; _local_tlab_stats = NEW_C_HEAP_ARRAY(ThreadLocalAllocStats, _num_workers, mtGC); - - for (uint i = 0; i < _num_workers; i++) { - ::new (&_local_tlab_stats[i]) ThreadLocalAllocStats(); - } + ::new (_local_tlab_stats) ThreadLocalAllocStats[_num_workers]{}; } ThreadLocalAllocStats tlab_stats() const { diff --git a/src/hotspot/share/gc/parallel/parMarkBitMap.cpp b/src/hotspot/share/gc/parallel/parMarkBitMap.cpp index c613c8615f0..bbd6669df8d 100644 --- a/src/hotspot/share/gc/parallel/parMarkBitMap.cpp +++ b/src/hotspot/share/gc/parallel/parMarkBitMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,7 +28,6 @@ #include "memory/memoryReserver.hpp" #include "nmt/memTracker.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/os.hpp" #include "utilities/align.hpp" #include "utilities/bitMap.inline.hpp" diff --git a/src/hotspot/share/gc/parallel/parallelArguments.cpp b/src/hotspot/share/gc/parallel/parallelArguments.cpp index be9673224f5..a856078edab 100644 --- a/src/hotspot/share/gc/parallel/parallelArguments.cpp +++ b/src/hotspot/share/gc/parallel/parallelArguments.cpp @@ -128,10 +128,6 @@ void ParallelArguments::initialize() { } } - if (FLAG_IS_DEFAULT(ParallelRefProcEnabled) && ParallelGCThreads > 1) { - FLAG_SET_DEFAULT(ParallelRefProcEnabled, true); - } - FullGCForwarding::initialize_flags(heap_reserved_size_bytes()); } diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp index 0d8a3166f79..f49419595e1 100644 --- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp +++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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 @@ -48,6 +48,7 @@ #include "memory/reservedSpace.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" +#include "runtime/atomic.hpp" #include "runtime/cpuTimeCounters.hpp" #include "runtime/globals_extension.hpp" #include "runtime/handles.inline.hpp" @@ -438,7 +439,7 @@ bool ParallelScavengeHeap::check_gc_overhead_limit() { log_debug(gc)("GC Overhead Limit: GC Time %f Free Space Young %f Old %f Counter %zu", (100 - _size_policy->mutator_time_percent()), percent_of(_young_gen->free_in_bytes(), _young_gen->capacity_in_bytes()), - percent_of(_old_gen->free_in_bytes(), _young_gen->capacity_in_bytes()), + percent_of(_old_gen->free_in_bytes(), _old_gen->capacity_in_bytes()), _gc_overhead_counter); if (little_mutator_time && little_free_space) { @@ -594,7 +595,7 @@ void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) { // these spaces. // The old space is divided into fixed-size blocks. class HeapBlockClaimer : public StackObj { - size_t _claimed_index; + Atomic _claimed_index; public: static const size_t InvalidIndex = SIZE_MAX; @@ -606,7 +607,7 @@ public: // Claim the block and get the block index. size_t claim_and_get_block() { size_t block_index; - block_index = AtomicAccess::fetch_then_add(&_claimed_index, 1u); + block_index = _claimed_index.fetch_then_add(1u); PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen(); size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims; diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.inline.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.inline.hpp index f257f4c9177..0f00b3ec2f9 100644 --- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.inline.hpp +++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.inline.hpp @@ -30,8 +30,11 @@ #include "gc/parallel/psScavenge.hpp" inline bool ParallelScavengeHeap::should_alloc_in_eden(const size_t size) const { - const size_t eden_size = young_gen()->eden_space()->capacity_in_words(); - return size < eden_size / 2; + const size_t max_young_gen_bytes = young_gen()->max_gen_size(); + const size_t survivor_size_bytes = young_gen()->from_space()->capacity_in_bytes(); + const size_t max_eden_size_bytes = max_young_gen_bytes - survivor_size_bytes * 2; + const size_t max_eden_size_words = max_eden_size_bytes / HeapWordSize; + return size < max_eden_size_words / 2; } inline bool ParallelScavengeHeap::is_in_young(const void* p) const { diff --git a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp index 7515031f01f..ff7a0aee088 100644 --- a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp +++ b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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,6 +30,7 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcUtil.hpp" #include "logging/log.hpp" +#include "runtime/atomicAccess.hpp" #include "runtime/timer.hpp" #include "utilities/align.hpp" diff --git a/src/hotspot/share/gc/parallel/psCardTable.cpp b/src/hotspot/share/gc/parallel/psCardTable.cpp index fcd0dd67a45..6429766309a 100644 --- a/src/hotspot/share/gc/parallel/psCardTable.cpp +++ b/src/hotspot/share/gc/parallel/psCardTable.cpp @@ -108,7 +108,7 @@ void PSCardTable::scan_obj_with_limit(PSPromotionManager* pm, } void PSCardTable::pre_scavenge(uint active_workers) { - _preprocessing_active_workers = active_workers; + _preprocessing_active_workers.store_relaxed(active_workers); } // The "shadow" table is a copy of the card table entries of the current stripe. @@ -382,9 +382,9 @@ void PSCardTable::scavenge_contents_parallel(ObjectStartArray* start_array, preprocess_card_table_parallel(object_start, old_gen_bottom, old_gen_top, stripe_index, n_stripes); // Sync with other workers. - AtomicAccess::dec(&_preprocessing_active_workers); + _preprocessing_active_workers.sub_then_fetch(1); SpinYield spin_yield; - while (AtomicAccess::load_acquire(&_preprocessing_active_workers) > 0) { + while (_preprocessing_active_workers.load_acquire() > 0) { spin_yield.wait(); } diff --git a/src/hotspot/share/gc/parallel/psCardTable.hpp b/src/hotspot/share/gc/parallel/psCardTable.hpp index 70c32d23b7f..033933bcbf1 100644 --- a/src/hotspot/share/gc/parallel/psCardTable.hpp +++ b/src/hotspot/share/gc/parallel/psCardTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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 @@ #include "gc/shared/cardTable.hpp" #include "oops/oop.hpp" +#include "runtime/atomic.hpp" class MutableSpace; class ObjectStartArray; @@ -37,7 +38,7 @@ class PSCardTable: public CardTable { static constexpr size_t num_cards_in_stripe = 128; static_assert(num_cards_in_stripe >= 1, "progress"); - volatile int _preprocessing_active_workers; + Atomic _preprocessing_active_workers; bool is_dirty(CardValue* card) { return !is_clean(card); diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp index 974cd6aca59..6a9f8bfeedc 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.cpp +++ b/src/hotspot/share/gc/parallel/psOldGen.cpp @@ -30,6 +30,7 @@ #include "gc/parallel/psOldGen.hpp" #include "gc/shared/cardTableBarrierSet.hpp" #include "gc/shared/gcLocker.hpp" +#include "gc/shared/hSpaceCounters.hpp" #include "gc/shared/spaceDecorator.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" @@ -113,9 +114,11 @@ void PSOldGen::initialize_performance_counters() { const char* perf_data_name = "old"; _gen_counters = new GenerationCounters(perf_data_name, 1, 1, min_gen_size(), max_gen_size(), virtual_space()->committed_size()); - _space_counters = new SpaceCounters(perf_data_name, 0, - virtual_space()->reserved_size(), - _object_space, _gen_counters); + _space_counters = new HSpaceCounters(_gen_counters->name_space(), + perf_data_name, + 0, + virtual_space()->reserved_size(), + _object_space->capacity_in_bytes()); } HeapWord* PSOldGen::expand_and_allocate(size_t word_size) { @@ -266,7 +269,7 @@ bool PSOldGen::expand_by(size_t bytes) { } post_resize(); if (UsePerfData) { - _space_counters->update_capacity(); + _space_counters->update_capacity(_object_space->capacity_in_bytes()); _gen_counters->update_capacity(_virtual_space->committed_size()); } } @@ -394,7 +397,7 @@ void PSOldGen::print_on(outputStream* st) const { void PSOldGen::update_counters() { if (UsePerfData) { - _space_counters->update_all(); + _space_counters->update_all(_object_space->capacity_in_bytes(), _object_space->used_in_bytes()); _gen_counters->update_capacity(_virtual_space->committed_size()); } } diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp index 05359b12836..7e3975036d4 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.hpp +++ b/src/hotspot/share/gc/parallel/psOldGen.hpp @@ -28,7 +28,8 @@ #include "gc/parallel/mutableSpace.hpp" #include "gc/parallel/objectStartArray.hpp" #include "gc/parallel/psVirtualspace.hpp" -#include "gc/parallel/spaceCounters.hpp" +#include "gc/shared/generationCounters.hpp" +#include "gc/shared/hSpaceCounters.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" @@ -43,7 +44,7 @@ class PSOldGen : public CHeapObj { // Performance Counters GenerationCounters* _gen_counters; - SpaceCounters* _space_counters; + HSpaceCounters* _space_counters; // Sizing information, in bytes, set in constructor const size_t _min_gen_size; diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index bab72296d4c..d03bc3cda45 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -30,6 +30,7 @@ #include "code/codeCache.hpp" #include "code/nmethod.hpp" #include "compiler/oopMap.hpp" +#include "cppstdlib/new.hpp" #include "gc/parallel/objectStartArray.inline.hpp" #include "gc/parallel/parallelArguments.hpp" #include "gc/parallel/parallelScavengeHeap.inline.hpp" @@ -83,7 +84,6 @@ #include "oops/methodData.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/safepoint.hpp" @@ -135,8 +135,8 @@ bool ParallelCompactData::RegionData::is_clear() { (_source_region == 0) && (_partial_obj_addr == nullptr) && (_partial_obj_size == 0) && - (_dc_and_los == 0) && - (_shadow_state == 0); + (dc_and_los() == 0) && + (shadow_state() == 0); } #ifdef ASSERT @@ -145,8 +145,8 @@ void ParallelCompactData::RegionData::verify_clear() { assert(_source_region == 0, "inv"); assert(_partial_obj_addr == nullptr, "inv"); assert(_partial_obj_size == 0, "inv"); - assert(_dc_and_los == 0, "inv"); - assert(_shadow_state == 0, "inv"); + assert(dc_and_los() == 0, "inv"); + assert(shadow_state() == 0, "inv"); } #endif @@ -296,7 +296,9 @@ void ParallelCompactData::clear_range(size_t beg_region, size_t end_region) { assert(end_region <= _region_count, "end_region out of range"); const size_t region_cnt = end_region - beg_region; - memset(_region_data + beg_region, 0, region_cnt * sizeof(RegionData)); + for (size_t i = beg_region; i < end_region; i++) { + ::new (&_region_data[i]) RegionData{}; + } } // The total live words on src_region would overflow the target space, so find @@ -1294,7 +1296,7 @@ void PSParallelCompact::marking_phase(ParallelOldTracer *gc_tracer) { } template -void PSParallelCompact::adjust_in_space_helper(SpaceId id, volatile uint* claim_counter, Func&& on_stripe) { +void PSParallelCompact::adjust_in_space_helper(SpaceId id, Atomic* claim_counter, Func&& on_stripe) { MutableSpace* sp = PSParallelCompact::space(id); HeapWord* const bottom = sp->bottom(); HeapWord* const top = sp->top(); @@ -1307,7 +1309,7 @@ void PSParallelCompact::adjust_in_space_helper(SpaceId id, volatile uint* claim_ const size_t stripe_size = num_regions_per_stripe * region_size; while (true) { - uint counter = AtomicAccess::fetch_then_add(claim_counter, num_regions_per_stripe); + uint counter = claim_counter->fetch_then_add(num_regions_per_stripe); HeapWord* cur_stripe = bottom + counter * region_size; if (cur_stripe >= top) { break; @@ -1317,7 +1319,7 @@ void PSParallelCompact::adjust_in_space_helper(SpaceId id, volatile uint* claim_ } } -void PSParallelCompact::adjust_in_old_space(volatile uint* claim_counter) { +void PSParallelCompact::adjust_in_old_space(Atomic* claim_counter) { // Regions in old-space shouldn't be split. assert(!_space_info[old_space_id].split_info().is_valid(), "inv"); @@ -1348,7 +1350,7 @@ void PSParallelCompact::adjust_in_old_space(volatile uint* claim_counter) { }); } -void PSParallelCompact::adjust_in_young_space(SpaceId id, volatile uint* claim_counter) { +void PSParallelCompact::adjust_in_young_space(SpaceId id, Atomic* claim_counter) { adjust_in_space_helper(id, claim_counter, [](HeapWord* stripe_start, HeapWord* stripe_end) { HeapWord* obj_start = stripe_start; while (obj_start < stripe_end) { @@ -1362,7 +1364,7 @@ void PSParallelCompact::adjust_in_young_space(SpaceId id, volatile uint* claim_c }); } -void PSParallelCompact::adjust_pointers_in_spaces(uint worker_id, volatile uint* claim_counters) { +void PSParallelCompact::adjust_pointers_in_spaces(uint worker_id, Atomic* claim_counters) { auto start_time = Ticks::now(); adjust_in_old_space(&claim_counters[0]); for (uint id = eden_space_id; id < last_space_id; ++id) { @@ -1376,12 +1378,12 @@ class PSAdjustTask final : public WorkerTask { WeakProcessor::Task _weak_proc_task; OopStorageSetStrongParState _oop_storage_iter; uint _nworkers; - volatile bool _code_cache_claimed; - volatile uint _claim_counters[PSParallelCompact::last_space_id] = {}; + Atomic _code_cache_claimed; + Atomic _claim_counters[PSParallelCompact::last_space_id]; bool try_claim_code_cache_task() { - return AtomicAccess::load(&_code_cache_claimed) == false - && AtomicAccess::cmpxchg(&_code_cache_claimed, false, true) == false; + return _code_cache_claimed.load_relaxed() == false + && _code_cache_claimed.compare_set(false, true); } public: @@ -1393,6 +1395,9 @@ public: _nworkers(nworkers), _code_cache_claimed(false) { + for (unsigned int i = PSParallelCompact::old_space_id; i < PSParallelCompact::last_space_id; ++i) { + ::new (&_claim_counters[i]) Atomic{}; + } ClassLoaderDataGraph::verify_claimed_marks_cleared(ClassLoaderData::_claim_stw_fullgc_adjust); } diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.hpp b/src/hotspot/share/gc/parallel/psParallelCompact.hpp index 4ac9395d727..f5ab041fa97 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.hpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,7 +34,7 @@ #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskTerminator.hpp" #include "oops/oop.hpp" -#include "runtime/atomicAccess.hpp" +#include "runtime/atomic.hpp" #include "runtime/orderAccess.hpp" class ParallelScavengeHeap; @@ -236,7 +236,7 @@ public: // in this region (words). This does not include the partial object // extending onto the region (if any), or the part of an object that extends // onto the next region (if any). - size_t live_obj_size() const { return _dc_and_los & los_mask; } + size_t live_obj_size() const { return dc_and_los() & los_mask; } // Total live data that lies within the region (words). size_t data_size() const { return partial_obj_size() + live_obj_size(); } @@ -268,9 +268,9 @@ public: // Minor subtlety: claimed() returns true if the region is marked // completed(), which is desirable since a region must be claimed before it // can be completed. - bool available() const { return _dc_and_los < dc_one; } - bool claimed() const { return _dc_and_los >= dc_claimed; } - bool completed() const { return _dc_and_los >= dc_completed; } + bool available() const { return dc_and_los() < dc_one; } + bool claimed() const { return dc_and_los() >= dc_claimed; } + bool completed() const { return dc_and_los() >= dc_completed; } // These are not atomic. void set_destination(HeapWord* addr) { _destination = addr; } @@ -315,7 +315,7 @@ public: // Return to the normal path here inline void shadow_to_normal(); - int shadow_state() { return _shadow_state; } + int shadow_state() { return _shadow_state.load_relaxed(); } bool is_clear(); @@ -339,9 +339,10 @@ public: size_t _source_region; HeapWord* _partial_obj_addr; region_sz_t _partial_obj_size; - region_sz_t volatile _dc_and_los; - int volatile _shadow_state; + Atomic _dc_and_los; + Atomic _shadow_state; + region_sz_t dc_and_los() const { return _dc_and_los.load_relaxed(); } #ifdef ASSERT public: uint _pushed; // 0 until region is pushed onto a stack @@ -411,7 +412,7 @@ private: inline uint ParallelCompactData::RegionData::destination_count_raw() const { - return _dc_and_los & dc_mask; + return dc_and_los() & dc_mask; } inline uint @@ -425,26 +426,26 @@ ParallelCompactData::RegionData::set_destination_count(uint count) { assert(count <= (dc_completed >> dc_shift), "count too large"); const region_sz_t live_sz = (region_sz_t) live_obj_size(); - _dc_and_los = (count << dc_shift) | live_sz; + _dc_and_los.store_relaxed((count << dc_shift) | live_sz); } inline void ParallelCompactData::RegionData::set_live_obj_size(size_t words) { assert(words <= los_mask, "would overflow"); - _dc_and_los = destination_count_raw() | (region_sz_t)words; + _dc_and_los.store_relaxed(destination_count_raw() | (region_sz_t)words); } inline void ParallelCompactData::RegionData::decrement_destination_count() { - assert(_dc_and_los < dc_claimed, "already claimed"); - assert(_dc_and_los >= dc_one, "count would go negative"); - AtomicAccess::add(&_dc_and_los, dc_mask); + assert(dc_and_los() < dc_claimed, "already claimed"); + assert(dc_and_los() >= dc_one, "count would go negative"); + _dc_and_los.add_then_fetch(dc_mask); } inline void ParallelCompactData::RegionData::set_completed() { assert(claimed(), "must be claimed first"); - _dc_and_los = dc_completed | (region_sz_t) live_obj_size(); + _dc_and_los.store_relaxed(dc_completed | (region_sz_t) live_obj_size()); } // MT-unsafe claiming of a region. Should only be used during single threaded @@ -452,7 +453,7 @@ inline void ParallelCompactData::RegionData::set_completed() inline bool ParallelCompactData::RegionData::claim_unsafe() { if (available()) { - _dc_and_los |= dc_claimed; + _dc_and_los.store_relaxed(dc_and_los() | dc_claimed); return true; } return false; @@ -461,36 +462,35 @@ inline bool ParallelCompactData::RegionData::claim_unsafe() inline void ParallelCompactData::RegionData::add_live_obj(size_t words) { assert(words <= (size_t)los_mask - live_obj_size(), "overflow"); - AtomicAccess::add(&_dc_and_los, static_cast(words)); + _dc_and_los.add_then_fetch(static_cast(words)); } inline bool ParallelCompactData::RegionData::claim() { const region_sz_t los = static_cast(live_obj_size()); - const region_sz_t old = AtomicAccess::cmpxchg(&_dc_and_los, los, dc_claimed | los); - return old == los; + return _dc_and_los.compare_set(los, dc_claimed | los); } inline bool ParallelCompactData::RegionData::mark_normal() { - return AtomicAccess::cmpxchg(&_shadow_state, UnusedRegion, NormalRegion) == UnusedRegion; + return _shadow_state.compare_set(UnusedRegion, NormalRegion); } inline bool ParallelCompactData::RegionData::mark_shadow() { - if (_shadow_state != UnusedRegion) return false; - return AtomicAccess::cmpxchg(&_shadow_state, UnusedRegion, ShadowRegion) == UnusedRegion; + if (shadow_state() != UnusedRegion) return false; + return _shadow_state.compare_set(UnusedRegion, ShadowRegion); } inline void ParallelCompactData::RegionData::mark_filled() { - int old = AtomicAccess::cmpxchg(&_shadow_state, ShadowRegion, FilledShadow); + int old = _shadow_state.compare_exchange(ShadowRegion, FilledShadow); assert(old == ShadowRegion, "Fail to mark the region as filled"); } inline bool ParallelCompactData::RegionData::mark_copied() { - return AtomicAccess::cmpxchg(&_shadow_state, FilledShadow, CopiedShadow) == FilledShadow; + return _shadow_state.compare_set(FilledShadow, CopiedShadow); } void ParallelCompactData::RegionData::shadow_to_normal() { - int old = AtomicAccess::cmpxchg(&_shadow_state, ShadowRegion, NormalRegion); + int old = _shadow_state.compare_exchange(ShadowRegion, NormalRegion); assert(old == ShadowRegion, "Fail to mark the region as finish"); } @@ -764,13 +764,13 @@ public: static bool invoke(bool clear_all_soft_refs, bool should_do_max_compaction); template - static void adjust_in_space_helper(SpaceId id, volatile uint* claim_counter, Func&& on_stripe); + static void adjust_in_space_helper(SpaceId id, Atomic* claim_counter, Func&& on_stripe); - static void adjust_in_old_space(volatile uint* claim_counter); + static void adjust_in_old_space(Atomic* claim_counter); - static void adjust_in_young_space(SpaceId id, volatile uint* claim_counter); + static void adjust_in_young_space(SpaceId id, Atomic* claim_counter); - static void adjust_pointers_in_spaces(uint worker_id, volatile uint* claim_counter); + static void adjust_pointers_in_spaces(uint worker_id, Atomic* claim_counter); static void post_initialize(); // Perform initialization for PSParallelCompact that requires diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.cpp b/src/hotspot/share/gc/parallel/psVirtualspace.cpp index f4b24fa51af..93803cf38e1 100644 --- a/src/hotspot/share/gc/parallel/psVirtualspace.cpp +++ b/src/hotspot/share/gc/parallel/psVirtualspace.cpp @@ -78,12 +78,13 @@ bool PSVirtualSpace::shrink_by(size_t bytes) { } char* const base_addr = committed_high_addr() - bytes; - bool result = special() || os::uncommit_memory(base_addr, bytes); - if (result) { - _committed_high_addr -= bytes; + if (!special()) { + os::uncommit_memory(base_addr, bytes); } - return result; + _committed_high_addr -= bytes; + + return true; } #ifndef PRODUCT diff --git a/src/hotspot/share/gc/parallel/psYoungGen.cpp b/src/hotspot/share/gc/parallel/psYoungGen.cpp index 593df38e985..870e912f51e 100644 --- a/src/hotspot/share/gc/parallel/psYoungGen.cpp +++ b/src/hotspot/share/gc/parallel/psYoungGen.cpp @@ -28,6 +28,7 @@ #include "gc/parallel/psYoungGen.hpp" #include "gc/shared/gcUtil.hpp" #include "gc/shared/genArguments.hpp" +#include "gc/shared/hSpaceCounters.hpp" #include "gc/shared/spaceDecorator.hpp" #include "logging/log.hpp" #include "oops/oop.inline.hpp" @@ -133,12 +134,21 @@ void PSYoungGen::initialize_work() { max_eden_size = size - 2 * max_survivor_size; } - _eden_counters = new SpaceCounters("eden", 0, max_eden_size, _eden_space, - _gen_counters); - _from_counters = new SpaceCounters("s0", 1, max_survivor_size, _from_space, - _gen_counters); - _to_counters = new SpaceCounters("s1", 2, max_survivor_size, _to_space, - _gen_counters); + _eden_counters = new HSpaceCounters(_gen_counters->name_space(), + "eden", + 0, + max_eden_size, + _eden_space->capacity_in_bytes()); + _from_counters = new HSpaceCounters(_gen_counters->name_space(), + "s0", + 1, + max_survivor_size, + _from_space->capacity_in_bytes()); + _to_counters = new HSpaceCounters(_gen_counters->name_space(), + "s1", + 2, + max_survivor_size, + _to_space->capacity_in_bytes()); compute_initial_space_boundaries(); } @@ -161,9 +171,9 @@ void PSYoungGen::compute_initial_space_boundaries() { space_invariants(); if (UsePerfData) { - _eden_counters->update_capacity(); - _from_counters->update_capacity(); - _to_counters->update_capacity(); + _eden_counters->update_capacity(_eden_space->capacity_in_bytes()); + _from_counters->update_capacity(_from_space->capacity_in_bytes()); + _to_counters->update_capacity(_to_space->capacity_in_bytes()); } } @@ -606,9 +616,9 @@ void PSYoungGen::post_resize() { void PSYoungGen::update_counters() { if (UsePerfData) { - _eden_counters->update_all(); - _from_counters->update_all(); - _to_counters->update_all(); + _eden_counters->update_all(_eden_space->capacity_in_bytes(), _eden_space->used_in_bytes()); + _from_counters->update_all(_from_space->capacity_in_bytes(), _from_space->used_in_bytes()); + _to_counters->update_all(_to_space->capacity_in_bytes(), _to_space->used_in_bytes()); _gen_counters->update_capacity(_virtual_space->committed_size()); } } diff --git a/src/hotspot/share/gc/parallel/psYoungGen.hpp b/src/hotspot/share/gc/parallel/psYoungGen.hpp index 98337d53184..10aa037da98 100644 --- a/src/hotspot/share/gc/parallel/psYoungGen.hpp +++ b/src/hotspot/share/gc/parallel/psYoungGen.hpp @@ -28,7 +28,8 @@ #include "gc/parallel/mutableSpace.hpp" #include "gc/parallel/objectStartArray.hpp" #include "gc/parallel/psVirtualspace.hpp" -#include "gc/parallel/spaceCounters.hpp" +#include "gc/shared/generationCounters.hpp" +#include "gc/shared/hSpaceCounters.hpp" class ReservedSpace; @@ -51,9 +52,9 @@ class PSYoungGen : public CHeapObj { // Performance counters GenerationCounters* _gen_counters; - SpaceCounters* _eden_counters; - SpaceCounters* _from_counters; - SpaceCounters* _to_counters; + HSpaceCounters* _eden_counters; + HSpaceCounters* _from_counters; + HSpaceCounters* _to_counters; // Initialize the space boundaries void compute_initial_space_boundaries(); diff --git a/src/hotspot/share/gc/parallel/spaceCounters.cpp b/src/hotspot/share/gc/parallel/spaceCounters.cpp deleted file mode 100644 index 8f24373abcb..00000000000 --- a/src/hotspot/share/gc/parallel/spaceCounters.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2002, 2025, 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 "gc/parallel/spaceCounters.hpp" -#include "memory/allocation.inline.hpp" -#include "memory/resourceArea.hpp" -#include "runtime/atomicAccess.hpp" -#include "runtime/mutex.hpp" -#include "runtime/mutexLocker.hpp" -#include "utilities/debug.hpp" -#include "utilities/macros.hpp" - -SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size, - MutableSpace* m, GenerationCounters* gc) - : _object_space(m) { - if (UsePerfData) { - EXCEPTION_MARK; - ResourceMark rm; - - const char* cns = PerfDataManager::name_space(gc->name_space(), "space", - ordinal); - - _name_space = NEW_C_HEAP_ARRAY(char, strlen(cns)+1, mtGC); - strcpy(_name_space, cns); - - const char* cname = PerfDataManager::counter_name(_name_space, "name"); - PerfDataManager::create_string_constant(SUN_GC, cname, name, CHECK); - - cname = PerfDataManager::counter_name(_name_space, "maxCapacity"); - PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes, - (jlong)max_size, CHECK); - - cname = PerfDataManager::counter_name(_name_space, "capacity"); - _capacity = PerfDataManager::create_variable(SUN_GC, cname, - PerfData::U_Bytes, - _object_space->capacity_in_bytes(), - CHECK); - - cname = PerfDataManager::counter_name(_name_space, "used"); - _used = PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes, - _object_space->used_in_bytes(), - CHECK); - - cname = PerfDataManager::counter_name(_name_space, "initCapacity"); - PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_Bytes, - _object_space->capacity_in_bytes(), CHECK); - } -} - -SpaceCounters::~SpaceCounters() { - FREE_C_HEAP_ARRAY(char, _name_space); -} - -void SpaceCounters::update_used() { - _used->set_value(_object_space->used_in_bytes()); -} diff --git a/src/hotspot/share/gc/parallel/spaceCounters.hpp b/src/hotspot/share/gc/parallel/spaceCounters.hpp deleted file mode 100644 index 86fc8438b23..00000000000 --- a/src/hotspot/share/gc/parallel/spaceCounters.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2002, 2025, 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. - * - */ - -#ifndef SHARE_GC_PARALLEL_SPACECOUNTERS_HPP -#define SHARE_GC_PARALLEL_SPACECOUNTERS_HPP - -#include "gc/parallel/mutableSpace.hpp" -#include "gc/shared/generationCounters.hpp" -#include "runtime/perfData.hpp" -#include "utilities/macros.hpp" - -// A SpaceCounter is a holder class for performance counters -// that track a space; - -class SpaceCounters: public CHeapObj { - friend class VMStructs; - - private: - PerfVariable* _capacity; - PerfVariable* _used; - - // Constant PerfData types don't need to retain a reference. - // However, it's a good idea to document them here. - // PerfConstant* _size; - - MutableSpace* _object_space; - char* _name_space; - - public: - - SpaceCounters(const char* name, int ordinal, size_t max_size, - MutableSpace* m, GenerationCounters* gc); - - ~SpaceCounters(); - - inline void update_capacity() { - _capacity->set_value(_object_space->capacity_in_bytes()); - } - - void update_used(); - - inline void update_all() { - update_used(); - update_capacity(); - } - - const char* name_space() const { return _name_space; } -}; - -#endif // SHARE_GC_PARALLEL_SPACECOUNTERS_HPP diff --git a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp index 914358760aa..86b74aa5736 100644 --- a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp +++ b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp @@ -22,6 +22,7 @@ * */ +#include "code/aotCodeCache.hpp" #include "gc/shared/c1/cardTableBarrierSetC1.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableBarrierSet.hpp" @@ -123,6 +124,7 @@ void CardTableBarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Op assert(addr->is_register(), "must be a register at this point"); #ifdef CARDTABLEBARRIERSET_POST_BARRIER_HELPER + assert(!AOTCodeCache::is_on(), "this path is not implemented"); gen->CardTableBarrierSet_post_barrier_helper(addr, card_table_base); #else LIR_Opr tmp = gen->new_pointer_register(); @@ -135,6 +137,17 @@ void CardTableBarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Op } LIR_Address* card_addr; +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + // load the card table address from the AOT Runtime Constants area + LIR_Opr byte_map_base_adr = LIR_OprFact::intptrConst(AOTRuntimeConstants::card_table_base_address()); + LIR_Opr byte_map_base_reg = gen->new_pointer_register(); + __ move(byte_map_base_adr, byte_map_base_reg); + LIR_Address* byte_map_base_indirect = new LIR_Address(byte_map_base_reg, 0, T_LONG); + __ move(byte_map_base_indirect, byte_map_base_reg); + card_addr = new LIR_Address(tmp, byte_map_base_reg, T_BYTE); + } else +#endif if (gen->can_inline_as_constant(card_table_base)) { card_addr = new LIR_Address(tmp, card_table_base->as_jint(), T_BYTE); } else { diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp index 42af77ebdf4..f7445ff254f 100644 --- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp @@ -23,6 +23,7 @@ */ #include "ci/ciUtilities.hpp" +#include "code/aotCodeCache.hpp" #include "gc/shared/c2/cardTableBarrierSetC2.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableBarrierSet.hpp" @@ -114,13 +115,20 @@ Node* CardTableBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access return result; } -Node* CardTableBarrierSetC2::byte_map_base_node(GraphKit* kit) const { +Node* CardTableBarrierSetC2::byte_map_base_node(IdealKit* kit) const { // Get base of card map +#if INCLUDE_CDS + if (AOTCodeCache::is_on_for_dump()) { + // load the card table address from the AOT Runtime Constants area + Node* byte_map_base_adr = kit->makecon(TypeRawPtr::make(AOTRuntimeConstants::card_table_base_address())); + return kit->load_aot_const(byte_map_base_adr, TypeRawPtr::NOTNULL); + } +#endif CardTable::CardValue* card_table_base = ci_card_table_address_const(); if (card_table_base != nullptr) { return kit->makecon(TypeRawPtr::make((address)card_table_base)); } else { - return kit->null(); + return kit->makecon(Type::get_zero_type(T_ADDRESS)); } } @@ -168,7 +176,7 @@ void CardTableBarrierSetC2::post_barrier(GraphKit* kit, Node* card_offset = __ URShiftX(cast, __ ConI(CardTable::card_shift())); // Combine card table base and card offset - Node* card_adr = __ AddP(__ top(), byte_map_base_node(kit), card_offset); + Node* card_adr = __ AddP(__ top(), byte_map_base_node(&ideal), card_offset); // Get the alias_index for raw card-mark memory int adr_type = Compile::AliasIdxRaw; diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp index 84876808f0d..8f5bae8c6dd 100644 --- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp +++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp @@ -43,7 +43,7 @@ protected: Node* new_val, const Type* value_type) const; virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const; - Node* byte_map_base_node(GraphKit* kit) const; + Node* byte_map_base_node(IdealKit* kit) const; public: virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const; diff --git a/src/hotspot/share/gc/shared/cardTable.cpp b/src/hotspot/share/gc/shared/cardTable.cpp index 34f1847befe..e6e3fdf3d82 100644 --- a/src/hotspot/share/gc/shared/cardTable.cpp +++ b/src/hotspot/share/gc/shared/cardTable.cpp @@ -169,9 +169,7 @@ void CardTable::resize_covered_region(MemRegion new_region) { // Shrink. MemRegion delta = MemRegion(new_committed.end(), old_committed.word_size() - new_committed.word_size()); - bool res = os::uncommit_memory((char*)delta.start(), - delta.byte_size()); - assert(res, "uncommit should succeed"); + os::uncommit_memory((char*)delta.start(), delta.byte_size()); } log_trace(gc, barrier)("CardTable::resize_covered_region: "); diff --git a/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp b/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp index 3a9b46d9df8..5d355318b21 100644 --- a/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp +++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp @@ -103,6 +103,10 @@ public: virtual void print_on(outputStream* st) const; + // The AOT code cache manager needs to know the region grain size + // shift for some barrier sets. + virtual uint grain_shift() { return 0; } + template class AccessBarrier: public BarrierSet::AccessBarrier { typedef BarrierSet::AccessBarrier Raw; diff --git a/src/hotspot/share/gc/shared/collectedHeap.cpp b/src/hotspot/share/gc/shared/collectedHeap.cpp index a59ea3745ab..9db23df7ace 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.cpp +++ b/src/hotspot/share/gc/shared/collectedHeap.cpp @@ -598,7 +598,6 @@ void CollectedHeap::initialize_reserved_region(const ReservedHeapSpace& rs) { void CollectedHeap::post_initialize() { StringDedup::initialize(); - initialize_serviceability(); } bool CollectedHeap::is_shutting_down() { diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp index 363ccf321b2..f13c3ab7b6e 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.hpp +++ b/src/hotspot/share/gc/shared/collectedHeap.hpp @@ -241,6 +241,10 @@ protected: */ virtual jint initialize() = 0; + // Initialize serviceability support. This should prepare the implementation + // for accepting serviceability-related calls, like memory_managers(), memory_pools(). + virtual void initialize_serviceability() = 0; + // In many heaps, there will be a need to perform some initialization activities // after the Universe is fully formed, but before general heap allocation is allowed. // This is the correct place to place such initialization methods. @@ -419,8 +423,6 @@ protected: // Generate any dumps preceding or following a full gc void full_gc_dump(GCTimer* timer, bool before); - virtual void initialize_serviceability() = 0; - void print_relative_to_gc(GCWhen::Type when) const; public: diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp index 6aa1fcf066b..65c970435e5 100644 --- a/src/hotspot/share/gc/shared/gc_globals.hpp +++ b/src/hotspot/share/gc/shared/gc_globals.hpp @@ -198,13 +198,6 @@ constraint(MarkStackSizeConstraintFunc,AfterErgo) \ range(1, (INT_MAX - 1)) \ \ - product(bool, ParallelRefProcEnabled, false, \ - "(Deprecated) Enable parallel reference processing " \ - "whenever possible") \ - \ - product(bool, ParallelRefProcBalancingEnabled, true, \ - "(Deprecated) Enable balancing of reference processing queues") \ - \ product(size_t, ReferencesPerThread, 1000, EXPERIMENTAL, \ "Ergonomically start one thread for this amount of " \ "references for reference processing if " \ @@ -269,18 +262,13 @@ product(bool, AlwaysActAsServerClassMachine, false, \ "(Deprecated) Always act like a server-class machine") \ \ - product(uint64_t, MaxRAM, 0, \ - "(Deprecated) Real memory size (in bytes) used to set maximum " \ - "heap size") \ - range(0, 0XFFFFFFFFFFFFFFFF) \ - \ product(bool, AggressiveHeap, false, \ "(Deprecated) Optimize heap options for long-running memory " \ "intensive apps") \ \ product(size_t, ErgoHeapSizeLimit, 0, \ "Maximum ergonomically set heap size (in bytes); zero means use " \ - "MaxRAM * MaxRAMPercentage / 100") \ + "(System RAM) * MaxRAMPercentage / 100") \ range(0, max_uintx) \ \ product(double, MaxRAMPercentage, 25.0, \ diff --git a/src/hotspot/share/gc/shared/hSpaceCounters.cpp b/src/hotspot/share/gc/shared/hSpaceCounters.cpp index 818d7422fba..a873bc2f45c 100644 --- a/src/hotspot/share/gc/shared/hSpaceCounters.cpp +++ b/src/hotspot/share/gc/shared/hSpaceCounters.cpp @@ -81,14 +81,3 @@ void HSpaceCounters::update_all(size_t capacity, size_t used) { update_capacity(capacity); update_used(used); } - -DEBUG_ONLY( - // for security reasons, we do not allow arbitrary reads from - // the counters as they may live in shared memory. - jlong HSpaceCounters::used() { - return _used->get_value(); - } - jlong HSpaceCounters::capacity() { - return _used->get_value(); - } -) diff --git a/src/hotspot/share/gc/shared/hSpaceCounters.hpp b/src/hotspot/share/gc/shared/hSpaceCounters.hpp index b9a6011bd65..cd008ac6dd3 100644 --- a/src/hotspot/share/gc/shared/hSpaceCounters.hpp +++ b/src/hotspot/share/gc/shared/hSpaceCounters.hpp @@ -54,13 +54,6 @@ class HSpaceCounters: public CHeapObj { void update_all(size_t capacity, size_t used); - DEBUG_ONLY( - // for security reasons, we do not allow arbitrary reads from - // the counters as they may live in shared memory. - jlong used(); - jlong capacity(); - ) - const char* name_space() const { return _name_space; } }; #endif // SHARE_GC_SHARED_HSPACECOUNTERS_HPP diff --git a/src/hotspot/share/gc/shared/parallelCleaning.cpp b/src/hotspot/share/gc/shared/parallelCleaning.cpp index e302085d0cc..8e275564a9f 100644 --- a/src/hotspot/share/gc/shared/parallelCleaning.cpp +++ b/src/hotspot/share/gc/shared/parallelCleaning.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,6 @@ #include "gc/shared/parallelCleaning.hpp" #include "logging/log.hpp" #include "oops/klass.inline.hpp" -#include "runtime/atomicAccess.hpp" CodeCacheUnloadingTask::CodeCacheUnloadingTask(bool unloading_occurred) : _unloading_occurred(unloading_occurred), @@ -39,7 +38,7 @@ CodeCacheUnloadingTask::CodeCacheUnloadingTask(bool unloading_occurred) : if(iter.next()) { _first_nmethod = iter.method(); } - _claimed_nmethod = _first_nmethod; + _claimed_nmethod.store_relaxed(_first_nmethod); } CodeCacheUnloadingTask::~CodeCacheUnloadingTask() { @@ -53,7 +52,7 @@ void CodeCacheUnloadingTask::claim_nmethods(nmethod** claimed_nmethods, int *num do { *num_claimed_nmethods = 0; - first = _claimed_nmethod; + first = _claimed_nmethod.load_relaxed(); last = NMethodIterator(NMethodIterator::all, first); if (first != nullptr) { @@ -67,7 +66,7 @@ void CodeCacheUnloadingTask::claim_nmethods(nmethod** claimed_nmethods, int *num } } - } while (AtomicAccess::cmpxchg(&_claimed_nmethod, first, last.method()) != first); + } while (!_claimed_nmethod.compare_set(first, last.method())); } void CodeCacheUnloadingTask::work(uint worker_id) { diff --git a/src/hotspot/share/gc/shared/parallelCleaning.hpp b/src/hotspot/share/gc/shared/parallelCleaning.hpp index ed76c4c9df9..0f5cb78bf55 100644 --- a/src/hotspot/share/gc/shared/parallelCleaning.hpp +++ b/src/hotspot/share/gc/shared/parallelCleaning.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 @@ #include "code/codeCache.hpp" #include "gc/shared/oopStorageParState.hpp" #include "gc/shared/workerThread.hpp" +#include "runtime/atomic.hpp" class CodeCacheUnloadingTask { @@ -36,7 +37,7 @@ class CodeCacheUnloadingTask { // Variables used to claim nmethods. nmethod* _first_nmethod; - nmethod* volatile _claimed_nmethod; + Atomic _claimed_nmethod; public: CodeCacheUnloadingTask(bool unloading_occurred); diff --git a/src/hotspot/share/gc/shared/plab.hpp b/src/hotspot/share/gc/shared/plab.hpp index 2eebdeeadb4..5200f022633 100644 --- a/src/hotspot/share/gc/shared/plab.hpp +++ b/src/hotspot/share/gc/shared/plab.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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 @@ #include "gc/shared/collectedHeap.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" #include "utilities/globalDefinitions.hpp" // Forward declarations. @@ -149,16 +150,16 @@ class PLABStats : public CHeapObj { protected: const char* _description; // Identifying string. - size_t _allocated; // Total allocated - size_t _wasted; // of which wasted (internal fragmentation) - size_t _undo_wasted; // of which wasted on undo (is not used for calculation of PLAB size) - size_t _unused; // Unused in last buffer + Atomic _allocated; // Total allocated + Atomic _wasted; // of which wasted (internal fragmentation) + Atomic _undo_wasted; // of which wasted on undo (is not used for calculation of PLAB size) + Atomic _unused; // Unused in last buffer virtual void reset() { - _allocated = 0; - _wasted = 0; - _undo_wasted = 0; - _unused = 0; + _allocated.store_relaxed(0); + _wasted.store_relaxed(0); + _undo_wasted.store_relaxed(0); + _unused.store_relaxed(0); } public: @@ -172,11 +173,11 @@ public: virtual ~PLABStats() { } - size_t allocated() const { return _allocated; } - size_t wasted() const { return _wasted; } - size_t unused() const { return _unused; } + size_t allocated() const { return _allocated.load_relaxed(); } + size_t wasted() const { return _wasted.load_relaxed(); } + size_t undo_wasted() const { return _undo_wasted.load_relaxed(); } + size_t unused() const { return _unused.load_relaxed(); } size_t used() const { return allocated() - (wasted() + unused()); } - size_t undo_wasted() const { return _undo_wasted; } static size_t min_size() { return PLAB::min_size(); diff --git a/src/hotspot/share/gc/shared/plab.inline.hpp b/src/hotspot/share/gc/shared/plab.inline.hpp index 020738352d3..5f3e9c91e26 100644 --- a/src/hotspot/share/gc/shared/plab.inline.hpp +++ b/src/hotspot/share/gc/shared/plab.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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,22 +29,21 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/atomicAccess.hpp" void PLABStats::add_allocated(size_t v) { - AtomicAccess::add(&_allocated, v); + _allocated.add_then_fetch(v); } void PLABStats::add_unused(size_t v) { - AtomicAccess::add(&_unused, v); + _unused.add_then_fetch(v); } void PLABStats::add_wasted(size_t v) { - AtomicAccess::add(&_wasted, v); + _wasted.add_then_fetch(v); } void PLABStats::add_undo_wasted(size_t v) { - AtomicAccess::add(&_undo_wasted, v); + _undo_wasted.add_then_fetch(v); } #endif // SHARE_GC_SHARED_PLAB_INLINE_HPP diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index 0153ee13287..b82db08ecbd 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -122,7 +122,7 @@ void ReferenceProcessor::verify_no_references_recorded() { #endif bool ReferenceProcessor::processing_is_mt() const { - return ParallelRefProcEnabled && _num_queues > 1; + return _num_queues > 1; } void ReferenceProcessor::weak_oops_do(OopClosure* f) { @@ -586,33 +586,9 @@ void ReferenceProcessor::set_active_mt_degree(uint v) { _next_id = 0; } -bool ReferenceProcessor::need_balance_queues(DiscoveredList refs_lists[]) { - assert(processing_is_mt(), "why balance non-mt processing?"); - // _num_queues is the processing degree. Only list entries up to - // _num_queues will be processed, so any non-empty lists beyond - // that must be redistributed to lists in that range. Even if not - // needed for that, balancing may be desirable to eliminate poor - // distribution of references among the lists. - if (ParallelRefProcBalancingEnabled) { - return true; // Configuration says do it. - } else { - // Configuration says don't balance, but if there are non-empty - // lists beyond the processing degree, then must ignore the - // configuration and balance anyway. - for (uint i = _num_queues; i < _max_num_queues; ++i) { - if (!refs_lists[i].is_empty()) { - return true; // Must balance despite configuration. - } - } - return false; // Safe to obey configuration and not balance. - } -} - void ReferenceProcessor::maybe_balance_queues(DiscoveredList refs_lists[]) { assert(processing_is_mt(), "Should not call this otherwise"); - if (need_balance_queues(refs_lists)) { - balance_queues(refs_lists); - } + balance_queues(refs_lists); } // Balances reference queues. diff --git a/src/hotspot/share/gc/shared/referenceProcessor.hpp b/src/hotspot/share/gc/shared/referenceProcessor.hpp index b211b94a85d..67bf3d7de36 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp @@ -366,7 +366,6 @@ private: // Balances reference queues. void balance_queues(DiscoveredList refs_lists[]); - bool need_balance_queues(DiscoveredList refs_lists[]); // If there is need to balance the given queue, do it. void maybe_balance_queues(DiscoveredList refs_lists[]); diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp index 0371ed2c73b..fc7ef75c1be 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp @@ -152,7 +152,15 @@ RefProcTotalPhaseTimesTracker::~RefProcTotalPhaseTimesTracker() { } ReferenceProcessorPhaseTimes::ReferenceProcessorPhaseTimes(GCTimer* gc_timer, uint max_gc_threads) : - _processing_is_mt(false), _gc_timer(gc_timer) { + _sub_phases_worker_time_sec{}, + _balance_queues_time_ms{}, + _soft_weak_final_refs_phase_worker_time_sec(nullptr), + _total_time_ms(0.0), + _ref_dropped{}, + _ref_discovered{}, + _processing_is_mt(false), + _gc_timer(gc_timer) { + assert(gc_timer != nullptr, "pre-condition"); for (uint i = 0; i < ReferenceProcessor::RefSubPhaseMax; i++) { _sub_phases_worker_time_sec[i] = new WorkerDataArray(nullptr, SubPhasesParWorkTitle[i], max_gc_threads); diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 84ba21527fd..093fa4432e2 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -51,7 +51,7 @@ void ContiguousSpace::initialize(MemRegion mr, set_bottom(bottom); set_end(end); if (clear_space) { - clear(SpaceDecorator::DontMangle); + set_top(bottom); } if (ZapUnusedHeapArea) { mangle_unused_area(); diff --git a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp index e86881d3523..61cf73fe04a 100644 --- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp +++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp @@ -76,8 +76,8 @@ void ThreadLocalAllocBuffer::accumulate_and_reset_statistics(ThreadLocalAllocSta size_t used = Universe::heap()->tlab_used(); _gc_waste += (unsigned)remaining(); - size_t total_allocated = (size_t)thread()->allocated_bytes(); - size_t allocated_since_last_gc = total_allocated - _allocated_before_last_gc; + uint64_t total_allocated = thread()->allocated_bytes(); + uint64_t allocated_since_last_gc = total_allocated - _allocated_before_last_gc; _allocated_before_last_gc = total_allocated; print_stats("gc"); @@ -459,13 +459,16 @@ size_t ThreadLocalAllocBuffer::end_reserve() { } size_t ThreadLocalAllocBuffer::estimated_used_bytes() const { + // Data races due to unsynchronized access like the following reads to _start + // and _top are undefined behavior. Atomic would not provide any additional + // guarantees, so use AtomicAccess directly. HeapWord* start = AtomicAccess::load(&_start); HeapWord* top = AtomicAccess::load(&_top); - // There has been a race when retrieving _top and _start. Return 0. - if (_top < _start) { + // If there has been a race when retrieving _top and _start, return 0. + if (top < start) { return 0; } - size_t used_bytes = pointer_delta(_top, _start, 1); + size_t used_bytes = pointer_delta(top, start, 1); // Comparing diff with the maximum allowed size will ensure that we don't add // the used bytes from a semi-initialized TLAB ending up with implausible values. // In this case also just return 0. diff --git a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp index a50e7c9533c..25d9bf00eac 100644 --- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp +++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp @@ -32,8 +32,10 @@ class ThreadLocalAllocStats; -// ThreadLocalAllocBuffer: a descriptor for thread-local storage used by -// the threads for allocation. It is thread-private at any time. +// ThreadLocalAllocBuffer is a descriptor for thread-local storage used by +// mutator threads for local/private allocation. As a TLAB is thread-private, +// there is no concurrent/parallel access to its memory or its members, +// other than by estimated_used_bytes(). // // Heap sampling is performed via the end and allocation_end // fields. @@ -52,7 +54,7 @@ private: size_t _desired_size; // desired size (including alignment_reserve) size_t _refill_waste_limit; // hold onto tlab if free() is larger than this - size_t _allocated_before_last_gc; // total bytes allocated up until the last gc + uint64_t _allocated_before_last_gc; // total bytes allocated up until the last gc static size_t _max_size; // maximum size of any TLAB static int _reserve_for_allocation_prefetch; // Reserve at the end of the TLAB @@ -123,7 +125,7 @@ public: // Due to races with concurrent allocations and/or resetting the TLAB the return // value may be inconsistent with any other metrics (e.g. total allocated // bytes), and may just incorrectly return 0. - // Intented fo external inspection only where accuracy is not 100% required. + // Intended for external inspection only where accuracy is not 100% required. size_t estimated_used_bytes() const; // Allocate size HeapWords. The memory is NOT initialized to zero. diff --git a/src/hotspot/share/gc/shared/vmStructs_gc.hpp b/src/hotspot/share/gc/shared/vmStructs_gc.hpp index 9348fd980f4..5bd87e6adf7 100644 --- a/src/hotspot/share/gc/shared/vmStructs_gc.hpp +++ b/src/hotspot/share/gc/shared/vmStructs_gc.hpp @@ -157,7 +157,7 @@ declare_toplevel_type(CollectedHeap*) \ declare_toplevel_type(ContiguousSpace*) \ declare_toplevel_type(HeapWord*) \ - declare_toplevel_type(HeapWord* volatile) \ + declare_toplevel_type(Atomic) \ declare_toplevel_type(MemRegion*) \ declare_toplevel_type(ThreadLocalAllocBuffer*) \ \ diff --git a/src/hotspot/share/gc/shared/weakProcessor.cpp b/src/hotspot/share/gc/shared/weakProcessor.cpp index bc7e9ad6375..071a004454a 100644 --- a/src/hotspot/share/gc/shared/weakProcessor.cpp +++ b/src/hotspot/share/gc/shared/weakProcessor.cpp @@ -72,7 +72,6 @@ void WeakProcessor::oops_do(OopClosure* closure) { } uint WeakProcessor::ergo_workers(uint max_workers) { - // Ignore ParallelRefProcEnabled; that's for j.l.r.Reference processing. if (ReferencesPerThread == 0) { // Configuration says always use all the threads. return max_workers; diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp index 80e6decf57d..029b917deab 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp @@ -30,6 +30,7 @@ #include "gc/shenandoah/shenandoahGeneration.hpp" #include "gc/shenandoah/shenandoahGenerationalHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp" +#include "gc/shenandoah/shenandoahInPlacePromoter.hpp" #include "gc/shenandoah/shenandoahOldGeneration.hpp" #include "gc/shenandoah/shenandoahTrace.hpp" #include "gc/shenandoah/shenandoahYoungGeneration.hpp" @@ -403,17 +404,9 @@ size_t ShenandoahGenerationalHeuristics::select_aged_regions(const size_t old_pr bool* const candidate_regions_for_promotion_by_copy = heap->collection_set()->preselected_regions(); ShenandoahMarkingContext* const ctx = heap->marking_context(); - const size_t old_garbage_threshold = - (ShenandoahHeapRegion::region_size_bytes() * heap->old_generation()->heuristics()->get_old_garbage_threshold()) / 100; - - const size_t pip_used_threshold = (ShenandoahHeapRegion::region_size_bytes() * ShenandoahGenerationalMinPIPUsage) / 100; - size_t promo_potential = 0; size_t candidates = 0; - // Tracks the padding of space above top in regions eligible for promotion in place - size_t promote_in_place_pad = 0; - // Sort the promotion-eligible regions in order of increasing live-data-bytes so that we can first reclaim regions that require // less evacuation effort. This prioritizes garbage first, expanding the allocation pool early before we reclaim regions that // have more live data. @@ -422,20 +415,7 @@ size_t ShenandoahGenerationalHeuristics::select_aged_regions(const size_t old_pr ResourceMark rm; AgedRegionData* sorted_regions = NEW_RESOURCE_ARRAY(AgedRegionData, num_regions); - ShenandoahFreeSet* freeset = heap->free_set(); - - // Any region that is to be promoted in place needs to be retired from its Collector or Mutator partition. - idx_t pip_low_collector_idx = freeset->max_regions(); - idx_t pip_high_collector_idx = -1; - idx_t pip_low_mutator_idx = freeset->max_regions(); - idx_t pip_high_mutator_idx = -1; - size_t collector_regions_to_pip = 0; - size_t mutator_regions_to_pip = 0; - - size_t pip_mutator_regions = 0; - size_t pip_collector_regions = 0; - size_t pip_mutator_bytes = 0; - size_t pip_collector_bytes = 0; + ShenandoahInPlacePromotionPlanner in_place_promotions(heap); for (idx_t i = 0; i < num_regions; i++) { ShenandoahHeapRegion* const r = heap->get_region(i); @@ -444,77 +424,19 @@ size_t ShenandoahGenerationalHeuristics::select_aged_regions(const size_t old_pr continue; } if (heap->is_tenurable(r)) { - if ((r->garbage() < old_garbage_threshold) && (r->used() > pip_used_threshold)) { + if (in_place_promotions.is_eligible(r)) { // We prefer to promote this region in place because it has a small amount of garbage and a large usage. - HeapWord* tams = ctx->top_at_mark_start(r); - HeapWord* original_top = r->top(); - if (!heap->is_concurrent_old_mark_in_progress() && tams == original_top) { - // No allocations from this region have been made during concurrent mark. It meets all the criteria - // for in-place-promotion. Though we only need the value of top when we fill the end of the region, - // we use this field to indicate that this region should be promoted in place during the evacuation - // phase. - r->save_top_before_promote(); - size_t remnant_bytes = r->free(); - size_t remnant_words = remnant_bytes / HeapWordSize; - assert(ShenandoahHeap::min_fill_size() <= PLAB::min_size(), "Implementation makes invalid assumptions"); - if (remnant_words >= ShenandoahHeap::min_fill_size()) { - ShenandoahHeap::fill_with_object(original_top, remnant_words); - // Fill the remnant memory within this region to assure no allocations prior to promote in place. Otherwise, - // newly allocated objects will not be parsable when promote in place tries to register them. Furthermore, any - // new allocations would not necessarily be eligible for promotion. This addresses both issues. - r->set_top(r->end()); - // The region r is either in the Mutator or Collector partition if remnant_words > heap()->plab_min_size. - // Otherwise, the region is in the NotFree partition. - ShenandoahFreeSetPartitionId p = free_set->membership(i); - if (p == ShenandoahFreeSetPartitionId::Mutator) { - mutator_regions_to_pip++; - if (i < pip_low_mutator_idx) { - pip_low_mutator_idx = i; - } - if (i > pip_high_mutator_idx) { - pip_high_mutator_idx = i; - } - pip_mutator_regions++; - pip_mutator_bytes += remnant_bytes; - } else if (p == ShenandoahFreeSetPartitionId::Collector) { - collector_regions_to_pip++; - if (i < pip_low_collector_idx) { - pip_low_collector_idx = i; - } - if (i > pip_high_collector_idx) { - pip_high_collector_idx = i; - } - pip_collector_regions++; - pip_collector_bytes += remnant_bytes; - } else { - assert((p == ShenandoahFreeSetPartitionId::NotFree) && (remnant_words < heap->plab_min_size()), - "Should be NotFree if not in Collector or Mutator partitions"); - // In this case, the memory is already counted as used and the region has already been retired. There is - // no need for further adjustments to used. Further, the remnant memory for this region will not be - // unallocated or made available to OldCollector after pip. - remnant_bytes = 0; - } - promote_in_place_pad += remnant_bytes; - free_set->prepare_to_promote_in_place(i, remnant_bytes); - } else { - // Since the remnant is so small that this region has already been retired, we don't have to worry about any - // accidental allocations occurring within this region before the region is promoted in place. - - // This region was already not in the Collector or Mutator set, so no need to remove it. - assert(free_set->membership(i) == ShenandoahFreeSetPartitionId::NotFree, "sanity"); - } - } - // Else, we do not promote this region (either in place or by copy) because it has received new allocations. - - // During evacuation, we exclude from promotion regions for which age > tenure threshold, garbage < garbage-threshold, - // used > pip_used_threshold, and get_top_before_promote() != tams + // Note that if this region has been used recently for allocation, it will not be promoted and it will + // not be selected for promotion by evacuation. + in_place_promotions.prepare(r); } else { // Record this promotion-eligible candidate region. After sorting and selecting the best candidates below, // we may still decide to exclude this promotion-eligible region from the current collection set. If this // happens, we will consider this region as part of the anticipated promotion potential for the next GC // pass; see further below. sorted_regions[candidates]._region = r; - sorted_regions[candidates++]._live_data = r->get_live_data_bytes(); + sorted_regions[candidates]._live_data = r->get_live_data_bytes(); + candidates++; } } else { // We only evacuate & promote objects from regular regions whose garbage() is above old-garbage-threshold. @@ -533,7 +455,7 @@ size_t ShenandoahGenerationalHeuristics::select_aged_regions(const size_t old_pr // in the current cycle and we will anticipate that they will be promoted in the next cycle. This will cause // us to reserve more old-gen memory so that these objects can be promoted in the subsequent cycle. if (heap->is_aging_cycle() && heap->age_census()->is_tenurable(r->age() + 1)) { - if (r->garbage() >= old_garbage_threshold) { + if (r->garbage() >= in_place_promotions.old_garbage_threshold()) { promo_potential += r->get_live_data_bytes(); } } @@ -542,21 +464,7 @@ size_t ShenandoahGenerationalHeuristics::select_aged_regions(const size_t old_pr // Subsequent regions may be selected if they have smaller live data. } - if (pip_mutator_regions + pip_collector_regions > 0) { - freeset->account_for_pip_regions(pip_mutator_regions, pip_mutator_bytes, pip_collector_regions, pip_collector_bytes); - } - - // Retire any regions that have been selected for promote in place - if (collector_regions_to_pip > 0) { - freeset->shrink_interval_if_range_modifies_either_boundary(ShenandoahFreeSetPartitionId::Collector, - pip_low_collector_idx, pip_high_collector_idx, - collector_regions_to_pip); - } - if (mutator_regions_to_pip > 0) { - freeset->shrink_interval_if_range_modifies_either_boundary(ShenandoahFreeSetPartitionId::Mutator, - pip_low_mutator_idx, pip_high_mutator_idx, - mutator_regions_to_pip); - } + in_place_promotions.update_free_set(); // Sort in increasing order according to live data bytes. Note that candidates represents the number of regions // that qualify to be promoted by evacuation. @@ -589,8 +497,6 @@ size_t ShenandoahGenerationalHeuristics::select_aged_regions(const size_t old_pr } log_info(gc, ergo)("Promotion potential of aged regions with sufficient garbage: " PROPERFMT, PROPERFMTARGS(promo_potential)); - - heap->old_generation()->set_pad_for_promote_in_place(promote_in_place_pad); heap->old_generation()->set_promotion_potential(promo_potential); return old_consumed; } diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp index fc7a35aa6c8..e657ac58ae4 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp @@ -128,7 +128,7 @@ private: // The value of command-line argument ShenandoahOldGarbageThreshold represents the percent of garbage that must // be present within an old-generation region before that region is considered a good candidate for inclusion in - // the collection set under normal circumstances. For our purposes, normal circustances are when the memory consumed + // the collection set under normal circumstances. For our purposes, normal circumstances are when the memory consumed // by the old generation is less than 50% of the soft heap capacity. When the old generation grows beyond the 50% // threshold, we dynamically adjust the old garbage threshold, allowing us to invest in packing the old generation // more tightly so that more memory can be made available to the more frequent young GC cycles. This variable diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp index c6e6108fda8..2be5722f7f9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp @@ -41,9 +41,9 @@ bool ShenandoahBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) { return true; } - ShenandoahReentrantLock* lock = ShenandoahNMethod::lock_for_nmethod(nm); + ShenandoahNMethodLock* lock = ShenandoahNMethod::lock_for_nmethod(nm); assert(lock != nullptr, "Must be"); - ShenandoahReentrantLocker locker(lock); + ShenandoahNMethodLocker locker(lock); if (!is_armed(nm)) { // Some other thread managed to complete while we were diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp index 07d339eb32e..64e135e9a4e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp @@ -136,13 +136,13 @@ public: assert(!nm_data->is_unregistered(), "Should not see unregistered entry"); if (nm->is_unloading()) { - ShenandoahReentrantLocker locker(nm_data->lock()); + ShenandoahNMethodLocker locker(nm_data->lock()); nm->unlink(); return; } { - ShenandoahReentrantLocker locker(nm_data->lock()); + ShenandoahNMethodLocker locker(nm_data->lock()); // Heal oops if (_bs->is_armed(nm)) { @@ -154,7 +154,7 @@ public: } // Clear compiled ICs and exception caches - ShenandoahReentrantLocker locker(nm_data->ic_lock()); + ShenandoahNMethodLocker locker(nm_data->ic_lock()); nm->unload_nmethod_caches(_unloading_occurred); } }; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp index 364279deafe..5206a0558e8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp @@ -1023,7 +1023,7 @@ public: void do_nmethod(nmethod* n) { ShenandoahNMethod* data = ShenandoahNMethod::gc_data(n); - ShenandoahReentrantLocker locker(data->lock()); + ShenandoahNMethodLocker locker(data->lock()); // Setup EvacOOM scope below reentrant lock to avoid deadlock with // nmethod_entry_barrier ShenandoahEvacOOMScope oom; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp index dd09bec8a7c..5b24140ac1c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp @@ -37,22 +37,22 @@ ShenandoahEvacOOMCounter::ShenandoahEvacOOMCounter() : void ShenandoahEvacOOMCounter::decrement() { assert(unmasked_count() > 0, "sanity"); // NOTE: It's ok to simply decrement, even with mask set, because unmasked value is positive. - AtomicAccess::dec(&_bits); + _bits.fetch_then_sub(1); } void ShenandoahEvacOOMCounter::clear() { assert(unmasked_count() == 0, "sanity"); - AtomicAccess::release_store_fence(&_bits, (jint)0); + _bits.release_store_fence((jint)0); } void ShenandoahEvacOOMCounter::set_oom_bit(bool decrement) { - jint threads_in_evac = AtomicAccess::load_acquire(&_bits); + jint threads_in_evac = _bits.load_acquire(); while (true) { jint newval = decrement ? (threads_in_evac - 1) | OOM_MARKER_MASK : threads_in_evac | OOM_MARKER_MASK; - jint other = AtomicAccess::cmpxchg(&_bits, threads_in_evac, newval); + jint other = _bits.compare_exchange(threads_in_evac, newval); if (other == threads_in_evac) { // Success: wait for other threads to get out of the protocol and return. break; @@ -65,7 +65,7 @@ void ShenandoahEvacOOMCounter::set_oom_bit(bool decrement) { bool ShenandoahEvacOOMCounter::try_increment() { - jint threads_in_evac = AtomicAccess::load_acquire(&_bits); + jint threads_in_evac = _bits.load_acquire(); while (true) { // Cannot enter evacuation if OOM_MARKER_MASK is set. @@ -73,7 +73,7 @@ bool ShenandoahEvacOOMCounter::try_increment() return false; } - jint other = AtomicAccess::cmpxchg(&_bits, threads_in_evac, threads_in_evac + 1); + jint other = _bits.compare_exchange(threads_in_evac, threads_in_evac + 1); if (other == threads_in_evac) { // Success: caller may safely enter evacuation return true; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.hpp b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.hpp index dd77f6216e0..3e28d9ac88e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.hpp @@ -27,6 +27,7 @@ #include "gc/shenandoah/shenandoahPadding.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" #include "runtime/javaThread.hpp" #include "utilities/globalDefinitions.hpp" @@ -36,7 +37,7 @@ class ShenandoahEvacOOMCounter { private: // Combination of a 31-bit counter and 1-bit OOM marker. - volatile jint _bits; + Atomic _bits; // This class must be at least a cache line in size to prevent false sharing. shenandoah_padding_minus_size(0, sizeof(jint)); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.inline.hpp index 11509ec9d2d..4bd4381068a 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.inline.hpp @@ -29,14 +29,13 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahThreadLocalData.hpp" -#include "runtime/atomicAccess.hpp" jint ShenandoahEvacOOMCounter::load_acquire() { - return AtomicAccess::load_acquire(&_bits); + return _bits.load_acquire(); } jint ShenandoahEvacOOMCounter::unmasked_count() { - return AtomicAccess::load_acquire(&_bits) & ~OOM_MARKER_MASK; + return _bits.load_acquire() & ~OOM_MARKER_MASK; } void ShenandoahEvacOOMHandler::enter_evacuation(Thread* thr) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp index c4fe9103fcb..961800f20d9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp @@ -1194,6 +1194,18 @@ void ShenandoahRegionPartitions::assert_bounds() { assert(_humongous_waste[int(ShenandoahFreeSetPartitionId::Mutator)] == young_humongous_waste, "Mutator humongous waste must match"); } + +inline void ShenandoahRegionPartitions::assert_bounds_sanity() { + for (uint8_t i = 0; i < UIntNumPartitions; i++) { + ShenandoahFreeSetPartitionId partition = static_cast(i); + assert(leftmost(partition) == _max || membership(leftmost(partition)) == partition, "Left most boundry must be sane"); + assert(rightmost(partition) == -1 || membership(rightmost(partition)) == partition, "Right most boundry must be sane"); + + assert(leftmost_empty(partition) == _max || leftmost_empty(partition) >= leftmost(partition), "Left most empty must be sane"); + assert(rightmost_empty(partition) == -1 || rightmost_empty(partition) <= rightmost(partition), "Right most empty must be sane"); + } +} + #endif ShenandoahFreeSet::ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions) : @@ -1654,6 +1666,12 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah // Not old collector alloc, so this is a young collector gclab or shared allocation orig_partition = ShenandoahFreeSetPartitionId::Collector; } + DEBUG_ONLY(bool boundary_changed = false;) + if ((result != nullptr) && in_new_region) { + _partitions.one_region_is_no_longer_empty(orig_partition); + DEBUG_ONLY(boundary_changed = true;) + } + if (alloc_capacity(r) < PLAB::min_size() * HeapWordSize) { // Regardless of whether this allocation succeeded, if the remaining memory is less than PLAB:min_size(), retire this region. // Note that retire_from_partition() increases used to account for waste. @@ -1662,15 +1680,11 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah // then retire the region so that subsequent searches can find available memory more quickly. size_t idx = r->index(); - if ((result != nullptr) && in_new_region) { - _partitions.one_region_is_no_longer_empty(orig_partition); - } size_t waste_bytes = _partitions.retire_from_partition(orig_partition, idx, r->used()); + DEBUG_ONLY(boundary_changed = true;) if (req.is_mutator_alloc() && (waste_bytes > 0)) { increase_bytes_allocated(waste_bytes); } - } else if ((result != nullptr) && in_new_region) { - _partitions.one_region_is_no_longer_empty(orig_partition); } switch (orig_partition) { @@ -1711,7 +1725,13 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah default: assert(false, "won't happen"); } - _partitions.assert_bounds(); +#ifdef ASSERT + if (boundary_changed) { + _partitions.assert_bounds(); + } else { + _partitions.assert_bounds_sanity(); + } +#endif return result; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp index 4e0aea80a9b..d55a06d5713 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp @@ -32,8 +32,8 @@ #include "gc/shenandoah/shenandoahSimpleBitMap.hpp" #include "logging/logStream.hpp" -typedef ShenandoahLock ShenandoahRebuildLock; -typedef ShenandoahLocker ShenandoahRebuildLocker; +typedef ShenandoahLock ShenandoahRebuildLock; +typedef ShenandoahLocker ShenandoahRebuildLocker; // Each ShenandoahHeapRegion is associated with a ShenandoahFreeSetPartitionId. enum class ShenandoahFreeSetPartitionId : uint8_t { @@ -402,6 +402,9 @@ public: // idx <= rightmost // } void assert_bounds() NOT_DEBUG_RETURN; + // this checks certain sanity conditions related to the bounds with much less effort than is required to + // more rigorously enforce correctness as is done by assert_bounds() + inline void assert_bounds_sanity() NOT_DEBUG_RETURN; }; // Publicly, ShenandoahFreeSet represents memory that is available to mutator threads. The public capacity(), used(), diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp index c9b956f9c2f..6912750378e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp @@ -24,14 +24,11 @@ */ #include "gc/shenandoah/shenandoahAsserts.hpp" -#include "gc/shenandoah/shenandoahFreeSet.hpp" +#include "gc/shenandoah/shenandoahGeneration.hpp" #include "gc/shenandoah/shenandoahGenerationalEvacuationTask.hpp" -#include "gc/shenandoah/shenandoahGenerationalHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeap.inline.hpp" -#include "gc/shenandoah/shenandoahOldGeneration.hpp" -#include "gc/shenandoah/shenandoahScanRemembered.inline.hpp" +#include "gc/shenandoah/shenandoahInPlacePromoter.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" -#include "gc/shenandoah/shenandoahYoungGeneration.hpp" class ShenandoahConcurrentEvacuator : public ObjectClosure { private: @@ -77,10 +74,10 @@ void ShenandoahGenerationalEvacuationTask::work(uint worker_id) { void ShenandoahGenerationalEvacuationTask::do_work() { if (_only_promote_regions) { // No allocations will be made, do not enter oom-during-evac protocol. - assert(ShenandoahHeap::heap()->collection_set()->is_empty(), "Should not have a collection set here"); + assert(_heap->collection_set()->is_empty(), "Should not have a collection set here"); promote_regions(); } else { - assert(!ShenandoahHeap::heap()->collection_set()->is_empty(), "Should have a collection set here"); + assert(!_heap->collection_set()->is_empty(), "Should have a collection set here"); ShenandoahEvacOOMScope oom_evac_scope; evacuate_and_promote_regions(); } @@ -95,16 +92,16 @@ void log_region(const ShenandoahHeapRegion* r, LogStream* ls) { } void ShenandoahGenerationalEvacuationTask::promote_regions() { - ShenandoahHeapRegion* r; LogTarget(Debug, gc) lt; - + ShenandoahInPlacePromoter promoter(_heap); + ShenandoahHeapRegion* r; while ((r = _regions->next()) != nullptr) { if (lt.is_enabled()) { LogStream ls(lt); log_region(r, &ls); } - maybe_promote_region(r); + promoter.maybe_promote_region(r); if (_heap->check_cancelled_gc_and_yield(_concurrent)) { break; @@ -115,6 +112,7 @@ void ShenandoahGenerationalEvacuationTask::promote_regions() { void ShenandoahGenerationalEvacuationTask::evacuate_and_promote_regions() { LogTarget(Debug, gc) lt; ShenandoahConcurrentEvacuator cl(_heap); + ShenandoahInPlacePromoter promoter(_heap); ShenandoahHeapRegion* r; while ((r = _regions->next()) != nullptr) { @@ -127,7 +125,7 @@ void ShenandoahGenerationalEvacuationTask::evacuate_and_promote_regions() { assert(r->has_live(), "Region %zu should have been reclaimed early", r->index()); _heap->marked_object_iterate(r, &cl); } else { - maybe_promote_region(r); + promoter.maybe_promote_region(r); } if (_heap->check_cancelled_gc_and_yield(_concurrent)) { @@ -135,182 +133,3 @@ void ShenandoahGenerationalEvacuationTask::evacuate_and_promote_regions() { } } } - - -void ShenandoahGenerationalEvacuationTask::maybe_promote_region(ShenandoahHeapRegion* r) { - if (r->is_young() && r->is_active() && _heap->is_tenurable(r)) { - if (r->is_humongous_start()) { - // We promote humongous_start regions along with their affiliated continuations during evacuation rather than - // doing this work during a safepoint. We cannot put humongous regions into the collection set because that - // triggers the load-reference barrier (LRB) to copy on reference fetch. - // - // Aged humongous continuation regions are handled with their start region. If an aged regular region has - // more garbage than the old garbage threshold, we'll promote by evacuation. If there is room for evacuation - // in this cycle, the region will be in the collection set. If there is not room, the region will be promoted - // by evacuation in some future GC cycle. - - // We do not promote primitive arrays because there's no performance penalty keeping them in young. When/if they - // become garbage, reclaiming the memory from young is much quicker and more efficient than reclaiming them from old. - oop obj = cast_to_oop(r->bottom()); - if (!obj->is_typeArray()) { - promote_humongous(r); - } - } else if (r->is_regular() && (r->get_top_before_promote() != nullptr)) { - // Likewise, we cannot put promote-in-place regions into the collection set because that would also trigger - // the LRB to copy on reference fetch. - // - // If an aged regular region has received allocations during the current cycle, we do not promote because the - // newly allocated objects do not have appropriate age; this region's age will be reset to zero at end of cycle. - promote_in_place(r); - } - } -} - -// When we promote a region in place, we can continue to use the established marking context to guide subsequent remembered -// set scans of this region's content. The region will be coalesced and filled prior to the next old-gen marking effort. -// We identify the entirety of the region as DIRTY to force the next remembered set scan to identify the "interesting pointers" -// contained herein. -void ShenandoahGenerationalEvacuationTask::promote_in_place(ShenandoahHeapRegion* region) { - assert(!_generation->is_old(), "Sanity check"); - ShenandoahMarkingContext* const marking_context = _heap->young_generation()->complete_marking_context(); - HeapWord* const tams = marking_context->top_at_mark_start(region); - size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes(); - - { - const size_t old_garbage_threshold = - (region_size_bytes * _heap->old_generation()->heuristics()->get_old_garbage_threshold()) / 100; - assert(!_heap->is_concurrent_old_mark_in_progress(), "Cannot promote in place during old marking"); - assert(region->garbage_before_padded_for_promote() < old_garbage_threshold, - "Region %zu has too much garbage for promotion", region->index()); - assert(region->is_young(), "Only young regions can be promoted"); - assert(region->is_regular(), "Use different service to promote humongous regions"); - assert(_heap->is_tenurable(region), "Only promote regions that are sufficiently aged"); - assert(region->get_top_before_promote() == tams, "Region %zu has been used for allocations before promotion", region->index()); - } - - ShenandoahOldGeneration* const old_gen = _heap->old_generation(); - ShenandoahYoungGeneration* const young_gen = _heap->young_generation(); - - // 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. - ShenandoahScanRemembered* const scanner = old_gen->card_scan(); - scanner->reset_object_range(region->bottom(), region->end()); - scanner->mark_range_as_dirty(region->bottom(), region->get_top_before_promote() - region->bottom()); - - HeapWord* obj_addr = region->bottom(); - while (obj_addr < tams) { - oop obj = cast_to_oop(obj_addr); - if (marking_context->is_marked(obj)) { - assert(obj->klass() != nullptr, "klass should not be null"); - // This thread is responsible for registering all objects in this region. No need for lock. - scanner->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); - scanner->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()); - - HeapWord* update_watermark = region->get_update_watermark(); - // pip_unpadded is memory too small to be filled above original top - size_t pip_unpadded = (region->end() - region->top()) * HeapWordSize; - assert((region->top() == region->end()) - || (pip_unpadded == (size_t) ((region->end() - region->top()) * HeapWordSize)), "Invariant"); - assert(pip_unpadded < ShenandoahHeap::min_fill_size() * HeapWordSize, "Sanity"); - size_t pip_pad_bytes = (region->top() - region->get_top_before_promote()) * HeapWordSize; - assert((pip_unpadded == 0) || (pip_pad_bytes == 0), "Only one of pip_unpadded and pip_pad_bytes is non-zero"); - - // Now that this region is affiliated with old, we can allow it to receive allocations, though it may not be in the - // is_collector_free range. We'll add it to that range below. - region->restore_top_before_promote(); -#ifdef ASSERT - size_t region_to_be_used_in_old = region->used(); - assert(region_to_be_used_in_old + pip_pad_bytes + pip_unpadded == region_size_bytes, "invariant"); -#endif - - // The update_watermark was likely established while we had the artificially high value of top. Make it sane now. - assert(update_watermark >= region->top(), "original top cannot exceed preserved update_watermark"); - region->set_update_watermark(region->top()); - - // Transfer this region from young to old, increasing promoted_reserve if available space exceeds plab_min_size() - _heap->free_set()->add_promoted_in_place_region_to_old_collector(region); - region->set_affiliation(OLD_GENERATION); - region->set_promoted_in_place(); - } -} - -void ShenandoahGenerationalEvacuationTask::promote_humongous(ShenandoahHeapRegion* region) { - ShenandoahMarkingContext* marking_context = _heap->marking_context(); - oop obj = cast_to_oop(region->bottom()); - assert(_generation->is_mark_complete(), "sanity"); - assert(region->is_young(), "Only young regions can be promoted"); - assert(region->is_humongous_start(), "Should not promote humongous continuation in isolation"); - assert(_heap->is_tenurable(region), "Only promote regions that are sufficiently aged"); - assert(marking_context->is_marked(obj), "promoted humongous object should be alive"); - - const size_t used_bytes = obj->size() * HeapWordSize; - const size_t spanned_regions = ShenandoahHeapRegion::required_regions(used_bytes); - const size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes(); - const size_t humongous_waste = spanned_regions * region_size_bytes - obj->size() * HeapWordSize; - const size_t index_limit = region->index() + spanned_regions; - - ShenandoahOldGeneration* const old_gen = _heap->old_generation(); - ShenandoahGeneration* const young_gen = _heap->young_generation(); - { - // We need to grab the heap lock in order to avoid a race when changing the affiliations of spanned_regions from - // young to old. - ShenandoahHeapLocker locker(_heap->lock()); - - // We promote humongous objects unconditionally, without checking for availability. We adjust - // usage totals, including humongous waste, after evacuation is done. - log_debug(gc)("promoting humongous region %zu, spanning %zu", region->index(), spanned_regions); - - // For this region and each humongous continuation region spanned by this humongous object, change - // affiliation to OLD_GENERATION and adjust the generation-use tallies. The remnant of memory - // in the last humongous region that is not spanned by obj is currently not used. - for (size_t i = region->index(); i < index_limit; i++) { - ShenandoahHeapRegion* r = _heap->get_region(i); - log_debug(gc)("promoting humongous region %zu, from " PTR_FORMAT " to " PTR_FORMAT, - r->index(), p2i(r->bottom()), p2i(r->top())); - // We mark the entire humongous object's range as dirty after loop terminates, so no need to dirty the range here - r->set_affiliation(OLD_GENERATION); - r->set_promoted_in_place(); - } - - ShenandoahFreeSet* freeset = _heap->free_set(); - freeset->transfer_humongous_regions_from_mutator_to_old_collector(spanned_regions, humongous_waste); - } - - // Since this region may have served previously as OLD, it may hold obsolete object range info. - HeapWord* const humongous_bottom = region->bottom(); - ShenandoahScanRemembered* const scanner = old_gen->card_scan(); - scanner->reset_object_range(humongous_bottom, humongous_bottom + spanned_regions * ShenandoahHeapRegion::region_size_words()); - // Since the humongous region holds only one object, no lock is necessary for this register_object() invocation. - scanner->register_object_without_lock(humongous_bottom); - - if (obj->is_typeArray()) { - // Primitive arrays don't need to be scanned. - log_debug(gc)("Clean cards for promoted humongous object (Region %zu) from " PTR_FORMAT " to " PTR_FORMAT, - region->index(), p2i(humongous_bottom), p2i(humongous_bottom + obj->size())); - scanner->mark_range_as_clean(humongous_bottom, obj->size()); - } else { - log_debug(gc)("Dirty cards for promoted humongous object (Region %zu) from " PTR_FORMAT " to " PTR_FORMAT, - region->index(), p2i(humongous_bottom), p2i(humongous_bottom + obj->size())); - scanner->mark_range_as_dirty(humongous_bottom, obj->size()); - } -} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.hpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.hpp index de47184ffff..1ff58b42e8c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.hpp @@ -27,6 +27,7 @@ #include "gc/shared/workerThread.hpp" +class ShenandoahGeneration; class ShenandoahGenerationalHeap; class ShenandoahHeapRegion; class ShenandoahRegionIterator; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp index 36ea0b9e497..2c2e5533c01 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp @@ -605,7 +605,8 @@ void ShenandoahGenerationalHeap::compute_old_generation_balance(size_t mutator_x ShenandoahOldGeneration* old_gen = old_generation(); size_t old_capacity = old_gen->max_capacity(); size_t old_usage = old_gen->used(); // includes humongous waste - size_t old_available = ((old_capacity >= old_usage)? old_capacity - old_usage: 0) + old_trashed_regions * region_size_bytes; + size_t old_currently_available = + ((old_capacity >= old_usage)? old_capacity - old_usage: 0) + old_trashed_regions * region_size_bytes; ShenandoahYoungGeneration* young_gen = young_generation(); size_t young_capacity = young_gen->max_capacity(); @@ -621,7 +622,8 @@ void ShenandoahGenerationalHeap::compute_old_generation_balance(size_t mutator_x size_t young_reserve = (young_generation()->max_capacity() * ShenandoahEvacReserve) / 100; // If ShenandoahOldEvacPercent equals 100, max_old_reserve is limited only by mutator_xfer_limit and young_reserve - const size_t bound_on_old_reserve = ((old_available + mutator_xfer_limit + young_reserve) * ShenandoahOldEvacPercent) / 100; + const size_t bound_on_old_reserve = + ((old_currently_available + mutator_xfer_limit + young_reserve) * ShenandoahOldEvacPercent) / 100; size_t proposed_max_old = ((ShenandoahOldEvacPercent == 100)? bound_on_old_reserve: MIN2((young_reserve * ShenandoahOldEvacPercent) / (100 - ShenandoahOldEvacPercent), @@ -631,68 +633,105 @@ void ShenandoahGenerationalHeap::compute_old_generation_balance(size_t mutator_x } // Decide how much old space we should reserve for a mixed collection - size_t reserve_for_mixed = 0; + size_t proposed_reserve_for_mixed = 0; const size_t old_fragmented_available = - old_available - (old_generation()->free_unaffiliated_regions() + old_trashed_regions) * region_size_bytes; + old_currently_available - (old_generation()->free_unaffiliated_regions() + old_trashed_regions) * region_size_bytes; if (old_fragmented_available > proposed_max_old) { - // After we've promoted regions in place, there may be an abundance of old-fragmented available memory, - // even more than the desired percentage for old reserve. We cannot transfer these fragmented regions back - // to young. Instead we make the best of the situation by using this fragmented memory for both promotions - // and evacuations. + // In this case, the old_fragmented_available is greater than the desired amount of evacuation to old. + // We'll use all of this memory to hold results of old evacuation, and we'll give back to the young generation + // any old regions that are not fragmented. + // + // This scenario may happen after we have promoted many regions in place, and each of these regions had non-zero + // unused memory, so there is now an abundance of old-fragmented available memory, even more than the desired + // percentage for old reserve. We cannot transfer these fragmented regions back to young. Instead we make the + // best of the situation by using this fragmented memory for both promotions and evacuations. + proposed_max_old = old_fragmented_available; } - size_t reserve_for_promo = old_fragmented_available; + // Otherwise: old_fragmented_available <= proposed_max_old. Do not shrink proposed_max_old from the original computation. + + // Though we initially set proposed_reserve_for_promo to equal the entirety of old fragmented available, we have the + // opportunity below to shift some of this memory into the proposed_reserve_for_mixed. + size_t proposed_reserve_for_promo = old_fragmented_available; const size_t max_old_reserve = proposed_max_old; + const size_t mixed_candidate_live_memory = old_generation()->unprocessed_collection_candidates_live_memory(); const bool doing_mixed = (mixed_candidate_live_memory > 0); if (doing_mixed) { - // We want this much memory to be unfragmented in order to reliably evacuate old. This is conservative because we - // may not evacuate the entirety of unprocessed candidates in a single mixed evacuation. + // In the ideal, all of the memory reserved for mixed evacuation would be unfragmented, but we don't enforce + // this. Note that the initial value of max_evac_need is conservative because we may not evacuate all of the + // remaining mixed evacuation candidates in a single cycle. const size_t max_evac_need = (size_t) (mixed_candidate_live_memory * ShenandoahOldEvacWaste); - assert(old_available >= old_generation()->free_unaffiliated_regions() * region_size_bytes, + assert(old_currently_available >= old_generation()->free_unaffiliated_regions() * region_size_bytes, "Unaffiliated available must be less than total available"); // We prefer to evacuate all of mixed into unfragmented memory, and will expand old in order to do so, unless // we already have too much fragmented available memory in old. - reserve_for_mixed = max_evac_need; - if (reserve_for_mixed + reserve_for_promo > max_old_reserve) { - // In this case, we'll allow old-evac to target some of the fragmented old memory. - size_t excess_reserves = (reserve_for_mixed + reserve_for_promo) - max_old_reserve; - if (reserve_for_promo > excess_reserves) { - reserve_for_promo -= excess_reserves; + proposed_reserve_for_mixed = max_evac_need; + if (proposed_reserve_for_mixed + proposed_reserve_for_promo > max_old_reserve) { + // We're trying to reserve more memory than is available. So we need to shrink our reserves. + size_t excess_reserves = (proposed_reserve_for_mixed + proposed_reserve_for_promo) - max_old_reserve; + // We need to shrink reserves by excess_reserves. We prefer to shrink by reducing promotion, giving priority to mixed + // evacuation. If the promotion reserve is larger than the amount we need to shrink by, do all the shrinkage there. + if (proposed_reserve_for_promo > excess_reserves) { + proposed_reserve_for_promo -= excess_reserves; } else { - excess_reserves -= reserve_for_promo; - reserve_for_promo = 0; - reserve_for_mixed -= excess_reserves; + // Otherwise, we'll shrink promotion reserve to zero and we'll shrink the mixed-evac reserve by the remaining excess. + excess_reserves -= proposed_reserve_for_promo; + proposed_reserve_for_promo = 0; + proposed_reserve_for_mixed -= excess_reserves; } } } + assert(proposed_reserve_for_mixed + proposed_reserve_for_promo <= max_old_reserve, + "Reserve for mixed (%zu) plus reserve for promotions (%zu) must be less than maximum old reserve (%zu)", + proposed_reserve_for_mixed, proposed_reserve_for_promo, max_old_reserve); // Decide how much additional space we should reserve for promotions from young. We give priority to mixed evacations // over promotions. const size_t promo_load = old_generation()->get_promotion_potential(); const bool doing_promotions = promo_load > 0; - if (doing_promotions) { - // We've already set aside all of the fragmented available memory within old-gen to represent old objects - // to be promoted from young generation. promo_load represents the memory that we anticipate to be promoted - // from regions that have reached tenure age. In the ideal, we will always use fragmented old-gen memory - // to hold individually promoted objects and will use unfragmented old-gen memory to represent the old-gen - // evacuation workloa. - // We're promoting and have an estimate of memory to be promoted from aged regions - assert(max_old_reserve >= (reserve_for_mixed + reserve_for_promo), "Sanity"); - const size_t available_for_additional_promotions = max_old_reserve - (reserve_for_mixed + reserve_for_promo); - size_t promo_need = (size_t)(promo_load * ShenandoahPromoEvacWaste); - if (promo_need > reserve_for_promo) { - reserve_for_promo += MIN2(promo_need - reserve_for_promo, available_for_additional_promotions); + // promo_load represents the combined total of live memory within regions that have reached tenure age. The true + // promotion potential is larger than this, because individual objects within regions that have not yet reached tenure + // age may be promotable. On the other hand, some of the objects that we intend to promote in the next GC cycle may + // die before they are next marked. In the future, the promo_load will include the total size of tenurable objects + // residing in regions that have not yet reached tenure age. + + if (doing_promotions) { + // We are always doing promotions, even when old_generation->get_promotion_potential() returns 0. As currently implemented, + // get_promotion_potential() only knows the total live memory contained within young-generation regions whose age is + // tenurable. It does not know whether that memory will still be live at the end of the next mark cycle, and it doesn't + // know how much memory is contained within objects whose individual ages are tenurable, which reside in regions with + // non-tenurable age. We use this, as adjusted by ShenandoahPromoEvacWaste, as an approximation of the total amount of + // memory to be promoted. In the near future, we expect to implement a change that will allow get_promotion_potential() + // to account also for the total memory contained within individual objects that are tenure-ready even when they do + // not reside in aged regions. This will represent a conservative over approximation of promotable memory because + // some of these objects may die before the next GC cycle executes. + + // Be careful not to ask for too much promotion reserves. We have observed jtreg test failures under which a greedy + // promotion reserve causes a humongous allocation which is awaiting a full GC to fail (specifically + // gc/TestAllocHumongousFragment.java). This happens if too much of the memory reclaimed by the full GC + // is immediately reserved so that it cannot be allocated by the waiting mutator. It's not clear that this + // particular test is representative of the needs of typical GenShen users. It is really a test of high frequency + // Full GCs under heap fragmentation stress. + + size_t promo_need = (size_t) (promo_load * ShenandoahPromoEvacWaste); + if (promo_need > proposed_reserve_for_promo) { + const size_t available_for_additional_promotions = + max_old_reserve - (proposed_reserve_for_mixed + proposed_reserve_for_promo); + if (proposed_reserve_for_promo + available_for_additional_promotions >= promo_need) { + proposed_reserve_for_promo = promo_need; + } else { + proposed_reserve_for_promo += available_for_additional_promotions; + } } - // We've already reserved all the memory required for the promo_load, and possibly more. The excess - // can be consumed by objects promoted from regions that have not yet reached tenure age. } + // else, leave proposed_reserve_for_promo as is. By default, it is initialized to represent old_fragmented_available. // This is the total old we want to reserve (initialized to the ideal reserve) - size_t old_reserve = reserve_for_mixed + reserve_for_promo; + size_t proposed_old_reserve = proposed_reserve_for_mixed + proposed_reserve_for_promo; // We now check if the old generation is running a surplus or a deficit. size_t old_region_deficit = 0; @@ -702,68 +741,70 @@ void ShenandoahGenerationalHeap::compute_old_generation_balance(size_t mutator_x // align the mutator_xfer_limit on region size mutator_xfer_limit = mutator_region_xfer_limit * region_size_bytes; - if (old_available >= old_reserve) { + if (old_currently_available >= proposed_old_reserve) { // We are running a surplus, so the old region surplus can go to young - const size_t old_surplus = old_available - old_reserve; + const size_t old_surplus = old_currently_available - proposed_old_reserve; old_region_surplus = old_surplus / region_size_bytes; const size_t unaffiliated_old_regions = old_generation()->free_unaffiliated_regions() + old_trashed_regions; old_region_surplus = MIN2(old_region_surplus, unaffiliated_old_regions); old_generation()->set_region_balance(checked_cast(old_region_surplus)); - } else if (old_available + mutator_xfer_limit >= old_reserve) { - // Mutator's xfer limit is sufficient to satisfy our need: transfer all memory from there - size_t old_deficit = old_reserve - old_available; + old_currently_available -= old_region_surplus * region_size_bytes; + young_available += old_region_surplus * region_size_bytes; + } else if (old_currently_available + mutator_xfer_limit >= proposed_old_reserve) { + // We know that old_currently_available < proposed_old_reserve because above test failed. Expand old_currently_available. + // Mutator's xfer limit is sufficient to satisfy our need: transfer all memory from there. + size_t old_deficit = proposed_old_reserve - old_currently_available; old_region_deficit = (old_deficit + region_size_bytes - 1) / region_size_bytes; old_generation()->set_region_balance(0 - checked_cast(old_region_deficit)); + old_currently_available += old_region_deficit * region_size_bytes; + young_available -= old_region_deficit * region_size_bytes; } else { - // We'll try to xfer from both mutator excess and from young collector reserve - size_t available_reserves = old_available + young_reserve + mutator_xfer_limit; - size_t old_entitlement = (available_reserves * ShenandoahOldEvacPercent) / 100; + // We know that (old_currently_available < proposed_old_reserve) and + // (old_currently_available + mutator_xfer_limit < proposed_old_reserve) because above tests failed. + // We need to shrink proposed_old_reserves. - // Round old_entitlement down to nearest multiple of regions to be transferred to old - size_t entitled_xfer = old_entitlement - old_available; - entitled_xfer = region_size_bytes * (entitled_xfer / region_size_bytes); - size_t unaffiliated_young_regions = young_generation()->free_unaffiliated_regions(); - size_t unaffiliated_young_memory = unaffiliated_young_regions * region_size_bytes; - if (entitled_xfer > unaffiliated_young_memory) { - entitled_xfer = unaffiliated_young_memory; - } - old_entitlement = old_available + entitled_xfer; - if (old_entitlement < old_reserve) { - // There's not enough memory to satisfy our desire. Scale back our old-gen intentions. - size_t budget_overrun = old_reserve - old_entitlement;; - if (reserve_for_promo > budget_overrun) { - reserve_for_promo -= budget_overrun; - old_reserve -= budget_overrun; - } else { - budget_overrun -= reserve_for_promo; - reserve_for_promo = 0; - reserve_for_mixed = (reserve_for_mixed > budget_overrun)? reserve_for_mixed - budget_overrun: 0; - old_reserve = reserve_for_promo + reserve_for_mixed; - } - } + // We could potentially shrink young_reserves in order to further expand proposed_old_reserves. Let's not bother. The + // important thing is that we keep a total amount of memory in reserve in preparation for the next GC cycle. At + // the time we choose the next collection set, we'll have an opportunity to shift some of these young reserves + // into old reserves if that makes sense. - // Because of adjustments above, old_reserve may be smaller now than it was when we tested the branch - // condition above: "(old_available + mutator_xfer_limit >= old_reserve) - // Therefore, we do NOT know that: mutator_xfer_limit < old_reserve - old_available - - size_t old_deficit = old_reserve - old_available; - old_region_deficit = (old_deficit + region_size_bytes - 1) / region_size_bytes; - - // Shrink young_reserve to account for loan to old reserve - const size_t reserve_xfer_regions = old_region_deficit - mutator_region_xfer_limit; - young_reserve -= reserve_xfer_regions * region_size_bytes; + // Start by taking all of mutator_xfer_limit into old_currently_available. + size_t old_region_deficit = mutator_region_xfer_limit; old_generation()->set_region_balance(0 - checked_cast(old_region_deficit)); + old_currently_available += old_region_deficit * region_size_bytes; + young_available -= old_region_deficit * region_size_bytes; + + assert(old_currently_available < proposed_old_reserve, + "Old currently available (%zu) must be less than old reserve (%zu)", old_currently_available, proposed_old_reserve); + + // There's not enough memory to satisfy our desire. Scale back our old-gen intentions. We prefer to satisfy + // the budget_overrun entirely from the promotion reserve, if that is large enough. Otherwise, we'll satisfy + // the overrun from a combination of promotion and mixed-evacuation reserves. + size_t budget_overrun = proposed_old_reserve - old_currently_available; + if (proposed_reserve_for_promo > budget_overrun) { + proposed_reserve_for_promo -= budget_overrun; + // Dead code: + // proposed_old_reserve -= budget_overrun; + } else { + budget_overrun -= proposed_reserve_for_promo; + proposed_reserve_for_promo = 0; + proposed_reserve_for_mixed = (proposed_reserve_for_mixed > budget_overrun)? proposed_reserve_for_mixed - budget_overrun: 0; + // Dead code: + // Note: proposed_reserve_for_promo is 0 and proposed_reserve_for_mixed may equal 0. + // proposed_old_reserve = proposed_reserve_for_mixed; + } } - assert(old_region_deficit == 0 || old_region_surplus == 0, "Only surplus or deficit, never both"); - assert(young_reserve + reserve_for_mixed + reserve_for_promo <= old_available + young_available, + assert(old_region_deficit == 0 || old_region_surplus == 0, + "Only surplus (%zu) or deficit (%zu), never both", old_region_surplus, old_region_deficit); + assert(young_reserve + proposed_reserve_for_mixed + proposed_reserve_for_promo <= old_currently_available + young_available, "Cannot reserve more memory than is available: %zu + %zu + %zu <= %zu + %zu", - young_reserve, reserve_for_mixed, reserve_for_promo, old_available, young_available); + young_reserve, proposed_reserve_for_mixed, proposed_reserve_for_promo, old_currently_available, young_available); // deficit/surplus adjustments to generation sizes will precede rebuild young_generation()->set_evacuation_reserve(young_reserve); - old_generation()->set_evacuation_reserve(reserve_for_mixed); - old_generation()->set_promoted_reserve(reserve_for_promo); + old_generation()->set_evacuation_reserve(proposed_reserve_for_mixed); + old_generation()->set_promoted_reserve(proposed_reserve_for_promo); } void ShenandoahGenerationalHeap::coalesce_and_fill_old_regions(bool concurrent) { @@ -1108,6 +1149,10 @@ void ShenandoahGenerationalHeap::complete_degenerated_cycle() { ShenandoahGCPhase phase(ShenandoahPhaseTimings::degen_gc_coalesce_and_fill); coalesce_and_fill_old_regions(false); } + + log_info(gc, cset)("Degenerated cycle complete, promotions reserved: %zu, promotions expended: %zu, failed count: %zu, failed bytes: %zu", + old_generation()->get_promoted_reserve(), old_generation()->get_promoted_expended(), + old_generation()->get_promotion_failed_count(), old_generation()->get_promotion_failed_words() * HeapWordSize); } void ShenandoahGenerationalHeap::complete_concurrent_cycle() { @@ -1121,6 +1166,10 @@ void ShenandoahGenerationalHeap::complete_concurrent_cycle() { // throw off the heuristics. entry_global_coalesce_and_fill(); } + + log_info(gc, cset)("Concurrent cycle complete, promotions reserved: %zu, promotions expended: %zu, failed count: %zu, failed bytes: %zu", + old_generation()->get_promoted_reserve(), old_generation()->get_promoted_expended(), + old_generation()->get_promotion_failed_count(), old_generation()->get_promotion_failed_words() * HeapWordSize); } void ShenandoahGenerationalHeap::entry_global_coalesce_and_fill() { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index ccfc1c036c2..d78bdae6a51 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -86,6 +86,7 @@ #include "nmt/memTracker.hpp" #include "oops/compressedOops.inline.hpp" #include "prims/jvmtiTagMap.hpp" +#include "runtime/atomic.hpp" #include "runtime/atomicAccess.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.inline.hpp" @@ -201,9 +202,9 @@ jint ShenandoahHeap::initialize() { assert(num_min_regions <= _num_regions, "sanity"); _minimum_size = num_min_regions * reg_size_bytes; - _soft_max_size = clamp(SoftMaxHeapSize, min_capacity(), max_capacity()); + _soft_max_size.store_relaxed(clamp(SoftMaxHeapSize, min_capacity(), max_capacity())); - _committed = _initial_size; + _committed.store_relaxed(_initial_size); size_t heap_page_size = UseLargePages ? os::large_page_size() : os::vm_page_size(); size_t bitmap_page_size = UseLargePages ? os::large_page_size() : os::vm_page_size(); @@ -725,17 +726,17 @@ size_t ShenandoahHeap::used() const { } size_t ShenandoahHeap::committed() const { - return AtomicAccess::load(&_committed); + return _committed.load_relaxed(); } void ShenandoahHeap::increase_committed(size_t bytes) { shenandoah_assert_heaplocked_or_safepoint(); - _committed += bytes; + _committed.fetch_then_add(bytes, memory_order_relaxed); } void ShenandoahHeap::decrease_committed(size_t bytes) { shenandoah_assert_heaplocked_or_safepoint(); - _committed -= bytes; + _committed.fetch_then_sub(bytes, memory_order_relaxed); } size_t ShenandoahHeap::capacity() const { @@ -747,7 +748,7 @@ size_t ShenandoahHeap::max_capacity() const { } size_t ShenandoahHeap::soft_max_capacity() const { - size_t v = AtomicAccess::load(&_soft_max_size); + size_t v = _soft_max_size.load_relaxed(); assert(min_capacity() <= v && v <= max_capacity(), "Should be in bounds: %zu <= %zu <= %zu", min_capacity(), v, max_capacity()); @@ -758,7 +759,7 @@ void ShenandoahHeap::set_soft_max_capacity(size_t v) { assert(min_capacity() <= v && v <= max_capacity(), "Should be in bounds: %zu <= %zu <= %zu", min_capacity(), v, max_capacity()); - AtomicAccess::store(&_soft_max_size, v); + _soft_max_size.store_relaxed(v); } size_t ShenandoahHeap::min_capacity() const { @@ -1775,12 +1776,7 @@ void ShenandoahHeap::scan_roots_for_iteration(ShenandoahScanObjectStack* oop_sta void ShenandoahHeap::reclaim_aux_bitmap_for_iteration() { if (!_aux_bitmap_region_special) { - bool success = os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size()); - if (!success) { - log_warning(gc)("Auxiliary marking bitmap uncommit failed: " PTR_FORMAT " (%zu bytes)", - p2i(_aux_bitmap_region.start()), _aux_bitmap_region.byte_size()); - assert(false, "Auxiliary marking bitmap uncommit should always succeed"); - } + os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size()); } } @@ -1946,7 +1942,7 @@ private: size_t const _stride; shenandoah_padding(0); - volatile size_t _index; + Atomic _index; shenandoah_padding(1); public: @@ -1959,8 +1955,8 @@ public: size_t stride = _stride; size_t max = _heap->num_regions(); - while (AtomicAccess::load(&_index) < max) { - size_t cur = AtomicAccess::fetch_then_add(&_index, stride, memory_order_relaxed); + while (_index.load_relaxed() < max) { + size_t cur = _index.fetch_then_add(stride, memory_order_relaxed); size_t start = cur; size_t end = MIN2(cur + stride, max); if (start >= max) break; @@ -2626,11 +2622,7 @@ void ShenandoahHeap::uncommit_bitmap_slice(ShenandoahHeapRegion *r) { size_t len = _bitmap_bytes_per_slice; char* addr = (char*) _bitmap_region.start() + off; - bool success = os::uncommit_memory(addr, len); - if (!success) { - log_warning(gc)("Bitmap slice uncommit failed: " PTR_FORMAT " (%zu bytes)", p2i(addr), len); - assert(false, "Bitmap slice uncommit should always succeed"); - } + os::uncommit_memory(addr, len); } void ShenandoahHeap::forbid_uncommit() { @@ -2712,11 +2704,11 @@ ShenandoahRegionIterator::ShenandoahRegionIterator(ShenandoahHeap* heap) : _index(0) {} void ShenandoahRegionIterator::reset() { - _index = 0; + _index.store_relaxed(0); } bool ShenandoahRegionIterator::has_next() const { - return _index < _heap->num_regions(); + return _index.load_relaxed() < _heap->num_regions(); } ShenandoahLiveData* ShenandoahHeap::get_liveness_cache(uint worker_id) { @@ -2842,3 +2834,13 @@ void ShenandoahHeap::log_heap_status(const char* msg) const { global_generation()->log_status(msg); } } + +ShenandoahHeapLocker::ShenandoahHeapLocker(ShenandoahHeapLock* lock, bool allow_block_for_safepoint) : _lock(lock) { +#ifdef ASSERT + ShenandoahFreeSet* free_set = ShenandoahHeap::heap()->free_set(); + // free_set is nullptr only at pre-initialized state + assert(free_set == nullptr || !free_set->rebuild_lock()->owned_by_self(), "Dead lock, can't acquire heap lock while holding free-set rebuild lock"); + assert(_lock != nullptr, "Must not"); +#endif + _lock->lock(allow_block_for_safepoint); +} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp index 9240091070b..85ad339469d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp @@ -88,7 +88,7 @@ private: ShenandoahHeap* _heap; shenandoah_padding(0); - volatile size_t _index; + Atomic _index; shenandoah_padding(1); // No implicit copying: iterators should be passed by reference to capture the state @@ -117,9 +117,23 @@ public: virtual bool is_thread_safe() { return false; } }; -typedef ShenandoahLock ShenandoahHeapLock; -typedef ShenandoahLocker ShenandoahHeapLocker; -typedef Stack ShenandoahScanObjectStack; +typedef ShenandoahLock ShenandoahHeapLock; +// ShenandoahHeapLocker implements locker to assure mutually exclusive access to the global heap data structures. +// Asserts in the implementation detect potential deadlock usage with regards the rebuild lock that is present +// in ShenandoahFreeSet. Whenever both locks are acquired, this lock should be acquired before the +// ShenandoahFreeSet rebuild lock. +class ShenandoahHeapLocker : public StackObj { +private: + ShenandoahHeapLock* _lock; +public: + ShenandoahHeapLocker(ShenandoahHeapLock* lock, bool allow_block_for_safepoint = false); + + ~ShenandoahHeapLocker() { + _lock->unlock(); + } +}; + +typedef Stack ShenandoahScanObjectStack; // Shenandoah GC is low-pause concurrent GC that uses a load reference barrier // for concurent evacuation and a snapshot-at-the-beginning write barrier for @@ -208,9 +222,9 @@ private: size_t _initial_size; size_t _minimum_size; - volatile size_t _soft_max_size; + Atomic _soft_max_size; shenandoah_padding(0); - volatile size_t _committed; + Atomic _committed; shenandoah_padding(1); public: @@ -340,7 +354,7 @@ private: ShenandoahSharedFlag _full_gc_move_in_progress; ShenandoahSharedFlag _concurrent_strong_root_in_progress; - size_t _gc_no_progress_count; + Atomic _gc_no_progress_count; // This updates the singular, global gc state. This call must happen on a safepoint. void set_gc_state_at_safepoint(uint mask, bool value); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp index e35f116b843..02f2beaf4e0 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp @@ -49,7 +49,7 @@ #include "gc/shenandoah/shenandoahWorkGroup.hpp" #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomicAccess.hpp" +#include "runtime/atomic.hpp" #include "runtime/javaThread.hpp" #include "runtime/objectMonitor.inline.hpp" #include "runtime/prefetch.inline.hpp" @@ -61,7 +61,7 @@ inline ShenandoahHeap* ShenandoahHeap::heap() { } inline ShenandoahHeapRegion* ShenandoahRegionIterator::next() { - size_t new_index = AtomicAccess::add(&_index, (size_t) 1, memory_order_relaxed); + size_t new_index = _index.add_then_fetch((size_t) 1, memory_order_relaxed); // get_region() provides the bounds-check and returns null on OOB. return _heap->get_region(new_index - 1); } @@ -75,15 +75,15 @@ inline WorkerThreads* ShenandoahHeap::safepoint_workers() { } inline void ShenandoahHeap::notify_gc_progress() { - AtomicAccess::store(&_gc_no_progress_count, (size_t) 0); + _gc_no_progress_count.store_relaxed((size_t) 0); } inline void ShenandoahHeap::notify_gc_no_progress() { - AtomicAccess::inc(&_gc_no_progress_count); + _gc_no_progress_count.add_then_fetch((size_t) 1); } inline size_t ShenandoahHeap::get_gc_no_progress_count() const { - return AtomicAccess::load(&_gc_no_progress_count); + return _gc_no_progress_count.load_relaxed(); } inline size_t ShenandoahHeap::heap_region_index_containing(const void* addr) const { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp index 6bb8382de0a..afc6b24e168 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp @@ -43,7 +43,6 @@ #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/globals_extension.hpp" #include "runtime/java.hpp" #include "runtime/mutexLocker.hpp" @@ -384,7 +383,7 @@ size_t ShenandoahHeapRegion::get_plab_allocs() const { void ShenandoahHeapRegion::set_live_data(size_t s) { assert(Thread::current()->is_VM_thread(), "by VM thread"); - _live_data = (s >> LogHeapWordSize); + _live_data.store_relaxed(s >> LogHeapWordSize); } void ShenandoahHeapRegion::print_on(outputStream* st) const { @@ -435,7 +434,7 @@ void ShenandoahHeapRegion::print_on(outputStream* st) const { st->print("|TAMS " SHR_PTR_FORMAT, p2i(ShenandoahHeap::heap()->marking_context()->top_at_mark_start(const_cast(this)))); st->print("|UWM " SHR_PTR_FORMAT, - p2i(_update_watermark)); + p2i(_update_watermark.load_relaxed())); st->print("|U %5zu%1s", byte_size_in_proper_unit(used()), proper_unit_for_byte_size(used())); st->print("|T %5zu%1s", byte_size_in_proper_unit(get_tlab_allocs()), proper_unit_for_byte_size(get_tlab_allocs())); st->print("|G %5zu%1s", byte_size_in_proper_unit(get_gclab_allocs()), proper_unit_for_byte_size(get_gclab_allocs())); @@ -817,11 +816,7 @@ void ShenandoahHeapRegion::do_commit() { void ShenandoahHeapRegion::do_uncommit() { ShenandoahHeap* heap = ShenandoahHeap::heap(); if (!heap->is_heap_region_special()) { - bool success = os::uncommit_memory((char *) bottom(), RegionSizeBytes); - if (!success) { - log_warning(gc)("Region uncommit failed: " PTR_FORMAT " (%zu bytes)", p2i(bottom()), RegionSizeBytes); - assert(false, "Region uncommit should always succeed"); - } + os::uncommit_memory((char *) bottom(), RegionSizeBytes); } if (!heap->is_bitmap_region_special()) { heap->uncommit_bitmap_slice(this); @@ -839,20 +834,20 @@ void ShenandoahHeapRegion::set_state(RegionState to) { evt.set_to(to); evt.commit(); } - AtomicAccess::store(&_state, to); + _state.store_relaxed(to); } void ShenandoahHeapRegion::record_pin() { - AtomicAccess::add(&_critical_pins, (size_t)1); + _critical_pins.add_then_fetch((size_t)1); } void ShenandoahHeapRegion::record_unpin() { assert(pin_count() > 0, "Region %zu should have non-zero pins", index()); - AtomicAccess::sub(&_critical_pins, (size_t)1); + _critical_pins.sub_then_fetch((size_t)1); } size_t ShenandoahHeapRegion::pin_count() const { - return AtomicAccess::load(&_critical_pins); + return _critical_pins.load_relaxed(); } void ShenandoahHeapRegion::set_affiliation(ShenandoahAffiliation new_affiliation) { @@ -864,7 +859,7 @@ void ShenandoahHeapRegion::set_affiliation(ShenandoahAffiliation new_affiliation log_debug(gc)("Setting affiliation of Region %zu from %s to %s, top: " PTR_FORMAT ", TAMS: " PTR_FORMAT ", watermark: " PTR_FORMAT ", top_bitmap: " PTR_FORMAT, index(), shenandoah_affiliation_name(region_affiliation), shenandoah_affiliation_name(new_affiliation), - p2i(top()), p2i(ctx->top_at_mark_start(this)), p2i(_update_watermark), p2i(ctx->top_bitmap(this))); + p2i(top()), p2i(ctx->top_at_mark_start(this)), p2i(_update_watermark.load_relaxed()), p2i(ctx->top_bitmap(this))); } #ifdef ASSERT diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp index 9da2816e2c9..3a0ac042f57 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp @@ -34,6 +34,7 @@ #include "gc/shenandoah/shenandoahAsserts.hpp" #include "gc/shenandoah/shenandoahHeap.hpp" #include "gc/shenandoah/shenandoahPadding.hpp" +#include "runtime/atomic.hpp" #include "utilities/sizes.hpp" class VMStructs; @@ -217,7 +218,7 @@ public: bool is_alloc_allowed() const { auto cur_state = state(); return is_empty_state(cur_state) || cur_state == _regular || cur_state == _pinned; } bool is_stw_move_allowed() const { auto cur_state = state(); return cur_state == _regular || cur_state == _cset || (ShenandoahHumongousMoves && cur_state == _humongous_start); } - RegionState state() const { return AtomicAccess::load(&_state); } + RegionState state() const { return _state.load_relaxed(); } int state_ordinal() const { return region_state_to_ordinal(state()); } void record_pin(); @@ -247,7 +248,7 @@ private: HeapWord* _top_before_promoted; // Seldom updated fields - volatile RegionState _state; + Atomic _state; HeapWord* _coalesce_and_fill_boundary; // for old regions not selected as collection set candidates. // Frequently updated fields @@ -257,12 +258,12 @@ private: size_t _gclab_allocs; size_t _plab_allocs; - volatile size_t _live_data; - volatile size_t _critical_pins; + Atomic _live_data; + Atomic _critical_pins; size_t _mixed_candidate_garbage_words; - HeapWord* volatile _update_watermark; + Atomic _update_watermark; uint _age; bool _promoted_in_place; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp index be982433885..39b7c732703 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp @@ -32,7 +32,6 @@ #include "gc/shenandoah/shenandoahGenerationalHeap.hpp" #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahOldGeneration.hpp" -#include "runtime/atomicAccess.hpp" HeapWord* ShenandoahHeapRegion::allocate_aligned(size_t size, ShenandoahAllocRequest &req, size_t alignment_in_bytes) { shenandoah_assert_heaplocked_or_safepoint(); @@ -147,16 +146,16 @@ inline void ShenandoahHeapRegion::increase_live_data_gc_words(size_t s) { } inline void ShenandoahHeapRegion::internal_increase_live_data(size_t s) { - AtomicAccess::add(&_live_data, s, memory_order_relaxed); + _live_data.add_then_fetch(s, memory_order_relaxed); } inline void ShenandoahHeapRegion::clear_live_data() { - AtomicAccess::store(&_live_data, (size_t)0); + _live_data.store_relaxed((size_t)0); _promoted_in_place = false; } inline size_t ShenandoahHeapRegion::get_live_data_words() const { - return AtomicAccess::load(&_live_data); + return _live_data.load_relaxed(); } inline size_t ShenandoahHeapRegion::get_live_data_bytes() const { @@ -205,21 +204,21 @@ inline size_t ShenandoahHeapRegion::garbage_before_padded_for_promote() const { } inline HeapWord* ShenandoahHeapRegion::get_update_watermark() const { - HeapWord* watermark = AtomicAccess::load_acquire(&_update_watermark); + HeapWord* watermark = _update_watermark.load_acquire(); assert(bottom() <= watermark && watermark <= top(), "within bounds"); return watermark; } inline void ShenandoahHeapRegion::set_update_watermark(HeapWord* w) { assert(bottom() <= w && w <= top(), "within bounds"); - AtomicAccess::release_store(&_update_watermark, w); + _update_watermark.release_store(w); } // Fast version that avoids synchronization, only to be used at safepoints. inline void ShenandoahHeapRegion::set_update_watermark_at_safepoint(HeapWord* w) { assert(bottom() <= w && w <= top(), "within bounds"); assert(SafepointSynchronize::is_at_safepoint(), "Should be at Shenandoah safepoint"); - _update_watermark = w; + _update_watermark.store_relaxed(w); } inline ShenandoahAffiliation ShenandoahHeapRegion::affiliation() const { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahInPlacePromoter.cpp b/src/hotspot/share/gc/shenandoah/shenandoahInPlacePromoter.cpp new file mode 100644 index 00000000000..83f4217df83 --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahInPlacePromoter.cpp @@ -0,0 +1,311 @@ +/* + * 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. + * + */ + +#include "gc/shared/plab.hpp" +#include "gc/shenandoah/shenandoahFreeSet.hpp" +#include "gc/shenandoah/shenandoahGenerationalHeap.inline.hpp" +#include "gc/shenandoah/shenandoahHeap.inline.hpp" +#include "gc/shenandoah/shenandoahHeapRegion.inline.hpp" +#include "gc/shenandoah/shenandoahInPlacePromoter.hpp" +#include "gc/shenandoah/shenandoahMarkingContext.hpp" +#include "gc/shenandoah/shenandoahOldGeneration.hpp" +#include "gc/shenandoah/shenandoahYoungGeneration.hpp" + +ShenandoahInPlacePromotionPlanner::RegionPromotions::RegionPromotions(ShenandoahFreeSet* free_set) + : _low_idx(free_set->max_regions()) + , _high_idx(-1) + , _regions(0) + , _bytes(0) + , _free_set(free_set) +{ +} + +void ShenandoahInPlacePromotionPlanner::RegionPromotions::increment(idx_t region_index, size_t remnant_bytes) { + if (region_index < _low_idx) { + _low_idx = region_index; + } + if (region_index > _high_idx) { + _high_idx = region_index; + } + _regions++; + _bytes += remnant_bytes; +} + +void ShenandoahInPlacePromotionPlanner::RegionPromotions::update_free_set(ShenandoahFreeSetPartitionId partition_id) const { + if (_regions > 0) { + _free_set->shrink_interval_if_range_modifies_either_boundary(partition_id, _low_idx, _high_idx, _regions); + } +} + +ShenandoahInPlacePromotionPlanner::ShenandoahInPlacePromotionPlanner(const ShenandoahGenerationalHeap* heap) + : _old_garbage_threshold(ShenandoahHeapRegion::region_size_bytes() * heap->old_generation()->heuristics()->get_old_garbage_threshold() / 100) + , _pip_used_threshold(ShenandoahHeapRegion::region_size_bytes() * ShenandoahGenerationalMinPIPUsage / 100) + , _heap(heap) + , _free_set(_heap->free_set()) + , _marking_context(_heap->marking_context()) + , _mutator_regions(_free_set) + , _collector_regions(_free_set) + , _pip_padding_bytes(0) +{ +} + +bool ShenandoahInPlacePromotionPlanner::is_eligible(const ShenandoahHeapRegion* region) const { + return region->garbage() < _old_garbage_threshold && region->used() > _pip_used_threshold; +} + +void ShenandoahInPlacePromotionPlanner::prepare(ShenandoahHeapRegion* r) { + HeapWord* tams = _marking_context->top_at_mark_start(r); + HeapWord* original_top = r->top(); + + if (_heap->is_concurrent_mark_in_progress() || tams != original_top) { + // We do not promote this region (either in place or by copy) because it has received new allocations. + // During evacuation, we exclude from promotion regions for which age > tenure threshold, garbage < garbage-threshold, + // used > pip_used_threshold, and get_top_before_promote() != tams. + // TODO: Such a region should have had its age reset to zero when it was used for allocation? + return; + } + + // No allocations from this region have been made during concurrent mark. It meets all the criteria + // for in-place-promotion. Though we only need the value of top when we fill the end of the region, + // we use this field to indicate that this region should be promoted in place during the evacuation + // phase. + r->save_top_before_promote(); + size_t remnant_bytes = r->free(); + size_t remnant_words = remnant_bytes / HeapWordSize; + assert(ShenandoahHeap::min_fill_size() <= PLAB::min_size(), "Implementation makes invalid assumptions"); + if (remnant_words >= ShenandoahHeap::min_fill_size()) { + ShenandoahHeap::fill_with_object(original_top, remnant_words); + // Fill the remnant memory within this region to assure no allocations prior to promote in place. Otherwise, + // newly allocated objects will not be parsable when promote in place tries to register them. Furthermore, any + // new allocations would not necessarily be eligible for promotion. This addresses both issues. + r->set_top(r->end()); + // The region r is either in the Mutator or Collector partition if remnant_words > heap()->plab_min_size. + // Otherwise, the region is in the NotFree partition. + const idx_t i = r->index(); + ShenandoahFreeSetPartitionId p = _free_set->membership(i); + if (p == ShenandoahFreeSetPartitionId::Mutator) { + _mutator_regions.increment(i, remnant_bytes); + } else if (p == ShenandoahFreeSetPartitionId::Collector) { + _collector_regions.increment(i, remnant_bytes); + } else { + assert((p == ShenandoahFreeSetPartitionId::NotFree) && (remnant_words < _heap->plab_min_size()), + "Should be NotFree if not in Collector or Mutator partitions"); + // In this case, the memory is already counted as used and the region has already been retired. There is + // no need for further adjustments to used. Further, the remnant memory for this region will not be + // unallocated or made available to OldCollector after pip. + remnant_bytes = 0; + } + + _pip_padding_bytes += remnant_bytes; + _free_set->prepare_to_promote_in_place(i, remnant_bytes); + } else { + // Since the remnant is so small that this region has already been retired, we don't have to worry about any + // accidental allocations occurring within this region before the region is promoted in place. + + // This region was already not in the Collector or Mutator set, so no need to remove it. + assert(_free_set->membership(r->index()) == ShenandoahFreeSetPartitionId::NotFree, "sanity"); + } +} + +void ShenandoahInPlacePromotionPlanner::update_free_set() const { + _heap->old_generation()->set_pad_for_promote_in_place(_pip_padding_bytes); + + if (_mutator_regions._regions + _collector_regions._regions > 0) { + _free_set->account_for_pip_regions(_mutator_regions._regions, _mutator_regions._bytes, + _collector_regions._regions, _collector_regions._bytes); + } + + // Retire any regions that have been selected for promote in place + _mutator_regions.update_free_set(ShenandoahFreeSetPartitionId::Mutator); + _collector_regions.update_free_set(ShenandoahFreeSetPartitionId::Collector); +} + +void ShenandoahInPlacePromoter::maybe_promote_region(ShenandoahHeapRegion* r) const { + if (r->is_young() && r->is_active() && _heap->is_tenurable(r)) { + if (r->is_humongous_start()) { + // We promote humongous_start regions along with their affiliated continuations during evacuation rather than + // doing this work during a safepoint. We cannot put humongous regions into the collection set because that + // triggers the load-reference barrier (LRB) to copy on reference fetch. + // + // Aged humongous continuation regions are handled with their start region. If an aged regular region has + // more garbage than ShenandoahOldGarbageThreshold, we'll promote by evacuation. If there is room for evacuation + // in this cycle, the region will be in the collection set. If there is no room, the region will be promoted + // by evacuation in some future GC cycle. + + // We do not promote primitive arrays because there's no performance penalty keeping them in young. When/if they + // become garbage, reclaiming the memory from young is much quicker and more efficient than reclaiming them from old. + oop obj = cast_to_oop(r->bottom()); + if (!obj->is_typeArray()) { + promote_humongous(r); + } + } else if (r->is_regular() && (r->get_top_before_promote() != nullptr)) { + // Likewise, we cannot put promote-in-place regions into the collection set because that would also trigger + // the LRB to copy on reference fetch. + // + // If an aged regular region has received allocations during the current cycle, we do not promote because the + // newly allocated objects do not have appropriate age; this region's age will be reset to zero at end of cycle. + promote(r); + } + } +} + +// When we promote a region in place, we can continue to use the established marking context to guide subsequent remembered +// set scans of this region's content. The region will be coalesced and filled prior to the next old-gen marking effort. +// We identify the entirety of the region as DIRTY to force the next remembered set scan to identify the "interesting pointers" +// contained herein. +void ShenandoahInPlacePromoter::promote(ShenandoahHeapRegion* region) const { + + ShenandoahMarkingContext* const marking_context = _heap->young_generation()->complete_marking_context(); + HeapWord* const tams = marking_context->top_at_mark_start(region); + size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes(); + + { + const size_t old_garbage_threshold = + (region_size_bytes * _heap->old_generation()->heuristics()->get_old_garbage_threshold()) / 100; + assert(!_heap->is_concurrent_old_mark_in_progress(), "Cannot promote in place during old marking"); + assert(region->garbage_before_padded_for_promote() < old_garbage_threshold, + "Region %zu has too much garbage for promotion", region->index()); + assert(region->is_young(), "Only young regions can be promoted"); + assert(region->is_regular(), "Use different service to promote humongous regions"); + assert(_heap->is_tenurable(region), "Only promote regions that are sufficiently aged"); + assert(region->get_top_before_promote() == tams, "Region %zu has been used for allocations before promotion", region->index()); + } + + ShenandoahOldGeneration* const old_gen = _heap->old_generation(); + + // 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. + ShenandoahScanRemembered* const scanner = old_gen->card_scan(); + scanner->reset_object_range(region->bottom(), region->end()); + scanner->mark_range_as_dirty(region->bottom(), region->get_top_before_promote() - region->bottom()); + + HeapWord* obj_addr = region->bottom(); + while (obj_addr < tams) { + oop obj = cast_to_oop(obj_addr); + if (marking_context->is_marked(obj)) { + assert(obj->klass() != nullptr, "klass should not be null"); + // This thread is responsible for registering all objects in this region. No need for lock. + scanner->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); + scanner->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()); +#ifdef ASSERT + HeapWord* update_watermark = region->get_update_watermark(); + // pip_unpadded is memory too small to be filled above original top + size_t pip_unpadded = (region->end() - region->top()) * HeapWordSize; + assert((region->top() == region->end()) + || (pip_unpadded == (size_t) ((region->end() - region->top()) * HeapWordSize)), "Invariant"); + assert(pip_unpadded < ShenandoahHeap::min_fill_size() * HeapWordSize, "Sanity"); + size_t pip_pad_bytes = (region->top() - region->get_top_before_promote()) * HeapWordSize; + assert((pip_unpadded == 0) || (pip_pad_bytes == 0), "Only one of pip_unpadded and pip_pad_bytes is non-zero"); +#endif + + // Now that this region is affiliated with old, we can allow it to receive allocations, though it may not be in the + // is_collector_free range. We'll add it to that range below. + region->restore_top_before_promote(); + + assert(region->used() + pip_pad_bytes + pip_unpadded == region_size_bytes, "invariant"); + + // The update_watermark was likely established while we had the artificially high value of top. Make it sane now. + assert(update_watermark >= region->top(), "original top cannot exceed preserved update_watermark"); + region->set_update_watermark(region->top()); + + // Transfer this region from young to old, increasing promoted_reserve if available space exceeds plab_min_size() + _heap->free_set()->add_promoted_in_place_region_to_old_collector(region); + region->set_affiliation(OLD_GENERATION); + region->set_promoted_in_place(); + } +} + +void ShenandoahInPlacePromoter::promote_humongous(ShenandoahHeapRegion* region) const { + oop obj = cast_to_oop(region->bottom()); + + assert(region->is_young(), "Only young regions can be promoted"); + assert(region->is_humongous_start(), "Should not promote humongous continuation in isolation"); + assert(_heap->is_tenurable(region), "Only promote regions that are sufficiently aged"); + assert(_heap->marking_context()->is_marked(obj), "Promoted humongous object should be alive"); + assert(!obj->is_typeArray(), "Don't promote humongous primitives"); + + const size_t used_bytes = obj->size() * HeapWordSize; + const size_t spanned_regions = ShenandoahHeapRegion::required_regions(used_bytes); + const size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes(); + const size_t humongous_waste = spanned_regions * region_size_bytes - obj->size() * HeapWordSize; + const size_t index_limit = region->index() + spanned_regions; + + ShenandoahOldGeneration* const old_gen = _heap->old_generation(); + { + // We need to grab the heap lock in order to avoid a race when changing the affiliations of spanned_regions from + // young to old. + ShenandoahHeapLocker locker(_heap->lock()); + + // We promote humongous objects unconditionally, without checking for availability. We adjust + // usage totals, including humongous waste, after evacuation is done. + log_debug(gc)("promoting humongous region %zu, spanning %zu", region->index(), spanned_regions); + + // For this region and each humongous continuation region spanned by this humongous object, change + // affiliation to OLD_GENERATION and adjust the generation-use tallies. The remnant of memory + // in the last humongous region that is not spanned by obj is currently not used. + for (size_t i = region->index(); i < index_limit; i++) { + ShenandoahHeapRegion* r = _heap->get_region(i); + log_debug(gc)("promoting humongous region %zu, from " PTR_FORMAT " to " PTR_FORMAT, + r->index(), p2i(r->bottom()), p2i(r->top())); + // We mark the entire humongous object's range as dirty after loop terminates, so no need to dirty the range here + r->set_affiliation(OLD_GENERATION); + r->set_promoted_in_place(); + } + + ShenandoahFreeSet* freeset = _heap->free_set(); + freeset->transfer_humongous_regions_from_mutator_to_old_collector(spanned_regions, humongous_waste); + } + + // Since this region may have served previously as OLD, it may hold obsolete object range info. + HeapWord* const humongous_bottom = region->bottom(); + ShenandoahScanRemembered* const scanner = old_gen->card_scan(); + scanner->reset_object_range(humongous_bottom, humongous_bottom + spanned_regions * ShenandoahHeapRegion::region_size_words()); + // Since the humongous region holds only one object, no lock is necessary for this register_object() invocation. + scanner->register_object_without_lock(humongous_bottom); + + log_debug(gc)("Dirty cards for promoted humongous object (Region %zu) from " PTR_FORMAT " to " PTR_FORMAT, + region->index(), p2i(humongous_bottom), p2i(humongous_bottom + obj->size())); + scanner->mark_range_as_dirty(humongous_bottom, obj->size()); +} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahInPlacePromoter.hpp b/src/hotspot/share/gc/shenandoah/shenandoahInPlacePromoter.hpp new file mode 100644 index 00000000000..939107dd3ac --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahInPlacePromoter.hpp @@ -0,0 +1,91 @@ +/* + * 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. + * + */ + +#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHINPLACEPROMOTER_HPP +#define SHARE_GC_SHENANDOAH_SHENANDOAHINPLACEPROMOTER_HPP + +#include "gc/shenandoah/shenandoahSimpleBitMap.hpp" + +class ShenandoahFreeSet; +class ShenandoahMarkingContext; +class ShenandoahGenerationalHeap; +class ShenandoahHeapRegion; + +class ShenandoahInPlacePromotionPlanner { + using idx_t = ShenandoahSimpleBitMap::idx_t; + + struct RegionPromotions { + idx_t _low_idx; + idx_t _high_idx; + size_t _regions; + size_t _bytes; + ShenandoahFreeSet* _free_set; + + explicit RegionPromotions(ShenandoahFreeSet* free_set); + void increment(idx_t region_index, size_t remnant_bytes); + void update_free_set(ShenandoahFreeSetPartitionId partition_id) const; + }; + + const size_t _old_garbage_threshold; + const size_t _pip_used_threshold; + + const ShenandoahGenerationalHeap* _heap; + ShenandoahFreeSet* _free_set; + const ShenandoahMarkingContext* _marking_context; + + // Any region that is to be promoted in place needs to be retired from its Collector or Mutator partition. + RegionPromotions _mutator_regions; + RegionPromotions _collector_regions; + + // Tracks the padding of space above top in regions eligible for promotion in place + size_t _pip_padding_bytes; +public: + explicit ShenandoahInPlacePromotionPlanner(const ShenandoahGenerationalHeap* heap); + + // Returns true if this region has garbage below and usage above the configurable thresholds + bool is_eligible(const ShenandoahHeapRegion* region) const; + + // Prepares the region for promotion by moving top to the end to prevent allocations + void prepare(ShenandoahHeapRegion* region); + + // Notifies the free set of in place promotions + void update_free_set() const; + + size_t old_garbage_threshold() const { return _old_garbage_threshold; } +}; + +class ShenandoahInPlacePromoter { + ShenandoahGenerationalHeap* _heap; +public: + explicit ShenandoahInPlacePromoter(ShenandoahGenerationalHeap* heap) : _heap(heap) {} + + // If the region still meets the criteria for promotion in place, it will be promoted + void maybe_promote_region(ShenandoahHeapRegion* region) const; + +private: + void promote(ShenandoahHeapRegion* region) const; + void promote_humongous(ShenandoahHeapRegion* region) const; +}; + +#endif // SHARE_GC_SHENANDOAH_SHENANDOAHINPLACEPROMOTER_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp b/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp index 7a3b33f5fd0..7e317f53424 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp @@ -24,7 +24,6 @@ #include "gc/shenandoah/shenandoahLock.hpp" -#include "runtime/atomicAccess.hpp" #include "runtime/interfaceSupport.inline.hpp" #include "runtime/javaThread.hpp" #include "runtime/os.hpp" @@ -46,8 +45,8 @@ void ShenandoahLock::contended_lock_internal(JavaThread* java_thread) { int ctr = os::is_MP() ? 0xFF : 0; int yields = 0; // Apply TTAS to avoid more expensive CAS calls if the lock is still held by other thread. - while (AtomicAccess::load(&_state) == locked || - AtomicAccess::cmpxchg(&_state, unlocked, locked) != unlocked) { + while (_state.load_relaxed() == locked || + _state.compare_exchange(unlocked, locked) != unlocked) { if (ctr > 0 && !SafepointSynchronize::is_synchronizing()) { // Lightly contended, spin a little if no safepoint is pending. SpinPause(); @@ -94,7 +93,7 @@ ShenandoahSimpleLock::ShenandoahSimpleLock() { assert(os::mutex_init_done(), "Too early!"); } -void ShenandoahSimpleLock::lock() { +void ShenandoahSimpleLock::lock(bool allow_block_for_safepoint) { _lock.lock(); } @@ -102,41 +101,49 @@ void ShenandoahSimpleLock::unlock() { _lock.unlock(); } -ShenandoahReentrantLock::ShenandoahReentrantLock() : - ShenandoahSimpleLock(), _owner(nullptr), _count(0) { - assert(os::mutex_init_done(), "Too early!"); +template +ShenandoahReentrantLock::ShenandoahReentrantLock() : + Lock(), _owner(nullptr), _count(0) { } -ShenandoahReentrantLock::~ShenandoahReentrantLock() { +template +ShenandoahReentrantLock::~ShenandoahReentrantLock() { assert(_count == 0, "Unbalance"); } -void ShenandoahReentrantLock::lock() { +template +void ShenandoahReentrantLock::lock(bool allow_block_for_safepoint) { Thread* const thread = Thread::current(); - Thread* const owner = AtomicAccess::load(&_owner); + Thread* const owner = _owner.load_relaxed(); if (owner != thread) { - ShenandoahSimpleLock::lock(); - AtomicAccess::store(&_owner, thread); + Lock::lock(allow_block_for_safepoint); + _owner.store_relaxed(thread); } _count++; } -void ShenandoahReentrantLock::unlock() { +template +void ShenandoahReentrantLock::unlock() { assert(owned_by_self(), "Invalid owner"); assert(_count > 0, "Invalid count"); _count--; if (_count == 0) { - AtomicAccess::store(&_owner, (Thread*)nullptr); - ShenandoahSimpleLock::unlock(); + _owner.store_relaxed((Thread*)nullptr); + Lock::unlock(); } } -bool ShenandoahReentrantLock::owned_by_self() const { +template +bool ShenandoahReentrantLock::owned_by_self() const { Thread* const thread = Thread::current(); - Thread* const owner = AtomicAccess::load(&_owner); + Thread* const owner = _owner.load_relaxed(); return owner == thread; } + +// Explicit template instantiation +template class ShenandoahReentrantLock; +template class ShenandoahReentrantLock; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp b/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp index fbdf4971354..7c91df191e5 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp @@ -27,17 +27,18 @@ #include "gc/shenandoah/shenandoahPadding.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" #include "runtime/javaThread.hpp" #include "runtime/safepoint.hpp" -class ShenandoahLock { +class ShenandoahLock { private: enum LockState { unlocked = 0, locked = 1 }; shenandoah_padding(0); - volatile LockState _state; + Atomic _state; shenandoah_padding(1); - Thread* volatile _owner; + Atomic _owner; shenandoah_padding(2); template @@ -47,34 +48,34 @@ private: public: ShenandoahLock() : _state(unlocked), _owner(nullptr) {}; - void lock(bool allow_block_for_safepoint) { - assert(AtomicAccess::load(&_owner) != Thread::current(), "reentrant locking attempt, would deadlock"); + void lock(bool allow_block_for_safepoint = false) { + assert(_owner.load_relaxed() != Thread::current(), "reentrant locking attempt, would deadlock"); if ((allow_block_for_safepoint && SafepointSynchronize::is_synchronizing()) || - (AtomicAccess::cmpxchg(&_state, unlocked, locked) != unlocked)) { + (_state.compare_exchange(unlocked, locked) != unlocked)) { // 1. Java thread, and there is a pending safepoint. Dive into contended locking // immediately without trying anything else, and block. // 2. Fast lock fails, dive into contended lock handling. contended_lock(allow_block_for_safepoint); } - assert(AtomicAccess::load(&_state) == locked, "must be locked"); - assert(AtomicAccess::load(&_owner) == nullptr, "must not be owned"); - DEBUG_ONLY(AtomicAccess::store(&_owner, Thread::current());) + assert(_state.load_relaxed() == locked, "must be locked"); + assert(_owner.load_relaxed() == nullptr, "must not be owned"); + DEBUG_ONLY(_owner.store_relaxed(Thread::current());) } void unlock() { - assert(AtomicAccess::load(&_owner) == Thread::current(), "sanity"); - DEBUG_ONLY(AtomicAccess::store(&_owner, (Thread*)nullptr);) + assert(_owner.load_relaxed() == Thread::current(), "sanity"); + DEBUG_ONLY(_owner.store_relaxed((Thread*)nullptr);) OrderAccess::fence(); - AtomicAccess::store(&_state, unlocked); + _state.store_relaxed(unlocked); } void contended_lock(bool allow_block_for_safepoint); bool owned_by_self() { #ifdef ASSERT - return _state == locked && _owner == Thread::current(); + return _state.load_relaxed() == locked && _owner.load_relaxed() == Thread::current(); #else ShouldNotReachHere(); return false; @@ -82,66 +83,46 @@ public: } }; -class ShenandoahLocker : public StackObj { -private: - ShenandoahLock* const _lock; -public: - ShenandoahLocker(ShenandoahLock* lock, bool allow_block_for_safepoint = false) : _lock(lock) { - if (_lock != nullptr) { - _lock->lock(allow_block_for_safepoint); - } - } - - ~ShenandoahLocker() { - if (_lock != nullptr) { - _lock->unlock(); - } - } -}; - +// Simple lock using PlatformMonitor class ShenandoahSimpleLock { private: PlatformMonitor _lock; // native lock public: ShenandoahSimpleLock(); - - virtual void lock(); - virtual void unlock(); + void lock(bool allow_block_for_safepoint = false); + void unlock(); }; -class ShenandoahReentrantLock : public ShenandoahSimpleLock { +// templated reentrant lock +template +class ShenandoahReentrantLock : public Lock { private: - Thread* volatile _owner; + Atomic _owner; uint64_t _count; public: ShenandoahReentrantLock(); ~ShenandoahReentrantLock(); - virtual void lock(); - virtual void unlock(); + void lock(bool allow_block_for_safepoint = false); + void unlock(); // If the lock already owned by this thread bool owned_by_self() const ; }; -class ShenandoahReentrantLocker : public StackObj { -private: - ShenandoahReentrantLock* const _lock; - +// template based ShenandoahLocker +template +class ShenandoahLocker : public StackObj { + Lock* const _lock; public: - ShenandoahReentrantLocker(ShenandoahReentrantLock* lock) : - _lock(lock) { - if (_lock != nullptr) { - _lock->lock(); - } + ShenandoahLocker(Lock* lock, bool allow_block_for_safepoint = false) : _lock(lock) { + assert(_lock != nullptr, "Must not"); + _lock->lock(allow_block_for_safepoint); } - ~ShenandoahReentrantLocker() { - if (_lock != nullptr) { - assert(_lock->owned_by_self(), "Must be owner"); - _lock->unlock(); - } + ~ShenandoahLocker() { + _lock->unlock(); } }; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp index 55cec63f045..594ad614d90 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp @@ -241,7 +241,7 @@ void ShenandoahNMethodTable::register_nmethod(nmethod* nm) { assert(nm == data->nm(), "Must be same nmethod"); // Prevent updating a nmethod while concurrent iteration is in progress. wait_until_concurrent_iteration_done(); - ShenandoahReentrantLocker data_locker(data->lock()); + ShenandoahNMethodLocker data_locker(data->lock()); data->update(); } else { // For a new nmethod, we can safely append it to the list, because @@ -433,8 +433,8 @@ void ShenandoahNMethodTableSnapshot::parallel_nmethods_do(NMethodClosure *f) { ShenandoahNMethod** const list = _list->list(); size_t max = (size_t)_limit; - while (_claimed < max) { - size_t cur = AtomicAccess::fetch_then_add(&_claimed, stride, memory_order_relaxed); + while (_claimed.load_relaxed() < max) { + size_t cur = _claimed.fetch_then_add(stride, memory_order_relaxed); size_t start = cur; size_t end = MIN2(cur + stride, max); if (start >= max) break; @@ -457,8 +457,8 @@ void ShenandoahNMethodTableSnapshot::concurrent_nmethods_do(NMethodClosure* cl) ShenandoahNMethod** list = _list->list(); size_t max = (size_t)_limit; - while (_claimed < max) { - size_t cur = AtomicAccess::fetch_then_add(&_claimed, stride, memory_order_relaxed); + while (_claimed.load_relaxed() < max) { + size_t cur = _claimed.fetch_then_add(stride, memory_order_relaxed); size_t start = cur; size_t end = MIN2(cur + stride, max); if (start >= max) break; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp index 5387870c9dc..2686b4f4985 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.hpp @@ -30,8 +30,13 @@ #include "gc/shenandoah/shenandoahLock.hpp" #include "gc/shenandoah/shenandoahPadding.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" #include "utilities/growableArray.hpp" +// Use ShenandoahReentrantLock as ShenandoahNMethodLock +typedef ShenandoahReentrantLock ShenandoahNMethodLock; +typedef ShenandoahLocker ShenandoahNMethodLocker; + // ShenandoahNMethod tuple records the internal locations of oop slots within reclocation stream in // the nmethod. This allows us to quickly scan the oops without doing the nmethod-internal scans, // that sometimes involves parsing the machine code. Note it does not record the oops themselves, @@ -43,16 +48,16 @@ private: int _oops_count; bool _has_non_immed_oops; bool _unregistered; - ShenandoahReentrantLock _lock; - ShenandoahReentrantLock _ic_lock; + ShenandoahNMethodLock _lock; + ShenandoahNMethodLock _ic_lock; public: ShenandoahNMethod(nmethod *nm, GrowableArray& oops, bool has_non_immed_oops); ~ShenandoahNMethod(); inline nmethod* nm() const; - inline ShenandoahReentrantLock* lock(); - inline ShenandoahReentrantLock* ic_lock(); + inline ShenandoahNMethodLock* lock(); + inline ShenandoahNMethodLock* ic_lock(); inline void oops_do(OopClosure* oops, bool fix_relocations = false); // Update oops when the nmethod is re-registered void update(); @@ -60,8 +65,8 @@ public: inline bool is_unregistered() const; static ShenandoahNMethod* for_nmethod(nmethod* nm); - static inline ShenandoahReentrantLock* lock_for_nmethod(nmethod* nm); - static inline ShenandoahReentrantLock* ic_lock_for_nmethod(nmethod* nm); + static inline ShenandoahNMethodLock* lock_for_nmethod(nmethod* nm); + static inline ShenandoahNMethodLock* ic_lock_for_nmethod(nmethod* nm); static void heal_nmethod(nmethod* nm); static inline void heal_nmethod_metadata(ShenandoahNMethod* nmethod_data); @@ -115,7 +120,7 @@ private: int _limit; shenandoah_padding(0); - volatile size_t _claimed; + Atomic _claimed; shenandoah_padding(1); public: diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp index 6758298675b..ef9e347b821 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp @@ -35,11 +35,11 @@ nmethod* ShenandoahNMethod::nm() const { return _nm; } -ShenandoahReentrantLock* ShenandoahNMethod::lock() { +ShenandoahNMethodLock* ShenandoahNMethod::lock() { return &_lock; } -ShenandoahReentrantLock* ShenandoahNMethod::ic_lock() { +ShenandoahNMethodLock* ShenandoahNMethod::ic_lock() { return &_ic_lock; } @@ -85,11 +85,11 @@ void ShenandoahNMethod::attach_gc_data(nmethod* nm, ShenandoahNMethod* gc_data) nm->set_gc_data(gc_data); } -ShenandoahReentrantLock* ShenandoahNMethod::lock_for_nmethod(nmethod* nm) { +ShenandoahNMethodLock* ShenandoahNMethod::lock_for_nmethod(nmethod* nm) { return gc_data(nm)->lock(); } -ShenandoahReentrantLock* ShenandoahNMethod::ic_lock_for_nmethod(nmethod* nm) { +ShenandoahNMethodLock* ShenandoahNMethod::ic_lock_for_nmethod(nmethod* nm) { return gc_data(nm)->ic_lock(); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp index 7187431c8f8..37e9729b7ff 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp @@ -504,7 +504,7 @@ void ShenandoahReferenceProcessor::process_references(ShenandoahRefProcThreadLoc if (!CompressedOops::is_null(*list)) { oop head = lrb(CompressedOops::decode_not_null(*list)); shenandoah_assert_not_in_cset_except(&head, head, ShenandoahHeap::heap()->cancelled_gc() || !ShenandoahLoadRefBarrier); - oop prev = AtomicAccess::xchg(&_pending_list, head); + oop prev = _pending_list.exchange(head); set_oop_field(p, prev); if (prev == nullptr) { // First to prepend to list, record tail @@ -519,14 +519,14 @@ void ShenandoahReferenceProcessor::process_references(ShenandoahRefProcThreadLoc void ShenandoahReferenceProcessor::work() { // Process discovered references uint max_workers = ShenandoahHeap::heap()->max_workers(); - uint worker_id = AtomicAccess::add(&_iterate_discovered_list_id, 1U, memory_order_relaxed) - 1; + uint worker_id = _iterate_discovered_list_id.fetch_then_add(1U, memory_order_relaxed); while (worker_id < max_workers) { if (UseCompressedOops) { process_references(_ref_proc_thread_locals[worker_id], worker_id); } else { process_references(_ref_proc_thread_locals[worker_id], worker_id); } - worker_id = AtomicAccess::add(&_iterate_discovered_list_id, 1U, memory_order_relaxed) - 1; + worker_id = _iterate_discovered_list_id.fetch_then_add(1U, memory_order_relaxed); } } @@ -559,7 +559,7 @@ public: void ShenandoahReferenceProcessor::process_references(ShenandoahPhaseTimings::Phase phase, WorkerThreads* workers, bool concurrent) { - AtomicAccess::release_store_fence(&_iterate_discovered_list_id, 0U); + _iterate_discovered_list_id.release_store_fence(0U); // Process discovered lists ShenandoahReferenceProcessorTask task(phase, concurrent, this); @@ -576,7 +576,7 @@ void ShenandoahReferenceProcessor::process_references(ShenandoahPhaseTimings::Ph void ShenandoahReferenceProcessor::enqueue_references_locked() { // Prepend internal pending list to external pending list - shenandoah_assert_not_in_cset_except(&_pending_list, _pending_list, ShenandoahHeap::heap()->cancelled_gc() || !ShenandoahLoadRefBarrier); + shenandoah_assert_not_in_cset_except(&_pending_list, _pending_list.load_relaxed(), ShenandoahHeap::heap()->cancelled_gc() || !ShenandoahLoadRefBarrier); // During reference processing, we maintain a local list of references that are identified by // _pending_list and _pending_list_tail. _pending_list_tail points to the next field of the last Reference object on @@ -589,7 +589,7 @@ void ShenandoahReferenceProcessor::enqueue_references_locked() { // 2. Overwriting the next field of the last Reference on my local list to point at the previous head of the // global Universe::_reference_pending_list - oop former_head_of_global_list = Universe::swap_reference_pending_list(_pending_list); + oop former_head_of_global_list = Universe::swap_reference_pending_list(_pending_list.load_relaxed()); if (UseCompressedOops) { set_oop_field(reinterpret_cast(_pending_list_tail), former_head_of_global_list); } else { @@ -598,7 +598,7 @@ void ShenandoahReferenceProcessor::enqueue_references_locked() { } void ShenandoahReferenceProcessor::enqueue_references(bool concurrent) { - if (_pending_list == nullptr) { + if (_pending_list.load_relaxed() == nullptr) { // Nothing to enqueue return; } @@ -616,7 +616,7 @@ void ShenandoahReferenceProcessor::enqueue_references(bool concurrent) { } // Reset internal pending list - _pending_list = nullptr; + _pending_list.store_relaxed(nullptr); _pending_list_tail = &_pending_list; } @@ -640,9 +640,9 @@ void ShenandoahReferenceProcessor::abandon_partial_discovery() { clean_discovered_list(_ref_proc_thread_locals[index].discovered_list_addr()); } } - if (_pending_list != nullptr) { - oop pending = _pending_list; - _pending_list = nullptr; + if (_pending_list.load_relaxed() != nullptr) { + oop pending = _pending_list.load_relaxed(); + _pending_list.store_relaxed(nullptr); if (UseCompressedOops) { narrowOop* list = reference_discovered_addr(pending); clean_discovered_list(list); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp index 14adb924585..01c79029132 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp @@ -31,6 +31,7 @@ #include "gc/shared/referenceProcessorStats.hpp" #include "gc/shenandoah/shenandoahPhaseTimings.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" class ShenandoahMarkRefsSuperClosure; class WorkerThreads; @@ -133,10 +134,10 @@ private: ShenandoahRefProcThreadLocal* _ref_proc_thread_locals; - oop _pending_list; + Atomic _pending_list; void* _pending_list_tail; // T* - volatile uint _iterate_discovered_list_id; + Atomic _iterate_discovered_list_id; ReferenceProcessorStats _stats; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSharedVariables.hpp b/src/hotspot/share/gc/shenandoah/shenandoahSharedVariables.hpp index 12c01ad5c90..e23187a5d3f 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahSharedVariables.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahSharedVariables.hpp @@ -27,7 +27,7 @@ #include "gc/shenandoah/shenandoahPadding.hpp" #include "memory/allocation.hpp" -#include "runtime/atomicAccess.hpp" +#include "runtime/atomic.hpp" typedef int32_t ShenandoahSharedValue; typedef struct ShenandoahSharedFlag { @@ -37,7 +37,7 @@ typedef struct ShenandoahSharedFlag { }; shenandoah_padding(0); - volatile ShenandoahSharedValue value; + Atomic value; shenandoah_padding(1); ShenandoahSharedFlag() { @@ -45,19 +45,19 @@ typedef struct ShenandoahSharedFlag { } void set() { - AtomicAccess::release_store_fence(&value, (ShenandoahSharedValue)SET); + value.release_store_fence((ShenandoahSharedValue)SET); } void unset() { - AtomicAccess::release_store_fence(&value, (ShenandoahSharedValue)UNSET); + value.release_store_fence((ShenandoahSharedValue)UNSET); } bool is_set() const { - return AtomicAccess::load_acquire(&value) == SET; + return value.load_acquire() == SET; } bool is_unset() const { - return AtomicAccess::load_acquire(&value) == UNSET; + return value.load_acquire() == UNSET; } void set_cond(bool val) { @@ -72,7 +72,7 @@ typedef struct ShenandoahSharedFlag { if (is_set()) { return false; } - ShenandoahSharedValue old = AtomicAccess::cmpxchg(&value, (ShenandoahSharedValue)UNSET, (ShenandoahSharedValue)SET); + ShenandoahSharedValue old = value.compare_exchange((ShenandoahSharedValue)UNSET, (ShenandoahSharedValue)SET); return old == UNSET; // success } @@ -80,17 +80,13 @@ typedef struct ShenandoahSharedFlag { if (!is_set()) { return false; } - ShenandoahSharedValue old = AtomicAccess::cmpxchg(&value, (ShenandoahSharedValue)SET, (ShenandoahSharedValue)UNSET); + ShenandoahSharedValue old = value.compare_exchange((ShenandoahSharedValue)SET, (ShenandoahSharedValue)UNSET); return old == SET; // success } - volatile ShenandoahSharedValue* addr_of() { - return &value; - } - private: volatile ShenandoahSharedValue* operator&() { - fatal("Use addr_of() instead"); + fatal("Not supported"); return nullptr; } @@ -105,7 +101,7 @@ private: typedef struct ShenandoahSharedBitmap { shenandoah_padding(0); - volatile ShenandoahSharedValue value; + Atomic value; shenandoah_padding(1); ShenandoahSharedBitmap() { @@ -116,7 +112,7 @@ typedef struct ShenandoahSharedBitmap { assert (mask < (sizeof(ShenandoahSharedValue) * CHAR_MAX), "sanity"); ShenandoahSharedValue mask_val = (ShenandoahSharedValue) mask; while (true) { - ShenandoahSharedValue ov = AtomicAccess::load_acquire(&value); + ShenandoahSharedValue ov = value.load_acquire(); // We require all bits of mask_val to be set if ((ov & mask_val) == mask_val) { // already set @@ -124,7 +120,7 @@ typedef struct ShenandoahSharedBitmap { } ShenandoahSharedValue nv = ov | mask_val; - if (AtomicAccess::cmpxchg(&value, ov, nv) == ov) { + if (value.compare_exchange(ov, nv) == ov) { // successfully set: if value returned from cmpxchg equals ov, then nv has overwritten value. return; } @@ -135,14 +131,14 @@ typedef struct ShenandoahSharedBitmap { assert (mask < (sizeof(ShenandoahSharedValue) * CHAR_MAX), "sanity"); ShenandoahSharedValue mask_val = (ShenandoahSharedValue) mask; while (true) { - ShenandoahSharedValue ov = AtomicAccess::load_acquire(&value); + ShenandoahSharedValue ov = value.load_acquire(); if ((ov & mask_val) == 0) { // already unset return; } ShenandoahSharedValue nv = ov & ~mask_val; - if (AtomicAccess::cmpxchg(&value, ov, nv) == ov) { + if (value.compare_exchange(ov, nv) == ov) { // successfully unset return; } @@ -150,7 +146,7 @@ typedef struct ShenandoahSharedBitmap { } void clear() { - AtomicAccess::release_store_fence(&value, (ShenandoahSharedValue)0); + value.release_store_fence((ShenandoahSharedValue)0); } // Returns true iff any bit set in mask is set in this.value. @@ -161,18 +157,18 @@ typedef struct ShenandoahSharedBitmap { // Returns true iff all bits set in mask are set in this.value. bool is_set_exactly(uint mask) const { assert (mask < (sizeof(ShenandoahSharedValue) * CHAR_MAX), "sanity"); - uint uvalue = AtomicAccess::load_acquire(&value); + uint uvalue = value.load_acquire(); return (uvalue & mask) == mask; } // Returns true iff all bits set in mask are unset in this.value. bool is_unset(uint mask) const { assert (mask < (sizeof(ShenandoahSharedValue) * CHAR_MAX), "sanity"); - return (AtomicAccess::load_acquire(&value) & (ShenandoahSharedValue) mask) == 0; + return (value.load_acquire() & (ShenandoahSharedValue) mask) == 0; } bool is_clear() const { - return (AtomicAccess::load_acquire(&value)) == 0; + return (value.load_acquire()) == 0; } void set_cond(uint mask, bool val) { @@ -183,17 +179,13 @@ typedef struct ShenandoahSharedBitmap { } } - volatile ShenandoahSharedValue* addr_of() { - return &value; - } - ShenandoahSharedValue raw_value() const { - return value; + return value.load_relaxed(); } private: volatile ShenandoahSharedValue* operator&() { - fatal("Use addr_of() instead"); + fatal("Not supported"); return nullptr; } @@ -210,42 +202,36 @@ template struct ShenandoahSharedEnumFlag { typedef uint32_t EnumValueType; shenandoah_padding(0); - volatile EnumValueType value; + Atomic value; shenandoah_padding(1); - ShenandoahSharedEnumFlag() { - value = 0; - } + ShenandoahSharedEnumFlag() : value(0) {} void set(T v) { assert (v >= 0, "sanity"); assert (v < (sizeof(EnumValueType) * CHAR_MAX), "sanity"); - AtomicAccess::release_store_fence(&value, (EnumValueType)v); + value.release_store_fence((EnumValueType)v); } T get() const { - return (T)AtomicAccess::load_acquire(&value); + return (T)value.load_acquire(); } T cmpxchg(T new_value, T expected) { assert (new_value >= 0, "sanity"); assert (new_value < (sizeof(EnumValueType) * CHAR_MAX), "sanity"); - return (T)AtomicAccess::cmpxchg(&value, (EnumValueType)expected, (EnumValueType)new_value); + return (T)value.compare_exchange((EnumValueType)expected, (EnumValueType)new_value); } T xchg(T new_value) { assert (new_value >= 0, "sanity"); assert (new_value < (sizeof(EnumValueType) * CHAR_MAX), "sanity"); - return (T)AtomicAccess::xchg(&value, (EnumValueType)new_value); - } - - volatile EnumValueType* addr_of() { - return &value; + return (T)value.exchange((EnumValueType)new_value); } private: volatile T* operator&() { - fatal("Use addr_of() instead"); + fatal("Not supported"); return nullptr; } @@ -260,7 +246,7 @@ private: typedef struct ShenandoahSharedSemaphore { shenandoah_padding(0); - volatile ShenandoahSharedValue value; + Atomic value; shenandoah_padding(1); static uint max_tokens() { @@ -269,17 +255,17 @@ typedef struct ShenandoahSharedSemaphore { ShenandoahSharedSemaphore(uint tokens) { assert(tokens <= max_tokens(), "sanity"); - AtomicAccess::release_store_fence(&value, (ShenandoahSharedValue)tokens); + value.release_store_fence((ShenandoahSharedValue)tokens); } bool try_acquire() { while (true) { - ShenandoahSharedValue ov = AtomicAccess::load_acquire(&value); + ShenandoahSharedValue ov = value.load_acquire(); if (ov == 0) { return false; } ShenandoahSharedValue nv = ov - 1; - if (AtomicAccess::cmpxchg(&value, ov, nv) == ov) { + if (value.compare_exchange(ov, nv) == ov) { // successfully set return true; } @@ -287,7 +273,7 @@ typedef struct ShenandoahSharedSemaphore { } void claim_all() { - AtomicAccess::release_store_fence(&value, (ShenandoahSharedValue)0); + value.release_store_fence((ShenandoahSharedValue)0); } } ShenandoahSharedSemaphore; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp b/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp index b248fab7958..ac7fe1f9a3a 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp @@ -80,7 +80,7 @@ public: virtual bool has_dead_oop(nmethod* nm) const { assert(ShenandoahHeap::heap()->is_concurrent_weak_root_in_progress(), "Only for this phase"); ShenandoahNMethod* data = ShenandoahNMethod::gc_data(nm); - ShenandoahReentrantLocker locker(data->lock()); + ShenandoahNMethodLocker locker(data->lock()); ShenandoahIsUnloadingOopClosure cl; data->oops_do(&cl); return cl.is_unloading(); @@ -90,14 +90,14 @@ public: class ShenandoahCompiledICProtectionBehaviour : public CompiledICProtectionBehaviour { public: virtual bool lock(nmethod* nm) { - ShenandoahReentrantLock* const lock = ShenandoahNMethod::ic_lock_for_nmethod(nm); + ShenandoahNMethodLock* const lock = ShenandoahNMethod::ic_lock_for_nmethod(nm); assert(lock != nullptr, "Not yet registered?"); lock->lock(); return true; } virtual void unlock(nmethod* nm) { - ShenandoahReentrantLock* const lock = ShenandoahNMethod::ic_lock_for_nmethod(nm); + ShenandoahNMethodLock* const lock = ShenandoahNMethod::ic_lock_for_nmethod(nm); assert(lock != nullptr, "Not yet registered?"); lock->unlock(); } @@ -107,7 +107,7 @@ public: return true; } - ShenandoahReentrantLock* const lock = ShenandoahNMethod::ic_lock_for_nmethod(nm); + ShenandoahNMethodLock* const lock = ShenandoahNMethod::ic_lock_for_nmethod(nm); assert(lock != nullptr, "Not yet registered?"); return lock->owned_by_self(); } diff --git a/src/hotspot/share/gc/shenandoah/vmStructs_shenandoah.hpp b/src/hotspot/share/gc/shenandoah/vmStructs_shenandoah.hpp index 3968575d089..4299bdb8126 100644 --- a/src/hotspot/share/gc/shenandoah/vmStructs_shenandoah.hpp +++ b/src/hotspot/share/gc/shenandoah/vmStructs_shenandoah.hpp @@ -29,21 +29,22 @@ #include "gc/shenandoah/shenandoahHeap.hpp" #include "gc/shenandoah/shenandoahHeapRegion.hpp" #include "gc/shenandoah/shenandoahMonitoringSupport.hpp" +#include "runtime/atomic.hpp" -#define VM_STRUCTS_SHENANDOAH(nonstatic_field, volatile_nonstatic_field, static_field) \ - nonstatic_field(ShenandoahHeap, _num_regions, size_t) \ - nonstatic_field(ShenandoahHeap, _regions, ShenandoahHeapRegion**) \ - nonstatic_field(ShenandoahHeap, _log_min_obj_alignment_in_bytes, int) \ - nonstatic_field(ShenandoahHeap, _free_set, ShenandoahFreeSet*) \ - volatile_nonstatic_field(ShenandoahHeap, _committed, size_t) \ - static_field(ShenandoahHeapRegion, RegionSizeBytes, size_t) \ - static_field(ShenandoahHeapRegion, RegionSizeBytesShift, size_t) \ - volatile_nonstatic_field(ShenandoahHeapRegion, _state, ShenandoahHeapRegion::RegionState) \ - nonstatic_field(ShenandoahHeapRegion, _index, size_t const) \ - nonstatic_field(ShenandoahHeapRegion, _bottom, HeapWord* const) \ - nonstatic_field(ShenandoahHeapRegion, _top, HeapWord*) \ - nonstatic_field(ShenandoahHeapRegion, _end, HeapWord* const) \ - nonstatic_field(ShenandoahFreeSet, _total_global_used, size_t) \ +#define VM_STRUCTS_SHENANDOAH(nonstatic_field, volatile_nonstatic_field, static_field) \ + nonstatic_field(ShenandoahHeap, _num_regions, size_t) \ + nonstatic_field(ShenandoahHeap, _regions, ShenandoahHeapRegion**) \ + nonstatic_field(ShenandoahHeap, _log_min_obj_alignment_in_bytes, int) \ + nonstatic_field(ShenandoahHeap, _free_set, ShenandoahFreeSet*) \ + volatile_nonstatic_field(ShenandoahHeap, _committed, Atomic) \ + static_field(ShenandoahHeapRegion, RegionSizeBytes, size_t) \ + static_field(ShenandoahHeapRegion, RegionSizeBytesShift, size_t) \ + nonstatic_field(ShenandoahHeapRegion, _state, Atomic) \ + nonstatic_field(ShenandoahHeapRegion, _index, size_t const) \ + nonstatic_field(ShenandoahHeapRegion, _bottom, HeapWord* const) \ + nonstatic_field(ShenandoahHeapRegion, _top, HeapWord*) \ + nonstatic_field(ShenandoahHeapRegion, _end, HeapWord* const) \ + nonstatic_field(ShenandoahFreeSet, _total_global_used, size_t) \ #define VM_INT_CONSTANTS_SHENANDOAH(declare_constant, declare_constant_with_value) \ declare_constant(ShenandoahHeapRegion::_empty_uncommitted) \ @@ -65,7 +66,7 @@ declare_toplevel_type(ShenandoahHeapRegion) \ declare_toplevel_type(ShenandoahHeap*) \ declare_toplevel_type(ShenandoahHeapRegion*) \ - declare_toplevel_type(ShenandoahHeapRegion::RegionState) \ + declare_toplevel_type(Atomic) \ declare_toplevel_type(ShenandoahFreeSet) \ declare_toplevel_type(ShenandoahFreeSet*) \ diff --git a/src/hotspot/share/gc/z/zUtils.inline.hpp b/src/hotspot/share/gc/z/zUtils.inline.hpp index b83f42d18e6..a221a925498 100644 --- a/src/hotspot/share/gc/z/zUtils.inline.hpp +++ b/src/hotspot/share/gc/z/zUtils.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -37,6 +37,9 @@ inline uintptr_t ZUtils::alloc_aligned_unfreeable(size_t alignment, size_t size) { const size_t padded_size = size + (alignment - 1); void* const addr = os::malloc(padded_size, mtGC); + if (addr == nullptr) { + vm_exit_out_of_memory(padded_size, OOM_MALLOC_ERROR, "ZGC alloc_aligned_unfreeable malloc failed"); + } void* const aligned_addr = align_up(addr, alignment); memset(aligned_addr, 0, size); diff --git a/src/hotspot/share/include/cds.h b/src/hotspot/share/include/cds.h index a7bc896172c..76de42db755 100644 --- a/src/hotspot/share/include/cds.h +++ b/src/hotspot/share/include/cds.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +40,7 @@ #define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba8 #define CDS_PREIMAGE_ARCHIVE_MAGIC 0xcafea07c #define CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION 13 -#define CURRENT_CDS_ARCHIVE_VERSION 19 +#define CURRENT_CDS_ARCHIVE_VERSION 20 typedef struct CDSFileMapRegion { int _crc; // CRC checksum of this region. diff --git a/src/hotspot/share/interpreter/bytecodeTracer.cpp b/src/hotspot/share/interpreter/bytecodeTracer.cpp index 69fc93b6c0f..21974218957 100644 --- a/src/hotspot/share/interpreter/bytecodeTracer.cpp +++ b/src/hotspot/share/interpreter/bytecodeTracer.cpp @@ -185,7 +185,9 @@ static Method* _method_currently_being_printed = nullptr; void BytecodeTracer::trace_interpreter(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st) { if (TraceBytecodes && BytecodeCounter::counter_value() >= TraceBytecodesAt) { BytecodePrinter printer(AtomicAccess::load_acquire(&_method_currently_being_printed)); - printer.trace(method, bcp, tos, tos2, st); + stringStream buf; + printer.trace(method, bcp, tos, tos2, &buf); + st->print("%s", buf.freeze()); // Save method currently being printed to detect when method printing changes. AtomicAccess::release_store(&_method_currently_being_printed, method()); } diff --git a/src/hotspot/share/interpreter/bytecodeTracer.hpp b/src/hotspot/share/interpreter/bytecodeTracer.hpp index e199a2b7ea2..ab66030b6cd 100644 --- a/src/hotspot/share/interpreter/bytecodeTracer.hpp +++ b/src/hotspot/share/interpreter/bytecodeTracer.hpp @@ -38,7 +38,7 @@ class outputStream; class BytecodeClosure; class BytecodeTracer: AllStatic { public: - NOT_PRODUCT(static void trace_interpreter(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st = tty);) + NOT_PRODUCT(static void trace_interpreter(const methodHandle& method, address bcp, uintptr_t tos, uintptr_t tos2, outputStream* st);) static void print_method_codes(const methodHandle& method, int from, int to, outputStream* st, int flags, bool buffered = true); }; diff --git a/src/hotspot/share/interpreter/interpreter.hpp b/src/hotspot/share/interpreter/interpreter.hpp index 576146b344e..f7d42fcb4da 100644 --- a/src/hotspot/share/interpreter/interpreter.hpp +++ b/src/hotspot/share/interpreter/interpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ class InterpreterCodelet: public Stub { // General info/converters int size() const { return _size; } static int alignment() { return HeapWordSize; } - static int code_alignment() { return CodeEntryAlignment; } + static uint code_alignment() { return CodeEntryAlignment; } // Code info address code_begin() const { return align_up((address)this + sizeof(InterpreterCodelet), code_alignment()); } diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index b985d2af6ff..ca7174389cf 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1522,7 +1522,7 @@ JRT_LEAF(intptr_t, InterpreterRuntime::trace_bytecode(JavaThread* current, intpt LastFrameAccessor last_frame(current); assert(last_frame.is_interpreted_frame(), "must be an interpreted frame"); methodHandle mh(current, last_frame.method()); - BytecodeTracer::trace_interpreter(mh, last_frame.bcp(), tos, tos2); + BytecodeTracer::trace_interpreter(mh, last_frame.bcp(), tos, tos2, tty); return preserve_this_value; JRT_END #endif // !PRODUCT diff --git a/src/hotspot/share/interpreter/rewriter.hpp b/src/hotspot/share/interpreter/rewriter.hpp index b5a4ad4870f..92e8e7db534 100644 --- a/src/hotspot/share/interpreter/rewriter.hpp +++ b/src/hotspot/share/interpreter/rewriter.hpp @@ -78,9 +78,6 @@ class Rewriter: public StackObj { _resolved_reference_limit = _resolved_references_map.length(); } - int cp_entry_to_cp_cache(int i) { assert(has_cp_cache(i), "oob"); return _cp_map.at(i); } - bool has_cp_cache(int i) { return (uint) i < (uint) _cp_map.length() && _cp_map.at(i) >= 0; } - int add_map_entry(int cp_index, GrowableArray* cp_map, GrowableArray* cp_cache_map) { assert(cp_map->at(cp_index) == -1, "not twice on same cp_index"); int cache_index = cp_cache_map->append(cp_index); diff --git a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp index b30ebd8108c..426ba4e7650 100644 --- a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp +++ b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp @@ -493,7 +493,7 @@ TRACE_REQUEST_FUNC(InitialSystemProperty) { TRACE_REQUEST_FUNC(ThreadAllocationStatistics) { ResourceMark rm; int initial_size = Threads::number_of_threads(); - GrowableArray allocated(initial_size); + GrowableArray allocated(initial_size); GrowableArray thread_ids(initial_size); JfrTicks time_stamp = JfrTicks::now(); JfrJavaThreadIterator iter; diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp index 7049df0198b..68a47193e55 100644 --- a/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp +++ b/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp @@ -58,29 +58,22 @@ static inline bool in_stack(intptr_t* ptr, JavaThread* jt) { return jt->is_in_full_stack_checked(reinterpret_cast
(ptr)); } +#ifdef ASSERT static inline bool sp_in_stack(const JfrSampleRequest& request, JavaThread* jt) { return in_stack(static_cast(request._sample_sp), jt); } +#endif // ASSERT static inline bool fp_in_stack(const JfrSampleRequest& request, JavaThread* jt) { return in_stack(static_cast(request._sample_bcp), jt); } -static inline void update_interpreter_frame_sender_pc(JfrSampleRequest& request, intptr_t* fp) { - request._sample_pc = frame::interpreter_return_address(fp); -} - static inline void update_interpreter_frame_pc(JfrSampleRequest& request, JavaThread* jt) { assert(fp_in_stack(request, jt), "invariant"); assert(is_interpreter(request), "invariant"); request._sample_pc = frame::interpreter_return_address(static_cast(request._sample_bcp)); } -static inline address interpreter_frame_return_address(const JfrSampleRequest& request) { - assert(is_interpreter(request), "invariant"); - return frame::interpreter_return_address(static_cast(request._sample_bcp)); -} - static inline intptr_t* frame_sender_sp(const JfrSampleRequest& request, JavaThread* jt) { assert(fp_in_stack(request, jt), "invariant"); return frame::sender_sp(static_cast(request._sample_bcp)); @@ -90,29 +83,10 @@ static inline void update_frame_sender_sp(JfrSampleRequest& request, JavaThread* request._sample_sp = frame_sender_sp(request, jt); } -static inline void update_frame_sender_sp(JfrSampleRequest& request, intptr_t* fp) { - request._sample_sp = frame::sender_sp(fp); -} - static inline intptr_t* frame_link(const JfrSampleRequest& request) { return frame::link(static_cast(request._sample_bcp)); } -static inline void update_sp(JfrSampleRequest& request, int frame_size) { - assert(frame_size >= 0, "invariant"); - request._sample_sp = static_cast(request._sample_sp) + frame_size; -} - -static inline void update_pc(JfrSampleRequest& request) { - assert(request._sample_sp != nullptr, "invariant"); - request._sample_pc = frame::return_address(static_cast(request._sample_sp)); -} - -static inline void update_fp(JfrSampleRequest& request) { - assert(request._sample_sp != nullptr, "invariant"); - request._sample_bcp = is_interpreter(request) ? frame::fp(static_cast(request._sample_sp)) : nullptr; -} - // Less extensive sanity checks for an interpreter frame. static bool is_valid_interpreter_frame(const JfrSampleRequest& request, JavaThread* jt) { assert(sp_in_stack(request, jt), "invariant"); diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp index 534c9996cfe..7c0f8c02e69 100644 --- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp +++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp @@ -66,10 +66,6 @@ static inline void send_safepoint_latency_event(const JfrSampleRequest& request, } } -static inline bool is_interpreter(address pc) { - return Interpreter::contains(pc); -} - static inline bool is_interpreter(const JfrSampleRequest& request) { return request._sample_bcp != nullptr; } diff --git a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp index ff688a297ed..c6c1b4cad60 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp @@ -176,6 +176,7 @@ static inline bool is_global(ConstBufferPtr buffer) { return buffer->context() == JFR_GLOBAL; } +#ifdef ASSERT static inline bool is_thread_local(ConstBufferPtr buffer) { assert(buffer != nullptr, "invariant"); return buffer->context() == JFR_THREADLOCAL; @@ -185,6 +186,7 @@ static inline bool is_virtual_thread_local(ConstBufferPtr buffer) { assert(buffer != nullptr, "invariant"); return buffer->context() == JFR_VIRTUAL_THREADLOCAL; } +#endif // ASSERT BufferPtr JfrCheckpointManager::lease_global(Thread* thread, bool previous_epoch /* false */, size_t size /* 0 */) { JfrCheckpointMspace* const mspace = instance()._global_mspace; diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp index b1c502e17f8..3dd9ea41d3d 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp @@ -1265,7 +1265,7 @@ static size_t teardown() { JfrKlassUnloading::clear(); _artifacts->clear(); _initial_type_set = true; - } else { + } else if (is_initial_typeset_for_chunk()) { _initial_type_set = false; } return total_count; diff --git a/src/hotspot/share/jfr/recorder/jfrRecorder.cpp b/src/hotspot/share/jfr/recorder/jfrRecorder.cpp index 061e3feac6f..5c12d5213ca 100644 --- a/src/hotspot/share/jfr/recorder/jfrRecorder.cpp +++ b/src/hotspot/share/jfr/recorder/jfrRecorder.cpp @@ -102,6 +102,9 @@ bool JfrRecorder::on_create_vm_1() { if (!create_checkpoint_manager()) { return false; } + if (!JfrSymbolTable::create()) { + return false; + } } // fast time initialization @@ -316,10 +319,7 @@ bool JfrRecorder::create_components() { if (!create_thread_group_manager()) { return false; } - if (!create_symbol_table()) { - return false; - } - return true; + return create_symbol_table(); } // subsystems @@ -418,7 +418,13 @@ bool JfrRecorder::create_thread_group_manager() { } bool JfrRecorder::create_symbol_table() { - return JfrSymbolTable::create(); + return !is_started_on_commandline() ? JfrSymbolTable::create() : true; +} + +void JfrRecorder::destroy_symbol_table() { + if (!is_started_on_commandline()) { + JfrSymbolTable::destroy(); + } } void JfrRecorder::destroy_components() { @@ -461,7 +467,7 @@ void JfrRecorder::destroy_components() { } JfrEventThrottler::destroy(); JfrThreadGroupManager::destroy(); - JfrSymbolTable::destroy(); + destroy_symbol_table(); } bool JfrRecorder::create_recorder_thread() { diff --git a/src/hotspot/share/jfr/recorder/jfrRecorder.hpp b/src/hotspot/share/jfr/recorder/jfrRecorder.hpp index 8cc4521669d..fa1b677b31a 100644 --- a/src/hotspot/share/jfr/recorder/jfrRecorder.hpp +++ b/src/hotspot/share/jfr/recorder/jfrRecorder.hpp @@ -59,6 +59,7 @@ class JfrRecorder : public JfrCHeapObj { static bool create_event_throttler(); static bool create_symbol_table(); static bool create_components(); + static void destroy_symbol_table(); static void destroy_components(); static void on_recorder_thread_exit(); diff --git a/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp b/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp index 8886f412bb2..23e4cf839bd 100644 --- a/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp +++ b/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp @@ -194,9 +194,11 @@ static inline bool is_not_jdk_module(const ModuleEntry* module, JavaThread* jt) return !is_jdk_module(module, jt); } +#ifdef ASSERT static inline bool jfr_is_started_on_command_line() { return JfrRecorder::is_started_on_commandline(); } +#endif // ASSERT static bool should_record(const Method* method, const Method* sender, JavaThread* jt) { assert(method != nullptr, "invariant"); diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index 3e9d8c97b88..6214f6a2746 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -355,7 +355,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { return vmIntrinsics; } -#define PREDEFINED_CONFIG_FLAGS(do_bool_flag, do_int_flag, do_size_t_flag, do_intx_flag, do_uintx_flag) \ +#define PREDEFINED_CONFIG_FLAGS(do_bool_flag, do_uint_flag, do_int_flag, do_size_t_flag, do_intx_flag, do_uintx_flag) \ do_int_flag(AllocateInstancePrefetchLines) \ do_int_flag(AllocatePrefetchDistance) \ do_intx_flag(AllocatePrefetchInstr) \ @@ -367,7 +367,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { do_bool_flag(CITime) \ do_bool_flag(CITimeEach) \ do_size_t_flag(CodeCacheSegmentSize) \ - do_intx_flag(CodeEntryAlignment) \ + do_uint_flag(CodeEntryAlignment) \ do_int_flag(ContendedPaddingWidth) \ do_bool_flag(DontCompileHugeMethods) \ do_bool_flag(EagerJVMCI) \ @@ -554,16 +554,17 @@ jobjectArray readConfiguration0(JNIEnv *env, JVMCI_TRAPS) { JVMCIENV->put_object_at(vmFlags, i++, vmFlagObj); \ } #define ADD_BOOL_FLAG(name) ADD_FLAG(bool, name, BOXED_BOOLEAN) +#define ADD_UINT_FLAG(name) ADD_FLAG(uint, name, BOXED_LONG) #define ADD_INT_FLAG(name) ADD_FLAG(int, name, BOXED_LONG) #define ADD_SIZE_T_FLAG(name) ADD_FLAG(size_t, name, BOXED_LONG) #define ADD_INTX_FLAG(name) ADD_FLAG(intx, name, BOXED_LONG) #define ADD_UINTX_FLAG(name) ADD_FLAG(uintx, name, BOXED_LONG) - len = 0 + PREDEFINED_CONFIG_FLAGS(COUNT_FLAG, COUNT_FLAG, COUNT_FLAG, COUNT_FLAG, COUNT_FLAG); + len = 0 + PREDEFINED_CONFIG_FLAGS(COUNT_FLAG, COUNT_FLAG, COUNT_FLAG, COUNT_FLAG, COUNT_FLAG, COUNT_FLAG); JVMCIObjectArray vmFlags = JVMCIENV->new_VMFlag_array(len, JVMCI_CHECK_NULL); int i = 0; JVMCIObject value; - PREDEFINED_CONFIG_FLAGS(ADD_BOOL_FLAG, ADD_INT_FLAG, ADD_SIZE_T_FLAG, ADD_INTX_FLAG, ADD_UINTX_FLAG) + PREDEFINED_CONFIG_FLAGS(ADD_BOOL_FLAG, ADD_UINT_FLAG, ADD_INT_FLAG, ADD_SIZE_T_FLAG, ADD_INTX_FLAG, ADD_UINTX_FLAG) JVMCIObjectArray vmIntrinsics = CompilerToVM::initialize_intrinsics(JVMCI_CHECK_NULL); diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 91482e825cd..74314b0ad61 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -432,7 +432,7 @@ \ nonstatic_field(Thread, _poll_data, SafepointMechanism::ThreadData) \ nonstatic_field(Thread, _tlab, ThreadLocalAllocBuffer) \ - nonstatic_field(Thread, _allocated_bytes, jlong) \ + nonstatic_field(Thread, _allocated_bytes, uint64_t) \ JFR_ONLY(nonstatic_field(Thread, _jfr_thread_local, JfrThreadLocal)) \ \ static_field(java_lang_Thread, _tid_offset, int) \ diff --git a/src/hotspot/share/memory/allocation.inline.hpp b/src/hotspot/share/memory/allocation.inline.hpp index 5561cdbe6f7..1cbff9d0255 100644 --- a/src/hotspot/share/memory/allocation.inline.hpp +++ b/src/hotspot/share/memory/allocation.inline.hpp @@ -87,8 +87,7 @@ E* MmapArrayAllocator::allocate(size_t length, MemTag mem_tag) { template void MmapArrayAllocator::free(E* addr, size_t length) { - bool result = os::release_memory((char*)addr, size_for(length)); - assert(result, "Failed to release memory"); + os::release_memory((char*)addr, size_for(length)); } template diff --git a/src/hotspot/share/memory/arena.cpp b/src/hotspot/share/memory/arena.cpp index 2de3f837c00..75cd909b028 100644 --- a/src/hotspot/share/memory/arena.cpp +++ b/src/hotspot/share/memory/arena.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -330,6 +330,9 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) { size_t len = MAX2(ARENA_ALIGN(x), (size_t) Chunk::size); if (MemTracker::check_exceeds_limit(x, _mem_tag)) { + if (alloc_failmode == AllocFailStrategy::EXIT_OOM) { + vm_exit_out_of_memory(x, OOM_MALLOC_ERROR, "MallocLimit in Arena::grow"); + } return nullptr; } diff --git a/src/hotspot/share/memory/memoryReserver.cpp b/src/hotspot/share/memory/memoryReserver.cpp index e8d1887f59f..1c44f76ed11 100644 --- a/src/hotspot/share/memory/memoryReserver.cpp +++ b/src/hotspot/share/memory/memoryReserver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,9 +99,7 @@ static char* reserve_memory_inner(char* requested_address, } // Base not aligned, retry. - if (!os::release_memory(base, size)) { - fatal("os::release_memory failed"); - } + os::release_memory(base, size); // Map using the requested alignment. return os::reserve_memory_aligned(size, alignment, mem_tag, exec); @@ -231,14 +229,9 @@ ReservedSpace MemoryReserver::reserve(size_t size, mem_tag); } -bool MemoryReserver::release(const ReservedSpace& reserved) { +void MemoryReserver::release(const ReservedSpace& reserved) { assert(reserved.is_reserved(), "Precondition"); - - if (reserved.special()) { - return os::release_memory_special(reserved.base(), reserved.size()); - } else { - return os::release_memory(reserved.base(), reserved.size()); - } + os::release_memory(reserved.base(), reserved.size()); } static char* map_memory_to_file(char* requested_address, @@ -266,9 +259,7 @@ static char* map_memory_to_file(char* requested_address, // Base not aligned, retry. - if (!os::unmap_memory(base, size)) { - fatal("os::unmap_memory failed"); - } + os::unmap_memory(base, size); // Map using the requested alignment. return os::map_memory_to_file_aligned(size, alignment, fd, mem_tag); @@ -376,11 +367,7 @@ ReservedSpace HeapReserver::Instance::reserve_memory(size_t size, void HeapReserver::Instance::release(const ReservedSpace& reserved) { if (reserved.is_reserved()) { if (_fd == -1) { - if (reserved.special()) { - os::release_memory_special(reserved.base(), reserved.size()); - } else{ - os::release_memory(reserved.base(), reserved.size()); - } + os::release_memory(reserved.base(), reserved.size()); } else { os::unmap_memory(reserved.base(), reserved.size()); } diff --git a/src/hotspot/share/memory/memoryReserver.hpp b/src/hotspot/share/memory/memoryReserver.hpp index 9ef12650b55..d13d8d72512 100644 --- a/src/hotspot/share/memory/memoryReserver.hpp +++ b/src/hotspot/share/memory/memoryReserver.hpp @@ -70,7 +70,7 @@ public: MemTag mem_tag); // Release reserved memory - static bool release(const ReservedSpace& reserved); + static void release(const ReservedSpace& reserved); }; class CodeMemoryReserver : AllStatic { diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp index d21c6546cf5..df4e507b104 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp @@ -190,10 +190,7 @@ void VirtualSpaceNode::uncommit_range(MetaWord* p, size_t word_size) { } // Uncommit... - if (os::uncommit_memory((char*)p, word_size * BytesPerWord) == false) { - // Note: this can actually happen, since uncommit may increase the number of mappings. - fatal("Failed to uncommit metaspace."); - } + os::uncommit_memory((char*)p, word_size * BytesPerWord); ASAN_POISON_MEMORY_REGION((char*)p, word_size * BytesPerWord); diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index cfbab1b8afb..a78b245cc07 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -1182,13 +1182,12 @@ bool universe_post_init() { Universe::heap()->update_capacity_and_used_at_gc(); } - // ("weak") refs processing infrastructure initialization + // Initialize serviceability + MemoryService::initialize(Universe::heap()); + + // Complete initialization Universe::heap()->post_initialize(); - MemoryService::add_metaspace_memory_pools(); - - MemoryService::set_universe_heap(Universe::heap()); - #if INCLUDE_CDS AOTMetaspace::post_initialize(CHECK_false); #endif diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index 92a168248d2..0627c0b9a8e 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -370,34 +370,22 @@ void VirtualSpace::shrink_by(size_t size) { assert(middle_high_boundary() <= aligned_upper_new_high && aligned_upper_new_high + upper_needs <= upper_high_boundary(), "must not shrink beyond region"); - if (!os::uncommit_memory(aligned_upper_new_high, upper_needs, _executable)) { - DEBUG_ONLY(warning("os::uncommit_memory failed")); - return; - } else { - _upper_high -= upper_needs; - } + os::uncommit_memory(aligned_upper_new_high, upper_needs, _executable); + _upper_high -= upper_needs; } if (middle_needs > 0) { assert(lower_high_boundary() <= aligned_middle_new_high && aligned_middle_new_high + middle_needs <= middle_high_boundary(), "must not shrink beyond region"); - if (!os::uncommit_memory(aligned_middle_new_high, middle_needs, _executable)) { - DEBUG_ONLY(warning("os::uncommit_memory failed")); - return; - } else { - _middle_high -= middle_needs; - } + os::uncommit_memory(aligned_middle_new_high, middle_needs, _executable); + _middle_high -= middle_needs; } if (lower_needs > 0) { assert(low_boundary() <= aligned_lower_new_high && aligned_lower_new_high + lower_needs <= lower_high_boundary(), "must not shrink beyond region"); - if (!os::uncommit_memory(aligned_lower_new_high, lower_needs, _executable)) { - DEBUG_ONLY(warning("os::uncommit_memory failed")); - return; - } else { - _lower_high -= lower_needs; - } + os::uncommit_memory(aligned_lower_new_high, lower_needs, _executable); + _lower_high -= lower_needs; } _high -= size; diff --git a/src/hotspot/share/nmt/memBaseline.cpp b/src/hotspot/share/nmt/memBaseline.cpp index 118e3ec64c0..65168fd4e09 100644 --- a/src/hotspot/share/nmt/memBaseline.cpp +++ b/src/hotspot/share/nmt/memBaseline.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 @@ -168,12 +168,13 @@ int compare_allocation_site(const VirtualMemoryAllocationSite& s1, } bool MemBaseline::aggregate_virtual_memory_allocation_sites() { + SortedLinkedList allocation_sites; VirtualMemoryAllocationSite* site; bool failed_oom = false; - _vma_allocations->visit_reserved_regions([&](ReservedMemoryRegion& rgn) { - VirtualMemoryAllocationSite tmp(*rgn.call_stack(), rgn.mem_tag()); + _vma_allocations->visit_reserved_regions([&](VirtualMemoryRegion& rgn) { + VirtualMemoryAllocationSite tmp(*rgn.reserved_call_stack(), rgn.mem_tag()); site = allocation_sites.find(tmp); if (site == nullptr) { LinkedListNode* node = diff --git a/src/hotspot/share/nmt/memMapPrinter.cpp b/src/hotspot/share/nmt/memMapPrinter.cpp index 9a2fe166d3d..639e06292fc 100644 --- a/src/hotspot/share/nmt/memMapPrinter.cpp +++ b/src/hotspot/share/nmt/memMapPrinter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -149,7 +149,7 @@ public: } } - bool do_allocation_site(const ReservedMemoryRegion* rgn) override { + bool do_allocation_site(const VirtualMemoryRegion* rgn) override { // Cancel iteration if we run out of memory (add returns false); return add(rgn->base(), rgn->end(), rgn->mem_tag()); } diff --git a/src/hotspot/share/nmt/memReporter.cpp b/src/hotspot/share/nmt/memReporter.cpp index 772bda2885b..27a94ec7bc0 100644 --- a/src/hotspot/share/nmt/memReporter.cpp +++ b/src/hotspot/share/nmt/memReporter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 @@ -395,14 +395,14 @@ int MemDetailReporter::report_virtual_memory_allocation_sites() { void MemDetailReporter::report_virtual_memory_map() { // Virtual memory map always in base address order output()->print_cr("Virtual memory map:"); - _baseline.virtual_memory_allocations()->visit_reserved_regions([&](ReservedMemoryRegion& rgn) { + _baseline.virtual_memory_allocations()->visit_reserved_regions([&](VirtualMemoryRegion& rgn) { report_virtual_memory_region(&rgn); return true; }); } -void MemDetailReporter::report_virtual_memory_region(const ReservedMemoryRegion* reserved_rgn) { - assert(reserved_rgn != nullptr, "null pointer"); +void MemDetailReporter::report_virtual_memory_region(const VirtualMemoryRegion* rgn) { + assert(rgn != nullptr, "null pointer"); // We don't bother about reporting peaks here. // That is because peaks - in the context of virtual memory, peak of committed areas - make little sense @@ -414,16 +414,16 @@ void MemDetailReporter::report_virtual_memory_region(const ReservedMemoryRegion* // usage *by callsite*. // Don't report if size is too small. - if (amount_in_current_scale(reserved_rgn->size()) == 0) return; + if (amount_in_current_scale(rgn->size()) == 0) return; outputStream* out = output(); const char* scale = current_scale(); - const NativeCallStack* stack = reserved_rgn->call_stack(); - bool all_committed = reserved_rgn->size() == _baseline.virtual_memory_allocations()->committed_size(*reserved_rgn); + const NativeCallStack* stack = rgn->reserved_call_stack(); + bool all_committed = rgn->size() == _baseline.virtual_memory_allocations()->committed_size(*rgn); const char* region_type = (all_committed ? "reserved and committed" : "reserved"); out->cr(); - print_virtual_memory_region(region_type, reserved_rgn->base(), reserved_rgn->size()); - out->print(" for %s", NMTUtil::tag_to_name(reserved_rgn->mem_tag())); + print_virtual_memory_region(region_type, rgn->base(), rgn->size()); + out->print(" for %s", NMTUtil::tag_to_name(rgn->mem_tag())); if (stack->is_empty()) { out->cr(); } else { @@ -433,9 +433,9 @@ void MemDetailReporter::report_virtual_memory_region(const ReservedMemoryRegion* if (all_committed) { bool reserved_and_committed = false; - _baseline.virtual_memory_allocations()->visit_committed_regions(*reserved_rgn, - [&](CommittedMemoryRegion& committed_rgn) { - if (committed_rgn.equals(*reserved_rgn)) { + _baseline.virtual_memory_allocations()->visit_committed_regions(*rgn, + [&](VirtualMemoryRegion& committed_rgn) { + if (committed_rgn.equals(*rgn)) { // One region spanning the entire reserved region, with the same stack trace. // Don't print this regions because the "reserved and committed" line above // already indicates that the region is committed. @@ -450,13 +450,13 @@ void MemDetailReporter::report_virtual_memory_region(const ReservedMemoryRegion* } } - auto print_committed_rgn = [&](const CommittedMemoryRegion& crgn) { + auto print_committed_rgn = [&](const VirtualMemoryRegion& rgn) { // Don't report if size is too small - if (amount_in_current_scale(crgn.size()) == 0) return; - stack = crgn.call_stack(); + if (amount_in_current_scale(rgn.size()) == 0) return; + stack = rgn.committed_call_stack(); out->cr(); INDENT_BY(8, - print_virtual_memory_region("committed", crgn.base(), crgn.size()); + print_virtual_memory_region("committed", rgn.base(), rgn.size()); if (stack->is_empty()) { out->cr(); } else { @@ -466,9 +466,9 @@ void MemDetailReporter::report_virtual_memory_region(const ReservedMemoryRegion* ) }; - _baseline.virtual_memory_allocations()->visit_committed_regions(*reserved_rgn, - [&](CommittedMemoryRegion& crgn) { - print_committed_rgn(crgn); + _baseline.virtual_memory_allocations()->visit_committed_regions(*rgn, + [&](VirtualMemoryRegion& committed_rgn) { + print_committed_rgn(committed_rgn); return true; }); } diff --git a/src/hotspot/share/nmt/memReporter.hpp b/src/hotspot/share/nmt/memReporter.hpp index bab8de138d0..0d7e7344608 100644 --- a/src/hotspot/share/nmt/memReporter.hpp +++ b/src/hotspot/share/nmt/memReporter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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,7 +178,7 @@ class MemDetailReporter : public MemSummaryReporter { int report_virtual_memory_allocation_sites(); // Report a virtual memory region - void report_virtual_memory_region(const ReservedMemoryRegion* rgn); + void report_virtual_memory_region(const VirtualMemoryRegion* rgn); }; /* diff --git a/src/hotspot/share/nmt/memoryFileTracker.cpp b/src/hotspot/share/nmt/memoryFileTracker.cpp index fe723d09364..0a458347169 100644 --- a/src/hotspot/share/nmt/memoryFileTracker.cpp +++ b/src/hotspot/share/nmt/memoryFileTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,21 +44,21 @@ void MemoryFileTracker::allocate_memory(MemoryFile* file, size_t offset, VMATree::RegionData regiondata(sidx, mem_tag); VMATree::SummaryDiff diff; file->_tree.commit_mapping(offset, size, regiondata, diff); - for (int i = 0; i < mt_number_of_tags; i++) { - VirtualMemory* summary = file->_summary.by_tag(NMTUtil::index_to_tag(i)); - summary->reserve_memory(diff.tag[i].commit); - summary->commit_memory(diff.tag[i].commit); - } + diff.visit([&](MemTag mt, const VMATree::SingleDiff& single_diff) { + VirtualMemory* summary = file->_summary.by_tag(mt); + summary->reserve_memory(single_diff.commit); + summary->commit_memory(single_diff.commit); + }); } void MemoryFileTracker::free_memory(MemoryFile* file, size_t offset, size_t size) { VMATree::SummaryDiff diff; file->_tree.release_mapping(offset, size, diff); - for (int i = 0; i < mt_number_of_tags; i++) { - VirtualMemory* summary = file->_summary.by_tag(NMTUtil::index_to_tag(i)); - summary->reserve_memory(diff.tag[i].commit); - summary->commit_memory(diff.tag[i].commit); - } + diff.visit([&](MemTag mt, const VMATree::SingleDiff& single_diff) { + VirtualMemory* summary = file->_summary.by_tag(mt); + summary->reserve_memory(single_diff.commit); + summary->commit_memory(single_diff.commit); + }); } void MemoryFileTracker::print_report_on(const MemoryFile* file, outputStream* stream, size_t scale) { diff --git a/src/hotspot/share/nmt/regionsTree.cpp b/src/hotspot/share/nmt/regionsTree.cpp index 83306cbc14f..1a87d051928 100644 --- a/src/hotspot/share/nmt/regionsTree.cpp +++ b/src/hotspot/share/nmt/regionsTree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,9 +58,9 @@ void RegionsTree::print_on(outputStream* st) { } #endif -size_t RegionsTree::committed_size(const ReservedMemoryRegion& rgn) { +size_t RegionsTree::committed_size(const VirtualMemoryRegion& rgn) { size_t result = 0; - visit_committed_regions(rgn, [&](CommittedMemoryRegion& crgn) { + visit_committed_regions(rgn, [&](VirtualMemoryRegion& crgn) { result += crgn.size(); return true; }); diff --git a/src/hotspot/share/nmt/regionsTree.hpp b/src/hotspot/share/nmt/regionsTree.hpp index 2e1b37d0c1a..4b27423db8c 100644 --- a/src/hotspot/share/nmt/regionsTree.hpp +++ b/src/hotspot/share/nmt/regionsTree.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,8 +29,7 @@ #include "nmt/vmatree.hpp" -class ReservedMemoryRegion; -class CommittedMemoryRegion; +class VirtualMemoryRegion; // RegionsTree extends VMATree to add some more specific API and also defines a helper // for processing the tree nodes in a shorter and more meaningful way. class RegionsTree : public VMATree { @@ -46,7 +45,7 @@ class RegionsTree : public VMATree { _with_storage(other._with_storage) {} RegionsTree& operator=(const RegionsTree& other) = delete; - ReservedMemoryRegion find_reserved_region(address addr); + VirtualMemoryRegion find_reserved_region(address addr); void commit_region(address addr, size_t size, const NativeCallStack& stack, SummaryDiff& diff); void uncommit_region(address addr, size_t size, SummaryDiff& diff); @@ -71,6 +70,7 @@ class RegionsTree : public VMATree { return position() - other.position(); } inline NativeCallStackStorage::StackIndex out_stack_index() const { return _node->val().out.reserved_stack(); } + inline NativeCallStackStorage::StackIndex out_committed_stack_index() const { return _node->val().out.committed_stack(); } inline MemTag in_tag() const { return _node->val().in.mem_tag(); } inline MemTag out_tag() const { return _node->val().out.mem_tag(); } inline void set_in_tag(MemTag tag) { _node->val().in.set_tag(tag); } @@ -81,7 +81,7 @@ class RegionsTree : public VMATree { DEBUG_ONLY(void print_on(outputStream* st);) template - void visit_committed_regions(const ReservedMemoryRegion& rgn, F func); + void visit_committed_regions(const VirtualMemoryRegion& rgn, F func); template void visit_reserved_regions(F func); @@ -90,7 +90,7 @@ class RegionsTree : public VMATree { return RegionData(_ncs_storage.push(ncs), tag); } - inline const NativeCallStack stack(NodeHelper& node) { + inline const NativeCallStack reserved_stack(NodeHelper& node) { if (!_with_storage) { return NativeCallStack::empty_stack(); } @@ -98,7 +98,15 @@ class RegionsTree : public VMATree { return _ncs_storage.get(si); } - size_t committed_size(const ReservedMemoryRegion& rgn); + inline const NativeCallStack committed_stack(NodeHelper& node) { + if (!_with_storage) { + return NativeCallStack::empty_stack(); + } + NativeCallStackStorage::StackIndex si = node.out_committed_stack_index(); + return _ncs_storage.get(si); + } + + size_t committed_size(const VirtualMemoryRegion& rgn); }; #endif // NMT_REGIONSTREE_HPP diff --git a/src/hotspot/share/nmt/regionsTree.inline.hpp b/src/hotspot/share/nmt/regionsTree.inline.hpp index 98cfa0e7f2c..793a5c5f1fa 100644 --- a/src/hotspot/share/nmt/regionsTree.inline.hpp +++ b/src/hotspot/share/nmt/regionsTree.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ #include "nmt/virtualMemoryTracker.hpp" template -void RegionsTree::visit_committed_regions(const ReservedMemoryRegion& rgn, F func) { +void RegionsTree::visit_committed_regions(const VirtualMemoryRegion& rgn, F func) { position start = (position)rgn.base(); size_t end = reinterpret_cast(rgn.end()) + 1; size_t comm_size = 0; @@ -38,8 +38,12 @@ void RegionsTree::visit_committed_regions(const ReservedMemoryRegion& rgn, F fun visit_range_in_order(start, end, [&](Node* node) { NodeHelper curr(node); if (prev.is_valid() && prev.is_committed_begin()) { - CommittedMemoryRegion cmr((address)prev.position(), curr.distance_from(prev), stack(prev)); - if (!func(cmr)) { + VirtualMemoryRegion rgn((address)prev.position(), + curr.distance_from(prev), + reserved_stack(prev), + committed_stack(prev), + prev.out_tag()); + if (!func(rgn)) { return false; } } @@ -63,13 +67,13 @@ void RegionsTree::visit_reserved_regions(F func) { } prev = curr; if (curr.is_released_begin() || begin_node.out_tag() != curr.out_tag()) { - auto st = stack(begin_node); + auto st = reserved_stack(begin_node); if (rgn_size == 0) { prev.clear_node(); return true; } - ReservedMemoryRegion rmr((address)begin_node.position(), rgn_size, st, begin_node.out_tag()); - if (!func(rmr)) { + VirtualMemoryRegion rgn((address)begin_node.position(), rgn_size, st, begin_node.out_tag()); + if (!func(rgn)) { return false; } rgn_size = 0; diff --git a/src/hotspot/share/nmt/virtualMemoryTracker.cpp b/src/hotspot/share/nmt/virtualMemoryTracker.cpp index d676d93e040..dc68664f34f 100644 --- a/src/hotspot/share/nmt/virtualMemoryTracker.cpp +++ b/src/hotspot/share/nmt/virtualMemoryTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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 @@ -80,16 +80,17 @@ void VirtualMemoryTracker::Instance::set_reserved_region_tag(address addr, size_ } void VirtualMemoryTracker::set_reserved_region_tag(address addr, size_t size, MemTag mem_tag) { - VMATree::SummaryDiff diff = tree()->set_tag((VMATree::position) addr, size, mem_tag); - apply_summary_diff(diff); + VMATree::SummaryDiff diff; + tree()->set_tag((VMATree::position)addr, size, mem_tag, diff); + apply_summary_diff(diff); } -void VirtualMemoryTracker::Instance::apply_summary_diff(VMATree::SummaryDiff diff) { +void VirtualMemoryTracker::Instance::apply_summary_diff(VMATree::SummaryDiff& diff) { assert(_tracker != nullptr, "Sanity check"); _tracker->apply_summary_diff(diff); } -void VirtualMemoryTracker::apply_summary_diff(VMATree::SummaryDiff diff) { +void VirtualMemoryTracker::apply_summary_diff(VMATree::SummaryDiff& diff) { VMATree::SingleDiff::delta reserve_delta, commit_delta; size_t reserved, committed; MemTag tag = mtNone; @@ -104,10 +105,9 @@ void VirtualMemoryTracker::apply_summary_diff(VMATree::SummaryDiff diff) { #endif }; - for (int i = 0; i < mt_number_of_tags; i++) { - reserve_delta = diff.tag[i].reserve; - commit_delta = diff.tag[i].commit; - tag = NMTUtil::index_to_tag(i); + diff.visit([&](MemTag tag, const VMATree::SingleDiff& single_diff) { + reserve_delta = single_diff.reserve; + commit_delta = single_diff.commit; reserved = VirtualMemorySummary::as_snapshot()->by_tag(tag)->reserved(); committed = VirtualMemorySummary::as_snapshot()->by_tag(tag)->committed(); if (reserve_delta != 0) { @@ -138,7 +138,7 @@ void VirtualMemoryTracker::apply_summary_diff(VMATree::SummaryDiff diff) { } } } - } + }); } void VirtualMemoryTracker::Instance::add_committed_region(address addr, size_t size, @@ -193,14 +193,14 @@ bool VirtualMemoryTracker::Instance::print_containing_region(const void* p, outp } bool VirtualMemoryTracker::print_containing_region(const void* p, outputStream* st) { - ReservedMemoryRegion rmr = tree()->find_reserved_region((address)p); - if (!rmr.contain_address((address)p)) { + VirtualMemoryRegion rgn = tree()->find_reserved_region((address)p); + if (!rgn.is_valid() || !rgn.contain_address((address)p)) { return false; } st->print_cr(PTR_FORMAT " in mmap'd memory region [" PTR_FORMAT " - " PTR_FORMAT "], tag %s", - p2i(p), p2i(rmr.base()), p2i(rmr.end()), NMTUtil::tag_to_enum_name(rmr.mem_tag())); + p2i(p), p2i(rgn.base()), p2i(rgn.end()), NMTUtil::tag_to_enum_name(rgn.mem_tag())); if (MemTracker::tracking_level() == NMT_detail) { - rmr.call_stack()->print_on(st); + rgn.reserved_call_stack()->print_on(st); } st->cr(); return true; @@ -213,7 +213,7 @@ bool VirtualMemoryTracker::Instance::walk_virtual_memory(VirtualMemoryWalker* wa bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) { bool ret = true; - tree()->visit_reserved_regions([&](ReservedMemoryRegion& rgn) { + tree()->visit_reserved_regions([&](VirtualMemoryRegion& rgn) { if (!walker->do_allocation_site(&rgn)) { ret = false; return false; @@ -223,29 +223,29 @@ bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) { return ret; } -size_t VirtualMemoryTracker::committed_size(const ReservedMemoryRegion* rmr) { +size_t VirtualMemoryTracker::committed_size(const VirtualMemoryRegion* rgn) { size_t result = 0; - tree()->visit_committed_regions(*rmr, [&](CommittedMemoryRegion& crgn) { + tree()->visit_committed_regions(*rgn, [&](VirtualMemoryRegion& crgn) { result += crgn.size(); return true; }); return result; } -size_t VirtualMemoryTracker::Instance::committed_size(const ReservedMemoryRegion* rmr) { +size_t VirtualMemoryTracker::Instance::committed_size(const VirtualMemoryRegion* rgn) { assert(_tracker != nullptr, "Sanity check"); - return _tracker->committed_size(rmr); + return _tracker->committed_size(rgn); } -address VirtualMemoryTracker::Instance::thread_stack_uncommitted_bottom(const ReservedMemoryRegion* rmr) { +address VirtualMemoryTracker::Instance::thread_stack_uncommitted_bottom(const VirtualMemoryRegion* rgn) { assert(_tracker != nullptr, "Sanity check"); - return _tracker->thread_stack_uncommitted_bottom(rmr); + return _tracker->thread_stack_uncommitted_bottom(rgn); } -address VirtualMemoryTracker::thread_stack_uncommitted_bottom(const ReservedMemoryRegion* rmr) { - address bottom = rmr->base(); - address top = rmr->end(); - tree()->visit_committed_regions(*rmr, [&](CommittedMemoryRegion& crgn) { +address VirtualMemoryTracker::thread_stack_uncommitted_bottom(const VirtualMemoryRegion* rgn) { + address bottom = rgn->base(); + address top = rgn->end(); + tree()->visit_committed_regions(*rgn, [&](VirtualMemoryRegion& crgn) { address committed_top = crgn.base() + crgn.size(); if (committed_top < top) { // committed stack guard pages, skip them @@ -299,7 +299,7 @@ class SnapshotThreadStackWalker : public VirtualMemoryWalker { public: SnapshotThreadStackWalker() {} - bool do_allocation_site(const ReservedMemoryRegion* rgn) { + bool do_allocation_site(const VirtualMemoryRegion* rgn) { if (MemTracker::NmtVirtualMemoryLocker::is_safe_to_use()) { assert_lock_strong(NmtVirtualMemory_lock); } @@ -340,19 +340,19 @@ void VirtualMemoryTracker::Instance::snapshot_thread_stacks() { walk_virtual_memory(&walker); } -ReservedMemoryRegion RegionsTree::find_reserved_region(address addr) { - ReservedMemoryRegion rmr; - auto contain_region = [&](ReservedMemoryRegion& region_in_tree) { +VirtualMemoryRegion RegionsTree::find_reserved_region(address addr) { + VirtualMemoryRegion rgn; + auto contain_region = [&](VirtualMemoryRegion& region_in_tree) { if (region_in_tree.contain_address(addr)) { - rmr = region_in_tree; + rgn = region_in_tree; return false; } return true; }; visit_reserved_regions(contain_region); - return rmr; + return rgn; } -bool CommittedMemoryRegion::equals(const ReservedMemoryRegion& rmr) const { - return size() == rmr.size() && call_stack()->equals(*(rmr.call_stack())); +bool VirtualMemoryRegion::equals_including_stacks(const VirtualMemoryRegion& rgn) const { + return size() == rgn.size() && committed_call_stack()->equals(*(rgn.reserved_call_stack())); } diff --git a/src/hotspot/share/nmt/virtualMemoryTracker.hpp b/src/hotspot/share/nmt/virtualMemoryTracker.hpp index c51b53194e6..f6cb18983a3 100644 --- a/src/hotspot/share/nmt/virtualMemoryTracker.hpp +++ b/src/hotspot/share/nmt/virtualMemoryTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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 @@ -194,15 +194,38 @@ class VirtualMemorySummary : AllStatic { */ class VirtualMemoryRegion { private: - address _base_address; - size_t _size; + address _base_address; + size_t _size; + MemTag _mem_tag; + NativeCallStack _reserved_stack; + NativeCallStack _committed_stack; public: + VirtualMemoryRegion() : + _base_address(nullptr), _size(0), _mem_tag(mtNone), + _reserved_stack(NativeCallStack::empty_stack()) , + _committed_stack(NativeCallStack::empty_stack()) {} + VirtualMemoryRegion(address addr, size_t size) : - _base_address(addr), _size(size) { + _base_address(addr), _size(size), _mem_tag(mtNone), + _reserved_stack(NativeCallStack::empty_stack()) , + _committed_stack(NativeCallStack::empty_stack()) { assert(addr != nullptr, "Invalid address"); assert(size > 0, "Invalid size"); - } + } + + VirtualMemoryRegion(address addr, size_t size, const NativeCallStack& reserved_stack, const NativeCallStack& committed_stack, MemTag mem_tag = mtNone) : + _base_address(addr), _size(size), _mem_tag(mem_tag), + _reserved_stack(reserved_stack), + _committed_stack(committed_stack) { + assert(addr != nullptr, "Invalid address"); + assert(size > 0, "Invalid size"); + } + + VirtualMemoryRegion(address addr, size_t size, const NativeCallStack& stack, MemTag mem_tag = mtNone) + : _base_address(addr), _size(size), _mem_tag(mem_tag), + _reserved_stack(stack), + _committed_stack(NativeCallStack::empty_stack()) {} inline address base() const { return _base_address; } inline address end() const { return base() + size(); } @@ -211,48 +234,18 @@ class VirtualMemoryRegion { inline bool is_empty() const { return size() == 0; } inline bool contain_address(address addr) const { + assert(is_valid(), "sanity"); return (addr >= base() && addr < end()); } - - inline bool contain_region(address addr, size_t size) const { - return contain_address(addr) && contain_address(addr + size - 1); - } - - inline bool same_region(address addr, size_t sz) const { - return (addr == base() && sz == size()); - } - - + private: inline bool overlap_region(address addr, size_t sz) const { assert(sz > 0, "Invalid size"); assert(size() > 0, "Invalid size"); + assert(is_valid(), "sanity"); return MAX2(addr, base()) < MIN2(addr + sz, end()); } - inline bool adjacent_to(address addr, size_t sz) const { - return (addr == end() || (addr + sz) == base()); - } - - void exclude_region(address addr, size_t sz) { - assert(contain_region(addr, sz), "Not containment"); - assert(addr == base() || addr + sz == end(), "Can not exclude from middle"); - size_t new_size = size() - sz; - - if (addr == base()) { - set_base(addr + sz); - } - set_size(new_size); - } - - void expand_region(address addr, size_t sz) { - assert(adjacent_to(addr, sz), "Not adjacent regions"); - if (base() == addr + sz) { - set_base(addr); - } - set_size(size() + sz); - } - // Returns 0 if regions overlap; 1 if this region follows rgn; // -1 if this region precedes rgn. inline int compare(const VirtualMemoryRegion& rgn) const { @@ -266,86 +259,27 @@ class VirtualMemoryRegion { } } + public: // Returns true if regions overlap, false otherwise. inline bool equals(const VirtualMemoryRegion& rgn) const { return compare(rgn) == 0; } - protected: - void set_base(address base) { - assert(base != nullptr, "Sanity check"); - _base_address = base; - } + bool equals_including_stacks(const VirtualMemoryRegion& other) const; + inline const NativeCallStack* committed_call_stack() const { return &_committed_stack; } - void set_size(size_t size) { - assert(size > 0, "Sanity check"); - _size = size; - } -}; + bool is_valid() const { return base() != nullptr && size() != 0;} + inline const NativeCallStack* reserved_call_stack() const { return &_reserved_stack; } -class CommittedMemoryRegion : public VirtualMemoryRegion { - private: - NativeCallStack _stack; - - public: - CommittedMemoryRegion() - : VirtualMemoryRegion((address)1, 1), _stack(NativeCallStack::empty_stack()) { } - - CommittedMemoryRegion(address addr, size_t size, const NativeCallStack& stack) - : VirtualMemoryRegion(addr, size), _stack(stack) { } - - inline void set_call_stack(const NativeCallStack& stack) { _stack = stack; } - inline const NativeCallStack* call_stack() const { return &_stack; } - bool equals(const ReservedMemoryRegion& other) const; -}; - -class ReservedMemoryRegion : public VirtualMemoryRegion { - private: - NativeCallStack _stack; - MemTag _mem_tag; - - public: - bool is_valid() { return base() != (address)1 && size() != 1;} - - ReservedMemoryRegion() - : VirtualMemoryRegion((address)1, 1), _stack(NativeCallStack::empty_stack()), _mem_tag(mtNone) { } - - ReservedMemoryRegion(address base, size_t size, const NativeCallStack& stack, - MemTag mem_tag = mtNone) - : VirtualMemoryRegion(base, size), _stack(stack), _mem_tag(mem_tag) { } - - - ReservedMemoryRegion(address base, size_t size) - : VirtualMemoryRegion(base, size), _stack(NativeCallStack::empty_stack()), _mem_tag(mtNone) { } - - // Copy constructor - ReservedMemoryRegion(const ReservedMemoryRegion& rr) - : VirtualMemoryRegion(rr.base(), rr.size()) { - *this = rr; - } - - inline void set_call_stack(const NativeCallStack& stack) { _stack = stack; } - inline const NativeCallStack* call_stack() const { return &_stack; } - - inline MemTag mem_tag() const { return _mem_tag; } - - ReservedMemoryRegion& operator= (const ReservedMemoryRegion& other) { - set_base(other.base()); - set_size(other.size()); - - _stack = *other.call_stack(); - _mem_tag = other.mem_tag(); - - return *this; - } + inline MemTag mem_tag() const { return _mem_tag; } const char* tag_name() const { return NMTUtil::tag_to_name(_mem_tag); } }; class VirtualMemoryWalker : public StackObj { public: - virtual bool do_allocation_site(const ReservedMemoryRegion* rgn) { return false; } + virtual bool do_allocation_site(const VirtualMemoryRegion* rgn) { return false; } }; @@ -375,9 +309,9 @@ class VirtualMemoryTracker { // Snapshot current thread stacks void snapshot_thread_stacks(); - void apply_summary_diff(VMATree::SummaryDiff diff); - size_t committed_size(const ReservedMemoryRegion* rmr); - address thread_stack_uncommitted_bottom(const ReservedMemoryRegion* rmr); + void apply_summary_diff(VMATree::SummaryDiff& diff); + size_t committed_size(const VirtualMemoryRegion* rmr); + address thread_stack_uncommitted_bottom(const VirtualMemoryRegion* rmr); RegionsTree* tree() { return &_tree; } @@ -400,10 +334,10 @@ class VirtualMemoryTracker { static bool walk_virtual_memory(VirtualMemoryWalker* walker); static bool print_containing_region(const void* p, outputStream* st); static void snapshot_thread_stacks(); - static void apply_summary_diff(VMATree::SummaryDiff diff); - static size_t committed_size(const ReservedMemoryRegion* rmr); + static void apply_summary_diff(VMATree::SummaryDiff& diff); + static size_t committed_size(const VirtualMemoryRegion* rmr); // uncommitted thread stack bottom, above guard pages if there is any. - static address thread_stack_uncommitted_bottom(const ReservedMemoryRegion* rmr); + static address thread_stack_uncommitted_bottom(const VirtualMemoryRegion* rgn); static RegionsTree* tree() { return _tracker->tree(); } }; diff --git a/src/hotspot/share/nmt/vmatree.cpp b/src/hotspot/share/nmt/vmatree.cpp index df7b1ac867e..6c5ab691f6d 100644 --- a/src/hotspot/share/nmt/vmatree.cpp +++ b/src/hotspot/share/nmt/vmatree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ #include "nmt/vmatree.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/growableArray.hpp" +#include "utilities/powerOfTwo.hpp" // Semantics @@ -192,8 +193,8 @@ void VMATree::compute_summary_diff(const SingleDiff::delta region_size, {0,a, 0,a, -a,a }, // op == Commit {0,0, 0,0, -a,0 } // op == Uncommit }; - SingleDiff& from_rescom = diff.tag[NMTUtil::tag_to_index(current_tag)]; - SingleDiff& to_rescom = diff.tag[NMTUtil::tag_to_index(operation_tag)]; + SingleDiff& from_rescom = diff.tag(current_tag); + SingleDiff& to_rescom = diff.tag(operation_tag); int st = state_to_index(ex); from_rescom.reserve += reserve[op][st * 2 ]; to_rescom.reserve += reserve[op][st * 2 + 1]; @@ -657,7 +658,7 @@ void VMATree::print_on(outputStream* out) { } #endif -VMATree::SummaryDiff VMATree::set_tag(const position start, const size size, const MemTag tag) { +void VMATree::set_tag(const position start, const size size, const MemTag tag, SummaryDiff& diff) { auto pos = [](TNode* n) { return n->key(); }; position from = start; position end = from+size; @@ -689,14 +690,13 @@ VMATree::SummaryDiff VMATree::set_tag(const position start, const size size, con }; bool success = find_next_range(); - if (!success) return SummaryDiff(); + if (!success) return; assert(range.start != nullptr && range.end != nullptr, "must be"); end = MIN2(from + remsize, pos(range.end)); IntervalState& out = out_state(range.start); StateType type = out.type(); - SummaryDiff diff; // Ignore any released ranges, these must be mtNone and have no stack if (type != StateType::Released) { RegionData new_data = RegionData(out.reserved_stack(), tag); @@ -713,7 +713,7 @@ VMATree::SummaryDiff VMATree::set_tag(const position start, const size size, con // Using register_mapping may invalidate the already found range, so we must // use find_next_range repeatedly bool success = find_next_range(); - if (!success) return diff; + if (!success) return; assert(range.start != nullptr && range.end != nullptr, "must be"); end = MIN2(from + remsize, pos(range.end)); @@ -729,25 +729,131 @@ VMATree::SummaryDiff VMATree::set_tag(const position start, const size size, con remsize = remsize - (end - from); from = end; } - - return diff; } #ifdef ASSERT void VMATree::SummaryDiff::print_on(outputStream* out) { - for (int i = 0; i < mt_number_of_tags; i++) { - if (tag[i].reserve == 0 && tag[i].commit == 0) { - continue; - } - out->print_cr("Tag %s R: " INT64_FORMAT " C: " INT64_FORMAT, NMTUtil::tag_to_enum_name((MemTag)i), tag[i].reserve, - tag[i].commit); - } + visit([&](MemTag mt, const SingleDiff& sd) { + out->print_cr("Tag %s R: " INT64_FORMAT " C: " INT64_FORMAT, + NMTUtil::tag_to_enum_name(mt), sd.reserve, sd.commit); + }); } #endif void VMATree::clear() { _tree.remove_all(); -}; +} + bool VMATree::is_empty() { return _tree.size() == 0; -}; +} + +VMATree::SummaryDiff::KVEntry& +VMATree::SummaryDiff::hash_insert_or_get(const KVEntry& kv, bool* found) { + DEBUG_ONLY(int counter = 0); + // If the length is large (picked as 32) + // then we apply a load-factor check and rehash if it exceeds it. + // When the length is small we're OK with a full linear search for an empty space + // to avoid a grow and rehash. + constexpr float load_factor = 0.5; + constexpr int load_factor_cutoff_length = 32; + if (_length > load_factor_cutoff_length && + (float)_occupied / _length > load_factor) { + grow_and_rehash(); + } + while (true) { + DEBUG_ONLY(counter++); + assert(counter < 8, "Infinite loop?"); + int i = hash_to_bucket(kv.mem_tag); + while (i < _length && _members[i].marker == Marker::Occupied) { + if (_members[i].mem_tag == kv.mem_tag) { + // Found previous + *found = true; + return _members[i]; + } + i++; + } + *found = false; + // We didn't find it but ran out of space, grow and rehash + // Then look at again + if (i >= _length) { + assert(_length < std::numeric_limits>::max(), ""); + grow_and_rehash(); + continue; + } + // We didn't find it, but _members[i] is empty, allocate a new one + assert(_members[i].marker == Marker::Empty, "must be"); + _members[i] = kv; + _occupied++; + return _members[i]; + } +} + +void VMATree::SummaryDiff::grow_and_rehash() { + assert(is_power_of_2(_length), "must be"); + constexpr int length_limit = std::numeric_limits>::max() + 1; + assert(is_power_of_2(length_limit), "must be"); + if (_length == length_limit) { + // If we are at MemTag's maximum size, then just continue with the current size. + return; + } + + int new_len = _length * 2; + // Save old entries (can't use ResourceMark, too early) + GrowableArrayCHeap tmp(_length); + for (int i = 0; i < _length; i++) { + tmp.push(_members[i]); + } + + // Clear previous -- if applicable + if (_members != _small) { + FREE_C_HEAP_ARRAY(KVEntry, _members); + } + + _members = NEW_C_HEAP_ARRAY(KVEntry, new_len, mtNMT); + // Clear new array + memset(_members, 0, sizeof(KVEntry) * new_len); + _length = new_len; + _occupied = 0; + + for (int i = 0; i < tmp.length(); i++) { + bool _found = false; + hash_insert_or_get(tmp.at(i), &_found); + } +} + +VMATree::SingleDiff& VMATree::SummaryDiff::tag(MemTag tag) { + KVEntry kv{Marker::Occupied, tag, {}}; + bool _found = false; + KVEntry& inserted = hash_insert_or_get(kv, &_found); + return inserted.single_diff; +} + +VMATree::SingleDiff& VMATree::SummaryDiff::tag(int mt_index) { + return tag((MemTag)mt_index); +} + +void VMATree::SummaryDiff::add(const SummaryDiff& other) { + other.visit([&](MemTag mt, const SingleDiff& single_diff) { + bool found = false; + KVEntry other_kv = {Marker::Occupied, mt, single_diff}; + KVEntry& this_kv = hash_insert_or_get(other_kv, &found); + if (found) { + this_kv.single_diff.reserve += other_kv.single_diff.reserve; + this_kv.single_diff.commit += other_kv.single_diff.commit; + } + }); +} + +void VMATree::SummaryDiff::clear() { + if (_members != _small) { + FREE_C_HEAP_ARRAY(KVEntry, _members); + } + memset(_small, 0, sizeof(_small)); +} + +uint32_t VMATree::SummaryDiff::hash_to_bucket(MemTag mt) { + uint32_t hash = primitive_hash((uint32_t)mt); + assert(is_power_of_2(_length), "must be"); + return hash & ((uint32_t)_length - 1); +} diff --git a/src/hotspot/share/nmt/vmatree.hpp b/src/hotspot/share/nmt/vmatree.hpp index f7ca8f4c7e0..ae732a4b0d3 100644 --- a/src/hotspot/share/nmt/vmatree.hpp +++ b/src/hotspot/share/nmt/vmatree.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -26,6 +26,7 @@ #ifndef SHARE_NMT_VMATREE_HPP #define SHARE_NMT_VMATREE_HPP +#include "memory/resourceArea.hpp" #include "nmt/memTag.hpp" #include "nmt/nmtNativeCallStackStorage.hpp" #include "utilities/globalDefinitions.hpp" @@ -238,24 +239,57 @@ public: delta commit; }; - struct SummaryDiff { - SingleDiff tag[mt_number_of_tags]; - SummaryDiff() { + class SummaryDiff { + enum class Marker { Empty, Occupied }; + static_assert((int)Marker::Empty == 0, "We memset the array to 0, so this must be true"); + + struct KVEntry { + Marker marker; + MemTag mem_tag; + SingleDiff single_diff; + }; + + static constexpr const int _init_size = 4; + KVEntry _small[_init_size]; + KVEntry* _members; + int _length; + int _occupied; + KVEntry& hash_insert_or_get(const KVEntry& kv, bool* found); + void grow_and_rehash(); + uint32_t hash_to_bucket(MemTag mt); + + public: + SummaryDiff() : _small(), _members(_small), _length(_init_size), _occupied(0) { clear(); } - void clear() { - for (int i = 0; i < mt_number_of_tags; i++) { - tag[i] = SingleDiff{0, 0}; + ~SummaryDiff() { + if (_members != _small) { + FREE_C_HEAP_ARRAY(KVEntry, _members); } } - void add(SummaryDiff& other) { - for (int i = 0; i < mt_number_of_tags; i++) { - tag[i].reserve += other.tag[i].reserve; - tag[i].commit += other.tag[i].commit; + SingleDiff& tag(MemTag tag); + SingleDiff& tag(int mt_index); + + template + void visit(F f) const { + int hits = 0; + for (int i = 0; i < _length; i++) { + const KVEntry& kv = _members[i]; + if (kv.marker == Marker::Occupied) { + f(kv.mem_tag, kv.single_diff); + hits++; + } + if (hits == _occupied) { + // Early exit + return; + } } } + void add(const SummaryDiff& other); + void clear(); + #ifdef ASSERT void print_on(outputStream* out); #endif @@ -313,7 +347,7 @@ public: // partially contained within that interval and set their tag to the one provided. // This may cause merging and splitting of ranges. // Released regions are ignored. - SummaryDiff set_tag(position from, size size, MemTag tag); + void set_tag(position from, size size, MemTag tag, SummaryDiff& diff); void uncommit_mapping(position from, size size, const RegionData& metadata, SummaryDiff& diff) { register_mapping(from, from + size, StateType::Reserved, metadata, diff, true); diff --git a/src/hotspot/share/oops/cpCache.hpp b/src/hotspot/share/oops/cpCache.hpp index e9e4f9a40e5..14202f226d1 100644 --- a/src/hotspot/share/oops/cpCache.hpp +++ b/src/hotspot/share/oops/cpCache.hpp @@ -196,7 +196,7 @@ class ConstantPoolCache: public MetaspaceObj { #endif public: - static int size() { return align_metadata_size(sizeof(ConstantPoolCache) / wordSize); } + static int size() { return align_metadata_size(sizeof_auto(ConstantPoolCache) / wordSize); } private: // Helpers diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp index add8e59b2be..e7479671dcf 100644 --- a/src/hotspot/share/oops/method.hpp +++ b/src/hotspot/share/oops/method.hpp @@ -465,7 +465,7 @@ public: bool contains(address bcp) const { return constMethod()->contains(bcp); } // prints byte codes - void print_codes(int flags = 0) const { print_codes_on(tty, flags); } + void print_codes(int flags = 0, bool buffered = true) const { print_codes_on(tty, flags, buffered); } void print_codes_on(outputStream* st, int flags = 0, bool buffered = true) const; void print_codes_on(int from, int to, outputStream* st, int flags = 0, bool buffered = true) const; diff --git a/src/hotspot/share/oops/trainingData.cpp b/src/hotspot/share/oops/trainingData.cpp index 1a16fd70e44..f52c22ad38a 100644 --- a/src/hotspot/share/oops/trainingData.cpp +++ b/src/hotspot/share/oops/trainingData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,6 +22,7 @@ * */ +#include "cds/aotCompressedPointers.hpp" #include "cds/cdsConfig.hpp" #include "ci/ciEnv.hpp" #include "ci/ciMetadata.hpp" @@ -512,8 +513,7 @@ void TrainingData::dump_training_data() { #endif // ASSERT td = ArchiveBuilder::current()->get_buffered_addr(td); uint hash = TrainingData::Key::cds_hash(td->key()); - u4 delta = ArchiveBuilder::current()->buffer_to_offset_u4((address)td); - writer.add(hash, delta); + writer.add(hash, AOTCompressedPointers::encode_not_null(td)); } writer.dump(&_archived_training_data_dictionary_for_dumping, "training data dictionary"); } diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index f470049bf7e..1662f808286 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -694,7 +694,9 @@ "Print progress during Iterative Global Value Numbering") \ \ develop(uint, VerifyIterativeGVN, 0, \ - "Verify Iterative Global Value Numbering =EDCBA, with:" \ + "Verify Iterative Global Value Numbering =FEDCBA, with:" \ + " F: verify Node::Ideal does not return nullptr if the node" \ + "hash has changed" \ " E: verify node specific invariants" \ " D: verify Node::Identity did not miss opportunities" \ " C: verify Node::Ideal did not miss opportunities" \ diff --git a/src/hotspot/share/opto/callnode.hpp b/src/hotspot/share/opto/callnode.hpp index 41d0c9f5aac..95d1fc27d45 100644 --- a/src/hotspot/share/opto/callnode.hpp +++ b/src/hotspot/share/opto/callnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,7 +120,6 @@ public: virtual int Opcode() const; virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash - virtual bool depends_only_on_test() const { return false; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return NotAMachineReg; } @@ -141,7 +140,6 @@ class RethrowNode : public Node { virtual int Opcode() const; virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash - virtual bool depends_only_on_test() const { return false; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; virtual uint match_edge(uint idx) const; diff --git a/src/hotspot/share/opto/castnode.cpp b/src/hotspot/share/opto/castnode.cpp index 2ebbdd7cdb3..4e3750b5ee5 100644 --- a/src/hotspot/share/opto/castnode.cpp +++ b/src/hotspot/share/opto/castnode.cpp @@ -207,6 +207,11 @@ bool ConstraintCastNode::higher_equal_types(PhaseGVN* phase, const Node* other) return true; } +Node* ConstraintCastNode::pin_node_under_control_impl() const { + assert(_dependency.is_floating(), "already pinned"); + return make_cast_for_type(in(0), in(1), bottom_type(), _dependency.with_pinned_dependency(), _extra_types); +} + #ifndef PRODUCT void ConstraintCastNode::dump_spec(outputStream *st) const { TypeNode::dump_spec(st); @@ -277,12 +282,9 @@ void CastIINode::dump_spec(outputStream* st) const { } #endif -CastIINode* CastIINode::pin_array_access_node() const { +CastIINode* CastIINode::pin_node_under_control_impl() const { assert(_dependency.is_floating(), "already pinned"); - if (has_range_check()) { - return new CastIINode(in(0), in(1), bottom_type(), _dependency.with_pinned_dependency(), has_range_check()); - } - return nullptr; + return new CastIINode(in(0), in(1), bottom_type(), _dependency.with_pinned_dependency(), _range_check_dependency, _extra_types); } void CastIINode::remove_range_check_cast(Compile* C) { diff --git a/src/hotspot/share/opto/castnode.hpp b/src/hotspot/share/opto/castnode.hpp index f22df546f41..38545fd6f41 100644 --- a/src/hotspot/share/opto/castnode.hpp +++ b/src/hotspot/share/opto/castnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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 @@ -166,8 +166,6 @@ protected: virtual int Opcode() const; virtual uint ideal_reg() const = 0; bool carry_dependency() const { return !_dependency.cmp(DependencyType::FloatingNarrowing); } - // A cast node depends_only_on_test if and only if it is floating - virtual bool depends_only_on_test() const { return _dependency.is_floating(); } const DependencyType& dependency() const { return _dependency; } TypeNode* dominating_cast(PhaseGVN* gvn, PhaseTransform* pt) const; static Node* make_cast_for_basic_type(Node* c, Node* n, const Type* t, const DependencyType& dependency, BasicType bt); @@ -191,6 +189,12 @@ protected: const Type* extra_type_at(int i) const { return _extra_types->field_at(i); } + +protected: + virtual bool depends_only_on_test_impl() const { return _dependency.is_floating(); } + +private: + virtual Node* pin_node_under_control_impl() const; }; //------------------------------CastIINode------------------------------------- @@ -222,13 +226,15 @@ class CastIINode: public ConstraintCastNode { #endif } - CastIINode* pin_array_access_node() const; CastIINode* make_with(Node* parent, const TypeInteger* type, const DependencyType& dependency) const; void remove_range_check_cast(Compile* C); #ifndef PRODUCT virtual void dump_spec(outputStream* st) const; #endif + +private: + virtual CastIINode* pin_node_under_control_impl() const; }; class CastLLNode: public ConstraintCastNode { @@ -320,8 +326,10 @@ class CheckCastPPNode: public ConstraintCastNode { virtual const Type* Value(PhaseGVN* phase) const; virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } - bool depends_only_on_test() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test(); } - }; + +private: + virtual bool depends_only_on_test_impl() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test_impl(); } +}; //------------------------------CastX2PNode------------------------------------- @@ -349,8 +357,10 @@ class CastP2XNode : public Node { virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegX; } virtual const Type *bottom_type() const { return TypeX_X; } + +private: // Return false to keep node from moving away from an associated card mark. - virtual bool depends_only_on_test() const { return false; } + virtual bool depends_only_on_test_impl() const { return false; } }; diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index efa0b55e2c2..c65bc391792 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -2243,7 +2243,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { PhaseIterGVN* igvn = phase->is_IterGVN(); if (wait_for_cast_input_igvn(igvn)) { igvn->_worklist.push(this); - return nullptr; + return progress; } uncasted = true; uin = unique_input(phase, true); @@ -2320,6 +2320,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { PhaseIterGVN* igvn = phase->is_IterGVN(); for (uint i = 1; i < req(); i++) { set_req_X(i, cast, igvn); + progress = this; } uin = cast; } @@ -2338,7 +2339,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { #endif // Identity may not return the expected uin, if it has to wait for the region, in irreducible case assert(ident == uin || ident->is_top() || must_wait_for_region_in_irreducible_loop(phase), "Identity must clean this up"); - return nullptr; + return progress; } Node* opt = nullptr; @@ -2529,7 +2530,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Phi references itself through all other inputs then splitting the // Phi through memory merges would create dead loop at later stage. if (ii == top) { - return nullptr; // Delay optimization until graph is cleaned. + return progress; // Delay optimization until graph is cleaned. } if (ii->is_MergeMem()) { MergeMemNode* n = ii->as_MergeMem(); diff --git a/src/hotspot/share/opto/cfgnode.hpp b/src/hotspot/share/opto/cfgnode.hpp index ca549af1554..6af2972e688 100644 --- a/src/hotspot/share/opto/cfgnode.hpp +++ b/src/hotspot/share/opto/cfgnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -124,7 +124,6 @@ public: virtual bool pinned() const { return (const Node*)in(0) == this; } virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash - virtual bool depends_only_on_test() const { return false; } virtual const Type* bottom_type() const { return Type::CONTROL; } virtual const Type* Value(PhaseGVN* phase) const; virtual Node* Identity(PhaseGVN* phase); @@ -287,7 +286,6 @@ public: virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual const Node *is_block_proj() const { return this; } - virtual bool depends_only_on_test() const { return false; } virtual const Type *bottom_type() const { return Type::CONTROL; } virtual const Type* Value(PhaseGVN* phase) const; virtual Node* Identity(PhaseGVN* phase); @@ -462,7 +460,7 @@ public: Node* fold_compares(PhaseIterGVN* phase); static Node* up_one_dom(Node* curr, bool linear_only = false); bool is_zero_trip_guard() const; - Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool pin_array_access_nodes); + Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool prev_dom_not_imply_this); ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call, Deoptimization::DeoptReason reason = Deoptimization::Reason_none) const; // Takes the type of val and filters it through the test represented @@ -565,7 +563,7 @@ public: return in(0)->as_If()->proj_out(1 - _con)->as_IfProj(); } - void pin_array_access_nodes(PhaseIterGVN* igvn); + void pin_dependent_nodes(PhaseIterGVN* igvn); protected: // Type of If input when this branch is always taken diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 80bb1dcf408..f1ea8231df9 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -1369,72 +1369,37 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const { cast_to_ptr_type(ptr)-> with_offset(offset); } - } else if (ta) { - // For arrays indexed by constant indices, we flatten the alias - // space to include all of the array body. Only the header, klass - // and array length can be accessed un-aliased. - if( offset != Type::OffsetBot ) { - if( ta->const_oop() ) { // MethodData* or Method* - offset = Type::OffsetBot; // Flatten constant access into array body - tj = ta = ta-> - remove_speculative()-> - cast_to_ptr_type(ptr)-> - cast_to_exactness(false)-> - with_offset(offset); - } else if( offset == arrayOopDesc::length_offset_in_bytes() ) { - // range is OK as-is. - tj = ta = TypeAryPtr::RANGE; - } else if( offset == oopDesc::klass_offset_in_bytes() ) { - tj = TypeInstPtr::KLASS; // all klass loads look alike - ta = TypeAryPtr::RANGE; // generic ignored junk - ptr = TypePtr::BotPTR; - } else if( offset == oopDesc::mark_offset_in_bytes() ) { - tj = TypeInstPtr::MARK; - ta = TypeAryPtr::RANGE; // generic ignored junk - ptr = TypePtr::BotPTR; - } else { // Random constant offset into array body - offset = Type::OffsetBot; // Flatten constant access into array body - tj = ta = ta-> - remove_speculative()-> - cast_to_ptr_type(ptr)-> - cast_to_exactness(false)-> - with_offset(offset); - } + } else if (ta != nullptr) { + // Common slices + if (offset == arrayOopDesc::length_offset_in_bytes()) { + return TypeAryPtr::RANGE; + } else if (offset == oopDesc::klass_offset_in_bytes()) { + return TypeInstPtr::KLASS; + } else if (offset == oopDesc::mark_offset_in_bytes()) { + return TypeInstPtr::MARK; } - // Arrays of fixed size alias with arrays of unknown size. - if (ta->size() != TypeInt::POS) { - const TypeAry *tary = TypeAry::make(ta->elem(), TypeInt::POS); - tj = ta = ta-> - remove_speculative()-> - cast_to_ptr_type(ptr)-> - with_ary(tary)-> - cast_to_exactness(false); - } - // Arrays of known objects become arrays of unknown objects. - if (ta->elem()->isa_narrowoop() && ta->elem() != TypeNarrowOop::BOTTOM) { - const TypeAry *tary = TypeAry::make(TypeNarrowOop::BOTTOM, ta->size()); - tj = ta = TypeAryPtr::make(ptr,ta->const_oop(),tary,nullptr,false,offset); - } - if (ta->elem()->isa_oopptr() && ta->elem() != TypeInstPtr::BOTTOM) { - const TypeAry *tary = TypeAry::make(TypeInstPtr::BOTTOM, ta->size()); - tj = ta = TypeAryPtr::make(ptr,ta->const_oop(),tary,nullptr,false,offset); + + // Remove size and stability + const TypeAry* normalized_ary = TypeAry::make(ta->elem(), TypeInt::POS, false); + // Remove ptr, const_oop, and offset + if (ta->elem() == Type::BOTTOM) { + // Bottom array (meet of int[] and byte[] for example), accesses to it will be done with + // Unsafe. This should alias with all arrays. For now just leave it as it is (this is + // incorrect, see JDK-8331133). + tj = ta = TypeAryPtr::make(TypePtr::BotPTR, nullptr, normalized_ary, nullptr, false, Type::OffsetBot); + } else if (ta->elem()->make_oopptr() != nullptr) { + // Object arrays, all of them share the same slice + const TypeAry* tary = TypeAry::make(TypeInstPtr::BOTTOM, TypeInt::POS, false); + tj = ta = TypeAryPtr::make(TypePtr::BotPTR, nullptr, tary, nullptr, false, Type::OffsetBot); + } else { + // Primitive arrays + tj = ta = TypeAryPtr::make(TypePtr::BotPTR, nullptr, normalized_ary, ta->exact_klass(), true, Type::OffsetBot); } + // Arrays of bytes and of booleans both use 'bastore' and 'baload' so // cannot be distinguished by bytecode alone. if (ta->elem() == TypeInt::BOOL) { - const TypeAry *tary = TypeAry::make(TypeInt::BYTE, ta->size()); - ciKlass* aklass = ciTypeArrayKlass::make(T_BYTE); - tj = ta = TypeAryPtr::make(ptr,ta->const_oop(),tary,aklass,false,offset); - } - // During the 2nd round of IterGVN, NotNull castings are removed. - // Make sure the Bottom and NotNull variants alias the same. - // Also, make sure exact and non-exact variants alias the same. - if (ptr == TypePtr::NotNull || ta->klass_is_exact() || ta->speculative() != nullptr) { - tj = ta = ta-> - remove_speculative()-> - cast_to_ptr_type(TypePtr::BotPTR)-> - cast_to_exactness(false)-> - with_offset(offset); + tj = ta = TypeAryPtr::BYTES; } } diff --git a/src/hotspot/share/opto/constantTable.cpp b/src/hotspot/share/opto/constantTable.cpp index aba71e45e1c..ae4ac336d93 100644 --- a/src/hotspot/share/opto/constantTable.cpp +++ b/src/hotspot/share/opto/constantTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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 @@ -158,7 +158,7 @@ void ConstantTable::calculate_offsets_and_size() { // Align size up to the next section start (which is insts; see // CodeBuffer::align_at_start). assert(_size == -1, "already set?"); - _size = align_up(offset, (int)CodeEntryAlignment); + _size = align_up(offset, CodeEntryAlignment); } bool ConstantTable::emit(C2_MacroAssembler* masm) const { diff --git a/src/hotspot/share/opto/divnode.hpp b/src/hotspot/share/opto/divnode.hpp index b13460c89f5..43432b271a4 100644 --- a/src/hotspot/share/opto/divnode.hpp +++ b/src/hotspot/share/opto/divnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,15 +35,33 @@ // Optimization - Graph Style +class DivModIntegerNode : public Node { +private: + bool _pinned; + +protected: + DivModIntegerNode(Node* c, Node* dividend, Node* divisor) : Node(c, dividend, divisor), _pinned(false) {} + +private: + virtual uint size_of() const override { return sizeof(DivModIntegerNode); } + virtual uint hash() const override { return Node::hash() + _pinned; } + virtual bool cmp(const Node& o) const override { return Node::cmp(o) && _pinned == static_cast(o)._pinned; } + virtual bool depends_only_on_test_impl() const override { return !_pinned; } + virtual DivModIntegerNode* pin_node_under_control_impl() const override { + DivModIntegerNode* res = static_cast(clone()); + res->_pinned = true; + return res; + } +}; //------------------------------DivINode--------------------------------------- // Integer division // Note: this is division as defined by JVMS, i.e., MinInt/-1 == MinInt. // On processors which don't naturally support this special case (e.g., x86), // the matcher or runtime system must take care of this. -class DivINode : public Node { +class DivINode : public DivModIntegerNode { public: - DivINode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} + DivINode(Node* c, Node* dividend, Node* divisor) : DivModIntegerNode(c, dividend, divisor) {} virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); @@ -54,9 +72,9 @@ public: //------------------------------DivLNode--------------------------------------- // Long division -class DivLNode : public Node { +class DivLNode : public DivModIntegerNode { public: - DivLNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} + DivLNode(Node* c, Node* dividend, Node* divisor) : DivModIntegerNode(c, dividend, divisor) {} virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); @@ -107,9 +125,9 @@ public: //------------------------------UDivINode--------------------------------------- // Unsigned integer division -class UDivINode : public Node { +class UDivINode : public DivModIntegerNode { public: - UDivINode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} + UDivINode(Node* c, Node* dividend, Node* divisor) : DivModIntegerNode(c, dividend, divisor) {} virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const; @@ -120,9 +138,9 @@ public: //------------------------------UDivLNode--------------------------------------- // Unsigned long division -class UDivLNode : public Node { +class UDivLNode : public DivModIntegerNode { public: - UDivLNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} + UDivLNode(Node* c, Node* dividend, Node* divisor) : DivModIntegerNode(c, dividend, divisor) {} virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const; @@ -133,9 +151,9 @@ public: //------------------------------ModINode--------------------------------------- // Integer modulus -class ModINode : public Node { +class ModINode : public DivModIntegerNode { public: - ModINode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} + ModINode(Node* c, Node* in1, Node* in2) : DivModIntegerNode(c, in1, in2) {} virtual int Opcode() const; virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); @@ -145,9 +163,9 @@ public: //------------------------------ModLNode--------------------------------------- // Long modulus -class ModLNode : public Node { +class ModLNode : public DivModIntegerNode { public: - ModLNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} + ModLNode(Node* c, Node* in1, Node* in2) : DivModIntegerNode(c, in1, in2) {} virtual int Opcode() const; virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); @@ -199,9 +217,9 @@ public: //------------------------------UModINode--------------------------------------- // Unsigned integer modulus -class UModINode : public Node { +class UModINode : public DivModIntegerNode { public: - UModINode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} + UModINode(Node* c, Node* in1, Node* in2) : DivModIntegerNode(c, in1, in2) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const { return TypeInt::INT; } @@ -211,9 +229,9 @@ public: //------------------------------UModLNode--------------------------------------- // Unsigned long modulus -class UModLNode : public Node { +class UModLNode : public DivModIntegerNode { public: - UModLNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} + UModLNode(Node* c, Node* in1, Node* in2) : DivModIntegerNode(c, in1, in2) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const { return TypeLong::LONG; } @@ -243,6 +261,9 @@ public: ProjNode* div_proj() { return proj_out_or_null(div_proj_num); } ProjNode* mod_proj() { return proj_out_or_null(mod_proj_num); } + +private: + virtual bool depends_only_on_test() const { return false; } }; //------------------------------DivModINode--------------------------------------- diff --git a/src/hotspot/share/opto/idealKit.cpp b/src/hotspot/share/opto/idealKit.cpp index dd7e9ae52b7..fbb61bfdf72 100644 --- a/src/hotspot/share/opto/idealKit.cpp +++ b/src/hotspot/share/opto/idealKit.cpp @@ -360,6 +360,17 @@ Node* IdealKit::load(Node* ctl, return transform(ld); } +// Load AOT runtime constant +Node* IdealKit::load_aot_const(Node* adr, const Type* t) { + BasicType bt = t->basic_type(); + const TypePtr* adr_type = nullptr; // debug-mode-only argument + DEBUG_ONLY(adr_type = C->get_adr_type(Compile::AliasIdxRaw)); + Node* ctl = (Node*)C->root(); // Raw memory access needs control + Node* ld = LoadNode::make(_gvn, ctl, C->immutable_memory(), adr, adr_type, t, bt, MemNode::unordered, + LoadNode::DependsOnlyOnTest, false, false, false, false, 0); + return transform(ld); +} + Node* IdealKit::store(Node* ctl, Node* adr, Node *val, BasicType bt, int adr_idx, MemNode::MemOrd mo, bool require_atomic_access, diff --git a/src/hotspot/share/opto/idealKit.hpp b/src/hotspot/share/opto/idealKit.hpp index 280f61fd9a9..518c3b92136 100644 --- a/src/hotspot/share/opto/idealKit.hpp +++ b/src/hotspot/share/opto/idealKit.hpp @@ -224,6 +224,9 @@ class IdealKit: public StackObj { MemNode::MemOrd mo = MemNode::unordered, LoadNode::ControlDependency control_dependency = LoadNode::DependsOnlyOnTest); + // Load AOT runtime constant + Node* load_aot_const(Node* adr, const Type* t); + // Return the new StoreXNode Node* store(Node* ctl, Node* adr, diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp index cd8017f9fb3..762791d467d 100644 --- a/src/hotspot/share/opto/ifnode.cpp +++ b/src/hotspot/share/opto/ifnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -604,7 +604,7 @@ static void adjust_check(IfProjNode* proj, Node* range, Node* index, // at the lowest/nearest dominating check in the graph. To ensure that these Loads/Casts do not float above any of the // dominating checks (even when the lowest dominating check is later replaced by yet another dominating check), we // need to pin them at the lowest dominating check. - proj->pin_array_access_nodes(igvn); + proj->pin_dependent_nodes(igvn); } //------------------------------up_one_dom------------------------------------- @@ -1539,7 +1539,7 @@ Node* IfNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------dominated_by----------------------------------- -Node* IfNode::dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool pin_array_access_nodes) { +Node* IfNode::dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool prev_dom_not_imply_this) { #ifndef PRODUCT if (TraceIterativeGVN) { tty->print(" Removing IfNode: "); this->dump(); @@ -1570,20 +1570,16 @@ Node* IfNode::dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool pin_array_ac // Loop ends when projection has no more uses. for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) { Node* s = ifp->last_out(j); // Get child of IfTrue/IfFalse - if (s->depends_only_on_test() && igvn->no_dependent_zero_check(s)) { - // For control producers. - // Do not rewire Div and Mod nodes which could have a zero divisor to avoid skipping their zero check. + if (s->depends_only_on_test()) { + // For control producers igvn->replace_input_of(s, 0, data_target); // Move child to data-target - if (pin_array_access_nodes && data_target != top) { - // As a result of range check smearing, Loads and range check Cast nodes that are control dependent on this - // range check (that is about to be removed) now depend on multiple dominating range checks. After the removal - // of this range check, these control dependent nodes end up at the lowest/nearest dominating check in the - // graph. To ensure that these Loads/Casts do not float above any of the dominating checks (even when the - // lowest dominating check is later replaced by yet another dominating check), we need to pin them at the - // lowest dominating check. - Node* clone = s->pin_array_access_node(); + if (prev_dom_not_imply_this && data_target != top) { + // If prev_dom_not_imply_this, s now depends on multiple tests with prev_dom being the + // lowest dominating one. As a result, it must be pinned there. Otherwise, it can be + // incorrectly moved to a dominating test equivalent to the lowest one here. + Node* clone = s->pin_node_under_control(); if (clone != nullptr) { - clone = igvn->transform(clone); + igvn->register_new_node_with_optimizer(clone, s); igvn->replace_node(s, clone); } } @@ -1831,16 +1827,15 @@ bool IfNode::is_zero_trip_guard() const { return false; } -void IfProjNode::pin_array_access_nodes(PhaseIterGVN* igvn) { +void IfProjNode::pin_dependent_nodes(PhaseIterGVN* igvn) { for (DUIterator i = outs(); has_out(i); i++) { Node* u = out(i); if (!u->depends_only_on_test()) { continue; } - Node* clone = u->pin_array_access_node(); + Node* clone = u->pin_node_under_control(); if (clone != nullptr) { - clone = igvn->transform(clone); - assert(clone != u, "shouldn't common"); + igvn->register_new_node_with_optimizer(clone, u); igvn->replace_node(u, clone); --i; } diff --git a/src/hotspot/share/opto/intrinsicnode.cpp b/src/hotspot/share/opto/intrinsicnode.cpp index 1397d31af53..c3e003ad8d3 100644 --- a/src/hotspot/share/opto/intrinsicnode.cpp +++ b/src/hotspot/share/opto/intrinsicnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,8 +46,8 @@ Node* StrIntrinsicNode::Ideal(PhaseGVN* phase, bool can_reshape) { if (in(0) && in(0)->is_top()) return nullptr; if (can_reshape) { - Node* mem = phase->transform(in(MemNode::Memory)); - // If transformed to a MergeMem, get the desired slice + Node* mem = in(MemNode::Memory); + // If mem input is a MergeMem, get the desired slice uint alias_idx = phase->C->get_alias_index(adr_type()); mem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(alias_idx) : mem; if (mem != in(MemNode::Memory)) { diff --git a/src/hotspot/share/opto/intrinsicnode.hpp b/src/hotspot/share/opto/intrinsicnode.hpp index 2672402881e..d81e7bed7e9 100644 --- a/src/hotspot/share/opto/intrinsicnode.hpp +++ b/src/hotspot/share/opto/intrinsicnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,6 +41,9 @@ class PartialSubtypeCheckNode : public Node { virtual int Opcode() const; virtual const Type* bottom_type() const { return TypeRawPtr::BOTTOM; } virtual uint ideal_reg() const { return Op_RegP; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------StrIntrinsic------------------------------- @@ -74,13 +77,15 @@ class StrIntrinsicNode: public Node { Node(control, char_array_mem, s1, s2), _encoding(encoding) { } - virtual bool depends_only_on_test() const { return false; } virtual const TypePtr* adr_type() const { return TypeAryPtr::BYTES; } virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; ArgEncoding encoding() const { return _encoding; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------StrComp------------------------------------- @@ -172,13 +177,15 @@ class VectorizedHashCodeNode: public Node { VectorizedHashCodeNode(Node* control, Node* ary_mem, Node* arg1, Node* cnt1, Node* result, Node* basic_type) : Node(control, ary_mem, arg1, cnt1, result, basic_type) {}; virtual int Opcode() const; - virtual bool depends_only_on_test() const { return false; } virtual const Type* bottom_type() const { return TypeInt::INT; } virtual const TypePtr* adr_type() const { return TypePtr::BOTTOM; } virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------EncodeISOArray-------------------------------- @@ -191,7 +198,6 @@ class EncodeISOArrayNode: public Node { bool is_ascii() { return _ascii; } virtual int Opcode() const; - virtual bool depends_only_on_test() const { return false; } virtual const Type* bottom_type() const { return TypeInt::INT; } virtual const TypePtr* adr_type() const { return TypePtr::BOTTOM; } virtual uint match_edge(uint idx) const; @@ -203,6 +209,9 @@ class EncodeISOArrayNode: public Node { virtual bool cmp(const Node& n) const { return Node::cmp(n) && _ascii == ((EncodeISOArrayNode&)n).is_ascii(); } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //-------------------------------DigitNode---------------------------------------- @@ -212,6 +221,9 @@ public: virtual int Opcode() const; const Type* bottom_type() const { return TypeInt::BOOL; } virtual uint ideal_reg() const { return Op_RegI; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------LowerCaseNode------------------------------------ @@ -221,6 +233,9 @@ public: virtual int Opcode() const; const Type* bottom_type() const { return TypeInt::BOOL; } virtual uint ideal_reg() const { return Op_RegI; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------UpperCaseNode------------------------------------ @@ -230,6 +245,9 @@ public: virtual int Opcode() const; const Type* bottom_type() const { return TypeInt::BOOL; } virtual uint ideal_reg() const { return Op_RegI; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------WhitespaceCode----------------------------------- @@ -239,6 +257,9 @@ public: virtual int Opcode() const; const Type* bottom_type() const { return TypeInt::BOOL; } virtual uint ideal_reg() const { return Op_RegI; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------CopySign----------------------------------------- diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index b4e18b596e4..3627d06a87a 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -1307,8 +1307,8 @@ bool LibraryCallKit::inline_string_indexOfI(StrIntrinsicNode::ArgEnc ae) { Node* tgt_start = array_element_address(tgt, intcon(0), T_BYTE); // Range checks - generate_string_range_check(src, src_offset, src_count, ae != StrIntrinsicNode::LL); - generate_string_range_check(tgt, intcon(0), tgt_count, ae == StrIntrinsicNode::UU); + generate_string_range_check(src, src_offset, src_count, ae != StrIntrinsicNode::LL, true); + generate_string_range_check(tgt, intcon(0), tgt_count, ae == StrIntrinsicNode::UU, true); if (stopped()) { return true; } @@ -1404,7 +1404,7 @@ bool LibraryCallKit::inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae) { Node* src_count = _gvn.transform(new SubINode(max, from_index)); // Range checks - generate_string_range_check(src, src_offset, src_count, ae == StrIntrinsicNode::U); + generate_string_range_check(src, src_offset, src_count, ae == StrIntrinsicNode::U, true); // Check for int_ch >= 0 Node* int_ch_cmp = _gvn.transform(new CmpINode(int_ch, intcon(0))); @@ -1448,11 +1448,11 @@ bool LibraryCallKit::inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae) { } //---------------------------inline_string_copy--------------------- // compressIt == true --> generate a compressed copy operation (compress char[]/byte[] to byte[]) -// int StringUTF16.compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) -// int StringUTF16.compress(byte[] src, int srcOff, byte[] dst, int dstOff, int len) +// int StringUTF16.compress0(char[] src, int srcOff, byte[] dst, int dstOff, int len) +// int StringUTF16.compress0(byte[] src, int srcOff, byte[] dst, int dstOff, int len) // compressIt == false --> generate an inflated copy operation (inflate byte[] to char[]/byte[]) -// void StringLatin1.inflate(byte[] src, int srcOff, char[] dst, int dstOff, int len) -// void StringLatin1.inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) +// void StringLatin1.inflate0(byte[] src, int srcOff, char[] dst, int dstOff, int len) +// void StringLatin1.inflate0(byte[] src, int srcOff, byte[] dst, int dstOff, int len) bool LibraryCallKit::inline_string_copy(bool compress) { if (too_many_traps(Deoptimization::Reason_intrinsic)) { return false; @@ -1495,8 +1495,8 @@ bool LibraryCallKit::inline_string_copy(bool compress) { } // Range checks - generate_string_range_check(src, src_offset, length, convert_src); - generate_string_range_check(dst, dst_offset, length, convert_dst); + generate_string_range_check(src, src_offset, length, convert_src, true); + generate_string_range_check(dst, dst_offset, length, convert_dst, true); if (stopped()) { return true; } diff --git a/src/hotspot/share/opto/locknode.hpp b/src/hotspot/share/opto/locknode.hpp index ee54e893e59..7d1507ae998 100644 --- a/src/hotspot/share/opto/locknode.hpp +++ b/src/hotspot/share/opto/locknode.hpp @@ -147,6 +147,9 @@ public: virtual int Opcode() const; virtual const Type* Value(PhaseGVN* phase) const { return TypeInt::CC; } const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; @@ -169,6 +172,8 @@ public: virtual const Type* Value(PhaseGVN* phase) const { return TypeInt::CC; } const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} +private: + virtual bool depends_only_on_test_impl() const { return false; } }; #endif // SHARE_OPTO_LOCKNODE_HPP diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 61a7ed29c3e..be099747fc0 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -334,7 +334,7 @@ class Invariance : public StackObj { // loop, it was marked invariant but n is only invariant if // it depends only on that test. Otherwise, unless that test // is out of the loop, it's not invariant. - if (n->is_CFG() || (n->depends_only_on_test() && _phase->igvn().no_dependent_zero_check(n)) || n->in(0) == nullptr || !_phase->is_member(_lpt, n->in(0))) { + if (n->is_CFG() || n->in(0) == nullptr || n->depends_only_on_test() || !_phase->is_member(_lpt, n->in(0))) { _invariant.set(n->_idx); // I am a invariant too } } diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 5b06f0555ab..986cfdaa3f1 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1676,8 +1676,8 @@ public: Node *has_local_phi_input( Node *n ); // Mark an IfNode as being dominated by a prior test, // without actually altering the CFG (and hence IDOM info). - void dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip = false, bool pin_array_access_nodes = false); - void rewire_safe_outputs_to_dominator(Node* source, Node* dominator, bool pin_array_access_nodes); + void dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip = false, bool prev_dom_not_imply_this = false); + void rewire_safe_outputs_to_dominator(Node* source, Node* dominator, bool dominator_not_imply_source); // Split Node 'n' through merge point RegionNode* split_thru_region(Node* n, RegionNode* region); @@ -1960,7 +1960,7 @@ public: bool can_move_to_inner_loop(Node* n, LoopNode* n_loop, Node* x); - void pin_array_access_nodes_dependent_on(Node* ctrl); + void pin_nodes_dependent_on(Node* ctrl, bool old_iff_is_rangecheck); Node* ensure_node_and_inputs_are_above_pre_end(CountedLoopEndNode* pre_end, Node* node); diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 2b48780f9b0..862cb7067ec 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -345,7 +345,7 @@ bool PhaseIdealLoop::loop_phi_backedge_type_contains_zero(const Node* phi_diviso // Replace the dominated test with an obvious true or false. Place it on the // IGVN worklist for later cleanup. Move control-dependent data Nodes on the // live path up to the dominating control. -void PhaseIdealLoop::dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip, bool pin_array_access_nodes) { +void PhaseIdealLoop::dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip, bool prevdom_not_imply_this) { if (VerifyLoopOptimizations && PrintOpto) { tty->print_cr("dominating test"); } // prevdom is the dominating projection of the dominating test. @@ -386,26 +386,25 @@ void PhaseIdealLoop::dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip, b return; } - rewire_safe_outputs_to_dominator(dp, prevdom, pin_array_access_nodes); + rewire_safe_outputs_to_dominator(dp, prevdom, prevdom_not_imply_this); } -void PhaseIdealLoop::rewire_safe_outputs_to_dominator(Node* source, Node* dominator, const bool pin_array_access_nodes) { +void PhaseIdealLoop::rewire_safe_outputs_to_dominator(Node* source, Node* dominator, const bool dominator_not_imply_source) { IdealLoopTree* old_loop = get_loop(source); for (DUIterator_Fast imax, i = source->fast_outs(imax); i < imax; i++) { Node* out = source->fast_out(i); // Control-dependent node - // Do not rewire Div and Mod nodes which could have a zero divisor to avoid skipping their zero check. - if (out->depends_only_on_test() && _igvn.no_dependent_zero_check(out)) { + if (out->depends_only_on_test()) { assert(out->in(0) == source, "must be control dependent on source"); _igvn.replace_input_of(out, 0, dominator); - if (pin_array_access_nodes) { + if (dominator_not_imply_source) { // Because of Loop Predication, Loads and range check Cast nodes that are control dependent on this range // check (that is about to be removed) now depend on multiple dominating Hoisted Check Predicates. After the // removal of this range check, these control dependent nodes end up at the lowest/nearest dominating predicate // in the graph. To ensure that these Loads/Casts do not float above any of the dominating checks (even when the // lowest dominating check is later replaced by yet another dominating check), we need to pin them at the lowest // dominating check. - Node* clone = out->pin_array_access_node(); + Node* clone = out->pin_node_under_control(); if (clone != nullptr) { clone = _igvn.register_new_node_with_optimizer(clone, out); _igvn.replace_node(out, clone); @@ -1644,7 +1643,7 @@ bool PhaseIdealLoop::try_merge_identical_ifs(Node* n) { void PhaseIdealLoop::push_pinned_nodes_thru_region(IfNode* dom_if, Node* region) { for (DUIterator i = region->outs(); region->has_out(i); i++) { Node* u = region->out(i); - if (!has_ctrl(u) || u->is_Phi() || !u->depends_only_on_test() || !_igvn.no_dependent_zero_check(u)) { + if (!has_ctrl(u) || u->is_Phi() || !u->depends_only_on_test()) { continue; } assert(u->in(0) == region, "not a control dependent node?"); @@ -1724,11 +1723,11 @@ void PhaseIdealLoop::try_sink_out_of_loop(Node* n) { Node* outside_ctrl = place_outside_loop(n_ctrl, loop_ctrl); if (!would_sink_below_pre_loop_exit(loop_ctrl, outside_ctrl)) { if (n->depends_only_on_test()) { - Node* pinned_clone = n->pin_array_access_node(); + // If this node depends_only_on_test, it will be rewired to a control input that is not + // the correct test. As a result, it must be pinned otherwise it can be incorrectly + // rewired to a dominating test equivalent to the new control. + Node* pinned_clone = n->pin_node_under_control(); if (pinned_clone != nullptr) { - // Pin array access nodes: if this is an array load, it's going to be dependent on a condition that's not a - // range check for that access. If that condition is replaced by an identical dominating one, then an - // unpinned load would risk floating above its range check. register_new_node(pinned_clone, n_ctrl); maybe_pinned_n = pinned_clone; _igvn.replace_node(n, pinned_clone); @@ -1754,11 +1753,11 @@ void PhaseIdealLoop::try_sink_out_of_loop(Node* n) { Node* u = n->last_out(j); // Clone private computation per use _igvn.rehash_node_delayed(u); Node* x = nullptr; - if (n->depends_only_on_test()) { - // Pin array access nodes: if this is an array load, it's going to be dependent on a condition that's not a - // range check for that access. If that condition is replaced by an identical dominating one, then an - // unpinned load would risk floating above its range check. - x = n->pin_array_access_node(); + if (n->in(0) != nullptr && n->depends_only_on_test()) { + // If this node depends_only_on_test, it will be rewired to a control input that is not + // the correct test. As a result, it must be pinned otherwise it can be incorrectly + // rewired to a dominating test equivalent to the new control. + x = n->pin_node_under_control(); } if (x == nullptr) { x = n->clone(); @@ -2328,14 +2327,12 @@ void PhaseIdealLoop::clone_loop_handle_data_uses(Node* old, Node_List &old_new, // We notify all uses of old, including use, and the indirect uses, // that may now be optimized because we have replaced old with phi. _igvn.add_users_to_worklist(old); - if (idx == 0 && - use->depends_only_on_test()) { - Node* pinned_clone = use->pin_array_access_node(); + if (idx == 0 && use->depends_only_on_test()) { + // If this node depends_only_on_test, it will be rewired to a control input that is not the + // correct test. As a result, it must be pinned otherwise it can be incorrectly rewired to + // a dominating test equivalent to the new control. + Node* pinned_clone = use->pin_node_under_control(); if (pinned_clone != nullptr) { - // Pin array access nodes: control is updated here to a region. If, after some transformations, only one path - // into the region is left, an array load could become dependent on a condition that's not a range check for - // that access. If that condition is replaced by an identical dominating one, then an unpinned load would risk - // floating above its range check. pinned_clone->set_req(0, phi); register_new_node_with_ctrl_of(pinned_clone, use); _igvn.replace_node(use, pinned_clone); @@ -4102,11 +4099,9 @@ bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { not_peel.test(n->_idx) && peel.test(n->in(0)->_idx)) { Node* n_clone = old_new[n->_idx]; if (n_clone->depends_only_on_test()) { - // Pin array access nodes: control is updated here to the loop head. If, after some transformations, the - // backedge is removed, an array load could become dependent on a condition that's not a range check for that - // access. If that condition is replaced by an identical dominating one, then an unpinned load would risk - // floating above its range check. - Node* pinned_clone = n_clone->pin_array_access_node(); + // If this node depends_only_on_test, it will be rewire to the loop head, which is not the + // correct test + Node* pinned_clone = n_clone->pin_node_under_control(); if (pinned_clone != nullptr) { register_new_node_with_ctrl_of(pinned_clone, n_clone); old_new.map(n->_idx, pinned_clone); diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index 7f152eddd65..21ed15f9ec7 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, Alibaba Group Holding Limited. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -44,6 +44,7 @@ #include "opto/mempointer.hpp" #include "opto/mulnode.hpp" #include "opto/narrowptrnode.hpp" +#include "opto/opcodes.hpp" #include "opto/phaseX.hpp" #include "opto/regalloc.hpp" #include "opto/regmask.hpp" @@ -552,6 +553,18 @@ Node::DomResult MemNode::maybe_all_controls_dominate(Node* dom, Node* sub) { bool MemNode::detect_ptr_independence(Node* p1, AllocateNode* a1, Node* p2, AllocateNode* a2, PhaseTransform* phase) { + // Trivial case: Non-overlapping values. Be careful, we can cast a raw pointer to an oop (e.g. in + // the allocation pattern) so joining the types only works if both are oops. join may also give + // an incorrect result when both pointers are nullable and the result is supposed to be + // TypePtr::NULL_PTR, so we exclude that case. + const Type* p1_type = p1->bottom_type(); + const Type* p2_type = p2->bottom_type(); + if (p1_type->isa_oopptr() && p2_type->isa_oopptr() && + (!p1_type->maybe_null() || !p2_type->maybe_null()) && + p1_type->join(p2_type)->empty()) { + return true; + } + // Attempt to prove that these two pointers cannot be aliased. // They may both manifestly be allocations, and they should differ. // Or, if they are not both allocations, they can be distinct constants. @@ -690,6 +703,20 @@ Node* MemNode::find_previous_store(PhaseValues* phase) { Node* base = AddPNode::Ideal_base_and_offset(adr, phase, offset); AllocateNode* alloc = AllocateNode::Ideal_allocation(base); + const TypePtr* adr_type = this->adr_type(); + if (adr_type == nullptr) { + // This means the access is dead + return phase->C->top(); + } else if (adr_type->base() == TypePtr::AnyPtr) { + assert(adr_type->ptr() == TypePtr::Null, "MemNode should never access a wide memory"); + // Give up, this will upset Compile::get_alias_index + return nullptr; + } + + int alias_idx = phase->C->get_alias_index(adr_type); + assert(alias_idx != Compile::AliasIdxTop, "must not be a dead node"); + assert(alias_idx != Compile::AliasIdxBot || !phase->C->do_aliasing(), "must not be a very wide access"); + if (offset == Type::OffsetBot) return nullptr; // cannot unalias unless there are precise offsets @@ -709,15 +736,32 @@ Node* MemNode::find_previous_store(PhaseValues* phase) { Node* st_adr = mem->in(MemNode::Address); intptr_t st_offset = 0; Node* st_base = AddPNode::Ideal_base_and_offset(st_adr, phase, st_offset); - if (st_base == nullptr) - break; // inscrutable pointer - - // For raw accesses it's not enough to prove that constant offsets don't intersect. - // We need the bases to be the equal in order for the offset check to make sense. - if ((adr_maybe_raw || check_if_adr_maybe_raw(st_adr)) && st_base != base) { + if (st_base == nullptr) { + // inscrutable pointer break; } + // If the bases are the same and the offsets are the same, it seems that this is the exact + // store we are looking for, the caller will check if the type of the store matches using + // MemNode::can_see_stored_value + if (st_base == base && st_offset == offset) { + return mem; // (b) found the store that this access observes + } + + // If it is provable that the memory accessed by mem does not overlap the memory accessed by + // this, we may walk past mem. + // For raw accesses, 2 accesses are independent if they have the same base and the offsets + // say that they do not overlap. + // For heap accesses, 2 accesses are independent if either the bases are provably different + // at runtime or the offsets say that the accesses do not overlap. + if ((adr_maybe_raw || check_if_adr_maybe_raw(st_adr)) && st_base != base) { + // Raw accesses can only be provably independent if they have the same base + break; + } + + // If the offsets say that the accesses do not overlap, then it is provable that mem and this + // do not overlap. For example, a LoadI from Object+8 is independent from a StoreL into + // Object+12, no matter what the bases are. if (st_offset != offset && st_offset != Type::OffsetBot) { const int MAX_STORE = MAX2(BytesPerLong, (int)MaxVectorSize); assert(mem->as_Store()->memory_size() <= MAX_STORE, ""); @@ -730,25 +774,25 @@ Node* MemNode::find_previous_store(PhaseValues* phase) { // in the same sequence of RawMem effects. We sometimes initialize // a whole 'tile' of array elements with a single jint or jlong.) mem = mem->in(MemNode::Memory); - continue; // (a) advance through independent store memory + continue; // (a) advance through the independent store } } - if (st_base != base && - detect_ptr_independence(base, alloc, - st_base, - AllocateNode::Ideal_allocation(st_base), - phase)) { - // Success: The bases are provably independent. + + // Same base and overlapping offsets, it seems provable that the accesses overlap, give up + if (st_base == base) { + break; + } + + // Try to prove that 2 different base nodes at compile time are different values at runtime + bool known_independent = false; + if (detect_ptr_independence(base, alloc, st_base, AllocateNode::Ideal_allocation(st_base), phase)) { + known_independent = true; + } + + if (known_independent) { mem = mem->in(MemNode::Memory); - continue; // (a) advance through independent store memory + continue; // (a) advance through the independent store } - - // (b) At this point, if the bases or offsets do not agree, we lose, - // since we have not managed to prove 'this' and 'mem' independent. - if (st_base == base && st_offset == offset) { - return mem; // let caller handle steps (c), (d) - } - } else if (mem->is_Proj() && mem->in(0)->is_Initialize()) { InitializeNode* st_init = mem->in(0)->as_Initialize(); AllocateNode* st_alloc = st_init->allocation(); @@ -769,7 +813,6 @@ Node* MemNode::find_previous_store(PhaseValues* phase) { // The bases are provably independent: Either they are // manifestly distinct allocations, or else the control // of this load dominates the store's allocation. - int alias_idx = phase->C->get_alias_index(adr_type()); if (alias_idx == Compile::AliasIdxRaw) { mem = st_alloc->in(TypeFunc::Memory); } else { @@ -792,6 +835,9 @@ Node* MemNode::find_previous_store(PhaseValues* phase) { } // Found an arraycopy that may affect that load return mem; + } else if (mem->is_MergeMem()) { + mem = mem->as_MergeMem()->memory_at(alias_idx); + continue; } else if (addr_t != nullptr && addr_t->is_known_instance_field()) { // Can't use optimize_simple_memory_chain() since it needs PhaseGVN. if (mem->is_Proj() && mem->in(0)->is_Call()) { @@ -817,10 +863,6 @@ Node* MemNode::find_previous_store(PhaseValues* phase) { // we are looking for. return mem; } - } else if (mem->is_MergeMem()) { - int alias_idx = phase->C->get_alias_index(adr_type()); - mem = mem->as_MergeMem()->memory_at(alias_idx); - continue; // (a) advance through independent MergeMem memory } } @@ -900,7 +942,7 @@ void LoadNode::dump_spec(outputStream *st) const { // standard dump does this in Verbose and WizardMode st->print(" #"); _type->dump_on(st); } - if (!depends_only_on_test()) { + if (in(0) != nullptr && !depends_only_on_test()) { st->print(" (does not depend only on test, "); if (control_dependency() == UnknownControl) { st->print("unknown control"); @@ -1025,14 +1067,6 @@ static bool skip_through_membars(Compile::AliasType* atp, const TypeInstPtr* tp, return false; } -LoadNode* LoadNode::pin_array_access_node() const { - const TypePtr* adr_type = this->adr_type(); - if (adr_type != nullptr && adr_type->isa_aryptr()) { - return clone_pinned(); - } - return nullptr; -} - // Is the value loaded previously stored by an arraycopy? If so return // a load node that reads from the source array so we may be able to // optimize out the ArrayCopy node later. @@ -1194,8 +1228,13 @@ Node* MemNode::can_see_stored_value(Node* st, PhaseValues* phase) const { } // LoadVector/StoreVector needs additional check to ensure the types match. if (st->is_StoreVector()) { - const TypeVect* in_vt = st->as_StoreVector()->vect_type(); - const TypeVect* out_vt = as_LoadVector()->vect_type(); + if ((Opcode() != Op_LoadVector && Opcode() != Op_StoreVector) || st->Opcode() != Op_StoreVector) { + // Some kind of masked access or gather/scatter + return nullptr; + } + + const TypeVect* in_vt = st->as_StoreVector()->vect_type(); + const TypeVect* out_vt = is_Load() ? as_LoadVector()->vect_type() : as_StoreVector()->vect_type(); if (in_vt != out_vt) { return nullptr; } @@ -1851,7 +1890,6 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* ctrl = in(MemNode::Control); Node* address = in(MemNode::Address); - bool progress = false; bool addr_mark = ((phase->type(address)->isa_oopptr() || phase->type(address)->isa_narrowoop()) && phase->type(address)->is_ptr()->offset() == oopDesc::mark_offset_in_bytes()); @@ -1864,7 +1902,7 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) { (depends_only_on_test() || has_unknown_control_dependency())) { ctrl = ctrl->in(0); set_req(MemNode::Control,ctrl); - progress = true; + return this; } intptr_t ignore = 0; @@ -1878,7 +1916,7 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) { && all_controls_dominate(base, phase->C->start())) { // A method-invariant, non-null address (constant or 'this' argument). set_req(MemNode::Control, nullptr); - progress = true; + return this; } } @@ -1951,6 +1989,10 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) { // the alias index stuff. So instead, peek through Stores and IFF we can // fold up, do so. Node* prev_mem = find_previous_store(phase); + if (prev_mem != nullptr && prev_mem->is_top()) { + // find_previous_store returns top when the access is dead + return prev_mem; + } if (prev_mem != nullptr) { Node* value = can_see_arraycopy_value(prev_mem, phase); if (value != nullptr) { @@ -1969,7 +2011,11 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } - return progress ? this : nullptr; + if (!can_reshape) { + phase->record_for_igvn(this); + } + + return nullptr; } // Helper to recognize certain Klass fields which are invariant across @@ -2585,6 +2631,21 @@ LoadNode* LoadNode::clone_pinned() const { return ld; } +// Pin a LoadNode if it carries a dependency on its control input. There are cases when the node +// does not actually have any dependency on its control input. For example, if we have a LoadNode +// being used only outside a loop but it must be scheduled inside the loop, we can clone the node +// for each of its use so that all the clones can be scheduled outside the loop. Then, to prevent +// the clones from being GVN-ed again, we add a control input for each of them at the loop exit. In +// those case, since there is not a dependency between the node and its control input, we do not +// need to pin it. +LoadNode* LoadNode::pin_node_under_control_impl() const { + const TypePtr* adr_type = this->adr_type(); + if (adr_type != nullptr && adr_type->isa_aryptr()) { + // Only array accesses have dependencies on their control input + return clone_pinned(); + } + return nullptr; +} //------------------------------Value------------------------------------------ const Type* LoadNKlassNode::Value(PhaseGVN* phase) const { @@ -3511,8 +3572,11 @@ Node* StoreNode::Identity(PhaseGVN* phase) { val->in(MemNode::Address)->eqv_uncast(adr) && val->in(MemNode::Memory )->eqv_uncast(mem) && val->as_Load()->store_Opcode() == Opcode()) { - // Ensure vector type is the same - if (!is_StoreVector() || (mem->is_LoadVector() && as_StoreVector()->vect_type() == mem->as_LoadVector()->vect_type())) { + if (!is_StoreVector()) { + result = mem; + } else if (Opcode() == Op_StoreVector && val->Opcode() == Op_LoadVector && + as_StoreVector()->vect_type() == val->as_LoadVector()->vect_type()) { + // Ensure both are not masked accesses or gathers/scatters and vector types are the same result = mem; } } @@ -3558,6 +3622,10 @@ Node* StoreNode::Identity(PhaseGVN* phase) { Node* prev_mem = find_previous_store(phase); // Steps (a), (b): Walk past independent stores to find an exact match. if (prev_mem != nullptr) { + if (prev_mem->is_top()) { + // find_previous_store returns top when the access is dead + return prev_mem; + } Node* prev_val = can_see_stored_value(prev_mem, phase); if (prev_val != nullptr && prev_val == val) { // prev_val and val might differ by a cast; it would be good diff --git a/src/hotspot/share/opto/memnode.hpp b/src/hotspot/share/opto/memnode.hpp index 249df51beb9..39b1ee88333 100644 --- a/src/hotspot/share/opto/memnode.hpp +++ b/src/hotspot/share/opto/memnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2024, Alibaba Group Holding Limited. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -299,8 +299,6 @@ public: bool has_unknown_control_dependency() const { return _control_dependency == UnknownControl; } bool has_pinned_control_dependency() const { return _control_dependency == Pinned; } - LoadNode* pin_array_access_node() const; - #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; #endif @@ -314,6 +312,7 @@ protected: Node* can_see_arraycopy_value(Node* st, PhaseGVN* phase) const; +private: // depends_only_on_test is almost always true, and needs to be almost always // true to enable key hoisting & commoning optimizations. However, for the // special case of RawPtr loads from TLS top & end, and other loads performed by @@ -323,11 +322,12 @@ protected: // which produce results (new raw memory state) inside of loops preventing all // manner of other optimizations). Basically, it's ugly but so is the alternative. // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { + virtual bool depends_only_on_test_impl() const { return adr_type() != TypeRawPtr::BOTTOM && _control_dependency == DependsOnlyOnTest; } LoadNode* clone_pinned() const; + virtual LoadNode* pin_node_under_control_impl() const; }; //------------------------------LoadBNode-------------------------------------- @@ -534,7 +534,6 @@ public: virtual int Opcode() const; virtual const Type* Value(PhaseGVN* phase) const; virtual Node* Identity(PhaseGVN* phase); - virtual bool depends_only_on_test() const { return true; } // Polymorphic factory method: static Node* make(PhaseGVN& gvn, Node* mem, Node* adr, const TypePtr* at, @@ -563,7 +562,6 @@ public: virtual const Type* Value(PhaseGVN* phase) const; virtual Node* Identity(PhaseGVN* phase); - virtual bool depends_only_on_test() const { return true; } }; @@ -580,7 +578,6 @@ private: virtual uint size_of() const { return sizeof(*this); } protected: virtual bool cmp( const Node &n ) const; - virtual bool depends_only_on_test() const { return false; } Node *Ideal_masked_input (PhaseGVN *phase, uint mask); Node* Ideal_sign_extended_input(PhaseGVN* phase, int num_rejected_bits); @@ -660,6 +657,9 @@ public: Node* convert_to_reinterpret_store(PhaseGVN& gvn, Node* val, const Type* vt); MemBarNode* trailing_membar() const; + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------StoreBNode------------------------------------- @@ -816,7 +816,6 @@ private: #endif // ASSERT public: LoadStoreNode( Node *c, Node *mem, Node *adr, Node *val, const TypePtr* at, const Type* rt, uint required ); - virtual bool depends_only_on_test() const { return false; } virtual uint match_edge(uint idx) const { return idx == MemNode::Address || idx == MemNode::ValueIn; } virtual const Type *bottom_type() const { return _type; } @@ -829,6 +828,9 @@ public: uint8_t barrier_data() { return _barrier_data; } void set_barrier_data(uint8_t barrier_data) { _barrier_data = barrier_data; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; class LoadStoreConditionalNode : public LoadStoreNode { @@ -1115,6 +1117,9 @@ public: // Return allocation input memory edge if it is different instance // or itself if it is the one we are looking for. static bool step_through(Node** np, uint instance_id, PhaseValues* phase); + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------MemBar----------------------------------------- @@ -1677,6 +1682,9 @@ public: virtual uint match_edge(uint idx) const { return (idx == 2); } virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; } virtual const Type *bottom_type() const { return Type::MEMORY; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; // cachewb pre sync node for ensuring that writebacks are serialised @@ -1689,6 +1697,9 @@ public: virtual uint match_edge(uint idx) const { return false; } virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; } virtual const Type *bottom_type() const { return Type::MEMORY; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; // cachewb pre sync node for ensuring that writebacks are serialised @@ -1701,6 +1712,9 @@ public: virtual uint match_edge(uint idx) const { return false; } virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; } virtual const Type *bottom_type() const { return Type::MEMORY; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------Prefetch--------------------------------------- @@ -1713,6 +1727,9 @@ public: virtual uint ideal_reg() const { return NotAMachineReg; } virtual uint match_edge(uint idx) const { return idx==2; } virtual const Type *bottom_type() const { return ( AllocatePrefetchStyle == 3 ) ? Type::MEMORY : Type::ABIO; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; #endif // SHARE_OPTO_MEMNODE_HPP diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp index aa8d6cfce2e..9bdaa3b9f34 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -902,27 +902,28 @@ static bool mask_shift_amount(PhaseGVN* phase, const Node* shift_node, uint nBit } // Use this in ::Ideal only with shiftNode == this! -// Returns the masked shift amount if constant or 0 if not constant. -static uint mask_and_replace_shift_amount(PhaseGVN* phase, Node* shift_node, uint nBits) { +// Sets masked_shift to the masked shift amount if constant or 0 if not constant. +// Returns shift_node if the shift amount input node was modified, nullptr otherwise. +static Node* mask_and_replace_shift_amount(PhaseGVN* phase, Node* shift_node, uint nBits, uint& masked_shift) { int real_shift; - uint masked_shift; if (mask_shift_amount(phase, shift_node, nBits, real_shift, masked_shift)) { if (masked_shift == 0) { // Let Identity() handle 0 shift count. - return 0; + return nullptr; } if (real_shift != (int)masked_shift) { - PhaseIterGVN* igvn = phase->is_IterGVN(); - if (igvn != nullptr) { - igvn->_worklist.push(shift_node); - } shift_node->set_req(2, phase->intcon(masked_shift)); // Replace shift count with masked value. + + // We need to notify the caller that the graph was reshaped, as Ideal needs + // to return the root of the reshaped graph if any change was made. + return shift_node; } - return masked_shift; + } else { + // Not a shift by a constant. + masked_shift = 0; } - // Not a shift by a constant. - return 0; + return nullptr; } // Called with @@ -974,7 +975,8 @@ Node* LShiftINode::Identity(PhaseGVN* phase) { } Node* LShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) { - uint con = mask_and_replace_shift_amount(phase, this, bits_per_java_integer(bt)); + uint con; + Node* progress = mask_and_replace_shift_amount(phase, this, bits_per_java_integer(bt), con); if (con == 0) { return nullptr; } @@ -1113,7 +1115,7 @@ Node* LShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) { return doubleShift; } - return nullptr; + return progress; } //------------------------------Ideal------------------------------------------ @@ -1238,20 +1240,26 @@ Node* RShiftNode::IdentityIL(PhaseGVN* phase, BasicType bt) { return in(1); } // Check for useless sign-masking + int lshift_count = 0; if (in(1)->Opcode() == Op_LShift(bt) && in(1)->req() == 3 && - in(1)->in(2) == in(2)) { + // Compare shift counts by value, not by node pointer, to also match a not-yet-normalized + // negative constant (e.g. -1 vs 31) + const_shift_count(phase, in(1), &lshift_count)) { count &= bits_per_java_integer(bt) - 1; // semantics of Java shifts - // Compute masks for which this shifting doesn't change - jlong lo = (CONST64(-1) << (bits_per_java_integer(bt) - ((uint)count)-1)); // FFFF8000 - jlong hi = ~lo; // 00007FFF - const TypeInteger* t11 = phase->type(in(1)->in(1))->isa_integer(bt); - if (t11 == nullptr) { - return this; - } - // Does actual value fit inside of mask? - if (lo <= t11->lo_as_long() && t11->hi_as_long() <= hi) { - return in(1)->in(1); // Then shifting is a nop + lshift_count &= bits_per_java_integer(bt) - 1; + if (count == lshift_count) { + // Compute masks for which this shifting doesn't change + jlong lo = (CONST64(-1) << (bits_per_java_integer(bt) - ((uint)count)-1)); // FFFF8000 + jlong hi = ~lo; // 00007FFF + const TypeInteger* t11 = phase->type(in(1)->in(1))->isa_integer(bt); + if (t11 == nullptr) { + return this; + } + // Does actual value fit inside of mask? + if (lo <= t11->lo_as_long() && t11->hi_as_long() <= hi) { + return in(1)->in(1); // Then shifting is a nop + } } } } @@ -1268,7 +1276,9 @@ Node* RShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) { if (t1 == nullptr) { return NodeSentinel; // Left input is an integer } - int shift = mask_and_replace_shift_amount(phase, this, bits_per_java_integer(bt)); + + uint shift; + Node* progress = mask_and_replace_shift_amount(phase, this, bits_per_java_integer(bt), shift); if (shift == 0) { return NodeSentinel; } @@ -1278,7 +1288,7 @@ Node* RShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) { // Such expressions arise normally from shift chains like (byte)(x >> 24). const Node* and_node = in(1); if (and_node->Opcode() != Op_And(bt)) { - return nullptr; + return progress; } const TypeInteger* mask_t = phase->type(and_node->in(2))->isa_integer(bt); if (mask_t != nullptr && mask_t->is_con()) { @@ -1287,7 +1297,8 @@ Node* RShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) { Node* shr_nomask = phase->transform(RShiftNode::make(and_node->in(1), in(2), bt)); return MulNode::make_and(shr_nomask, phase->integercon(maskbits >> shift, bt), bt); } - return nullptr; + + return progress; } Node* RShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { @@ -1298,18 +1309,19 @@ Node* RShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { if (progress != nullptr) { return progress; } - int shift = mask_and_replace_shift_amount(phase, this, BitsPerJavaInteger); + uint shift; + progress = mask_and_replace_shift_amount(phase, this, BitsPerJavaInteger, shift); assert(shift != 0, "handled by IdealIL"); // Check for "(short[i] <<16)>>16" which simply sign-extends const Node *shl = in(1); if (shl->Opcode() != Op_LShiftI) { - return nullptr; + return progress; } const TypeInt* left_shift_t = phase->type(shl->in(2))->isa_int(); if (left_shift_t == nullptr) { - return nullptr; + return progress; } if (shift == 16 && left_shift_t->is_con(16)) { Node *ld = shl->in(1); @@ -1341,7 +1353,7 @@ Node* RShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { } } - return nullptr; + return progress; } const Type* RShiftNode::ValueIL(PhaseGVN* phase, BasicType bt) const { @@ -1497,7 +1509,8 @@ Node* URShiftINode::Identity(PhaseGVN* phase) { //------------------------------Ideal------------------------------------------ Node* URShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { - int con = mask_and_replace_shift_amount(phase, this, BitsPerJavaInteger); + uint con; + Node* progress = mask_and_replace_shift_amount(phase, this, BitsPerJavaInteger, con); if (con == 0) { return nullptr; } @@ -1524,11 +1537,14 @@ Node* URShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { // If Q is "X << z" the rounding is useless. Look for patterns like // ((X<>> Z and replace with (X + Y>>>Z) & Z-mask. Node *add = in(1); - const TypeInt *t2 = phase->type(in(2))->isa_int(); if (in1_op == Op_AddI) { Node *lshl = add->in(1); - if( lshl->Opcode() == Op_LShiftI && - phase->type(lshl->in(2)) == t2 ) { + // Compare shift counts by value, not by node pointer, to also match a not-yet-normalized + // negative constant (e.g. -1 vs 31) + int lshl_con = 0; + if (lshl->Opcode() == Op_LShiftI && + const_shift_count(phase, lshl, &lshl_con) && + (lshl_con & (BitsPerJavaInteger - 1)) == con) { Node *y_z = phase->transform( new URShiftINode(add->in(2),in(2)) ); Node *sum = phase->transform( new AddINode( lshl->in(1), y_z ) ); return new AndINode( sum, phase->intcon(mask) ); @@ -1555,11 +1571,16 @@ Node* URShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { // Check for "(X << z ) >>> z" which simply zero-extends Node *shl = in(1); - if( in1_op == Op_LShiftI && - phase->type(shl->in(2)) == t2 ) - return new AndINode( shl->in(1), phase->intcon(mask) ); + // Compare shift counts by value, not by node pointer, to also match a not-yet-normalized + // negative constant (e.g. -1 vs 31) + int shl_con = 0; + if (in1_op == Op_LShiftI && + const_shift_count(phase, shl, &shl_con) && + (shl_con & (BitsPerJavaInteger - 1)) == con) + return new AndINode(shl->in(1), phase->intcon(mask)); // Check for (x >> n) >>> 31. Replace with (x >>> 31) + const TypeInt* t2 = phase->type(in(2))->isa_int(); Node *shr = in(1); if ( in1_op == Op_RShiftI ) { Node *in11 = shr->in(1); @@ -1571,7 +1592,7 @@ Node* URShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) { } } - return nullptr; + return progress; } //------------------------------Value------------------------------------------ @@ -1661,7 +1682,8 @@ Node* URShiftLNode::Identity(PhaseGVN* phase) { //------------------------------Ideal------------------------------------------ Node* URShiftLNode::Ideal(PhaseGVN* phase, bool can_reshape) { - int con = mask_and_replace_shift_amount(phase, this, BitsPerJavaLong); + uint con; + Node* progress = mask_and_replace_shift_amount(phase, this, BitsPerJavaLong, con); if (con == 0) { return nullptr; } @@ -1677,11 +1699,15 @@ Node* URShiftLNode::Ideal(PhaseGVN* phase, bool can_reshape) { const TypeInt *t2 = phase->type(in(2))->isa_int(); if (add->Opcode() == Op_AddL) { Node *lshl = add->in(1); - if( lshl->Opcode() == Op_LShiftL && - phase->type(lshl->in(2)) == t2 ) { - Node *y_z = phase->transform( new URShiftLNode(add->in(2),in(2)) ); - Node *sum = phase->transform( new AddLNode( lshl->in(1), y_z ) ); - return new AndLNode( sum, phase->longcon(mask) ); + // Compare shift counts by value, not by node pointer, to also match a not-yet-normalized + // negative constant (e.g. -1 vs 63) + int lshl_con = 0; + if (lshl->Opcode() == Op_LShiftL && + const_shift_count(phase, lshl, &lshl_con) && + (lshl_con & (BitsPerJavaLong - 1)) == con) { + Node* y_z = phase->transform(new URShiftLNode(add->in(2), in(2))); + Node* sum = phase->transform(new AddLNode(lshl->in(1), y_z)); + return new AndLNode(sum, phase->longcon(mask)); } } @@ -1701,9 +1727,14 @@ Node* URShiftLNode::Ideal(PhaseGVN* phase, bool can_reshape) { // Check for "(X << z ) >>> z" which simply zero-extends Node *shl = in(1); - if( shl->Opcode() == Op_LShiftL && - phase->type(shl->in(2)) == t2 ) - return new AndLNode( shl->in(1), phase->longcon(mask) ); + // Compare shift counts by value, not by node pointer, to also match a not-yet-normalized + // negative constant (e.g. -1 vs 63) + int shl_con = 0; + if (shl->Opcode() == Op_LShiftL && + const_shift_count(phase, shl, &shl_con) && + (shl_con & (BitsPerJavaLong - 1)) == con) { + return new AndLNode(shl->in(1), phase->longcon(mask)); + } // Check for (x >> n) >>> 63. Replace with (x >>> 63) Node *shr = in(1); @@ -1716,7 +1747,8 @@ Node* URShiftLNode::Ideal(PhaseGVN* phase, bool can_reshape) { return new URShiftLNode(in11, phase->intcon(63)); } } - return nullptr; + + return progress; } //------------------------------Value------------------------------------------ diff --git a/src/hotspot/share/opto/multnode.hpp b/src/hotspot/share/opto/multnode.hpp index 20ab59aeabc..b63d418b742 100644 --- a/src/hotspot/share/opto/multnode.hpp +++ b/src/hotspot/share/opto/multnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,7 +42,6 @@ public: virtual const Type *bottom_type() const = 0; virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash - virtual bool depends_only_on_test() const { return false; } virtual const RegMask &out_RegMask() const; virtual Node *match( const ProjNode *proj, const Matcher *m ); virtual uint ideal_reg() const { return NotAMachineReg; } @@ -176,8 +175,7 @@ public: const bool _is_io_use; // Used to distinguish between the projections // used on the control and io paths from a macro node virtual int Opcode() const; - virtual bool is_CFG() const; - virtual bool depends_only_on_test() const { return false; } + virtual bool is_CFG() const; virtual const Type *bottom_type() const; virtual const TypePtr *adr_type() const; virtual bool pinned() const; diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp index 832727a424e..cb5795a1250 100644 --- a/src/hotspot/share/opto/node.cpp +++ b/src/hotspot/share/opto/node.cpp @@ -1151,15 +1151,19 @@ const Type* Node::Value(PhaseGVN* phase) const { // 'Idealize' the graph rooted at this Node. // // In order to be efficient and flexible there are some subtle invariants -// these Ideal calls need to hold. Running with '-XX:VerifyIterativeGVN=1' checks -// these invariants, although its too slow to have on by default. If you are -// hacking an Ideal call, be sure to test with '-XX:VerifyIterativeGVN=1' +// these Ideal calls need to hold. Some of the flag bits for '-XX:VerifyIterativeGVN' +// can help with validating these invariants, although they are too slow to have on by default: +// - '-XX:VerifyIterativeGVN=1' checks the def-use info +// - '-XX:VerifyIterativeGVN=100000' checks the return value +// If you are hacking an Ideal call, be sure to use these. // // The Ideal call almost arbitrarily reshape the graph rooted at the 'this' // pointer. If ANY change is made, it must return the root of the reshaped // graph - even if the root is the same Node. Example: swapping the inputs // to an AddINode gives the same answer and same root, but you still have to -// return the 'this' pointer instead of null. +// return the 'this' pointer instead of null. If the node was already dead +// before the Ideal call, this rule does not apply, and it is fine to return +// nullptr even if modifications were made. // // You cannot return an OLD Node, except for the 'this' pointer. Use the // Identity call to return an old Node; basically if Identity can find diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index e65578924d1..46b89aa2c5f 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -1059,14 +1059,135 @@ public: virtual bool is_CFG() const { return false; } - // If this node is control-dependent on a test, can it be - // rerouted to a dominating equivalent test? This is usually - // true of non-CFG nodes, but can be false for operations which - // depend for their correct sequencing on more than one test. - // (In that case, hoisting to a dominating test may silently - // skip some other important test.) - virtual bool depends_only_on_test() const { assert(!is_CFG(), ""); return true; }; + // If this node is control-dependent on a test, can it be rerouted to a dominating equivalent + // test? This means that the node can be executed safely as long as it happens after the test + // that is its control input without worrying about the whole control flow. On the contrary, if + // the node depends on a test that is not its control input, or if it depends on more than one + // tests, then this method must return false. + // + // Pseudocode examples: + // 1. if (y != 0) { + // x / y; + // } + // The division depends only on the test y != 0 and can be executed anywhere y != 0 holds true. + // As a result, depends_only_on_test returns true. + // 2. if (y != 0) { + // if (x > 1) { + // x / y; + // } + // } + // If the division x / y has its control input being the IfTrueNode of the test y != 0, then + // depends_only_on_test returns true. Otherwise, if the division has its control input being the + // IfTrueNode of the test x > 1, then depends_only_on_test returns false. + // 3. if (y > z) { + // if (z > 0) { + // x / y + // } + // } + // The division depends on both tests y > z and z > 0. As a result, depends_only_on_test returns + // false. + // + // This method allows more freedom in certain nodes with regards to scheduling, for example it + // allows nodes to float out of loops together with its test. + // + // This method is pessimistic, this means that it may return false even if the node satisfy the + // requirements. However, it must return false if the node does not satisfy the requirements. + // When a test is decomposed into multiple tests, all nodes that depend on the decomposed test + // must be pinned at the lowest dominating test of those. For example, when a zero check of a + // division is split through a region but the division itself is not, it must be pinned at the + // merge point by returning false when calling this method. + bool depends_only_on_test() const { + if (is_CFG() || pinned()) { + return false; + } + assert(in(0) != nullptr, "must have a control input"); + return depends_only_on_test_impl(); + } + // Return a clone of the current node that's pinned. The current node must return true for + // depends_only_on_test, and the retuned node must return false. This method is called when the + // node is disconnected from its test. + // + // Examples: + // 1. for (int i = start; i <= limit; i++) { + // if (!rangecheck(i, a)) { + // trap; + // } + // a[i]; + // } + // Loop predication can then hoist the range check out of the loop: + // if (!rangecheck(start, a)) { + // trap; + // } + // if (!rangecheck(limit, a)) { + // trap; + // } + // for (int i = start; i <= limit; i++) { + // a[i]; + // } + // As the load a[i] now depends on both tests rangecheck(start, a) and rangecheck(limit, a), it + // must be pinned at the lowest dominating test of those. + // + // 2. if (y > x) { + // if (x >= 0) { + // if (y != 0) { + // x / y; + // } + // } + // } + // The test (y != 0) == true can be deduced from (y > x) == true and (x >= 0) == true, so we may + // choose to elide it. In such cases, the division x / y now depends on both tests + // (y > x) == true and (x >= 0) == true, so it must be pinned at the lowest dominating test of + // those. + // + // 3. if (b) { + // ... + // } else { + // ... + // } + // if (y == 0) { + // trap; + // } + // x / y; + // The division x / y depends only on the test (y == 0) == false, but if we split the test + // through the merge point but not the division: + // if (b) { + // ... + // if (y == 0) { + // trap; + // } + // } else { + // ... + // if (y == 0) { + // trap; + // } + // } + // x / y; + // The division now has the control input being the RegionNode merge the branches of if(b) + // instead of a test that proves y != 0. As a result, it must be pinned at that node. + // + // There are cases where the node does not actually have a dependency on its control input. For + // example, when we try to sink a LoadNode out of a loop in PhaseIdealLoop::try_sink_out_of_loop, + // we clone the node so that all of the clones can be scheduled out of the loop. To prevent the + // clones from being GVN-ed again, we add a control input for the node at the loop exit. For the + // cases when the node does provably not depend on its control input, this method can return + // nullptr. + Node* pin_node_under_control() const { + assert(depends_only_on_test(), "must be a depends_only_on_test node"); + Node* res = pin_node_under_control_impl(); + if (res == nullptr) { + assert(is_Load(), "unexpected failure to pin for %s", Name()); + return nullptr; + } + assert(!res->depends_only_on_test(), "the result must not depends_only_on_test"); + return res; + } + +private: + virtual bool depends_only_on_test_impl() const { assert(false, "%s", Name()); return false; } + virtual Node* pin_node_under_control_impl() const { assert(false, "%s", Name()); return nullptr; } + +public: // When building basic blocks, I need to have a notion of block beginning // Nodes, next block selector Nodes (block enders), and next block // projections. These calls need to work on their machine equivalents. The @@ -1201,13 +1322,6 @@ public: template void visit_uses(Callback callback, Check is_boundary) const; - // Returns a clone of the current node that's pinned (if the current node is not) for nodes found in array accesses - // (Load and range check CastII nodes). - // This is used when an array access is made dependent on 2 or more range checks (range check smearing or Loop Predication). - virtual Node* pin_array_access_node() const { - return nullptr; - } - //----------------- Code Generation // Ideal register class for Matching. Zero means unmatched instruction diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index ce24c46590d..3cbbc114778 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ #include "opto/callnode.hpp" #include "opto/castnode.hpp" #include "opto/cfgnode.hpp" +#include "opto/convertnode.hpp" #include "opto/idealGraphPrinter.hpp" #include "opto/loopnode.hpp" #include "opto/machnode.hpp" @@ -1722,11 +1723,6 @@ void PhaseIterGVN::verify_Ideal_for(Node* n, bool can_reshape) { case Op_MergeMem: return; - // URShiftINode::Ideal - // Found in tier1-3. Did not investigate further yet. - case Op_URShiftI: - return; - // CMoveINode::Ideal // Found in tier1-3. Did not investigate further yet. case Op_CMoveI: @@ -2011,40 +2007,6 @@ void PhaseIterGVN::verify_Identity_for(Node* n) { case Op_ConvI2L: return; - // MaxNode::find_identity_operation - // Finds patterns like Max(A, Max(A, B)) -> Max(A, B) - // This can be a 2-hop search, so maybe notification is not - // good enough. - // - // Found with: - // compiler/codegen/TestBooleanVect.java - // -XX:VerifyIterativeGVN=1110 - case Op_MaxL: - case Op_MinL: - case Op_MaxI: - case Op_MinI: - case Op_MaxF: - case Op_MinF: - case Op_MaxHF: - case Op_MinHF: - case Op_MaxD: - case Op_MinD: - return; - - - // AddINode::Identity - // Converts (x-y)+y to x - // Could be issue with notification - // - // Turns out AddL does the same. - // - // Found with: - // compiler/c2/Test6792161.java - // -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyIterativeGVN=1110 - case Op_AddI: - case Op_AddL: - return; - // AbsINode::Identity // Not investigated yet. case Op_AbsI: @@ -2167,9 +2129,15 @@ Node *PhaseIterGVN::transform_old(Node* n) { DEBUG_ONLY(dead_loop_check(k);) DEBUG_ONLY(bool is_new = (k->outcnt() == 0);) C->remove_modified_node(k); +#ifndef PRODUCT + uint hash_before = is_verify_Ideal_return() ? k->hash() : 0; +#endif Node* i = apply_ideal(k, /*can_reshape=*/true); assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes"); #ifndef PRODUCT + if (is_verify_Ideal_return()) { + assert(k->outcnt() == 0 || i != nullptr || hash_before == k->hash(), "hash changed after Ideal returned nullptr for %s", k->Name()); + } verify_step(k); #endif @@ -2193,9 +2161,15 @@ Node *PhaseIterGVN::transform_old(Node* n) { // Try idealizing again DEBUG_ONLY(is_new = (k->outcnt() == 0);) C->remove_modified_node(k); +#ifndef PRODUCT + uint hash_before = is_verify_Ideal_return() ? k->hash() : 0; +#endif i = apply_ideal(k, /*can_reshape=*/true); assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes"); #ifndef PRODUCT + if (is_verify_Ideal_return()) { + assert(k->outcnt() == 0 || i != nullptr || hash_before == k->hash(), "hash changed after Ideal returned nullptr for %s", k->Name()); + } verify_step(k); #endif DEBUG_ONLY(loop_count++;) @@ -2582,12 +2556,15 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ auto is_boundary = [](Node* n){ return !n->is_ConstraintCast(); }; use->visit_uses(push_the_uses_to_worklist, is_boundary); } - // If changed LShift inputs, check RShift users for useless sign-ext + // If changed LShift inputs, check RShift/URShift users for + // "(X << C) >> C" sign-ext and "(X << C) >>> C" zero-ext optimizations. if (use_op == Op_LShiftI || use_op == Op_LShiftL) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); - if (u->Opcode() == Op_RShiftI || u->Opcode() == Op_RShiftL) + if (u->Opcode() == Op_RShiftI || u->Opcode() == Op_RShiftL || + u->Opcode() == Op_URShiftI || u->Opcode() == Op_URShiftL) { worklist.push(u); + } } } // If changed LShift inputs, check And users for shift and mask (And) operation @@ -2639,6 +2616,26 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ } } } + // ConvD2F::Ideal matches ConvD2F(SqrtD(ConvF2D(x))) => SqrtF(x). + // Notify ConvD2F users of SqrtD when any input of the SqrtD changes. + if (use_op == Op_SqrtD) { + for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { + Node* u = use->fast_out(i2); + if (u->Opcode() == Op_ConvD2F) { + worklist.push(u); + } + } + } + // ConvF2HF::Ideal matches ConvF2HF(binopF(ConvHF2F(...))) => FP16BinOp(...). + // Notify ConvF2HF users of float binary ops when any input changes. + if (Float16NodeFactory::is_float32_binary_oper(use_op)) { + for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { + Node* u = use->fast_out(i2); + if (u->Opcode() == Op_ConvF2HF) { + worklist.push(u); + } + } + } // If changed AddP inputs: // - check Stores for loop invariant, and // - if the changed input is the offset, check constant-offset AddP users for @@ -2668,7 +2665,7 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ if (use->is_MinMax()) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); - if (u->Opcode() == use->Opcode()) { + if (u->is_MinMax()) { worklist.push(u); } } @@ -2768,6 +2765,18 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ }; use->visit_uses(push_and_to_worklist, is_boundary); } + + // If changed Sub inputs, check Add for identity. + // e.g., (x - y) + y -> x; x + (y - x) -> y. + if (use_op == Op_SubI || use_op == Op_SubL) { + const int add_op = (use_op == Op_SubI) ? Op_AddI : Op_AddL; + for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { + Node* u = use->fast_out(i2); + if (u->Opcode() == add_op) { + worklist.push(u); + } + } + } } /** @@ -2784,37 +2793,6 @@ void PhaseIterGVN::remove_speculative_types() { _table.check_no_speculative_types(); } -// Check if the type of a divisor of a Div or Mod node includes zero. -bool PhaseIterGVN::no_dependent_zero_check(Node* n) const { - switch (n->Opcode()) { - case Op_DivI: - case Op_ModI: - case Op_UDivI: - case Op_UModI: { - // Type of divisor includes 0? - if (type(n->in(2)) == Type::TOP) { - // 'n' is dead. Treat as if zero check is still there to avoid any further optimizations. - return false; - } - const TypeInt* type_divisor = type(n->in(2))->is_int(); - return (type_divisor->_hi < 0 || type_divisor->_lo > 0); - } - case Op_DivL: - case Op_ModL: - case Op_UDivL: - case Op_UModL: { - // Type of divisor includes 0? - if (type(n->in(2)) == Type::TOP) { - // 'n' is dead. Treat as if zero check is still there to avoid any further optimizations. - return false; - } - const TypeLong* type_divisor = type(n->in(2))->is_long(); - return (type_divisor->_hi < 0 || type_divisor->_lo > 0); - } - } - return true; -} - //============================================================================= #ifndef PRODUCT uint PhaseCCP::_total_invokes = 0; diff --git a/src/hotspot/share/opto/phaseX.hpp b/src/hotspot/share/opto/phaseX.hpp index ce02f456c00..cd38f37ccf5 100644 --- a/src/hotspot/share/opto/phaseX.hpp +++ b/src/hotspot/share/opto/phaseX.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -604,7 +604,6 @@ public: } bool is_dominator(Node *d, Node *n) { return is_dominator_helper(d, n, false); } - bool no_dependent_zero_check(Node* n) const; #ifndef PRODUCT static bool is_verify_def_use() { @@ -627,6 +626,10 @@ public: // '-XX:VerifyIterativeGVN=10000' return ((VerifyIterativeGVN % 100000) / 10000) == 1; } + static bool is_verify_Ideal_return() { + // '-XX:VerifyIterativeGVN=100000' + return ((VerifyIterativeGVN % 1000000) / 100000) == 1; + } protected: // Sub-quadratic implementation of '-XX:VerifyIterativeGVN=1' (Use-Def verification). julong _verify_counter; diff --git a/src/hotspot/share/opto/rootnode.hpp b/src/hotspot/share/opto/rootnode.hpp index 3838578b4db..76f0ec440a9 100644 --- a/src/hotspot/share/opto/rootnode.hpp +++ b/src/hotspot/share/opto/rootnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 @@ public: virtual const Type *bottom_type() const; virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash - virtual bool depends_only_on_test() const { return false; } virtual const Node *is_block_proj() const { return this; } virtual const RegMask &out_RegMask() const; virtual uint ideal_reg() const { return NotAMachineReg; } diff --git a/src/hotspot/share/opto/split_if.cpp b/src/hotspot/share/opto/split_if.cpp index de9ddb60b0c..dff8bf86606 100644 --- a/src/hotspot/share/opto/split_if.cpp +++ b/src/hotspot/share/opto/split_if.cpp @@ -29,6 +29,7 @@ #include "opto/movenode.hpp" #include "opto/node.hpp" #include "opto/opaquenode.hpp" +#include "opto/opcodes.hpp" #include "opto/predicates.hpp" //------------------------------split_thru_region------------------------------ @@ -716,14 +717,11 @@ void PhaseIdealLoop::do_split_if(Node* iff, RegionNode** new_false_region, Regio } // End of while merge point has phis _igvn.remove_dead_node(region); - if (iff->Opcode() == Op_RangeCheck) { - // Pin array access nodes: control is updated here to a region. If, after some transformations, only one path - // into the region is left, an array load could become dependent on a condition that's not a range check for - // that access. If that condition is replaced by an identical dominating one, then an unpinned load would risk - // floating above its range check. - pin_array_access_nodes_dependent_on(new_true); - pin_array_access_nodes_dependent_on(new_false); - } + + // Control is updated here to a region, which is not a test, so any node that + // depends_only_on_test must be pinned + pin_nodes_dependent_on(new_true, iff->Opcode() == Op_RangeCheck); + pin_nodes_dependent_on(new_false, iff->Opcode() == Op_RangeCheck); if (new_false_region != nullptr) { *new_false_region = new_false; @@ -735,13 +733,22 @@ void PhaseIdealLoop::do_split_if(Node* iff, RegionNode** new_false_region, Regio DEBUG_ONLY( if (VerifyLoopOptimizations) { verify(); } ); } -void PhaseIdealLoop::pin_array_access_nodes_dependent_on(Node* ctrl) { +void PhaseIdealLoop::pin_nodes_dependent_on(Node* ctrl, bool old_iff_is_rangecheck) { for (DUIterator i = ctrl->outs(); ctrl->has_out(i); i++) { Node* use = ctrl->out(i); if (!use->depends_only_on_test()) { continue; } - Node* pinned_clone = use->pin_array_access_node(); + + + // When a RangeCheckNode is folded because its condition is a constant, IfProjNode::Identity + // returns the control input of the RangeCheckNode. As a result, when the old IfNode is not a + // RangeCheckNode, and a Load output of it depends_only_on_test, we don't need to pin the Load. + if (use->is_Load() && !old_iff_is_rangecheck) { + continue; + } + + Node* pinned_clone = use->pin_node_under_control(); if (pinned_clone != nullptr) { register_new_node_with_ctrl_of(pinned_clone, use); _igvn.replace_node(use, pinned_clone); diff --git a/src/hotspot/share/opto/subnode.hpp b/src/hotspot/share/opto/subnode.hpp index 463d9e020cb..a90661c49ee 100644 --- a/src/hotspot/share/opto/subnode.hpp +++ b/src/hotspot/share/opto/subnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -507,6 +507,9 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; @@ -522,6 +525,9 @@ public: const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type* Value(PhaseGVN* phase) const; + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------SqrtFNode-------------------------------------- @@ -541,6 +547,9 @@ public: const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } virtual const Type* Value(PhaseGVN* phase) const; + +private: + virtual bool depends_only_on_test_impl() const { return false; } }; //------------------------------SqrtHFNode------------------------------------- diff --git a/src/hotspot/share/opto/subtypenode.hpp b/src/hotspot/share/opto/subtypenode.hpp index abf9cad4844..2dac3866209 100644 --- a/src/hotspot/share/opto/subtypenode.hpp +++ b/src/hotspot/share/opto/subtypenode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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 @@ -48,7 +48,6 @@ public: virtual int Opcode() const; const Type* bottom_type() const { return TypeInt::CC; } - bool depends_only_on_test() const { return false; } ciMethod* method() const { return _method; } int bci() const { return _bci; } @@ -71,6 +70,8 @@ private: static bool is_oop(PhaseGVN* phase, Node* n); Node* load_klass(PhaseGVN* phase) const; + + virtual bool depends_only_on_test_impl() const { return false; } #endif // ASSERT }; diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index 31cc8fa0460..d878b2b1d3d 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -2214,7 +2214,7 @@ bool SuperWord::is_vector_use(Node* use, int u_idx) const { return true; } - if (!is_velt_basic_type_compatible_use_def(use, def)) { + if (!is_velt_basic_type_compatible_use_def(use, def, d_pk->size())) { return false; } @@ -2280,7 +2280,7 @@ Node_List* PackSet::strided_pack_input_at_index_or_null(const Node_List* pack, c // Check if the output type of def is compatible with the input type of use, i.e. if the // types have the same size. -bool SuperWord::is_velt_basic_type_compatible_use_def(Node* use, Node* def) const { +bool SuperWord::is_velt_basic_type_compatible_use_def(Node* use, Node* def, const uint pack_size) const { assert(in_bb(def) && in_bb(use), "both use and def are in loop"); // Conversions are trivially compatible. @@ -2306,8 +2306,17 @@ bool SuperWord::is_velt_basic_type_compatible_use_def(Node* use, Node* def) cons type2aelembytes(use_bt) == 4; } - // Default case: input size of use equals output size of def. - return type2aelembytes(use_bt) == type2aelembytes(def_bt); + // Input size of use equals output size of def + if (type2aelembytes(use_bt) == type2aelembytes(def_bt)) { + return true; + } + + // Subword cast: Element sizes differ, but the platform supports a cast to change the def shape to the use shape. + if (VectorCastNode::is_supported_subword_cast(def_bt, use_bt, pack_size)) { + return true; + } + + return false; } // Return nullptr if success, else failure message diff --git a/src/hotspot/share/opto/superword.hpp b/src/hotspot/share/opto/superword.hpp index 9654465220b..4e6fce70e5c 100644 --- a/src/hotspot/share/opto/superword.hpp +++ b/src/hotspot/share/opto/superword.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2026, 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 @@ -653,7 +653,7 @@ private: // Is use->in(u_idx) a vector use? bool is_vector_use(Node* use, int u_idx) const; - bool is_velt_basic_type_compatible_use_def(Node* use, Node* def) const; + bool is_velt_basic_type_compatible_use_def(Node* use, Node* def, const uint pack_size) const; bool do_vtransform() const; }; diff --git a/src/hotspot/share/opto/superwordVTransformBuilder.cpp b/src/hotspot/share/opto/superwordVTransformBuilder.cpp index 832e91603d9..f8b8bfe2ed0 100644 --- a/src/hotspot/share/opto/superwordVTransformBuilder.cpp +++ b/src/hotspot/share/opto/superwordVTransformBuilder.cpp @@ -254,6 +254,20 @@ VTransformNode* SuperWordVTransformBuilder::get_or_make_vtnode_vector_input_at_i Node_List* pack_in = _packset.pack_input_at_index_or_null(pack, index); if (pack_in != nullptr) { + Node* in_p0 = pack_in->at(0); + BasicType def_bt = _vloop_analyzer.types().velt_basic_type(in_p0); + BasicType use_bt = _vloop_analyzer.types().velt_basic_type(p0); + + // If the use and def types are different, emit a cast node + if (use_bt != def_bt && !p0->is_Convert() && VectorCastNode::is_supported_subword_cast(def_bt, use_bt, pack->size())) { + VTransformNode* in = get_vtnode(pack_in->at(0)); + const VTransformVectorNodeProperties properties = VTransformVectorNodeProperties::make_from_pack(pack, _vloop_analyzer); + VTransformNode* cast = new (_vtransform.arena()) VTransformElementWiseVectorNode(_vtransform, 2, properties, VectorCastNode::opcode(-1, def_bt)); + cast->set_req(1, in); + + return cast; + } + // Input is a matching pack -> vtnode already exists. assert(index != 2 || !VectorNode::is_shift(p0), "shift's count cannot be vector"); return get_vtnode(pack_in->at(0)); diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index c637737eef9..1a0872ee0e6 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -97,7 +97,7 @@ const Type::TypeInfo Type::_type_info[Type::lastype] = { { Bad, T_ILLEGAL, "vectorz:", false, Op_VecZ, relocInfo::none }, // VectorZ #endif { Bad, T_ADDRESS, "anyptr:", false, Op_RegP, relocInfo::none }, // AnyPtr - { Bad, T_ADDRESS, "rawptr:", false, Op_RegP, relocInfo::none }, // RawPtr + { Bad, T_ADDRESS, "rawptr:", false, Op_RegP, relocInfo::external_word_type }, // RawPtr { Bad, T_OBJECT, "oop:", true, Op_RegP, relocInfo::oop_type }, // OopPtr { Bad, T_OBJECT, "inst:", true, Op_RegP, relocInfo::oop_type }, // InstPtr { Bad, T_OBJECT, "ary:", true, Op_RegP, relocInfo::oop_type }, // AryPtr diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp index 9df10fefdd1..7fc06db4b78 100644 --- a/src/hotspot/share/opto/vectorIntrinsics.cpp +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp @@ -42,7 +42,7 @@ static bool check_vbox(const TypeInstPtr* vbox_type) { ciInstanceKlass* ik = vbox_type->instance_klass(); assert(is_vector(ik), "not a vector"); - ciField* fd1 = ik->get_field_by_name(ciSymbols::ETYPE_name(), ciSymbols::class_signature(), /* is_static */ true); + ciField* fd1 = ik->get_field_by_name(ciSymbols::CTYPE_name(), ciSymbols::class_signature(), /* is_static */ true); assert(fd1 != nullptr, "element type info is missing"); ciConstant val1 = fd1->constant_value(); @@ -301,9 +301,9 @@ static bool is_primitive_lane_type(VectorSupport::LaneType laneType) { return laneType >= VectorSupport::LT_FLOAT && laneType <= VectorSupport::LT_LONG; } -static BasicType get_vector_primitive_lane_type(VectorSupport::LaneType lane_type) { - assert(is_primitive_lane_type(lane_type), ""); - switch (lane_type) { +static BasicType get_vector_primitive_lane_type(VectorSupport::LaneType lanetype) { + assert(is_primitive_lane_type(lanetype), ""); + switch (lanetype) { case VectorSupport::LaneType::LT_FLOAT: return T_FLOAT; case VectorSupport::LaneType::LT_DOUBLE: return T_DOUBLE; case VectorSupport::LaneType::LT_LONG: return T_LONG; diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index ba88ae9496f..d332bf440f6 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -1561,6 +1561,13 @@ bool VectorCastNode::implemented(int opc, uint vlen, BasicType src_type, BasicTy return false; } +bool VectorCastNode::is_supported_subword_cast(BasicType def_bt, BasicType use_bt, const uint pack_size) { + assert(def_bt != use_bt, "use and def types must be different"); + + // Opcode is only required to disambiguate half float, so we pass -1 as it can't be encountered here. + return (is_subword_type(def_bt) || is_subword_type(use_bt)) && VectorCastNode::implemented(-1, pack_size, def_bt, use_bt); +} + Node* VectorCastNode::Identity(PhaseGVN* phase) { if (!in(1)->is_top()) { BasicType in_bt = in(1)->bottom_type()->is_vect()->element_basic_type(); diff --git a/src/hotspot/share/opto/vectornode.hpp b/src/hotspot/share/opto/vectornode.hpp index edbceb30635..f0d010ee735 100644 --- a/src/hotspot/share/opto/vectornode.hpp +++ b/src/hotspot/share/opto/vectornode.hpp @@ -1846,6 +1846,7 @@ class VectorCastNode : public VectorNode { static VectorNode* make(int vopc, Node* n1, BasicType bt, uint vlen); static int opcode(int opc, BasicType bt, bool is_signed = true); static bool implemented(int opc, uint vlen, BasicType src_type, BasicType dst_type); + static bool is_supported_subword_cast(BasicType def_bt, BasicType use_bt, const uint pack_size); virtual Node* Identity(PhaseGVN* phase); }; diff --git a/src/hotspot/share/opto/vtransform.hpp b/src/hotspot/share/opto/vtransform.hpp index b60c71945e1..2c535eca6d1 100644 --- a/src/hotspot/share/opto/vtransform.hpp +++ b/src/hotspot/share/opto/vtransform.hpp @@ -975,4 +975,5 @@ public: virtual VTransformApplyResult apply(VTransformApplyState& apply_state) const override; NOT_PRODUCT(virtual const char* name() const override { return "StoreVector"; };) }; + #endif // SHARE_OPTO_VTRANSFORM_HPP diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index 2b3a2966c27..423e1a5a1f4 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -3641,7 +3641,9 @@ JVM_ENTRY(jobjectArray, JVM_GetVmArguments(JNIEnv *env)) int index = 0; for (int j = 0; j < num_flags; j++, index++) { - Handle h = java_lang_String::create_from_platform_dependent_str(vm_flags[j], CHECK_NULL); + stringStream prefixed; + prefixed.print("-XX:%s", vm_flags[j]); + Handle h = java_lang_String::create_from_platform_dependent_str(prefixed.base(), CHECK_NULL); result_h->obj_at_put(index, h()); } for (int i = 0; i < num_args; i++, index++) { diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp index e0863c07f4f..9c5abdf790b 100644 --- a/src/hotspot/share/prims/jvmtiEnv.cpp +++ b/src/hotspot/share/prims/jvmtiEnv.cpp @@ -1077,11 +1077,19 @@ JvmtiEnv::SuspendAllVirtualThreads(jint except_count, const jthread* except_list JvmtiVTSuspender::register_vthread_resume(thread_oop); } } + // Restore resumed state for current thread if it is virtual. + // It must be suspended in the suspend_thread call out of disabler context. + oop cur_oop = self_tobj(); + if (cur_oop != nullptr) { + assert(JvmtiVTSuspender::is_vthread_suspended(cur_oop), "sanity check"); + JvmtiVTSuspender::register_vthread_resume(cur_oop); + } } // Self suspend after all other suspends if necessary. // Do not use MountUnmountDisabler in context of self suspend to avoid deadlocks. if (self_tobj() != nullptr) { - suspend_thread(self_tobj(), current, /* single_suspend */ false); + // Register current vthread as suspended with the suspend_thread call. + suspend_thread(self_tobj(), current, /* single_suspend */ true); } return JVMTI_ERROR_NONE; } /* end SuspendAllVirtualThreads */ diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index 4894a4dd21a..401bb4dfdb8 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -2491,7 +2491,7 @@ SetOrClearFramePopClosure::do_thread(Thread *target) { _result = JVMTI_ERROR_NO_MORE_FRAMES; return; } - assert(_state->get_thread_or_saved() == java_thread, "Must be"); + assert(_state->get_thread() == java_thread, "Must be"); RegisterMap reg_map(java_thread, RegisterMap::UpdateMap::include, diff --git a/src/hotspot/share/prims/jvmtiEnvThreadState.cpp b/src/hotspot/share/prims/jvmtiEnvThreadState.cpp index 571c4ca5528..303923076b1 100644 --- a/src/hotspot/share/prims/jvmtiEnvThreadState.cpp +++ b/src/hotspot/share/prims/jvmtiEnvThreadState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -151,11 +151,6 @@ bool JvmtiEnvThreadState::is_virtual() { return _state->is_virtual(); } -// Use _thread_saved if cthread is detached from JavaThread (_thread == nullptr). -JavaThread* JvmtiEnvThreadState::get_thread_or_saved() { - return _state->get_thread_or_saved(); -} - JavaThread* JvmtiEnvThreadState::get_thread() { return _state->get_thread(); } @@ -344,7 +339,7 @@ void JvmtiEnvThreadState::reset_current_location(jvmtiEvent event_type, bool ena if (enabled) { // If enabling breakpoint, no need to reset. // Can't do anything if empty stack. - JavaThread* thread = get_thread_or_saved(); + JavaThread* thread = get_thread(); if (event_type == JVMTI_EVENT_SINGLE_STEP && ((thread == nullptr && is_virtual()) || thread->has_last_Java_frame())) { diff --git a/src/hotspot/share/prims/jvmtiEnvThreadState.hpp b/src/hotspot/share/prims/jvmtiEnvThreadState.hpp index a2ab25a59dd..16b369e0857 100644 --- a/src/hotspot/share/prims/jvmtiEnvThreadState.hpp +++ b/src/hotspot/share/prims/jvmtiEnvThreadState.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -170,8 +170,6 @@ public: inline JvmtiThreadState* jvmti_thread_state() { return _state; } - // use _thread_saved if cthread is detached from JavaThread - JavaThread *get_thread_or_saved(); JavaThread *get_thread(); inline JvmtiEnv *get_env() { return _env; } diff --git a/src/hotspot/share/prims/jvmtiEventController.cpp b/src/hotspot/share/prims/jvmtiEventController.cpp index 9df3bbb4b3e..cb44b833c48 100644 --- a/src/hotspot/share/prims/jvmtiEventController.cpp +++ b/src/hotspot/share/prims/jvmtiEventController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -217,6 +217,10 @@ class EnterInterpOnlyModeClosure : public HandshakeClosure { assert(state != nullptr, "sanity check"); assert(state->get_thread() == jt, "handshake unsafe conditions"); + assert(jt->jvmti_thread_state() == state, "sanity check"); + assert(!jt->is_interp_only_mode(), "sanity check"); + assert(!state->is_interp_only_mode(), "sanity check"); + if (!state->is_pending_interp_only_mode()) { _completed = true; return; // The pending flag has been already cleared, so bail out. @@ -361,7 +365,8 @@ void VM_ChangeSingleStep::doit() { void JvmtiEventControllerPrivate::enter_interp_only_mode(JvmtiThreadState *state) { EC_TRACE(("[%s] # Entering interpreter only mode", - JvmtiTrace::safe_get_thread_name(state->get_thread_or_saved()))); + JvmtiTrace::safe_get_thread_name(state->get_thread()))); + JavaThread *target = state->get_thread(); Thread *current = Thread::current(); @@ -371,8 +376,13 @@ void JvmtiEventControllerPrivate::enter_interp_only_mode(JvmtiThreadState *state } // This flag will be cleared in EnterInterpOnlyModeClosure handshake. state->set_pending_interp_only_mode(true); - if (target == nullptr) { // an unmounted virtual thread - return; // EnterInterpOnlyModeClosure will be executed right after mount. + + // There are two cases when entering interp_only_mode is postponed: + // 1. Unmounted virtual thread - EnterInterpOnlyModeClosure::do_thread will be executed at mount; + // 2. Carrier thread with mounted virtual thread - EnterInterpOnlyModeClosure::do_thread will be executed at unmount. + if (target == nullptr || // an unmounted virtual thread + JvmtiEnvBase::is_thread_carrying_vthread(target, state->get_thread_oop())) { // a vthread carrying thread + return; // EnterInterpOnlyModeClosure will be executed right after mount or unmount. } EnterInterpOnlyModeClosure hs(state); if (target->is_handshake_safe_for(current)) { @@ -388,7 +398,8 @@ void JvmtiEventControllerPrivate::enter_interp_only_mode(JvmtiThreadState *state void JvmtiEventControllerPrivate::leave_interp_only_mode(JvmtiThreadState *state) { EC_TRACE(("[%s] # Leaving interpreter only mode", - JvmtiTrace::safe_get_thread_name(state->get_thread_or_saved()))); + JvmtiTrace::safe_get_thread_name(state->get_thread()))); + if (state->is_pending_interp_only_mode()) { state->set_pending_interp_only_mode(false); // Just clear the pending flag. assert(!state->is_interp_only_mode(), "sanity check"); @@ -409,7 +420,7 @@ JvmtiEventControllerPrivate::trace_changed(JvmtiThreadState *state, jlong now_en if (changed & bit) { // it changed, print it log_trace(jvmti)("[%s] # %s event %s", - JvmtiTrace::safe_get_thread_name(state->get_thread_or_saved()), + JvmtiTrace::safe_get_thread_name(state->get_thread()), (now_enabled & bit)? "Enabling" : "Disabling", JvmtiTrace::event_name((jvmtiEvent)ei)); } } @@ -932,7 +943,7 @@ JvmtiEventControllerPrivate::set_user_enabled(JvmtiEnvBase *env, JavaThread *thr void JvmtiEventControllerPrivate::set_frame_pop(JvmtiEnvThreadState *ets, JvmtiFramePop fpop) { EC_TRACE(("[%s] # set frame pop - frame=%d", - JvmtiTrace::safe_get_thread_name(ets->get_thread_or_saved()), + JvmtiTrace::safe_get_thread_name(ets->get_thread()), fpop.frame_number() )); ets->get_frame_pops()->set(fpop); @@ -943,7 +954,7 @@ JvmtiEventControllerPrivate::set_frame_pop(JvmtiEnvThreadState *ets, JvmtiFrameP void JvmtiEventControllerPrivate::clear_frame_pop(JvmtiEnvThreadState *ets, JvmtiFramePop fpop) { EC_TRACE(("[%s] # clear frame pop - frame=%d", - JvmtiTrace::safe_get_thread_name(ets->get_thread_or_saved()), + JvmtiTrace::safe_get_thread_name(ets->get_thread()), fpop.frame_number() )); ets->get_frame_pops()->clear(fpop); @@ -953,7 +964,7 @@ JvmtiEventControllerPrivate::clear_frame_pop(JvmtiEnvThreadState *ets, JvmtiFram void JvmtiEventControllerPrivate::clear_all_frame_pops(JvmtiEnvThreadState *ets) { EC_TRACE(("[%s] # clear all frame pops", - JvmtiTrace::safe_get_thread_name(ets->get_thread_or_saved()) + JvmtiTrace::safe_get_thread_name(ets->get_thread()) )); ets->get_frame_pops()->clear_all(); @@ -965,7 +976,7 @@ JvmtiEventControllerPrivate::clear_to_frame_pop(JvmtiEnvThreadState *ets, JvmtiF int cleared_cnt = ets->get_frame_pops()->clear_to(fpop); EC_TRACE(("[%s] # clear to frame pop - frame=%d, count=%d", - JvmtiTrace::safe_get_thread_name(ets->get_thread_or_saved()), + JvmtiTrace::safe_get_thread_name(ets->get_thread()), fpop.frame_number(), cleared_cnt )); diff --git a/src/hotspot/share/prims/jvmtiThreadState.cpp b/src/hotspot/share/prims/jvmtiThreadState.cpp index fc965e568f7..32bf2c4e98e 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.cpp +++ b/src/hotspot/share/prims/jvmtiThreadState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,13 +51,12 @@ static const int UNKNOWN_STACK_DEPTH = -99; // JvmtiThreadState *JvmtiThreadState::_head = nullptr; -bool JvmtiThreadState::_seen_interp_only_mode = false; +Atomic JvmtiThreadState::_seen_interp_only_mode{false}; JvmtiThreadState::JvmtiThreadState(JavaThread* thread, oop thread_oop) : _thread_event_enable() { assert(JvmtiThreadState_lock->is_locked(), "sanity check"); _thread = thread; - _thread_saved = nullptr; _exception_state = ES_CLEARED; _hide_single_stepping = false; _pending_interp_only_mode = false; @@ -118,11 +117,11 @@ JvmtiThreadState::JvmtiThreadState(JavaThread* thread, oop thread_oop) if (thread != nullptr) { if (thread_oop == nullptr || thread->jvmti_vthread() == nullptr || thread->jvmti_vthread() == thread_oop) { - // The JavaThread for carrier or mounted virtual thread case. + // The JavaThread for an active carrier or a mounted virtual thread case. // Set this only if thread_oop is current thread->jvmti_vthread(). thread->set_jvmti_thread_state(this); + assert(!thread->is_interp_only_mode(), "sanity check"); } - thread->set_interp_only_mode(false); } } @@ -135,7 +134,10 @@ JvmtiThreadState::~JvmtiThreadState() { } // clear this as the state for the thread + assert(get_thread() != nullptr, "sanity check"); + assert(get_thread()->jvmti_thread_state() == this, "sanity check"); get_thread()->set_jvmti_thread_state(nullptr); + get_thread()->set_interp_only_mode(false); // zap our env thread states { @@ -321,18 +323,21 @@ void JvmtiThreadState::add_env(JvmtiEnvBase *env) { void JvmtiThreadState::enter_interp_only_mode() { assert(_thread != nullptr, "sanity check"); + assert(JvmtiThreadState_lock->is_locked(), "sanity check"); assert(!is_interp_only_mode(), "entering interp only when in interp only mode"); - _seen_interp_only_mode = true; + assert(_thread->jvmti_vthread() == nullptr || _thread->jvmti_vthread() == get_thread_oop(), "sanity check"); + assert(_thread->jvmti_thread_state() == this, "sanity check"); + _saved_interp_only_mode = true; _thread->set_interp_only_mode(true); invalidate_cur_stack_depth(); } void JvmtiThreadState::leave_interp_only_mode() { + assert(JvmtiThreadState_lock->is_locked(), "sanity check"); assert(is_interp_only_mode(), "leaving interp only when not in interp only mode"); - if (_thread == nullptr) { - // Unmounted virtual thread updates the saved value. - _saved_interp_only_mode = false; - } else { + _saved_interp_only_mode = false; + if (_thread != nullptr && _thread->jvmti_thread_state() == this) { + assert(_thread->jvmti_vthread() == nullptr || _thread->jvmti_vthread() == get_thread_oop(), "sanity check"); _thread->set_interp_only_mode(false); } } @@ -340,7 +345,7 @@ void JvmtiThreadState::leave_interp_only_mode() { // Helper routine used in several places int JvmtiThreadState::count_frames() { - JavaThread* thread = get_thread_or_saved(); + JavaThread* thread = get_thread(); javaVFrame *jvf; ResourceMark rm; if (thread == nullptr) { @@ -479,8 +484,6 @@ void JvmtiThreadState::update_for_pop_top_frame() { } // force stack depth to be recalculated invalidate_cur_stack_depth(); - } else { - assert(!is_enabled(JVMTI_EVENT_FRAME_POP), "Must have no framepops set"); } } @@ -579,11 +582,8 @@ void JvmtiThreadState::update_thread_oop_during_vm_start() { } } +// For virtual threads only. void JvmtiThreadState::set_thread(JavaThread* thread) { - _thread_saved = nullptr; // Common case. - if (!_is_virtual && thread == nullptr) { - // Save JavaThread* if carrier thread is being detached. - _thread_saved = _thread; - } + assert(is_virtual(), "sanity check"); _thread = thread; } diff --git a/src/hotspot/share/prims/jvmtiThreadState.hpp b/src/hotspot/share/prims/jvmtiThreadState.hpp index 43b568cf1fc..fa77518a8b6 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.hpp +++ b/src/hotspot/share/prims/jvmtiThreadState.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -123,8 +123,11 @@ class JvmtiVTSuspender : AllStatic { class JvmtiThreadState : public CHeapObj { private: friend class JvmtiEnv; + // The _thread field is a link to the JavaThread associated with JvmtiThreadState. + // A platform (including carrier) thread should always have a stable link to its JavaThread. + // The _thread field of a virtual thread should point to the JavaThread when + // virtual thread is mounted. It should be set to null when it is unmounted. JavaThread *_thread; - JavaThread *_thread_saved; OopHandle _thread_oop_h; // Jvmti Events that cannot be posted in their current context. JvmtiDeferredEventQueue* _jvmti_event_queue; @@ -181,7 +184,7 @@ class JvmtiThreadState : public CHeapObj { inline JvmtiEnvThreadState* head_env_thread_state(); inline void set_head_env_thread_state(JvmtiEnvThreadState* ets); - static bool _seen_interp_only_mode; // interp_only_mode was requested at least once + static Atomic _seen_interp_only_mode; // interp_only_mode was requested at least once public: ~JvmtiThreadState(); @@ -204,19 +207,22 @@ class JvmtiThreadState : public CHeapObj { // Return true if any thread has entered interp_only_mode at any point during the JVMs execution. static bool seen_interp_only_mode() { - return _seen_interp_only_mode; + return _seen_interp_only_mode.load_acquire(); } void add_env(JvmtiEnvBase *env); // The pending_interp_only_mode is set when the interp_only_mode is triggered. // It is cleared by EnterInterpOnlyModeClosure handshake. - bool is_pending_interp_only_mode() { return _pending_interp_only_mode; } - void set_pending_interp_only_mode(bool val) { _pending_interp_only_mode = val; } + bool is_pending_interp_only_mode() { return _pending_interp_only_mode; } + void set_pending_interp_only_mode(bool val) { + _seen_interp_only_mode.release_store(true); + _pending_interp_only_mode = val; + } // Used by the interpreter for fullspeed debugging support bool is_interp_only_mode() { - return _thread == nullptr ? _saved_interp_only_mode : _thread->is_interp_only_mode(); + return _saved_interp_only_mode; } void enter_interp_only_mode(); void leave_interp_only_mode(); @@ -245,8 +251,10 @@ class JvmtiThreadState : public CHeapObj { int count_frames(); - inline JavaThread *get_thread() { return _thread; } - inline JavaThread *get_thread_or_saved(); // return _thread_saved if _thread is null + inline JavaThread *get_thread() { + assert(is_virtual() || _thread != nullptr, "sanity check"); + return _thread; + } // Needed for virtual threads as they can migrate to different JavaThread's. // Also used for carrier threads to clear/restore _thread. diff --git a/src/hotspot/share/prims/jvmtiThreadState.inline.hpp b/src/hotspot/share/prims/jvmtiThreadState.inline.hpp index 2b060f1a2e4..aa81463a696 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.inline.hpp +++ b/src/hotspot/share/prims/jvmtiThreadState.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2026, 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 @@ -130,22 +130,21 @@ inline JvmtiThreadState* JvmtiThreadState::state_for(JavaThread *thread, Handle return state; } -inline JavaThread* JvmtiThreadState::get_thread_or_saved() { - // Use _thread_saved if cthread is detached from JavaThread (_thread == null). - return (_thread == nullptr && !is_virtual()) ? _thread_saved : _thread; -} - inline void JvmtiThreadState::set_should_post_on_exceptions(bool val) { - get_thread_or_saved()->set_should_post_on_exceptions_flag(val ? JNI_TRUE : JNI_FALSE); + get_thread()->set_should_post_on_exceptions_flag(val ? JNI_TRUE : JNI_FALSE); } inline void JvmtiThreadState::unbind_from(JvmtiThreadState* state, JavaThread* thread) { if (state == nullptr) { + assert(!thread->is_interp_only_mode(), "sanity check"); return; } - // Save thread's interp_only_mode. - state->_saved_interp_only_mode = thread->is_interp_only_mode(); - state->set_thread(nullptr); // Make sure stale _thread value is never used. + assert(thread->jvmti_thread_state() == state, "sanity check"); + assert(state->get_thread() == thread, "sanity check"); + assert(thread->is_interp_only_mode() == state->_saved_interp_only_mode, "sanity check"); + if (state->is_virtual()) { // clean _thread link for virtual threads only + state->set_thread(nullptr); // make sure stale _thread value is never used + } } inline void JvmtiThreadState::bind_to(JvmtiThreadState* state, JavaThread* thread) { @@ -158,7 +157,7 @@ inline void JvmtiThreadState::bind_to(JvmtiThreadState* state, JavaThread* threa // Bind JavaThread to JvmtiThreadState. thread->set_jvmti_thread_state(state); - if (state != nullptr) { + if (state != nullptr && state->is_virtual()) { // Bind to JavaThread. state->set_thread(thread); } @@ -167,8 +166,13 @@ inline void JvmtiThreadState::bind_to(JvmtiThreadState* state, JavaThread* threa inline void JvmtiThreadState::process_pending_interp_only(JavaThread* current) { JvmtiThreadState* state = current->jvmti_thread_state(); - if (state != nullptr && state->is_pending_interp_only_mode()) { - JvmtiEventController::enter_interp_only_mode(state); + if (state != nullptr && seen_interp_only_mode()) { // avoid MutexLocker if possible + MutexLocker mu(JvmtiThreadState_lock); + if (state->is_pending_interp_only_mode()) { + assert(state->get_thread() == current, "sanity check"); + assert(!state->is_interp_only_mode(), "sanity check"); + JvmtiEventController::enter_interp_only_mode(state); + } } } #endif // SHARE_PRIMS_JVMTITHREADSTATE_INLINE_HPP diff --git a/src/hotspot/share/prims/vectorSupport.cpp b/src/hotspot/share/prims/vectorSupport.cpp index 9c0ec113a02..58f22d38d33 100644 --- a/src/hotspot/share/prims/vectorSupport.cpp +++ b/src/hotspot/share/prims/vectorSupport.cpp @@ -54,8 +54,8 @@ bool VectorSupport::is_vector_mask(Klass* klass) { BasicType VectorSupport::klass2bt(InstanceKlass* ik) { assert(ik->is_subclass_of(vmClasses::vector_VectorPayload_klass()), "%s not a VectorPayload", ik->name()->as_C_string()); fieldDescriptor fd; // find_field initializes fd if found - // static final Class ETYPE; - Klass* holder = ik->find_field(vmSymbols::ETYPE_name(), vmSymbols::class_signature(), &fd); + // static final Class CTYPE; + Klass* holder = ik->find_field(vmSymbols::CTYPE_name(), vmSymbols::class_signature(), &fd); assert(holder != nullptr, "sanity"); assert(fd.is_static(), ""); diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 35e0b83d25f..1a440584fe1 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -2215,25 +2215,10 @@ WB_ENTRY(jboolean, WB_CDSMemoryMappingFailed(JNIEnv* env, jobject wb)) return FileMapInfo::memory_mapping_failed(); WB_END -WB_ENTRY(jboolean, WB_IsSharedInternedString(JNIEnv* env, jobject wb, jobject str)) - if (!HeapShared::is_loading_mapping_mode()) { - return false; - } - ResourceMark rm(THREAD); - oop str_oop = JNIHandles::resolve(str); - int length; - jchar* chars = java_lang_String::as_unicode_string(str_oop, length, CHECK_(false)); - return StringTable::lookup_shared(chars, length) == str_oop; -WB_END - WB_ENTRY(jboolean, WB_IsSharedClass(JNIEnv* env, jobject wb, jclass clazz)) return (jboolean)AOTMetaspace::in_aot_cache(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz))); WB_END -WB_ENTRY(jboolean, WB_AreSharedStringsMapped(JNIEnv* env)) - return AOTMappedHeapLoader::is_mapped(); -WB_END - WB_ENTRY(void, WB_LinkClass(JNIEnv* env, jobject wb, jclass clazz)) Klass *k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); if (!k->is_instance_klass()) { @@ -3058,9 +3043,7 @@ static JNINativeMethod methods[] = { {CC"getCDSGenericHeaderMinVersion", CC"()I", (void*)&WB_GetCDSGenericHeaderMinVersion}, {CC"getCurrentCDSVersion", CC"()I", (void*)&WB_GetCDSCurrentVersion}, {CC"isSharingEnabled", CC"()Z", (void*)&WB_IsSharingEnabled}, - {CC"isSharedInternedString", CC"(Ljava/lang/String;)Z", (void*)&WB_IsSharedInternedString }, {CC"isSharedClass", CC"(Ljava/lang/Class;)Z", (void*)&WB_IsSharedClass }, - {CC"areSharedStringsMapped", CC"()Z", (void*)&WB_AreSharedStringsMapped }, {CC"linkClass", CC"(Ljava/lang/Class;)V", (void*)&WB_LinkClass}, {CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped}, {CC"isCDSIncluded", CC"()Z", (void*)&WB_IsCDSIncluded }, diff --git a/src/hotspot/share/runtime/abstract_vm_version.hpp b/src/hotspot/share/runtime/abstract_vm_version.hpp index 5a6b41506c7..17ade2c068d 100644 --- a/src/hotspot/share/runtime/abstract_vm_version.hpp +++ b/src/hotspot/share/runtime/abstract_vm_version.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 +42,7 @@ typedef enum { } VirtualizationType; class outputStream; +class stringStream; enum class vmIntrinsicID; // Abstract_VM_Version provides information about the VM. @@ -226,6 +227,21 @@ class Abstract_VM_Version: AllStatic { static const char* cpu_name(void); static const char* cpu_description(void); + + static void get_cpu_features_name(void* features_buffer, stringStream& ss) { return; } + + // Returns names of features present in features_set1 but not in features_set2 + static void get_missing_features_name(void* features_set1, void* features_set2, stringStream& ss) { return; } + + // Returns number of bytes required to store cpu features representation + static int cpu_features_size() { return 0; } + + // Stores arch dependent cpu features representation in the provided buffer. + // Size of the buffer must be same as returned by cpu_features_size() + static void store_cpu_features(void* buf) { return; } + + // features_to_test is an opaque object that stores arch specific representation of cpu features + static bool supports_features(void* features_to_test) { return false; }; }; #endif // SHARE_RUNTIME_ABSTRACT_VM_VERSION_HPP diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 546ae610769..a1dae76f680 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -536,9 +536,6 @@ static SpecialFlag const special_jvm_flags[] = { #ifdef _LP64 { "UseCompressedClassPointers", JDK_Version::jdk(25), JDK_Version::jdk(27), JDK_Version::undefined() }, #endif - { "ParallelRefProcEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, - { "ParallelRefProcBalancingEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, - { "MaxRAM", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, { "AggressiveHeap", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, { "NeverActAsServerClassMachine", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, { "AlwaysActAsServerClassMachine", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, @@ -553,6 +550,9 @@ static SpecialFlag const special_jvm_flags[] = { #endif { "PSChunkLargeArrays", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, + { "ParallelRefProcEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, + { "ParallelRefProcBalancingEnabled", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, + { "MaxRAM", JDK_Version::jdk(26), JDK_Version::jdk(27), JDK_Version::jdk(28) }, #ifdef ASSERT { "DummyObsoleteTestFlag", JDK_Version::undefined(), JDK_Version::jdk(18), JDK_Version::undefined() }, @@ -1510,25 +1510,19 @@ void Arguments::set_heap_size() { // Check if the user has configured any limit on the amount of RAM we may use. bool has_ram_limit = !FLAG_IS_DEFAULT(MaxRAMPercentage) || !FLAG_IS_DEFAULT(MinRAMPercentage) || - !FLAG_IS_DEFAULT(InitialRAMPercentage) || - !FLAG_IS_DEFAULT(MaxRAM); + !FLAG_IS_DEFAULT(InitialRAMPercentage); - if (FLAG_IS_DEFAULT(MaxRAM)) { - if (CompilerConfig::should_set_client_emulation_mode_flags()) { - // Limit the available memory if client emulation mode is enabled. - FLAG_SET_ERGO(MaxRAM, 1ULL*G); - } else { - // Use the available physical memory on the system. - FLAG_SET_ERGO(MaxRAM, os::physical_memory()); - } - } + // Limit the available memory if client emulation mode is enabled. + const size_t avail_mem = CompilerConfig::should_set_client_emulation_mode_flags() + ? 1ULL*G + : os::physical_memory(); // 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)) { - uint64_t min_memory = (uint64_t)(((double)MaxRAM * MinRAMPercentage) / 100); - uint64_t max_memory = (uint64_t)(((double)MaxRAM * MaxRAMPercentage) / 100); + uint64_t min_memory = (uint64_t)(((double)avail_mem * MinRAMPercentage) / 100); + uint64_t max_memory = (uint64_t)(((double)avail_mem * MaxRAMPercentage) / 100); const size_t reasonable_min = clamp_by_size_t_max(min_memory); size_t reasonable_max = clamp_by_size_t_max(max_memory); @@ -1615,7 +1609,7 @@ void Arguments::set_heap_size() { reasonable_minimum = limit_heap_by_allocatable_memory(reasonable_minimum); if (InitialHeapSize == 0) { - uint64_t initial_memory = (uint64_t)(((double)MaxRAM * InitialRAMPercentage) / 100); + uint64_t initial_memory = (uint64_t)(((double)avail_mem * InitialRAMPercentage) / 100); size_t reasonable_initial = clamp_by_size_t_max(initial_memory); reasonable_initial = limit_heap_by_allocatable_memory(reasonable_initial); diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index 2beba9abb06..54a65358693 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -2155,7 +2155,9 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* current, jint tr // Lock to read ProfileData, and ensure lock is not broken by a safepoint // We must do this already now, since we cannot acquire this lock while // holding the tty lock (lock ordering by rank). - MutexLocker ml(trap_mdo->extra_data_lock(), Mutex::_no_safepoint_check_flag); + ConditionalMutexLocker ml((trap_mdo != nullptr) ? trap_mdo->extra_data_lock() : nullptr, + (trap_mdo != nullptr), + Mutex::_no_safepoint_check_flag); ttyLocker ttyl; diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp index 63d3424b3ed..444ce321759 100644 --- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp +++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -163,10 +163,10 @@ JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(size_t value, bool verbose) { return JVMFlag::VIOLATES_CONSTRAINT; } - if (CodeCacheSegmentSize < (size_t)CodeEntryAlignment) { + if (CodeCacheSegmentSize < CodeEntryAlignment) { JVMFlag::printError(verbose, "CodeCacheSegmentSize (%zu) must be " - "larger than or equal to CodeEntryAlignment (%zd) " + "larger than or equal to CodeEntryAlignment (%u) " "to align entry points\n", CodeCacheSegmentSize, CodeEntryAlignment); return JVMFlag::VIOLATES_CONSTRAINT; @@ -194,25 +194,25 @@ JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(size_t value, bool verbose) { return JVMFlag::SUCCESS; } -JVMFlag::Error CodeEntryAlignmentConstraintFunc(intx value, bool verbose) { +JVMFlag::Error CodeEntryAlignmentConstraintFunc(uint value, bool verbose) { if (!is_power_of_2(value)) { JVMFlag::printError(verbose, - "CodeEntryAlignment (%zd) must be " + "CodeEntryAlignment (%u) must be " "a power of two\n", CodeEntryAlignment); return JVMFlag::VIOLATES_CONSTRAINT; } if (CodeEntryAlignment < 16) { JVMFlag::printError(verbose, - "CodeEntryAlignment (%zd) must be " + "CodeEntryAlignment (%u) must be " "greater than or equal to %d\n", CodeEntryAlignment, 16); return JVMFlag::VIOLATES_CONSTRAINT; } - if ((size_t)CodeEntryAlignment > CodeCacheSegmentSize) { + if (CodeEntryAlignment > CodeCacheSegmentSize) { JVMFlag::printError(verbose, - "CodeEntryAlignment (%zd) must be " + "CodeEntryAlignment (%u) must be " "less than or equal to CodeCacheSegmentSize (%zu) " "to align entry points\n", CodeEntryAlignment, CodeCacheSegmentSize); @@ -241,10 +241,10 @@ JVMFlag::Error OptoLoopAlignmentConstraintFunc(intx value, bool verbose) { return JVMFlag::VIOLATES_CONSTRAINT; } - if (OptoLoopAlignment > CodeEntryAlignment) { + if (checked_cast(OptoLoopAlignment) > CodeEntryAlignment) { JVMFlag::printError(verbose, "OptoLoopAlignment (%zd) must be " - "less or equal to CodeEntryAlignment (%zd)\n", + "less or equal to CodeEntryAlignment (%u)\n", value, CodeEntryAlignment); return JVMFlag::VIOLATES_CONSTRAINT; } @@ -306,7 +306,7 @@ JVMFlag::Error TypeProfileLevelConstraintFunc(uint value, bool verbose) { } JVMFlag::Error VerifyIterativeGVNConstraintFunc(uint value, bool verbose) { - const int max_modes = 5; + const int max_modes = 6; uint original_value = value; for (int i = 0; i < max_modes; i++) { if (value % 10 > 1) { @@ -339,10 +339,10 @@ JVMFlag::Error InitArrayShortSizeConstraintFunc(intx value, bool verbose) { #ifdef COMPILER2 JVMFlag::Error InteriorEntryAlignmentConstraintFunc(intx value, bool verbose) { - if (InteriorEntryAlignment > CodeEntryAlignment) { + if (checked_cast(InteriorEntryAlignment) > CodeEntryAlignment) { JVMFlag::printError(verbose, "InteriorEntryAlignment (%zd) must be " - "less than or equal to CodeEntryAlignment (%zd)\n", + "less than or equal to CodeEntryAlignment (%u)\n", InteriorEntryAlignment, CodeEntryAlignment); return JVMFlag::VIOLATES_CONSTRAINT; } diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.hpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.hpp index 4544ad706fd..cf785800cfc 100644 --- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.hpp +++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,7 +41,7 @@ f(intx, CompileThresholdConstraintFunc) \ f(intx, OnStackReplacePercentageConstraintFunc) \ f(size_t, CodeCacheSegmentSizeConstraintFunc) \ - f(intx, CodeEntryAlignmentConstraintFunc) \ + f(uint, CodeEntryAlignmentConstraintFunc) \ f(intx, OptoLoopAlignmentConstraintFunc) \ f(uintx, ArraycopyDstPrefetchDistanceConstraintFunc) \ f(uintx, ArraycopySrcPrefetchDistanceConstraintFunc) \ diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 6a2bbc9c648..6d4b9908e1c 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1508,8 +1508,9 @@ const int ObjectAlignmentInBytes = 8; range(1, 1024) \ constraint(CodeCacheSegmentSizeConstraintFunc, AfterErgo) \ \ - product_pd(intx, CodeEntryAlignment, EXPERIMENTAL, \ - "Code entry alignment for generated code (in bytes)") \ + product_pd(uint, CodeEntryAlignment, EXPERIMENTAL, \ + "Code entry alignment for generated code" \ + " (in bytes, power of two)") \ constraint(CodeEntryAlignmentConstraintFunc, AfterErgo) \ \ product_pd(intx, OptoLoopAlignment, \ diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index ee4f776df06..758051a7351 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -151,7 +151,8 @@ static void print_method_profiling_data() { ss.fill_to(2); m->method_data()->parameters_type_data()->print_data_on(&ss); } - m->print_codes_on(&ss); + // Buffering to a stringStream, disable internal buffering so it's not done twice. + m->print_codes_on(&ss, 0, false); tty->print("%s", ss.as_string()); // print all at once total_size += m->method_data()->size_in_bytes(); } diff --git a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp index a891e333d4c..77a567d4a09 100644 --- a/src/hotspot/share/runtime/javaThread.cpp +++ b/src/hotspot/share/runtime/javaThread.cpp @@ -514,7 +514,7 @@ JavaThread::JavaThread(MemTag mem_tag) : #ifdef MACOS_AARCH64 _cur_wx_enable(nullptr), - _cur_wx_mode(0), + _cur_wx_mode(nullptr), #endif _lock_stack(this), diff --git a/src/hotspot/share/runtime/lockStack.cpp b/src/hotspot/share/runtime/lockStack.cpp index a88a84eb9f8..58b9c58a329 100644 --- a/src/hotspot/share/runtime/lockStack.cpp +++ b/src/hotspot/share/runtime/lockStack.cpp @@ -1,7 +1,7 @@ /* * Copyright (c) 2022, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,4 @@ void LockStack::print_on(outputStream* st) { OMCache::OMCache(JavaThread* jt) : _entries() { STATIC_ASSERT(std::is_standard_layout::value); STATIC_ASSERT(std::is_standard_layout::value); - STATIC_ASSERT(offsetof(OMCache, _null_sentinel) == offsetof(OMCache, _entries) + - offsetof(OMCache::OMCacheEntry, _oop) + - OMCache::CAPACITY * in_bytes(oop_to_oop_difference())); } diff --git a/src/hotspot/share/runtime/lockStack.hpp b/src/hotspot/share/runtime/lockStack.hpp index dbc958a71e2..a32364b1774 100644 --- a/src/hotspot/share/runtime/lockStack.hpp +++ b/src/hotspot/share/runtime/lockStack.hpp @@ -1,7 +1,7 @@ /* * Copyright (c) 2022, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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 @@ -132,14 +132,13 @@ class LockStack { class OMCache { friend class VMStructs; public: - static constexpr int CAPACITY = 8; + static constexpr int CAPACITY = 2; private: struct OMCacheEntry { oop _oop = nullptr; ObjectMonitor* _monitor = nullptr; } _entries[CAPACITY]; - const oop _null_sentinel = nullptr; public: static ByteSize entries_offset() { return byte_offset_of(OMCache, _entries); } diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp index 144533cd959..8c6994c2152 100644 --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -329,13 +329,18 @@ void ObjectMonitor::set_object_strong() { void ObjectMonitor::ExitOnSuspend::operator()(JavaThread* current) { if (current->is_suspended()) { + // There could be an ongoing safepoint/handshake operation. + // Process them, except suspend requests, before exiting the + // monitor, as this may involve touching oops if the successor + // is a virtual thread. Before processing pending operations, + // set the monitor as pending again. + current->set_current_pending_monitor(_om); + SafepointMechanism::process_if_requested(current, false /*allow_suspend*/, false /*check_async_exception*/); _om->_recursions = 0; _om->clear_successor(); // Don't need a full fence after clearing successor here because of the call to exit(). _om->exit(current, false /* not_suspended */); _om_exited = true; - - current->set_current_pending_monitor(_om); } } @@ -1644,6 +1649,7 @@ void ObjectMonitor::exit_epilog(JavaThread* current, ObjectWaiter* Wakee) { Trigger = t->_ParkEvent; set_successor(t); } else { + assert_not_at_safepoint(); vthread = Wakee->vthread(); assert(vthread != nullptr, ""); Trigger = ObjectMonitor::vthread_unparker_ParkEvent(); diff --git a/src/hotspot/share/runtime/objectMonitor.hpp b/src/hotspot/share/runtime/objectMonitor.hpp index 574a652f230..8d9a481bf37 100644 --- a/src/hotspot/share/runtime/objectMonitor.hpp +++ b/src/hotspot/share/runtime/objectMonitor.hpp @@ -217,6 +217,7 @@ class ObjectMonitor : public CHeapObj { static int Knob_SpinLimit; + static ByteSize object_offset() { return byte_offset_of(ObjectMonitor, _object); } static ByteSize metadata_offset() { return byte_offset_of(ObjectMonitor, _metadata); } static ByteSize owner_offset() { return byte_offset_of(ObjectMonitor, _owner); } static ByteSize recursions_offset() { return byte_offset_of(ObjectMonitor, _recursions); } diff --git a/src/hotspot/share/runtime/objectMonitorTable.cpp b/src/hotspot/share/runtime/objectMonitorTable.cpp index 9b522720a28..767f5de6897 100644 --- a/src/hotspot/share/runtime/objectMonitorTable.cpp +++ b/src/hotspot/share/runtime/objectMonitorTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,278 +31,634 @@ #include "runtime/thread.hpp" #include "runtime/timerTrace.hpp" #include "runtime/trimNativeHeap.hpp" -#include "utilities/concurrentHashTableTasks.inline.hpp" #include "utilities/globalDefinitions.hpp" // ----------------------------------------------------------------------------- -// ConcurrentHashTable storing links from objects to ObjectMonitors +// Theory of operations -- Object Monitor Table: +// +// The OMT (Object Monitor Table) is a concurrent hash table specifically +// designed so that it (in the normal case) can be searched from C2 generated +// code. +// +// In its simplest form it consists of: +// 1. An array of pointers. +// 2. The size (capacity) of the array, which is always a power of two. +// +// When you want to find a monitor associated with an object, you extract the +// hash value of the object. Then calculate an index by taking the hash value +// and bit-wise AND it with the capacity mask (e.g. size-1) of the OMT. Now +// use that index into the OMT's array of pointers. If the pointer is non +// null, check if it's a monitor pointer that is associated with the object. +// If so you're done. If the pointer is non null, but associated with another +// object, you start looking at (index+1), (index+2) and so on, until you +// either find the correct monitor, or a null pointer. Finding a null pointer +// means that the monitor is simply not in the OMT. +// +// If the size of the pointer array is significantly larger than the number of +// pointers in it, the chance of finding the monitor in the hash index +// (without any further linear searching) is quite high. It is also straight +// forward to generate C2 code for this, which for the fast path doesn't +// contain any branching at all. See: C2_MacroAssembler::fast_lock(). +// +// When the number of monitors (pointers in the array) reaches above the +// allowed limit (defined by the GROW_LOAD_FACTOR symbol) we need to grow the +// table. +// +// A simple description of how growing the OMT is done, is to say that we +// allocate a new table (twice as large as the old one), and then copy all the +// old monitor pointers from the old table to the new. +// +// But since the OMT is a concurrent hash table and things needs to work for +// other clients of the OMT while we grow it, it's gets a bit more +// complicated. +// +// Both the new and (potentially several) old table(s) may exist at the same +// time. The newest is always called the "current", and the older ones are +// singly linked using a "prev" pointer. +// +// As soon as we have allocated and linked in the new "current" OMT, all new +// monitor pointers will be added to the new table. Effectively making the +// atomic switch from "old current" to "new current" a linearization point. +// +// After that we start to go through all the indexes in the old table. If the +// index is empty (the pointer is null) we put a "tombstone" into that index, +// which will prevent any future concurrent insert ending up in that index. +// +// If the index contains a monitor pointer, we insert that monitor pointer +// into the OMT which can be considered as one generation newer. If the index +// contains a "removed" pointer, we just ignore it. +// +// We use special pointer values for "tombstone" and "removed". Any pointer +// that is not null, not a tombstone and not removed, is considered to be a +// pointer to a monitor. +// +// When all the monitor pointers from an old OMT has been transferred to the +// new OMT, the old table is unlinked. +// +// This copying from an old OMT to one generation newer OMT, will continue +// until all the monitor pointers from old OMTs has been transferred to the +// newest "current" OMT. +// +// The memory for old, unlinked OMTs will be freed after a thread-local +// handshake with all Java threads. +// +// Searching the OMT for a monitor pointer while there are several generations +// of the OMT, will start from the oldest OMT. +// +// A note about the GROW_LOAD_FACTOR: In order to guarantee that the add and +// search algorithms can't loop forever, we must make sure that there is at +// least one null pointer in the array to stop them from dead looping. +// Furthermore, when we grow the OMT, we must make sure that the new "current" +// can accommodate all the monitors from all older OMTs, while still being so +// sparsely populated that the C2 generated code will likely find what it's +// searching for at the hash index, without needing further linear searching. +// The grow load factor is set to 12.5%, which satisfies the above +// requirements. Don't change it for fun, it might backfire. +// ----------------------------------------------------------------------------- -using ConcurrentTable = ConcurrentHashTable; +ObjectMonitorTable::Table* volatile ObjectMonitorTable::_curr; -static ConcurrentTable* _table = nullptr; -static volatile size_t _items_count = 0; -static size_t _table_size = 0; -static volatile bool _resize = false; +class ObjectMonitorTable::Table : public CHeapObj { + friend class ObjectMonitorTable; -class ObjectMonitorTableConfig : public AllStatic { - public: - using Value = ObjectMonitor*; - static uintx get_hash(Value const& value, bool* is_dead) { - return (uintx)value->hash(); + DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0); + const size_t _capacity_mask; // One less than its power-of-two capacity + Table* volatile _prev; // Set while rehashing + Entry volatile* _buckets; // The payload + DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(_capacity_mask) + sizeof(_prev) + sizeof(_buckets)); + volatile size_t _items_count; + DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(_items_count)); + + static Entry as_entry(ObjectMonitor* monitor) { + Entry entry = static_cast((uintptr_t)monitor); + assert(entry >= Entry::below_is_special, "Must be! (entry: " PTR_FORMAT ")", intptr_t(entry)); + return entry; } - static void* allocate_node(void* context, size_t size, Value const& value) { - ObjectMonitorTable::inc_items_count(); - return AllocateHeap(size, mtObjectMonitor); - }; - static void free_node(void* context, void* memory, Value const& value) { - ObjectMonitorTable::dec_items_count(); - FreeHeap(memory); + + static ObjectMonitor* as_monitor(Entry entry) { + assert(entry >= Entry::below_is_special, "Must be! (entry: " PTR_FORMAT ")", intptr_t(entry)); + return reinterpret_cast(entry); + } + + static Entry empty() { + return Entry::empty; + } + + static Entry tombstone() { + return Entry::tombstone; + } + + static Entry removed() { + return Entry::removed; + } + + // Make sure we leave space for previous versions to relocate too. + bool try_inc_items_count() { + for (;;) { + size_t population = AtomicAccess::load(&_items_count); + if (should_grow(population)) { + return false; + } + if (AtomicAccess::cmpxchg(&_items_count, population, population + 1, memory_order_relaxed) == population) { + return true; + } + } + } + + double get_load_factor(size_t count) { + return (double)count / (double)capacity(); + } + + void inc_items_count() { + AtomicAccess::inc(&_items_count, memory_order_relaxed); + } + + void dec_items_count() { + AtomicAccess::dec(&_items_count, memory_order_relaxed); + } + +public: + Table(size_t capacity, Table* prev) + : _capacity_mask(capacity - 1), + _prev(prev), + _buckets(NEW_C_HEAP_ARRAY(Entry, capacity, mtObjectMonitor)), + _items_count(0) + { + for (size_t i = 0; i < capacity; ++i) { + _buckets[i] = empty(); + } + } + + ~Table() { + FREE_C_HEAP_ARRAY(Entry, _buckets); + } + + Table* prev() { + return AtomicAccess::load(&_prev); + } + + size_t capacity() { + return _capacity_mask + 1; + } + + bool should_grow(size_t population) { + return get_load_factor(population) > GROW_LOAD_FACTOR; + } + + bool should_grow() { + return should_grow(AtomicAccess::load(&_items_count)); + } + + size_t total_items() { + size_t current_items = AtomicAccess::load(&_items_count); + Table* prev = AtomicAccess::load(&_prev); + if (prev != nullptr) { + return prev->total_items() + current_items; + } + return current_items; + } + + ObjectMonitor* get(oop obj, intptr_t hash) { + // Acquire tombstones and relocations in case prev transitioned to null + Table* prev = AtomicAccess::load_acquire(&_prev); + if (prev != nullptr) { + ObjectMonitor* result = prev->get(obj, hash); + if (result != nullptr) { + return result; + } + } + + const size_t start_index = size_t(hash) & _capacity_mask; + size_t index = start_index; + + for (;;) { + Entry volatile* bucket = _buckets + index; + Entry entry = AtomicAccess::load_acquire(bucket); + + if (entry == tombstone() || entry == empty()) { + // Not found + break; + } + + if (entry != removed() && as_monitor(entry)->object_peek() == obj) { + // Found matching monitor. + return as_monitor(entry); + } + + index = (index + 1) & _capacity_mask; + assert(index != start_index, "invariant"); + } + + // Rehashing could have started by now, but if a monitor has been inserted in a + // newer table, it was inserted after the get linearization point. + return nullptr; + } + + ObjectMonitor* prepare_insert(oop obj, intptr_t hash) { + // Acquire any tomb stones and relocations if prev transitioned to null. + Table* prev = AtomicAccess::load_acquire(&_prev); + if (prev != nullptr) { + ObjectMonitor* result = prev->prepare_insert(obj, hash); + if (result != nullptr) { + return result; + } + } + + const size_t start_index = size_t(hash) & _capacity_mask; + size_t index = start_index; + + for (;;) { + Entry volatile* bucket = _buckets + index; + Entry entry = AtomicAccess::load_acquire(bucket); + + if (entry == empty()) { + // Found an empty slot to install the new monitor in. + // To avoid concurrent inserts succeeding, place a tomb stone here. + Entry result = AtomicAccess::cmpxchg(bucket, entry, tombstone(), memory_order_relaxed); + if (result == entry) { + // Success! Nobody will try to insert here again, except reinsert from rehashing. + return nullptr; + } + entry = result; + } + + if (entry == tombstone()) { + // Can't insert into this table. + return nullptr; + } + + if (entry != removed() && as_monitor(entry)->object_peek() == obj) { + // Found matching monitor. + return as_monitor(entry); + } + + index = (index + 1) & _capacity_mask; + assert(index != start_index, "invariant"); + } + } + + ObjectMonitor* get_set(oop obj, Entry new_monitor, intptr_t hash) { + // Acquire any tombstones and relocations if prev transitioned to null. + Table* prev = AtomicAccess::load_acquire(&_prev); + if (prev != nullptr) { + // Sprinkle tombstones in previous tables to force concurrent inserters + // to the latest table. We only really want to try inserting in the + // latest table. + ObjectMonitor* result = prev->prepare_insert(obj, hash); + if (result != nullptr) { + return result; + } + } + + const size_t start_index = size_t(hash) & _capacity_mask; + size_t index = start_index; + + for (;;) { + Entry volatile* bucket = _buckets + index; + Entry entry = AtomicAccess::load_acquire(bucket); + + if (entry == empty()) { + // Empty slot to install the new monitor + if (try_inc_items_count()) { + // Succeeding in claiming an item. + Entry result = AtomicAccess::cmpxchg(bucket, entry, new_monitor, memory_order_acq_rel); + if (result == entry) { + // Success - already incremented. + return as_monitor(new_monitor); + } + + // Something else was installed in place. + dec_items_count(); + entry = result; + } else { + // Out of allowance; leaving place for rehashing to succeed. + // To avoid concurrent inserts succeeding, place a tombstone here. + Entry result = AtomicAccess::cmpxchg(bucket, entry, tombstone(), memory_order_acq_rel); + if (result == entry) { + // Success; nobody will try to insert here again, except reinsert from rehashing. + return nullptr; + } + entry = result; + } + } + + if (entry == tombstone()) { + // Can't insert into this table. + return nullptr; + } + + if (entry != removed() && as_monitor(entry)->object_peek() == obj) { + // Found matching monitor. + return as_monitor(entry); + } + + index = (index + 1) & _capacity_mask; + assert(index != start_index, "invariant"); + } + } + + void remove(oop obj, Entry old_monitor, intptr_t hash) { + assert(old_monitor >= Entry::below_is_special, + "Must be! (old_monitor: " PTR_FORMAT ")", intptr_t(old_monitor)); + + const size_t start_index = size_t(hash) & _capacity_mask; + size_t index = start_index; + + for (;;) { + Entry volatile* bucket = _buckets + index; + Entry entry = AtomicAccess::load_acquire(bucket); + + if (entry == empty()) { + // The monitor does not exist in this table. + break; + } + + if (entry == tombstone()) { + // Stop searching at tombstones. + break; + } + + if (entry == old_monitor) { + // Found matching entry; remove it + Entry result = AtomicAccess::cmpxchg(bucket, entry, removed(), memory_order_relaxed); + assert(result == entry, "should not fail"); + break; + } + + index = (index + 1) & _capacity_mask; + assert(index != start_index, "invariant"); + } + + // Old versions are removed after newer versions to ensure that observing + // the monitor removed and then doing a subsequent lookup results in there + // still not being a monitor, instead of flickering back to being there. + // Only the deflation thread rebuilds and unlinks tables, so we do not need + // any concurrency safe prev read below. + if (_prev != nullptr) { + _prev->remove(obj, old_monitor, hash); + } + } + + void reinsert(oop obj, Entry new_monitor) { + intptr_t hash = obj->mark().hash(); + + const size_t start_index = size_t(hash) & _capacity_mask; + size_t index = start_index; + + for (;;) { + Entry volatile* bucket = _buckets + index; + Entry entry = AtomicAccess::load_acquire(bucket); + + if (entry == empty()) { + // Empty slot to install the new monitor. + Entry result = AtomicAccess::cmpxchg(bucket, entry, new_monitor, memory_order_acq_rel); + if (result == entry) { + // Success - unconditionally increment. + inc_items_count(); + return; + } + + // Another monitor was installed. + entry = result; + } + + if (entry == tombstone()) { + // A concurrent inserter did not get enough allowance in the table. + // But reinsert always succeeds - we will take the spot. + Entry result = AtomicAccess::cmpxchg(bucket, entry, new_monitor, memory_order_acq_rel); + if (result == entry) { + // Success - unconditionally increment. + inc_items_count(); + return; + } + + // Another monitor was installed. + entry = result; + } + + if (entry == removed()) { + // A removed entry can be flipped back with reinsertion. + Entry result = AtomicAccess::cmpxchg(bucket, entry, new_monitor, memory_order_release); + if (result == entry) { + // Success - but don't increment; the initial entry did that for us. + return; + } + + // Another monitor was installed. + entry = result; + } + + assert(entry != empty(), "invariant"); + assert(entry != tombstone(), "invariant"); + assert(entry != removed(), "invariant"); + assert(as_monitor(entry)->object_peek() != obj, "invariant"); + index = (index + 1) & _capacity_mask; + assert(index != start_index, "invariant"); + } + } + + void rebuild() { + Table* prev = _prev; + if (prev == nullptr) { + // Base case for recursion - no previous version. + return; + } + + // Finish rebuilding up to prev as target so we can use prev as source. + prev->rebuild(); + + JavaThread* current = JavaThread::current(); + + // Relocate entries from prev. + for (size_t index = 0; index <= prev->_capacity_mask; index++) { + if ((index & 127) == 0) { + // Poll for safepoints to improve time to safepoint + ThreadBlockInVM tbivm(current); + } + + Entry volatile* bucket = prev->_buckets + index; + Entry entry = AtomicAccess::load_acquire(bucket); + + if (entry == empty()) { + // Empty slot; put a tombstone there. + Entry result = AtomicAccess::cmpxchg(bucket, entry, tombstone(), memory_order_acq_rel); + if (result == empty()) { + // Success; move to next entry. + continue; + } + + // Concurrent insert; relocate. + entry = result; + } + + if (entry != tombstone() && entry != removed()) { + // A monitor + ObjectMonitor* monitor = as_monitor(entry); + oop obj = monitor->object_peek(); + if (obj != nullptr) { + // In the current implementation the deflation thread drives + // the rebuilding, and it will already have removed any entry + // it has deflated. The assert is only here to make sure. + assert(!monitor->is_being_async_deflated(), "Should be"); + // Re-insert still live monitor. + reinsert(obj, entry); + } + } + } + + // Unlink this table, releasing the tombstones and relocations. + AtomicAccess::release_store(&_prev, (Table*)nullptr); } }; -class Lookup : public StackObj { - oop _obj; - - public: - explicit Lookup(oop obj) : _obj(obj) {} - - uintx get_hash() const { - uintx hash = _obj->mark().hash(); - assert(hash != 0, "should have a hash"); - return hash; - } - - bool equals(ObjectMonitor** value) { - assert(*value != nullptr, "must be"); - return (*value)->object_refers_to(_obj); - } - - bool is_dead(ObjectMonitor** value) { - assert(*value != nullptr, "must be"); - return false; - } -}; - -class LookupMonitor : public StackObj { - ObjectMonitor* _monitor; - - public: - explicit LookupMonitor(ObjectMonitor* monitor) : _monitor(monitor) {} - - uintx get_hash() const { - return _monitor->hash(); - } - - bool equals(ObjectMonitor** value) { - return (*value) == _monitor; - } - - bool is_dead(ObjectMonitor** value) { - assert(*value != nullptr, "must be"); - return (*value)->object_is_dead(); - } -}; - -void ObjectMonitorTable::inc_items_count() { - AtomicAccess::inc(&_items_count, memory_order_relaxed); -} - -void ObjectMonitorTable::dec_items_count() { - AtomicAccess::dec(&_items_count, memory_order_relaxed); -} - -double ObjectMonitorTable::get_load_factor() { - size_t count = AtomicAccess::load(&_items_count); - return (double)count / (double)_table_size; -} - -size_t ObjectMonitorTable::table_size(Thread* current) { - return ((size_t)1) << _table->get_size_log2(current); -} - -size_t ObjectMonitorTable::max_log_size() { - // TODO[OMTable]: Evaluate the max size. - // TODO[OMTable]: Need to fix init order to use Universe::heap()->max_capacity(); - // Using MaxHeapSize directly this early may be wrong, and there - // are definitely rounding errors (alignment). - const size_t max_capacity = MaxHeapSize; - const size_t min_object_size = CollectedHeap::min_dummy_object_size() * HeapWordSize; - const size_t max_objects = max_capacity / MAX2(MinObjAlignmentInBytes, checked_cast(min_object_size)); - const size_t log_max_objects = log2i_graceful(max_objects); - - return MAX2(MIN2(SIZE_BIG_LOG2, log_max_objects), min_log_size()); -} - -// ~= log(AvgMonitorsPerThreadEstimate default) -size_t ObjectMonitorTable::min_log_size() { - return 10; -} - -template -size_t ObjectMonitorTable::clamp_log_size(V log_size) { - return MAX2(MIN2(log_size, checked_cast(max_log_size())), checked_cast(min_log_size())); -} - -size_t ObjectMonitorTable::initial_log_size() { - const size_t estimate = log2i(MAX2(os::processor_count(), 1)) + log2i(MAX2(AvgMonitorsPerThreadEstimate, size_t(1))); - return clamp_log_size(estimate); -} - -size_t ObjectMonitorTable::grow_hint() { - return ConcurrentTable::DEFAULT_GROW_HINT; -} - void ObjectMonitorTable::create() { - _table = new ConcurrentTable(initial_log_size(), max_log_size(), grow_hint()); - _items_count = 0; - _table_size = table_size(Thread::current()); - _resize = false; -} - -void ObjectMonitorTable::verify_monitor_get_result(oop obj, ObjectMonitor* monitor) { -#ifdef ASSERT - if (SafepointSynchronize::is_at_safepoint()) { - bool has_monitor = obj->mark().has_monitor(); - assert(has_monitor == (monitor != nullptr), - "Inconsistency between markWord and ObjectMonitorTable has_monitor: %s monitor: " PTR_FORMAT, - BOOL_TO_STR(has_monitor), p2i(monitor)); - } -#endif + _curr = new Table(128, nullptr); } ObjectMonitor* ObjectMonitorTable::monitor_get(Thread* current, oop obj) { - ObjectMonitor* result = nullptr; - Lookup lookup_f(obj); - auto found_f = [&](ObjectMonitor** found) { - assert((*found)->object_peek() == obj, "must be"); - result = *found; - }; - _table->get(current, lookup_f, found_f); - verify_monitor_get_result(obj, result); + const intptr_t hash = obj->mark().hash(); + Table* curr = AtomicAccess::load_acquire(&_curr); + ObjectMonitor* monitor = curr->get(obj, hash); + return monitor; +} + +// Returns a new table to try inserting into. +ObjectMonitorTable::Table* ObjectMonitorTable::grow_table(Table* curr) { + Table* result; + Table* new_table = AtomicAccess::load_acquire(&_curr); + if (new_table != curr) { + // Table changed; no need to try further + return new_table; + } + + { + // Use MonitorDeflation_lock to only allow one inflating thread to + // attempt to allocate the new table. + MonitorLocker ml(MonitorDeflation_lock, Mutex::_no_safepoint_check_flag); + + new_table = AtomicAccess::load_acquire(&_curr); + if (new_table != curr) { + // Table changed; no need to try further + return new_table; + } + + new_table = new Table(curr->capacity() << 1, curr); + result = AtomicAccess::cmpxchg(&_curr, curr, new_table, memory_order_acq_rel); + if (result == curr) { + log_info(monitorinflation)("Growing object monitor table (capacity: %zu)", + new_table->capacity()); + // Since we grew the table (we have a new current) we need to + // notify the deflation thread to rebuild the table (to get rid of + // old currents). + ObjectSynchronizer::set_is_async_deflation_requested(true); + ml.notify_all(); + return new_table; + } + } + + // Somebody else started rehashing; restart in new table. + delete new_table; + return result; } -void ObjectMonitorTable::try_notify_grow() { - if (!_table->is_max_size_reached() && !AtomicAccess::load(&_resize)) { - AtomicAccess::store(&_resize, true); - if (Service_lock->try_lock()) { - Service_lock->notify(); - Service_lock->unlock(); - } - } -} - -bool ObjectMonitorTable::should_grow() { - return get_load_factor() > GROW_LOAD_FACTOR && !_table->is_max_size_reached(); -} - -bool ObjectMonitorTable::should_resize() { - return should_grow() || should_shrink() || AtomicAccess::load(&_resize); -} - -template -bool ObjectMonitorTable::run_task(JavaThread* current, Task& task, const char* task_name, Args&... args) { - if (task.prepare(current)) { - log_trace(monitortable)("Started to %s", task_name); - TraceTime timer(task_name, TRACETIME_LOG(Debug, monitortable, perf)); - while (task.do_task(current, args...)) { - task.pause(current); - { - ThreadBlockInVM tbivm(current); - } - task.cont(current); - } - task.done(current); - return true; - } - return false; -} - -bool ObjectMonitorTable::grow(JavaThread* current) { - ConcurrentTable::GrowTask grow_task(_table); - if (run_task(current, grow_task, "Grow")) { - _table_size = table_size(current); - log_info(monitortable)("Grown to size: %zu", _table_size); - return true; - } - return false; -} - -bool ObjectMonitorTable::clean(JavaThread* current) { - ConcurrentTable::BulkDeleteTask clean_task(_table); - auto is_dead = [&](ObjectMonitor** monitor) { - return (*monitor)->object_is_dead(); - }; - auto do_nothing = [&](ObjectMonitor** monitor) {}; - NativeHeapTrimmer::SuspendMark sm("ObjectMonitorTable"); - return run_task(current, clean_task, "Clean", is_dead, do_nothing); -} - -bool ObjectMonitorTable::resize(JavaThread* current) { - LogTarget(Info, monitortable) lt; - bool success = false; - - if (should_grow()) { - lt.print("Start growing with load factor %f", get_load_factor()); - success = grow(current); - } else { - if (!_table->is_max_size_reached() && AtomicAccess::load(&_resize)) { - lt.print("WARNING: Getting resize hints with load factor %f", get_load_factor()); - } - lt.print("Start cleaning with load factor %f", get_load_factor()); - success = clean(current); - } - - AtomicAccess::store(&_resize, false); - - return success; -} - ObjectMonitor* ObjectMonitorTable::monitor_put_get(Thread* current, ObjectMonitor* monitor, oop obj) { - // Enter the monitor into the concurrent hashtable. - ObjectMonitor* result = monitor; - Lookup lookup_f(obj); - auto found_f = [&](ObjectMonitor** found) { - assert((*found)->object_peek() == obj, "must be"); - result = *found; - }; - bool grow; - _table->insert_get(current, lookup_f, monitor, found_f, &grow); - verify_monitor_get_result(obj, result); - if (grow) { - try_notify_grow(); - } - return result; -} + const intptr_t hash = obj->mark().hash(); + Table* curr = AtomicAccess::load_acquire(&_curr); -bool ObjectMonitorTable::remove_monitor_entry(Thread* current, ObjectMonitor* monitor) { - LookupMonitor lookup_f(monitor); - return _table->remove(current, lookup_f); -} - -bool ObjectMonitorTable::contains_monitor(Thread* current, ObjectMonitor* monitor) { - LookupMonitor lookup_f(monitor); - bool result = false; - auto found_f = [&](ObjectMonitor** found) { - result = true; - }; - _table->get(current, lookup_f, found_f); - return result; -} - -void ObjectMonitorTable::print_on(outputStream* st) { - auto printer = [&] (ObjectMonitor** entry) { - ObjectMonitor* om = *entry; - oop obj = om->object_peek(); - st->print("monitor=" PTR_FORMAT ", ", p2i(om)); - st->print("object=" PTR_FORMAT, p2i(obj)); - assert(obj->mark().hash() == om->hash(), "hash must match"); - st->cr(); - return true; - }; - if (SafepointSynchronize::is_at_safepoint()) { - _table->do_safepoint_scan(printer); - } else { - _table->do_scan(Thread::current(), printer); + for (;;) { + // Curr is the latest table and is reasonably loaded. + ObjectMonitor* result = curr->get_set(obj, curr->as_entry(monitor), hash); + if (result != nullptr) { + return result; + } + // The table's limit was reached, we need to grow it. + curr = grow_table(curr); } } + +void ObjectMonitorTable::remove_monitor_entry(Thread* current, ObjectMonitor* monitor) { + oop obj = monitor->object_peek(); + if (obj == nullptr) { + // Defer removal until subsequent rebuilding. + return; + } + const intptr_t hash = obj->mark().hash(); + Table* curr = AtomicAccess::load_acquire(&_curr); + curr->remove(obj, curr->as_entry(monitor), hash); + assert(monitor_get(current, obj) != monitor, "should have been removed"); +} + +// Before handshake; rehash and unlink tables. +void ObjectMonitorTable::rebuild(GrowableArray* delete_list) { + Table* new_table; + { + // Concurrent inserts while in the middle of rebuilding can result + // in the population count increasing past the load factor limit. + // For this to be okay we need to bound how much it may exceed the + // limit. A sequence of tables with doubling capacity may + // eventually, after rebuilding, reach the maximum population of + // max_population(table_1) + max_population(table_1*2) + ... + + // max_population(table_1*2^n). + // I.e. max_population(2*table_1 *2^n) - max_population(table_1). + // With a 12.5% load factor, the implication is that as long as + // rebuilding a table will double its capacity, the maximum load + // after rebuilding is less than 25%. However, we can't always + // double the size each time we rebuild the table. Instead we + // recursively estimate the population count of the chain of + // tables (the current, and all the previous currents). If the sum + // of the population is less than the growing factor, we do not + // need to grow the table. If the new concurrently rebuilding + // table is immediately filled up by concurrent inserts, then the + // worst case load factor after the rebuild may be twice as large, + // which is still guaranteed to be less than a 50% load. If this + // happens, it will cause subsequent rebuilds to increase the + // table capacity, keeping the worst case less than 50%, until the + // load factor eventually becomes less than 12.5% again. So in + // some sense this allows us to be fooled once, but not twice. So, + // given the growing threshold of 12.5%, it is impossible for the + // tables to reach a load factor above 50%. Which is more than + // enough to guarantee the function of this concurrent hash table. + Table* curr = AtomicAccess::load_acquire(&_curr); + size_t need_to_accomodate = curr->total_items(); + size_t new_capacity = curr->should_grow(need_to_accomodate) + ? curr->capacity() << 1 + : curr->capacity(); + new_table = new Table(new_capacity, curr); + Table* result = AtomicAccess::cmpxchg(&_curr, curr, new_table, memory_order_acq_rel); + if (result != curr) { + // Somebody else racingly started rehashing. Delete the + // new_table and treat somebody else's table as the new one. + delete new_table; + new_table = result; + } + log_info(monitorinflation)("Rebuilding object monitor table (capacity: %zu)", + new_table->capacity()); + } + + for (Table* curr = new_table->prev(); curr != nullptr; curr = curr->prev()) { + delete_list->append(curr); + } + + // Rebuild with the new table as target. + new_table->rebuild(); +} + +// After handshake; destroy old tables +void ObjectMonitorTable::destroy(GrowableArray* delete_list) { + for (ObjectMonitorTable::Table* table: *delete_list) { + delete table; + } +} + +address ObjectMonitorTable::current_table_address() { + return (address)(&_curr); +} + +ByteSize ObjectMonitorTable::table_capacity_mask_offset() { + return byte_offset_of(Table, _capacity_mask); +} + +ByteSize ObjectMonitorTable::table_buckets_offset() { + return byte_offset_of(Table, _buckets); +} diff --git a/src/hotspot/share/runtime/objectMonitorTable.hpp b/src/hotspot/share/runtime/objectMonitorTable.hpp index 146468d46b2..e8e7c61c6fa 100644 --- a/src/hotspot/share/runtime/objectMonitorTable.hpp +++ b/src/hotspot/share/runtime/objectMonitorTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,7 +28,9 @@ #include "memory/allStatic.hpp" #include "oops/oopsHierarchy.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/sizes.hpp" +template class GrowableArray; class JavaThread; class ObjectMonitor; class ObjectMonitorTableConfig; @@ -36,42 +38,39 @@ class outputStream; class Thread; class ObjectMonitorTable : AllStatic { - friend class ObjectMonitorTableConfig; + static constexpr double GROW_LOAD_FACTOR = 0.125; - private: - static void inc_items_count(); - static void dec_items_count(); - static double get_load_factor(); - static size_t table_size(Thread* current); - static size_t max_log_size(); - static size_t min_log_size(); +public: + class Table; - template - static size_t clamp_log_size(V log_size); - static size_t initial_log_size(); - static size_t grow_hint(); +private: + static Table* volatile _curr; + static Table* grow_table(Table* curr); + + enum class Entry : uintptr_t { + empty = 0, + tombstone = 1, + removed = 2, + below_is_special = (removed + 1) + }; + +public: + typedef enum { + // Used in the platform code. See: C2_MacroAssembler::fast_lock(). + below_is_special = (int)Entry::below_is_special + } SpecialPointerValues; - public: static void create(); - static void verify_monitor_get_result(oop obj, ObjectMonitor* monitor); static ObjectMonitor* monitor_get(Thread* current, oop obj); - static void try_notify_grow(); - static bool should_shrink() { return false; } // Not implemented - - static constexpr double GROW_LOAD_FACTOR = 0.75; - - static bool should_grow(); - static bool should_resize(); - - template - static bool run_task(JavaThread* current, Task& task, const char* task_name, Args&... args); - static bool grow(JavaThread* current); - static bool clean(JavaThread* current); - static bool resize(JavaThread* current); static ObjectMonitor* monitor_put_get(Thread* current, ObjectMonitor* monitor, oop obj); - static bool remove_monitor_entry(Thread* current, ObjectMonitor* monitor); - static bool contains_monitor(Thread* current, ObjectMonitor* monitor); - static void print_on(outputStream* st); + static void rebuild(GrowableArray* delete_list); + static void destroy(GrowableArray* delete_list); + static void remove_monitor_entry(Thread* current, ObjectMonitor* monitor); + + // Compiler support + static address current_table_address(); + static ByteSize table_capacity_mask_offset(); + static ByteSize table_buckets_offset(); }; #endif // SHARE_RUNTIME_OBJECTMONITORTABLE_HPP diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 3a5a5745095..16335f97fdb 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -2293,7 +2293,7 @@ void os::commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint, // We do not have the same lock protection for pd_commit_memory and record_virtual_memory_commit. // We assume that there is some external synchronization that prevents a region from being uncommitted // before it is finished being committed. -bool os::uncommit_memory(char* addr, size_t bytes, bool executable) { +void os::uncommit_memory(char* addr, size_t bytes, bool executable) { assert_nonempty_range(addr, bytes); bool res; if (MemTracker::enabled()) { @@ -2306,13 +2306,10 @@ bool os::uncommit_memory(char* addr, size_t bytes, bool executable) { res = pd_uncommit_memory(addr, bytes, executable); } - if (res) { - log_debug(os, map)("Uncommitted " RANGEFMT, RANGEFMTARGS(addr, bytes)); - } else { - log_info(os, map)("Failed to uncommit " RANGEFMT, RANGEFMTARGS(addr, bytes)); + if (!res) { + fatal("Failed to uncommit " RANGEFMT, RANGEFMTARGS(addr, bytes)); } - - return res; + log_debug(os, map)("Uncommitted " RANGEFMT, RANGEFMTARGS(addr, bytes)); } // The scope of NmtVirtualMemoryLocker covers both pd_release_memory and record_virtual_memory_release because @@ -2320,7 +2317,7 @@ bool os::uncommit_memory(char* addr, size_t bytes, bool executable) { // We do not have the same lock protection for pd_reserve_memory and record_virtual_memory_reserve. // We assume that there is some external synchronization that prevents a region from being released // before it is finished being reserved. -bool os::release_memory(char* addr, size_t bytes) { +void os::release_memory(char* addr, size_t bytes) { assert_nonempty_range(addr, bytes); bool res; if (MemTracker::enabled()) { @@ -2333,11 +2330,9 @@ bool os::release_memory(char* addr, size_t bytes) { res = pd_release_memory(addr, bytes); } if (!res) { - log_info(os, map)("Failed to release " RANGEFMT, RANGEFMTARGS(addr, bytes)); - } else { - log_debug(os, map)("Released " RANGEFMT, RANGEFMTARGS(addr, bytes)); + fatal("Failed to release " RANGEFMT, RANGEFMTARGS(addr, bytes)); } - return res; + log_debug(os, map)("Released " RANGEFMT, RANGEFMTARGS(addr, bytes)); } // Prints all mappings @@ -2406,7 +2401,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset, return result; } -bool os::unmap_memory(char *addr, size_t bytes) { +void os::unmap_memory(char *addr, size_t bytes) { bool result; if (MemTracker::enabled()) { MemTracker::NmtVirtualMemoryLocker nvml; @@ -2417,7 +2412,9 @@ bool os::unmap_memory(char *addr, size_t bytes) { } else { result = pd_unmap_memory(addr, bytes); } - return result; + if (!result) { + fatal("Failed to unmap memory " RANGEFMT, RANGEFMTARGS(addr, bytes)); + } } void os::disclaim_memory(char *addr, size_t bytes) { @@ -2445,20 +2442,6 @@ char* os::reserve_memory_special(size_t size, size_t alignment, size_t page_size return result; } -bool os::release_memory_special(char* addr, size_t bytes) { - bool res; - if (MemTracker::enabled()) { - MemTracker::NmtVirtualMemoryLocker nvml; - res = pd_release_memory_special(addr, bytes); - if (res) { - MemTracker::record_virtual_memory_release(addr, bytes); - } - } else { - res = pd_release_memory_special(addr, bytes); - } - return res; -} - // Convenience wrapper around naked_short_sleep to allow for longer sleep // times. Only for use by non-JavaThreads. void os::naked_sleep(jlong millis) { diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index c6a1d670926..e185188384f 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -245,9 +245,7 @@ class os: AllStatic { static size_t pd_pretouch_memory(void* first, void* last, size_t page_size); static char* pd_reserve_memory_special(size_t size, size_t alignment, size_t page_size, - char* addr, bool executable); - static bool pd_release_memory_special(char* addr, size_t bytes); static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned); @@ -536,8 +534,8 @@ class os: AllStatic { static void commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint, bool executable, const char* mesg); - static bool uncommit_memory(char* addr, size_t bytes, bool executable = false); - static bool release_memory(char* addr, size_t bytes); + static void uncommit_memory(char* addr, size_t bytes, bool executable = false); + static void release_memory(char* addr, size_t bytes); // Does the platform support trimming the native heap? static bool can_trim_native_heap(); @@ -566,7 +564,7 @@ class os: AllStatic { static bool unguard_memory(char* addr, size_t bytes); static bool create_stack_guard_pages(char* addr, size_t bytes); static bool pd_create_stack_guard_pages(char* addr, size_t bytes); - static bool remove_stack_guard_pages(char* addr, size_t bytes); + static void remove_stack_guard_pages(char* addr, size_t bytes); // Helper function to create a new file with template jvmheap.XXXXXX. // Returns a valid fd on success or else returns -1 static int create_file_for_heap(const char* dir); @@ -582,7 +580,7 @@ class os: AllStatic { static char* map_memory(int fd, const char* file_name, size_t file_offset, char *addr, size_t bytes, MemTag mem_tag, bool read_only = false, bool allow_exec = false); - static bool unmap_memory(char *addr, size_t bytes); + static void unmap_memory(char *addr, size_t bytes); static void disclaim_memory(char *addr, size_t bytes); static void realign_memory(char *addr, size_t bytes, size_t alignment_hint); @@ -605,7 +603,6 @@ class os: AllStatic { // reserve, commit and pin the entire memory region static char* reserve_memory_special(size_t size, size_t alignment, size_t page_size, char* addr, bool executable); - static bool release_memory_special(char* addr, size_t bytes); static void large_page_init(); static size_t large_page_size(); static bool can_commit_large_page_memory(); diff --git a/src/hotspot/share/runtime/perfData.hpp b/src/hotspot/share/runtime/perfData.hpp index ca1f1f410ad..d910f8662fe 100644 --- a/src/hotspot/share/runtime/perfData.hpp +++ b/src/hotspot/share/runtime/perfData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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 @@ -716,7 +716,7 @@ class PerfDataManager : AllStatic { // Utility Classes /* - * this class will administer a PerfCounter used as a time accumulator + * This class will administer a PerfCounter used as a time accumulator * for a basic block much like the TraceTime class. * * Example: @@ -731,6 +731,9 @@ class PerfDataManager : AllStatic { * Note: use of this class does not need to occur within a guarded * block. The UsePerfData guard is used with the implementation * of this class. + * + * But also note this class does not guard against shutdown races - + * see SafePerfTraceTime below. */ class PerfTraceTime : public StackObj { @@ -756,6 +759,26 @@ class PerfTraceTime : public StackObj { } }; +/* A variant of PerfTraceTime that guards against use during shutdown - + * see PerfDataManager::destroy. + */ +class SafePerfTraceTime : public StackObj { + + protected: + elapsedTimer _t; + PerfLongCounter* _timerp; + + public: + inline SafePerfTraceTime(PerfLongCounter* timerp); + + const char* name() const { + assert(_timerp != nullptr, "sanity"); + return _timerp->name(); + } + + inline ~SafePerfTraceTime(); +}; + /* The PerfTraceTimedEvent class is responsible for counting the * occurrence of some event and measuring the elapsed time of * the event in two separate PerfCounter instances. diff --git a/src/hotspot/share/runtime/perfData.inline.hpp b/src/hotspot/share/runtime/perfData.inline.hpp index 5212691b924..ca0b27e25bc 100644 --- a/src/hotspot/share/runtime/perfData.inline.hpp +++ b/src/hotspot/share/runtime/perfData.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ #include "runtime/perfData.hpp" +#include "utilities/globalCounter.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/growableArray.hpp" @@ -50,4 +51,23 @@ inline bool PerfDataManager::exists(const char* name) { } } +inline SafePerfTraceTime::SafePerfTraceTime(PerfLongCounter* timerp) : _timerp(timerp) { + GlobalCounter::CriticalSection cs(Thread::current()); + if (!UsePerfData || !PerfDataManager::has_PerfData() || timerp == nullptr) { + return; + } + _t.start(); +} + +inline SafePerfTraceTime::~SafePerfTraceTime() { + GlobalCounter::CriticalSection cs(Thread::current()); + if (!UsePerfData || !PerfDataManager::has_PerfData() || !_t.is_active()) { + return; + } + + _t.stop(); + _timerp->inc(_t.ticks()); +} + + #endif // SHARE_RUNTIME_PERFDATA_INLINE_HPP diff --git a/src/hotspot/share/runtime/serviceThread.cpp b/src/hotspot/share/runtime/serviceThread.cpp index 27958885a7f..95e672984fa 100644 --- a/src/hotspot/share/runtime/serviceThread.cpp +++ b/src/hotspot/share/runtime/serviceThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 @@ -85,7 +85,6 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) { bool cldg_cleanup_work = false; bool jvmti_tagmap_work = false; bool oopmap_cache_work = false; - bool object_monitor_table_work = false; { // Need state transition ThreadBlockInVM so that this thread // will be handled by safepoint correctly when this thread is @@ -112,8 +111,7 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) { (oop_handles_to_release = JavaThread::has_oop_handles_to_release()) | (cldg_cleanup_work = ClassLoaderDataGraph::should_clean_metaspaces_and_reset()) | (jvmti_tagmap_work = JvmtiTagMap::has_object_free_events_and_reset()) | - (oopmap_cache_work = OopMapCache::has_cleanup_work()) | - (object_monitor_table_work = ObjectSynchronizer::needs_resize()) + (oopmap_cache_work = OopMapCache::has_cleanup_work()) ) == 0) { // Wait until notified that there is some work to do or timer expires. // Some cleanup requests don't notify the ServiceThread so work needs to be done at periodic intervals. @@ -171,10 +169,6 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) { if (oopmap_cache_work) { OopMapCache::cleanup(); } - - if (object_monitor_table_work) { - ObjectSynchronizer::resize_table(jt); - } } } diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index d426fd31a43..ae3835dd344 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,9 +22,11 @@ * */ +#include "cds/aotCompressedPointers.hpp" #include "cds/archiveBuilder.hpp" #include "cds/archiveUtils.inline.hpp" #include "classfile/classLoader.hpp" +#include "classfile/compactHashtable.hpp" #include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "classfile/vmClasses.hpp" @@ -2933,8 +2935,7 @@ public: assert(buffered_entry != nullptr,"sanity check"); uint hash = fp->compute_hash(); - u4 delta = _builder->buffer_to_offset_u4((address)buffered_entry); - _writer->add(hash, delta); + _writer->add(hash, AOTCompressedPointers::encode_not_null(buffered_entry)); if (lsh.is_enabled()) { address fp_runtime_addr = (address)buffered_fp + ArchiveBuilder::current()->buffer_to_requested_delta(); address entry_runtime_addr = (address)buffered_entry + ArchiveBuilder::current()->buffer_to_requested_delta(); diff --git a/src/hotspot/share/runtime/sharedRuntime.hpp b/src/hotspot/share/runtime/sharedRuntime.hpp index 11bd39c839f..a026a4b7d69 100644 --- a/src/hotspot/share/runtime/sharedRuntime.hpp +++ b/src/hotspot/share/runtime/sharedRuntime.hpp @@ -25,7 +25,6 @@ #ifndef SHARE_RUNTIME_SHAREDRUNTIME_HPP #define SHARE_RUNTIME_SHAREDRUNTIME_HPP -#include "classfile/compactHashtable.hpp" #include "code/codeBlob.hpp" #include "code/vmreg.hpp" #include "interpreter/linkResolver.hpp" @@ -38,6 +37,7 @@ class AdapterHandlerEntry; class AdapterFingerPrint; class MetaspaceClosure; +class SerializeClosure; class vframeStream; // Runtime is the base class for various runtime interfaces diff --git a/src/hotspot/share/runtime/stackOverflow.cpp b/src/hotspot/share/runtime/stackOverflow.cpp index e2bd157c555..61dbce8c5b4 100644 --- a/src/hotspot/share/runtime/stackOverflow.cpp +++ b/src/hotspot/share/runtime/stackOverflow.cpp @@ -116,13 +116,8 @@ void StackOverflow::remove_stack_guard_pages() { size_t len = stack_guard_zone_size(); if (os::must_commit_stack_guard_pages()) { - if (os::remove_stack_guard_pages((char *) low_addr, len)) { - _stack_guard_state = stack_guard_unused; - } else { - log_warning(os, thread)("Attempt to deallocate stack guard pages failed (" - PTR_FORMAT "-" PTR_FORMAT ").", p2i(low_addr), p2i(low_addr + len)); - return; - } + os::remove_stack_guard_pages((char *) low_addr, len); + _stack_guard_state = stack_guard_unused; } else { if (_stack_guard_state == stack_guard_unused) return; if (os::unguard_memory((char *) low_addr, len)) { diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index fde1aa50400..c93e1a65512 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -1195,13 +1195,10 @@ size_t ObjectSynchronizer::deflate_idle_monitors() { GrowableArray delete_list((int)deflated_count); unlinked_count = _in_use_list.unlink_deflated(deflated_count, &delete_list, &safepointer); -#ifdef ASSERT + GrowableArray table_delete_list; if (UseObjectMonitorTable) { - for (ObjectMonitor* monitor : delete_list) { - assert(!ObjectSynchronizer::contains_monitor(current, monitor), "Should have been removed"); - } + ObjectMonitorTable::rebuild(&table_delete_list); } -#endif log.before_handshake(unlinked_count); @@ -1222,6 +1219,9 @@ size_t ObjectSynchronizer::deflate_idle_monitors() { // Delete the unlinked ObjectMonitors. deleted_count = delete_monitors(&delete_list, &safepointer); + if (UseObjectMonitorTable) { + ObjectMonitorTable::destroy(&table_delete_list); + } assert(unlinked_count == deleted_count, "must be"); } @@ -1549,11 +1549,11 @@ ObjectMonitor* ObjectSynchronizer::add_monitor(JavaThread* current, ObjectMonito return ObjectMonitorTable::monitor_put_get(current, monitor, obj); } -bool ObjectSynchronizer::remove_monitor(Thread* current, ObjectMonitor* monitor, oop obj) { +void ObjectSynchronizer::remove_monitor(Thread* current, ObjectMonitor* monitor, oop obj) { assert(UseObjectMonitorTable, "must be"); assert(monitor->object_peek() == obj, "must be, cleared objects are removed by is_dead"); - return ObjectMonitorTable::remove_monitor_entry(current, monitor); + ObjectMonitorTable::remove_monitor_entry(current, monitor); } void ObjectSynchronizer::deflate_mark_word(oop obj) { @@ -1575,20 +1575,6 @@ void ObjectSynchronizer::create_om_table() { ObjectMonitorTable::create(); } -bool ObjectSynchronizer::needs_resize() { - if (!UseObjectMonitorTable) { - return false; - } - return ObjectMonitorTable::should_resize(); -} - -bool ObjectSynchronizer::resize_table(JavaThread* current) { - if (!UseObjectMonitorTable) { - return true; - } - return ObjectMonitorTable::resize(current); -} - class ObjectSynchronizer::LockStackInflateContendedLocks : private OopClosure { private: oop _contended_oops[LockStack::CAPACITY]; @@ -2296,10 +2282,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_and_enter(oop object, BasicLock* lock void ObjectSynchronizer::deflate_monitor(Thread* current, oop obj, ObjectMonitor* monitor) { if (obj != nullptr) { deflate_mark_word(obj); - } - bool removed = remove_monitor(current, monitor, obj); - if (obj != nullptr) { - assert(removed, "Should have removed the entry if obj was alive"); + remove_monitor(current, monitor, obj); } } @@ -2308,11 +2291,6 @@ ObjectMonitor* ObjectSynchronizer::get_monitor_from_table(Thread* current, oop o return ObjectMonitorTable::monitor_get(current, obj); } -bool ObjectSynchronizer::contains_monitor(Thread* current, ObjectMonitor* monitor) { - assert(UseObjectMonitorTable, "must be"); - return ObjectMonitorTable::contains_monitor(current, monitor); -} - ObjectMonitor* ObjectSynchronizer::read_monitor(markWord mark) { return mark.monitor(); } diff --git a/src/hotspot/share/runtime/synchronizer.hpp b/src/hotspot/share/runtime/synchronizer.hpp index a10e44b3092..97690b9c886 100644 --- a/src/hotspot/share/runtime/synchronizer.hpp +++ b/src/hotspot/share/runtime/synchronizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -213,7 +213,7 @@ public: static ObjectMonitor* get_or_insert_monitor(oop object, JavaThread* current, ObjectSynchronizer::InflateCause cause); static ObjectMonitor* add_monitor(JavaThread* current, ObjectMonitor* monitor, oop obj); - static bool remove_monitor(Thread* current, ObjectMonitor* monitor, oop obj); + static void remove_monitor(Thread* current, ObjectMonitor* monitor, oop obj); static void deflate_mark_word(oop object); diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 355dc70ae39..6de56c30d5f 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -485,8 +485,8 @@ void Thread::print_on(outputStream* st, bool print_extended_info) const { (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(); - st->print("allocated=%zu%s ", + uint64_t allocated_bytes = cooked_allocated_bytes(); + st->print("allocated=" UINT64_FORMAT "%s ", byte_size_in_proper_unit(allocated_bytes), proper_unit_for_byte_size(allocated_bytes) ); diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index dc09d4c68c2..bef31a70170 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -257,7 +257,7 @@ class Thread: public ThreadShadow { private: ThreadLocalAllocBuffer _tlab; // Thread-local eden - jlong _allocated_bytes; // Cumulative number of bytes allocated on + uint64_t _allocated_bytes; // Cumulative number of bytes allocated on // the Java heap ThreadHeapSampler _heap_sampler; // For use when sampling the memory. @@ -405,13 +405,14 @@ class Thread: public ThreadShadow { // Thread-Local Allocation Buffer (TLAB) support ThreadLocalAllocBuffer& tlab() { return _tlab; } + const ThreadLocalAllocBuffer& tlab() const { return _tlab; } void initialize_tlab(); void retire_tlab(ThreadLocalAllocStats* stats = nullptr); void fill_tlab(HeapWord* start, size_t pre_reserved, size_t new_size); - jlong allocated_bytes() { return _allocated_bytes; } - void incr_allocated_bytes(jlong size) { _allocated_bytes += size; } - inline jlong cooked_allocated_bytes(); + uint64_t allocated_bytes() { return _allocated_bytes; } + void incr_allocated_bytes(uint64_t size) { _allocated_bytes += size; } + inline uint64_t cooked_allocated_bytes() const; ThreadHeapSampler& heap_sampler() { return _heap_sampler; } diff --git a/src/hotspot/share/runtime/thread.inline.hpp b/src/hotspot/share/runtime/thread.inline.hpp index b194f5e2a7f..b4cf3ec589a 100644 --- a/src/hotspot/share/runtime/thread.inline.hpp +++ b/src/hotspot/share/runtime/thread.inline.hpp @@ -36,8 +36,8 @@ #include "runtime/os.hpp" #endif -inline jlong Thread::cooked_allocated_bytes() { - jlong allocated_bytes = AtomicAccess::load_acquire(&_allocated_bytes); +inline uint64_t Thread::cooked_allocated_bytes() const { + uint64_t allocated_bytes = AtomicAccess::load_acquire(&_allocated_bytes); size_t used_bytes = 0; if (UseTLAB) { // cooked_used_bytes() does its best to not return implausible values, but diff --git a/src/hotspot/share/runtime/threadWXSetters.inline.hpp b/src/hotspot/share/runtime/threadWXSetters.inline.hpp index e7e37fcde1b..87f8d38e4dc 100644 --- a/src/hotspot/share/runtime/threadWXSetters.inline.hpp +++ b/src/hotspot/share/runtime/threadWXSetters.inline.hpp @@ -42,7 +42,7 @@ class ThreadWXEnable { public: ThreadWXEnable(WXMode* new_mode, Thread* thread) : _thread(thread), _this_wx_mode(new_mode) { - NOT_PRODUCT(PerfTraceTime ptt(ClassLoader::perf_change_wx_time());) + NOT_PRODUCT(SafePerfTraceTime ptt(ClassLoader::perf_change_wx_time());) JavaThread* javaThread = _thread && _thread->is_Java_thread() ? JavaThread::cast(_thread) : nullptr; @@ -55,7 +55,7 @@ public: } ThreadWXEnable(WXMode new_mode, Thread* thread) : _thread(thread), _this_wx_mode(nullptr) { - NOT_PRODUCT(PerfTraceTime ptt(ClassLoader::perf_change_wx_time());) + NOT_PRODUCT(SafePerfTraceTime ptt(ClassLoader::perf_change_wx_time());) JavaThread* javaThread = _thread && _thread->is_Java_thread() ? JavaThread::cast(_thread) : nullptr; @@ -68,7 +68,7 @@ public: } ~ThreadWXEnable() { - NOT_PRODUCT(PerfTraceTime ptt(ClassLoader::perf_change_wx_time());) + NOT_PRODUCT(SafePerfTraceTime ptt(ClassLoader::perf_change_wx_time());) if (_thread) { _thread->enable_wx(_old_mode); JavaThread* javaThread @@ -86,4 +86,3 @@ public: #endif // MACOS_AARCH64 #endif // SHARE_RUNTIME_THREADWXSETTERS_INLINE_HPP - diff --git a/src/hotspot/share/runtime/vframe.inline.hpp b/src/hotspot/share/runtime/vframe.inline.hpp index 54dbb44ebd4..6bd83e7f7c9 100644 --- a/src/hotspot/share/runtime/vframe.inline.hpp +++ b/src/hotspot/share/runtime/vframe.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -176,7 +176,8 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { INTPTR_FORMAT " not found or invalid at %d", p2i(_frame.pc()), decode_offset); nm()->print_on(&ss); - nm()->method()->print_codes_on(&ss); + // Buffering to a stringStream, disable internal buffering so it's not done twice. + nm()->method()->print_codes_on(&ss, 0, false); nm()->print_code_on(&ss); nm()->print_pcs_on(&ss); tty->print("%s", ss.as_string()); // print all at once diff --git a/src/hotspot/share/runtime/vmOperations.cpp b/src/hotspot/share/runtime/vmOperations.cpp index c5539fd5e50..ef480f04c57 100644 --- a/src/hotspot/share/runtime/vmOperations.cpp +++ b/src/hotspot/share/runtime/vmOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 +51,7 @@ #include "runtime/threadSMR.inline.hpp" #include "runtime/vmOperations.hpp" #include "services/threadService.hpp" +#include "utilities/growableArray.hpp" #include "utilities/ticks.hpp" #define VM_OP_NAME_INITIALIZE(name) #name, @@ -286,42 +287,27 @@ class ObjectMonitorsDump : public MonitorClosure, public ObjectMonitorsView { } private: - class ObjectMonitorLinkedList : - public LinkedListImpl {}; + using ObjectMonitorList = GrowableArrayCHeap; // HashTable SIZE is specified at compile time so we // use 1031 which is the first prime after 1024. - typedef HashTable PtrTable; PtrTable* _ptrs; size_t _key_count; size_t _om_count; - void add_list(int64_t key, ObjectMonitorLinkedList* list) { - _ptrs->put(key, list); - _key_count++; - } - - ObjectMonitorLinkedList* get_list(int64_t key) { - ObjectMonitorLinkedList** listpp = _ptrs->get(key); - return (listpp == nullptr) ? nullptr : *listpp; - } - void add(ObjectMonitor* monitor) { int64_t key = monitor->owner(); - ObjectMonitorLinkedList* list = get_list(key); - if (list == nullptr) { - // Create new list and add it to the hash table: - list = new (mtThread) ObjectMonitorLinkedList; - _ptrs->put(key, list); + bool created = false; + ObjectMonitorList* list = _ptrs->put_if_absent(key, &created); + if (created) { _key_count++; } - assert(list->find(monitor) == nullptr, "Should not contain duplicates"); - list->add(monitor); // Add the ObjectMonitor to the list. + assert(list->find(monitor) == -1, "Should not contain duplicates"); + list->push(monitor); // Add the ObjectMonitor to the list. _om_count++; } @@ -332,17 +318,7 @@ class ObjectMonitorsDump : public MonitorClosure, public ObjectMonitorsView { ObjectMonitorsDump() : _ptrs(new (mtThread) PtrTable), _key_count(0), _om_count(0) {} ~ObjectMonitorsDump() { - class CleanupObjectMonitorsDump: StackObj { - public: - bool do_entry(int64_t& key, ObjectMonitorLinkedList*& list) { - list->clear(); // clear the LinkListNodes - delete list; // then delete the LinkedList - return true; - } - } cleanup; - - _ptrs->unlink(&cleanup); // cleanup the LinkedLists - delete _ptrs; // then delete the hash table + delete _ptrs; } // Implements MonitorClosure used to collect all owned monitors in the system @@ -368,11 +344,12 @@ class ObjectMonitorsDump : public MonitorClosure, public ObjectMonitorsView { // Implements the ObjectMonitorsView interface void visit(MonitorClosure* closure, JavaThread* thread) override { int64_t key = ObjectMonitor::owner_id_from(thread); - ObjectMonitorLinkedList* list = get_list(key); - LinkedListIterator iter(list != nullptr ? list->head() : nullptr); - while (!iter.is_empty()) { - ObjectMonitor* monitor = *iter.next(); - closure->do_monitor(monitor); + ObjectMonitorList* list = _ptrs->get(key); + if (list == nullptr) { + return; + } + for (int i = 0; i < list->length(); i++) { + closure->do_monitor(list->at(i)); } } diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index f65a3441bf4..a54fbc7e8ab 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -22,6 +22,7 @@ * */ +#include "cds/aotCompressedPointers.hpp" #include "cds/filemap.hpp" #include "classfile/classLoaderDataGraph.hpp" #include "classfile/javaClasses.hpp" @@ -158,7 +159,7 @@ unchecked_nonstatic_field) \ \ /******************************************************************/ \ - /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */ \ + /* OopDesc and Klass hierarchies */ \ /******************************************************************/ \ \ volatile_nonstatic_field(oopDesc, _mark, markWord) \ @@ -232,27 +233,7 @@ nonstatic_field(Klass, _vtable_len, int) \ nonstatic_field(Klass, _class_loader_data, ClassLoaderData*) \ nonstatic_field(vtableEntry, _method, Method*) \ - nonstatic_field(MethodData, _size, int) \ nonstatic_field(MethodData, _method, Method*) \ - nonstatic_field(MethodData, _data_size, int) \ - nonstatic_field(MethodData, _data[0], intptr_t) \ - nonstatic_field(MethodData, _parameters_type_data_di, int) \ - nonstatic_field(MethodData, _compiler_counters._nof_decompiles, uint) \ - nonstatic_field(MethodData, _compiler_counters._nof_overflow_recompiles, uint) \ - nonstatic_field(MethodData, _compiler_counters._nof_overflow_traps, uint) \ - nonstatic_field(MethodData, _compiler_counters._trap_hist._array[0], u1) \ - nonstatic_field(MethodData, _eflags, intx) \ - nonstatic_field(MethodData, _arg_local, intx) \ - nonstatic_field(MethodData, _arg_stack, intx) \ - nonstatic_field(MethodData, _arg_returned, intx) \ - nonstatic_field(MethodData, _tenure_traps, uint) \ - nonstatic_field(MethodData, _invoke_mask, int) \ - nonstatic_field(MethodData, _backedge_mask, int) \ - nonstatic_field(DataLayout, _header._struct._tag, u1) \ - nonstatic_field(DataLayout, _header._struct._flags, u1) \ - nonstatic_field(DataLayout, _header._struct._bci, u2) \ - nonstatic_field(DataLayout, _header._struct._traps, u4) \ - nonstatic_field(DataLayout, _cells[0], intptr_t) \ nonstatic_field(MethodCounters, _invoke_mask, int) \ nonstatic_field(MethodCounters, _backedge_mask, int) \ COMPILER2_OR_JVMCI_PRESENT(nonstatic_field(MethodCounters, _interpreter_throwout_count, u2)) \ @@ -427,6 +408,8 @@ volatile_nonstatic_field(ClassLoaderData, _klasses, Klass*) \ nonstatic_field(ClassLoaderData, _has_class_mirror_holder, bool) \ \ + static_field(ClassLoaderData, _the_null_class_loader_data, ClassLoaderData*) \ + \ volatile_static_field(ClassLoaderDataGraph, _head, ClassLoaderData*) \ \ /**********/ \ @@ -595,7 +578,7 @@ nonstatic_field(ThreadShadow, _exception_file, const char*) \ nonstatic_field(ThreadShadow, _exception_line, int) \ nonstatic_field(Thread, _tlab, ThreadLocalAllocBuffer) \ - nonstatic_field(Thread, _allocated_bytes, jlong) \ + nonstatic_field(Thread, _allocated_bytes, uint64_t) \ nonstatic_field(JavaThread, _lock_stack, LockStack) \ nonstatic_field(LockStack, _top, uint32_t) \ nonstatic_field(LockStack, _base[0], oop) \ @@ -762,7 +745,7 @@ CDS_ONLY(nonstatic_field(FileMapInfo, _header, FileMapHeader*)) \ CDS_ONLY( static_field(FileMapInfo, _current_info, FileMapInfo*)) \ CDS_ONLY(nonstatic_field(FileMapHeader, _regions[0], CDSFileMapRegion)) \ - CDS_ONLY(nonstatic_field(FileMapHeader, _cloned_vtables_offset, size_t)) \ + CDS_ONLY(nonstatic_field(FileMapHeader, _cloned_vtables, AOTCompressedPointers::narrowPtr)) \ CDS_ONLY(nonstatic_field(FileMapHeader, _mapped_base_address, char*)) \ CDS_ONLY(nonstatic_field(CDSFileMapRegion, _mapped_base, char*)) \ CDS_ONLY(nonstatic_field(CDSFileMapRegion, _used, size_t)) \ @@ -903,7 +886,6 @@ /*****************************/ \ \ declare_toplevel_type(void*) \ - declare_toplevel_type(Atomic) \ declare_toplevel_type(int*) \ declare_toplevel_type(char*) \ declare_toplevel_type(char**) \ @@ -961,8 +943,6 @@ declare_type(ConstMethod, MetaspaceObj) \ declare_type(Annotations, MetaspaceObj) \ \ - declare_toplevel_type(MethodData::CompilerCounters) \ - \ declare_toplevel_type(narrowKlass) \ \ declare_toplevel_type(vtableEntry) \ @@ -971,7 +951,6 @@ declare_toplevel_type(Symbol*) \ declare_toplevel_type(volatile Metadata*) \ \ - declare_toplevel_type(DataLayout) \ declare_toplevel_type(BSMAttributeEntries) \ \ /********/ \ @@ -1203,6 +1182,7 @@ \ /* all enum types */ \ \ + declare_integer_type(AOTCompressedPointers::narrowPtr) \ declare_integer_type(Bytecodes::Code) \ declare_integer_type(InstanceKlass::ClassState) \ declare_integer_type(JavaThreadState) \ @@ -1310,6 +1290,12 @@ VM_INT_CONSTANTS_GC(declare_constant, \ declare_constant_with_value) \ \ + /*****************/ \ + /* CDS constants */ \ + /*****************/ \ + \ + CDS_ONLY(declare_constant(AOTCompressedPointers::MetadataOffsetShift)) \ + \ /******************/ \ /* Useful globals */ \ /******************/ \ diff --git a/src/hotspot/share/sanitizers/ub.hpp b/src/hotspot/share/sanitizers/ub.hpp index d5901f6821c..8a6bfa50f51 100644 --- a/src/hotspot/share/sanitizers/ub.hpp +++ b/src/hotspot/share/sanitizers/ub.hpp @@ -33,12 +33,9 @@ // Useful if the function or method is known to do something special or even 'dangerous', for // example causing desired signals/crashes. #ifdef UNDEFINED_BEHAVIOR_SANITIZER -#if defined(__clang__) +#if defined(__clang__) || defined(__GNUC__) #define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined","float-divide-by-zero"))) #endif -#if defined(__GNUC__) && !defined(__clang__) -#define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined"))) -#endif #endif #ifndef ATTRIBUTE_NO_UBSAN diff --git a/src/hotspot/share/services/management.cpp b/src/hotspot/share/services/management.cpp index 290e4839c96..09277e16479 100644 --- a/src/hotspot/share/services/management.cpp +++ b/src/hotspot/share/services/management.cpp @@ -2124,12 +2124,12 @@ JVM_ENTRY(jlong, jmm_GetTotalThreadAllocatedMemory(JNIEnv *env)) // We keep a high water mark to ensure monotonicity in case threads counted // on a previous call end up in state (2). - static jlong high_water_result = 0; + static uint64_t high_water_result = 0; JavaThreadIteratorWithHandle jtiwh; - jlong result = ThreadService::exited_allocated_bytes(); + uint64_t result = ThreadService::exited_allocated_bytes(); for (; JavaThread* thread = jtiwh.next();) { - jlong size = thread->cooked_allocated_bytes(); + uint64_t size = thread->cooked_allocated_bytes(); result += size; } @@ -2144,7 +2144,7 @@ JVM_ENTRY(jlong, jmm_GetTotalThreadAllocatedMemory(JNIEnv *env)) high_water_result = result; } } - return result; + return checked_cast(result); JVM_END // Gets the amount of memory allocated on the Java heap for a single thread. @@ -2156,13 +2156,13 @@ JVM_ENTRY(jlong, jmm_GetOneThreadAllocatedMemory(JNIEnv *env, jlong thread_id)) } if (thread_id == 0) { // current thread - return thread->cooked_allocated_bytes(); + return checked_cast(thread->cooked_allocated_bytes()); } ThreadsListHandle tlh; JavaThread* java_thread = tlh.list()->find_JavaThread_from_java_tid(thread_id); if (is_platform_thread(java_thread)) { - return java_thread->cooked_allocated_bytes(); + return checked_cast(java_thread->cooked_allocated_bytes()); } return -1; JVM_END diff --git a/src/hotspot/share/services/memoryService.cpp b/src/hotspot/share/services/memoryService.cpp index cd53f44e053..f64da3c5477 100644 --- a/src/hotspot/share/services/memoryService.cpp +++ b/src/hotspot/share/services/memoryService.cpp @@ -66,7 +66,13 @@ void GcThreadCountClosure::do_thread(Thread* thread) { _count++; } -void MemoryService::set_universe_heap(CollectedHeap* heap) { +void MemoryService::initialize(CollectedHeap* heap) { + // Prepare metaspace pools + add_metaspace_memory_pools(); + + // Ask heap to initialize its memory pools/managers + heap->initialize_serviceability(); + ResourceMark rm; // For internal allocations in GrowableArray. GrowableArray gc_mem_pools = heap->memory_pools(); diff --git a/src/hotspot/share/services/memoryService.hpp b/src/hotspot/share/services/memoryService.hpp index d10c3d2e9d9..1a947ec1d0c 100644 --- a/src/hotspot/share/services/memoryService.hpp +++ b/src/hotspot/share/services/memoryService.hpp @@ -60,7 +60,7 @@ private: static MemoryPool* _compressed_class_pool; public: - static void set_universe_heap(CollectedHeap* heap); + static void initialize(CollectedHeap* heap); static void add_code_heap_memory_pool(CodeHeap* heap, const char* name); static void add_metaspace_memory_pools(); diff --git a/src/hotspot/share/services/threadService.cpp b/src/hotspot/share/services/threadService.cpp index 4dc6abe54b7..4f511075967 100644 --- a/src/hotspot/share/services/threadService.cpp +++ b/src/hotspot/share/services/threadService.cpp @@ -74,7 +74,7 @@ PerfVariable* ThreadService::_daemon_threads_count = nullptr; volatile int ThreadService::_atomic_threads_count = 0; volatile int ThreadService::_atomic_daemon_threads_count = 0; -volatile jlong ThreadService::_exited_allocated_bytes = 0; +volatile uint64_t ThreadService::_exited_allocated_bytes = 0; ThreadDumpResult* ThreadService::_threaddump_list = nullptr; diff --git a/src/hotspot/share/services/threadService.hpp b/src/hotspot/share/services/threadService.hpp index 4b0e76658b6..ddfc78e6315 100644 --- a/src/hotspot/share/services/threadService.hpp +++ b/src/hotspot/share/services/threadService.hpp @@ -63,7 +63,7 @@ private: // As could this... // Number of heap bytes allocated by terminated threads. - static volatile jlong _exited_allocated_bytes; + static volatile uint64_t _exited_allocated_bytes; // These 2 counters are like the above thread counts, but are // atomically decremented in ThreadService::current_thread_exiting instead of @@ -106,8 +106,8 @@ public: 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 AtomicAccess::load(&_exited_allocated_bytes); } - static void incr_exited_allocated_bytes(jlong size) { + static uint64_t exited_allocated_bytes() { return AtomicAccess::load(&_exited_allocated_bytes); } + static void incr_exited_allocated_bytes(uint64_t size) { // No need for an atomic add because called under the Threads_lock, // but because _exited_allocated_bytes is read concurrently, need // atomic store to avoid readers seeing a partial update. diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index 54602297759..9560d863a2c 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -168,6 +168,29 @@ class oopDesc; #define SIZE_FORMAT_X_0 "0x%08" PRIxPTR #endif // _LP64 + +template +constexpr auto sizeof_auto_impl() { + if constexpr (N <= std::numeric_limits::max()) return uint8_t(N); + else if constexpr (N <= std::numeric_limits::max()) return uint16_t(N); + else if constexpr (N <= std::numeric_limits::max()) return uint32_t(N); + else return uint64_t(N); +} + +// Yields the size (in bytes) of the operand, using the smallest +// unsigned type that can represent the size value. The operand may be +// an expression, which is an unevaluated operand, or it may be a +// type. All of the restrictions for sizeof operands apply to the +// operand. The result is a constant expression. +// +// Example of correct usage of sizeof/sizeof_auto: +// // this will wrap using sizeof_auto, use sizeof to ensure computation using size_t +// size_t size = std::numeric_limits::max() * sizeof(uint16_t); +// // implicit narrowing conversion or compiler warning/error using stricter compiler flags when using sizeof +// int count = 42 / sizeof_auto(uint16_t); + +#define sizeof_auto(...) sizeof_auto_impl() + // Convert pointer to intptr_t, for use in printing pointers. inline intptr_t p2i(const volatile void* p) { return (intptr_t) p; @@ -433,7 +456,8 @@ typedef unsigned char u_char; typedef u_char* address; typedef const u_char* const_address; -// Pointer subtraction. +// Pointer subtraction, calculating high - low. Asserts on underflow. +// // The idea here is to avoid ptrdiff_t, which is signed and so doesn't have // the range we might need to find differences from one end of the heap // to the other. @@ -444,28 +468,28 @@ typedef const u_char* const_address; // and then additions like // ... top() + size ... // are safe because we know that top() is at least size below end(). -inline size_t pointer_delta(const volatile void* left, - const volatile void* right, +inline size_t pointer_delta(const volatile void* high, + const volatile void* low, size_t element_size) { - assert(left >= right, "avoid underflow - left: " PTR_FORMAT " right: " PTR_FORMAT, p2i(left), p2i(right)); - return (((uintptr_t) left) - ((uintptr_t) right)) / element_size; + assert(high >= low, "avoid underflow - high address: " PTR_FORMAT " low address: " PTR_FORMAT, p2i(high), p2i(low)); + return (((uintptr_t) high) - ((uintptr_t) low)) / element_size; } // A version specialized for HeapWord*'s. -inline size_t pointer_delta(const HeapWord* left, const HeapWord* right) { - return pointer_delta(left, right, sizeof(HeapWord)); +inline size_t pointer_delta(const HeapWord* high, const HeapWord* low) { + return pointer_delta(high, low, sizeof(HeapWord)); } // A version specialized for MetaWord*'s. -inline size_t pointer_delta(const MetaWord* left, const MetaWord* right) { - return pointer_delta(left, right, sizeof(MetaWord)); +inline size_t pointer_delta(const MetaWord* high, const MetaWord* low) { + return pointer_delta(high, low, sizeof(MetaWord)); } // pointer_delta_as_int is called to do pointer subtraction for nearby pointers that // returns a non-negative int, usually used as a size of a code buffer range. // This scales to sizeof(T). template -inline int pointer_delta_as_int(const volatile T* left, const volatile T* right) { - size_t delta = pointer_delta(left, right, sizeof(T)); +inline int pointer_delta_as_int(const volatile T* high, const volatile T* low) { + size_t delta = pointer_delta(high, low, sizeof(T)); assert(delta <= size_t(INT_MAX), "pointer delta out of range: %zu", delta); return static_cast(delta); } diff --git a/src/hotspot/share/utilities/rbTree.hpp b/src/hotspot/share/utilities/rbTree.hpp index a2f84ac2373..c522d787466 100644 --- a/src/hotspot/share/utilities/rbTree.hpp +++ b/src/hotspot/share/utilities/rbTree.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,9 +26,8 @@ #define SHARE_UTILITIES_RBTREE_HPP #include "cppstdlib/type_traits.hpp" -#include "metaprogramming/enableIf.hpp" +#include "memory/allocation.hpp" #include "nmt/memTag.hpp" -#include "runtime/os.hpp" #include "utilities/globalDefinitions.hpp" // An intrusive red-black tree is constructed with two template parameters: @@ -64,8 +63,9 @@ enum class RBTreeOrdering : int { LT, EQ, GT }; template class AbstractRBTree; - +class Arena; class outputStream; +class ResourceArea; class IntrusiveRBNode { template @@ -81,7 +81,7 @@ class IntrusiveRBNode { DEBUG_ONLY(mutable bool _visited); public: - IntrusiveRBNode() : _parent(0), _left(nullptr), _right(nullptr) DEBUG_ONLY(COMMA _visited(false)) {} + IntrusiveRBNode(); // Gets the previous in-order node in the tree. // nullptr is returned if there is no previous node. @@ -96,22 +96,18 @@ public: void print_on(outputStream* st, int depth = 0) const; private: - bool is_black() const { return (_parent & 0x1) != 0; } - bool is_red() const { return (_parent & 0x1) == 0; } + bool is_black() const; + bool is_red() const; - void set_black() { _parent |= 0x1; } - void set_red() { _parent &= ~0x1; } + void set_black(); + void set_red(); - IntrusiveRBNode* parent() const { return (IntrusiveRBNode*)(_parent & ~0x1); } - void set_parent(IntrusiveRBNode* new_parent) { _parent = (_parent & 0x1) | (uintptr_t)new_parent; } + IntrusiveRBNode* parent() const; + void set_parent(IntrusiveRBNode* new_parent); - bool is_right_child() const { - return parent() != nullptr && parent()->_right == this; - } + bool is_right_child() const; - bool is_left_child() const { - return parent() != nullptr && parent()->_left == this; - } + bool is_left_child() const; void replace_child(IntrusiveRBNode* old_child, IntrusiveRBNode* new_child); @@ -142,20 +138,20 @@ private: V _value; public: - const K& key() const { return _key; } + const K& key() const; - V& val() { return _value; } - const V& val() const { return _value; } - void set_val(const V& v) { _value = v; } + V& val(); + const V& val() const; + void set_val(const V& v); - RBNode() {} - RBNode(const K& key) : IntrusiveRBNode(), _key(key) {} - RBNode(const K& key, const V& val) : IntrusiveRBNode(), _key(key), _value(val) {} + RBNode(); + RBNode(const K& key); + RBNode(const K& key, const V& val); - const RBNode* prev() const { return (RBNode*)IntrusiveRBNode::prev(); } - const RBNode* next() const { return (RBNode*)IntrusiveRBNode::next(); } - RBNode* prev() { return (RBNode*)IntrusiveRBNode::prev(); } - RBNode* next() { return (RBNode*)IntrusiveRBNode::next(); } + const RBNode* prev() const; + const RBNode* next() const; + RBNode* prev(); + RBNode* next(); void print_on(outputStream* st, int depth = 0) const; @@ -176,17 +172,15 @@ public: friend AbstractRBTree; NodeType** _insert_location; NodeType* _parent; - Cursor() : _insert_location(nullptr), _parent(nullptr) {} - Cursor(NodeType** insert_location, NodeType* parent) - : _insert_location(insert_location), _parent(parent) {} - Cursor(NodeType* const* insert_location, NodeType* parent) - : _insert_location((NodeType**)insert_location), _parent(parent) {} + Cursor(); + Cursor(NodeType** insert_location, NodeType* parent); + Cursor(NodeType* const* insert_location, NodeType* parent); public: - bool valid() const { return _insert_location != nullptr; } - bool found() const { return *_insert_location != nullptr; } - NodeType* node() { return _insert_location == nullptr ? nullptr : *_insert_location; } - NodeType* node() const { return _insert_location == nullptr ? nullptr : *_insert_location; } + bool valid() const; + bool found() const; + NodeType* node(); + NodeType* node() const; }; protected: @@ -212,36 +206,16 @@ private: static constexpr bool HasNodeVerifier = HasNodeVerifierImpl::value; - RBTreeOrdering cmp(const K& a, const NodeType* b) const { - if constexpr (HasNodeComparator) { - return COMPARATOR::cmp(a, b); - } else if constexpr (HasKeyComparator) { - return COMPARATOR::cmp(a, b->key()); - } - } + RBTreeOrdering cmp(const K& a, const NodeType* b) const; - bool less_than(const NodeType* a, const NodeType* b) const { - if constexpr (HasNodeVerifier) { - return COMPARATOR::less_than(a, b); - } else { - return true; - } - } + bool less_than(const NodeType* a, const NodeType* b) const; - void assert_key_leq(K a, K b) const { - if constexpr (HasKeyComparator) { // Cannot assert if no key comparator exist. - assert(COMPARATOR::cmp(a, b) != RBTreeOrdering::GT, "key a must be less or equal to key b"); - } - } + void assert_key_leq(K a, K b) const; // True if node is black (nil nodes count as black) - static inline bool is_black(const IntrusiveRBNode* node) { - return node == nullptr || node->is_black(); - } + static inline bool is_black(const IntrusiveRBNode* node); - static inline bool is_red(const IntrusiveRBNode* node) { - return node != nullptr && node->is_red(); - } + static inline bool is_red(const IntrusiveRBNode* node); void fix_insert_violations(IntrusiveRBNode* node); @@ -251,18 +225,14 @@ private: void remove_from_tree(IntrusiveRBNode* node); struct empty_verifier { - bool operator()(const NodeType* n) const { - return true; - } + bool operator()(const NodeType* n) const; }; template void verify_self(NODE_VERIFIER verifier, const USER_VERIFIER& extra_verifier) const; struct default_printer { - void operator()(outputStream* st, const NodeType* n, int depth) const { - n->print_on(st, depth); - } + void operator()(outputStream* st, const NodeType* n, int depth) const; }; template @@ -271,12 +241,9 @@ private: public: NONCOPYABLE(AbstractRBTree); - AbstractRBTree() : _num_nodes(0), _root(nullptr) DEBUG_ONLY(COMMA _expected_visited(false)) { - static_assert(std::is_trivially_destructible::value, "key type must be trivially destructable"); - static_assert(HasKeyComparator || HasNodeComparator, "comparator must be of correct type"); - } + AbstractRBTree(); - size_t size() const { return _num_nodes; } + size_t size() const; // Gets the cursor associated with the given node or key. Cursor cursor(const K& key, const NodeType* hint_node = nullptr); @@ -311,87 +278,39 @@ public: void replace_at_cursor(NodeType* new_node, const Cursor& node_cursor); // Finds the node associated with the given key. - NodeType* find_node(const K& key, const NodeType* hint_node = nullptr) const { - Cursor node_cursor = cursor(key, hint_node); - return node_cursor.node(); - } - - NodeType* find_node(const K& key, const NodeType* hint_node = nullptr) { - Cursor node_cursor = cursor(key, hint_node); - return node_cursor.node(); - } + NodeType* find_node(const K& key, const NodeType* hint_node = nullptr); + NodeType* find_node(const K& key, const NodeType* hint_node = nullptr) const; // Inserts the given node into the tree. - void insert(const K& key, NodeType* node, const NodeType* hint_node = nullptr) { - Cursor node_cursor = cursor(key, hint_node); - insert_at_cursor(node, node_cursor); - } + void insert(const K& key, NodeType* node, const NodeType* hint_node = nullptr); - void remove(NodeType* node) { - Cursor node_cursor = cursor(node); - remove_at_cursor(node_cursor); - } + // Removes the given node from the tree. + void remove(NodeType* node); // Finds the node with the closest key <= the given key. // If no node is found, null is returned instead. - NodeType* closest_leq(const K& key) const { - Cursor node_cursor = cursor(key); - return node_cursor.found() ? node_cursor.node() : prev(node_cursor).node(); - } - - NodeType* closest_leq(const K& key) { - Cursor node_cursor = cursor(key); - return node_cursor.found() ? node_cursor.node() : prev(node_cursor).node(); - } + NodeType* closest_leq(const K& key); + NodeType* closest_leq(const K& key) const; // Finds the node with the closest key > the given key. // If no node is found, null is returned instead. - NodeType* closest_gt(const K& key) const { - Cursor node_cursor = cursor(key); - return next(node_cursor).node(); - } - - NodeType* closest_gt(const K& key) { - Cursor node_cursor = cursor(key); - return next(node_cursor).node(); - } + NodeType* closest_gt(const K& key); + NodeType* closest_gt(const K& key) const; // Finds the node with the closest key >= the given key. // If no node is found, null is returned instead. - NodeType* closest_ge(const K& key) const { - Cursor node_cursor = cursor(key); - return node_cursor.found() ? node_cursor.node() : next(node_cursor).node(); - } - - NodeType* closest_ge(const K& key) { - Cursor node_cursor = cursor(key); - return node_cursor.found() ? node_cursor.node() : next(node_cursor).node(); - } + NodeType* closest_ge(const K& key); + NodeType* closest_ge(const K& key) const; // Returns leftmost node, nullptr if tree is empty. // If COMPARATOR::cmp(a, b) behaves canonically (positive value for a > b), this will the smallest key value. - const NodeType* leftmost() const { - IntrusiveRBNode* n = _root, *n2 = nullptr; - while (n != nullptr) { - n2 = n; - n = n->_left; - } - return (NodeType*)n2; - } + NodeType* leftmost(); + const NodeType* leftmost() const; // Returns rightmost node, nullptr if tree is empty. // If COMPARATOR::cmp(a, b) behaves canonically (positive value for a > b), this will the largest key value. - const NodeType* rightmost() const { - IntrusiveRBNode* n = _root, *n2 = nullptr; - while (n != nullptr) { - n2 = n; - n = n->_right; - } - return (NodeType*)n2; - } - - NodeType* leftmost() { return const_cast(static_cast(this)->leftmost()); } - NodeType* rightmost() { return const_cast(static_cast(this)->rightmost()); } + NodeType* rightmost(); + const NodeType* rightmost() const; struct Range { NodeType* start; @@ -403,11 +322,7 @@ public: // Return the range [start, end) // where start->key() <= addr < end->key(). // Failure to find the range leads to start and/or end being null. - Range find_enclosing_range(K key) const { - NodeType* start = closest_leq(key); - NodeType* end = closest_gt(key); - return Range(start, end); - } + Range find_enclosing_range(K key) const; // Visit all RBNodes in ascending order, calling f on each node. // If f returns `true` the iteration continues, otherwise it is stopped at the current node. @@ -417,7 +332,6 @@ public: template void visit_in_order(F f); - // Visit all RBNodes in ascending order whose keys are in range [from, to], calling f on each node. // If f returns `true` the iteration continues, otherwise it is stopped at the current node. template @@ -433,15 +347,7 @@ public: // This should return true if the node is valid. // If provided, each node is also verified through this callable. template - void verify_self(const USER_VERIFIER& extra_verifier = USER_VERIFIER()) const { - if constexpr (HasNodeVerifier) { - verify_self([](const NodeType* a, const NodeType* b){ return COMPARATOR::less_than(a, b);}, extra_verifier); - } else if constexpr (HasKeyComparator) { - verify_self([](const NodeType* a, const NodeType* b){ return COMPARATOR::cmp(a->key(), b->key()) == RBTreeOrdering::LT; }, extra_verifier); - } else { - verify_self([](const NodeType*, const NodeType*){ return true;}, extra_verifier); - } - } + void verify_self(const USER_VERIFIER& extra_verifier = USER_VERIFIER()) const; // Accepts an optional printing callable `void node_printer(outputStream* st, const Node* n, int depth)`. // If provided, each node is printed through this callable rather than the default `print_on`. @@ -458,131 +364,82 @@ class RBTree : public AbstractRBTree, COMPARATOR> { ALLOCATOR _allocator; public: - RBTree() : BaseType(), _allocator() {} + template + RBTree(AllocArgs... alloc_args); + ~RBTree(); NONCOPYABLE(RBTree); - ~RBTree() { remove_all(); } bool copy_into(RBTree& other) const; typedef typename BaseType::Cursor Cursor; using BaseType::cursor; using BaseType::insert_at_cursor; - using BaseType::remove_at_cursor; using BaseType::next; using BaseType::prev; - void replace_at_cursor(RBNode* new_node, const Cursor& node_cursor) { - RBNode* old_node = node_cursor.node(); - BaseType::replace_at_cursor(new_node, node_cursor); - free_node(old_node); - } + void remove_at_cursor(const Cursor& node_cursor); + void replace_at_cursor(RBNode* new_node, const Cursor& node_cursor); - RBNode* allocate_node(const K& key) { - void* node_place = _allocator.allocate(sizeof(RBNode)); - if (node_place == nullptr) { - return nullptr; - } - return new (node_place) RBNode(key); - } + RBNode* allocate_node(const K& key); + RBNode* allocate_node(const K& key, const V& val); - RBNode* allocate_node(const K& key, const V& val) { - void* node_place = _allocator.allocate(sizeof(RBNode)); - if (node_place == nullptr) { - return nullptr; - } - return new (node_place) RBNode(key, val); - } - - void free_node(RBNode* node) { - node->_value.~V(); - _allocator.free(node); - } + void free_node(RBNode* node); // Inserts a node with the given key/value into the tree, // if the key already exist, the value is updated instead. // Returns false if and only if allocation of a new node failed. - bool upsert(const K& key, const V& val, const RBNode* hint_node = nullptr) { - Cursor node_cursor = cursor(key, hint_node); - RBNode* node = node_cursor.node(); - if (node != nullptr) { - node->set_val(val); - return true; - } - - node = allocate_node(key, val); - if (node == nullptr) { - return false; - } - insert_at_cursor(node, node_cursor); - return true; - } + bool upsert(const K& key, const V& val, const RBNode* hint_node = nullptr); // Finds the value of the node associated with the given key. - V* find(const K& key) { - Cursor node_cursor = cursor(key); - return node_cursor.found() ? &node_cursor.node()->_value : nullptr; - } + V* find(const K& key); + V* find(const K& key) const; - V* find(const K& key) const { - const Cursor node_cursor = cursor(key); - return node_cursor.found() ? &node_cursor.node()->_value : nullptr; - } - - void remove(RBNode* node) { - Cursor node_cursor = cursor(node); - remove_at_cursor(node_cursor); - free_node(node); - } + void remove(RBNode* node); // Removes the node with the given key from the tree if it exists. // Returns true if the node was successfully removed, false otherwise. - bool remove(const K& key) { - Cursor node_cursor = cursor(key); - if (!node_cursor.found()) { - return false; - } - RBNode* node = node_cursor.node(); - remove_at_cursor(node_cursor); - free_node((RBNode*)node); - return true; - } + bool remove(const K& key); // Removes all existing nodes from the tree. - void remove_all() { - IntrusiveRBNode* to_delete[64]; - int stack_idx = 0; - to_delete[stack_idx++] = BaseType::_root; - - while (stack_idx > 0) { - IntrusiveRBNode* head = to_delete[--stack_idx]; - if (head == nullptr) continue; - to_delete[stack_idx++] = head->_left; - to_delete[stack_idx++] = head->_right; - free_node((RBNode*)head); - } - BaseType::_num_nodes = 0; - BaseType::_root = nullptr; - } + void remove_all(); }; template class RBTreeCHeapAllocator { public: - void* allocate(size_t sz) { - void* allocation = os::malloc(sz, mem_tag); - if (allocation == nullptr && strategy == AllocFailStrategy::EXIT_OOM) { - vm_exit_out_of_memory(sz, OOM_MALLOC_ERROR, - "red-black tree failed allocation"); - } - return allocation; - } - - void free(void* ptr) { os::free(ptr); } + void* allocate(size_t sz); + void free(void* ptr); }; +template +class RBTreeArenaAllocator { + Arena* _arena; +public: + RBTreeArenaAllocator(Arena* arena); + void* allocate(size_t sz); + void free(void* ptr); +}; + +template +class RBTreeResourceAreaAllocator { + ResourceArea* _rarea; +public: + RBTreeResourceAreaAllocator(ResourceArea* rarea); + void* allocate(size_t sz); + void free(void* ptr); +}; + + + template using RBTreeCHeap = RBTree>; +template +using RBTreeArena = RBTree>; + +template +using RBTreeResourceArea = RBTree>; + template using IntrusiveRBTree = AbstractRBTree; diff --git a/src/hotspot/share/utilities/rbTree.inline.hpp b/src/hotspot/share/utilities/rbTree.inline.hpp index 6e01f92d12a..381cb916405 100644 --- a/src/hotspot/share/utilities/rbTree.inline.hpp +++ b/src/hotspot/share/utilities/rbTree.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,12 +27,49 @@ #include "utilities/rbTree.hpp" +#include "memory/allocation.hpp" +#include "memory/arena.hpp" +#include "memory/resourceArea.hpp" #include "metaprogramming/enableIf.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" #include "utilities/powerOfTwo.hpp" +inline IntrusiveRBNode::IntrusiveRBNode() + : _parent(0), _left(nullptr), _right(nullptr) DEBUG_ONLY(COMMA _visited(false)) {} + +inline bool IntrusiveRBNode::is_black() const { + return (_parent & 0x1) != 0; +} + +inline bool IntrusiveRBNode::is_red() const { + return (_parent & 0x1) == 0; +} + +inline void IntrusiveRBNode::set_black() { + _parent |= 0x1; +} +inline void IntrusiveRBNode::set_red() { + _parent &= ~0x1; +} + +inline IntrusiveRBNode* IntrusiveRBNode::parent() const { + return reinterpret_cast(_parent & ~0x1); +} + +inline void IntrusiveRBNode::set_parent(IntrusiveRBNode* new_parent) { + _parent = (_parent & 0x1) | reinterpret_cast(new_parent); +} + +inline bool IntrusiveRBNode::is_right_child() const { + return parent() != nullptr && parent()->_right == this; +} + +inline bool IntrusiveRBNode::is_left_child() const { + return parent() != nullptr && parent()->_left == this; +} + inline void IntrusiveRBNode::replace_child(IntrusiveRBNode* old_child, IntrusiveRBNode* new_child) { if (_left == old_child) { _left = new_child; @@ -185,6 +222,144 @@ inline void IntrusiveRBNode::verify( } +template +inline const K& RBNode::key() const { + return _key; +} + +template +inline V& RBNode::val() { + return _value; +} + +template +inline const V& RBNode::val() const { + return _value; +} + +template +inline void RBNode::set_val(const V& v) { + _value = v; +} + +template +inline RBNode::RBNode() {} + +template +inline RBNode::RBNode(const K& key) : IntrusiveRBNode(), _key(key) {} + +template +inline RBNode::RBNode(const K& key, const V& val) : IntrusiveRBNode(), _key(key), _value(val) {} + +template +inline const RBNode* RBNode::prev() const { + return static_cast*>(IntrusiveRBNode::prev()); +} + +template +inline const RBNode* RBNode::next() const { + return static_cast*>(IntrusiveRBNode::next()); +} + +template +inline RBNode* RBNode::prev() { + return static_cast*>(IntrusiveRBNode::prev()); +} + +template +inline RBNode* RBNode::next() { + return static_cast*>(IntrusiveRBNode::next()); +} + +template +inline AbstractRBTree::Cursor::Cursor() + : _insert_location(nullptr), _parent(nullptr) {} + +template +inline AbstractRBTree::Cursor::Cursor(NodeType** insert_location, NodeType* parent) + : _insert_location(insert_location), _parent(parent) {} + +template +inline AbstractRBTree::Cursor::Cursor(NodeType* const* insert_location, NodeType* parent) + : _insert_location(const_cast(insert_location)), _parent(parent) {} + +template +inline bool AbstractRBTree::Cursor::valid() const { + return _insert_location != nullptr; +} + +template +inline bool AbstractRBTree::Cursor::found() const { + return *_insert_location != nullptr; +} + +template +inline NodeType* AbstractRBTree::Cursor::node() { + return _insert_location == nullptr ? nullptr : *_insert_location; +} + +template +inline NodeType* AbstractRBTree::Cursor::node() const { + return _insert_location == nullptr ? nullptr : *_insert_location; +} + +template +inline RBTreeOrdering AbstractRBTree::cmp(const K& a, const NodeType* b) const { + if constexpr (HasNodeComparator) { + return COMPARATOR::cmp(a, b); + } else if constexpr (HasKeyComparator) { + return COMPARATOR::cmp(a, b->key()); + } +} + +template +inline bool AbstractRBTree::less_than(const NodeType* a, const NodeType* b) const { + if constexpr (HasNodeVerifier) { + return COMPARATOR::less_than(a, b); + } else { + return true; + } +} + +template +inline void AbstractRBTree::assert_key_leq(K a, K b) const { + if constexpr (HasKeyComparator) { // Cannot assert if no key comparator exist. + assert(COMPARATOR::cmp(a, b) != RBTreeOrdering::GT, "key a must be less or equal to key b"); + } +} + +template +inline bool AbstractRBTree::is_black(const IntrusiveRBNode* node) { + return node == nullptr || node->is_black(); +} + +template +inline bool AbstractRBTree::is_red(const IntrusiveRBNode* node) { + return node != nullptr && node->is_red(); +} + +template +inline bool AbstractRBTree::empty_verifier::operator()(const NodeType* n) const { + return true; +} + +template +inline void AbstractRBTree::default_printer::operator()(outputStream* st, const NodeType* n, int depth) const { + n->print_on(st, depth); +} + +template +inline AbstractRBTree::AbstractRBTree() + : _num_nodes(0), _root(nullptr) DEBUG_ONLY(COMMA _expected_visited(false)) { + static_assert(std::is_trivially_destructible::value, "key type must be trivially destructable"); + static_assert(HasKeyComparator || HasNodeComparator, "comparator must be of correct type"); +} + +template +inline size_t AbstractRBTree::size() const { + return _num_nodes; +} + template inline const typename AbstractRBTree::Cursor AbstractRBTree::cursor(const K& key, const NodeType* hint_node) const { @@ -233,7 +408,9 @@ AbstractRBTree::cursor(const K& key, const NodeType* hi template inline void AbstractRBTree::insert_at_cursor(NodeType* node, const Cursor& node_cursor) { - assert(node_cursor.valid() && !node_cursor.found(), "must be"); + precond(node != nullptr); + precond(node_cursor.valid()); + precond(!node_cursor.found()); _num_nodes++; *node_cursor._insert_location = node; @@ -447,7 +624,8 @@ inline void AbstractRBTree::remove_from_tree(IntrusiveR template inline void AbstractRBTree::remove_at_cursor(const Cursor& node_cursor) { - assert(node_cursor.valid() && node_cursor.found(), "must be"); + precond(node_cursor.valid()); + precond(node_cursor.found()); _num_nodes--; IntrusiveRBNode* node = node_cursor.node(); @@ -543,7 +721,9 @@ AbstractRBTree::prev(const Cursor& node_cursor) const { template inline void AbstractRBTree::replace_at_cursor(NodeType* new_node, const Cursor& node_cursor) { - assert(node_cursor.valid() && node_cursor.found(), "must be"); + precond(new_node != nullptr); + precond(node_cursor.valid()); + precond(node_cursor.found()); NodeType* old_node = node_cursor.node(); if (old_node == new_node) { return; @@ -596,6 +776,106 @@ AbstractRBTree::prev(const Cursor& node_cursor) { return static_cast*>(this)->prev(node_cursor); } +template +inline NodeType* AbstractRBTree::find_node(const K& key, const NodeType* hint_node) const { + Cursor node_cursor = cursor(key, hint_node); + return node_cursor.node(); +} + +template +inline NodeType* AbstractRBTree::find_node(const K& key, const NodeType* hint_node) { + Cursor node_cursor = cursor(key, hint_node); + return node_cursor.node(); +} + +template +inline void AbstractRBTree::insert(const K& key, NodeType* node, const NodeType* hint_node) { + precond(node != nullptr); + Cursor node_cursor = cursor(key, hint_node); + insert_at_cursor(node, node_cursor); +} + +template +inline void AbstractRBTree::remove(NodeType* node) { + precond(node != nullptr); + Cursor node_cursor = cursor(node); + remove_at_cursor(node_cursor); +} + +template +inline NodeType* AbstractRBTree::closest_leq(const K& key) const { + Cursor node_cursor = cursor(key); + return node_cursor.found() ? node_cursor.node() : prev(node_cursor).node(); +} + +template +inline NodeType* AbstractRBTree::closest_leq(const K& key) { + Cursor node_cursor = cursor(key); + return node_cursor.found() ? node_cursor.node() : prev(node_cursor).node(); +} + +template +inline NodeType* AbstractRBTree::closest_gt(const K& key) const { + Cursor node_cursor = cursor(key); + return next(node_cursor).node(); +} + +template +inline NodeType* AbstractRBTree::closest_gt(const K& key) { + Cursor node_cursor = cursor(key); + return next(node_cursor).node(); +} + +template +inline NodeType* AbstractRBTree::closest_ge(const K& key) const { + Cursor node_cursor = cursor(key); + return node_cursor.found() ? node_cursor.node() : next(node_cursor).node(); +} + +template +inline NodeType* AbstractRBTree::closest_ge(const K& key) { + Cursor node_cursor = cursor(key); + return node_cursor.found() ? node_cursor.node() : next(node_cursor).node(); +} + +template +inline const NodeType* AbstractRBTree::leftmost() const { + IntrusiveRBNode* n = _root, *n2 = nullptr; + while (n != nullptr) { + n2 = n; + n = n->_left; + } + return static_cast(n2); +} + +template +inline const NodeType* AbstractRBTree::rightmost() const { + IntrusiveRBNode* n = _root, *n2 = nullptr; + while (n != nullptr) { + n2 = n; + n = n->_right; + } + return static_cast(n2); +} + +template +inline NodeType* AbstractRBTree::leftmost() { + return const_cast(static_cast*>(this)->leftmost()); +} + +template +inline NodeType* AbstractRBTree::rightmost() { + return const_cast(static_cast*>(this)->rightmost()); +} + +template +inline typename AbstractRBTree::Range +AbstractRBTree::find_enclosing_range(K key) const { + NodeType* start = closest_leq(key); + NodeType* end = closest_gt(key); + return Range(start, end); +} + template template inline void AbstractRBTree::visit_in_order(F f) const { @@ -662,6 +942,18 @@ inline void AbstractRBTree::visit_range_in_order(const } } +template +template +inline void AbstractRBTree::verify_self(const USER_VERIFIER& extra_verifier) const { + if constexpr (HasNodeVerifier) { + verify_self([](const NodeType* a, const NodeType* b){ return COMPARATOR::less_than(a, b);}, extra_verifier); + } else if constexpr (HasKeyComparator) { + verify_self([](const NodeType* a, const NodeType* b){ return COMPARATOR::cmp(a->key(), b->key()) == RBTreeOrdering::LT; }, extra_verifier); + } else { + verify_self([](const NodeType*, const NodeType*){ return true;}, extra_verifier); + } +} + template template inline void AbstractRBTree::verify_self(NODE_VERIFIER verifier, const USER_VERIFIER& extra_verifier) const { @@ -753,11 +1045,20 @@ void AbstractRBTree::print_on(outputStream* st, const P } } +template +template +inline RBTree::RBTree(AllocArgs... alloc_args) : BaseType(), _allocator(alloc_args...) {} + +template +inline RBTree::~RBTree() { + remove_all(); +} + template bool RBTree::copy_into(RBTree& other) const { - assert(other.size() == 0, "You can only copy into an empty RBTree"); - assert(std::is_copy_constructible::value, "Key type must be copy-constructible when copying a RBTree"); - assert(std::is_copy_constructible::value, "Value type must be copy-constructible when copying a RBTree"); + precond(other.size() == 0); + precond(std::is_copy_constructible::value); + precond(std::is_copy_constructible::value); enum class Dir { Left, Right }; struct node_pair { const IntrusiveRBNode* current; IntrusiveRBNode* other_parent; Dir dir; }; struct stack { @@ -802,4 +1103,145 @@ bool RBTree::copy_into(RBTree& other) const { return true; } +template +inline void RBTree::remove_at_cursor(const Cursor& node_cursor) { + precond(node_cursor.valid()); + precond(node_cursor.found()); + RBNode* old_node = node_cursor.node(); + BaseType::remove_at_cursor(node_cursor); + free_node(old_node); +} + +template +inline void RBTree::replace_at_cursor(RBNode* new_node, const Cursor& node_cursor) { + precond(new_node != nullptr); + precond(node_cursor.valid()); + precond(node_cursor.found()); + RBNode* old_node = node_cursor.node(); + BaseType::replace_at_cursor(new_node, node_cursor); + free_node(old_node); +} + +template +inline RBNode* RBTree::allocate_node(const K& key) { + void* node_place = _allocator.allocate(sizeof(RBNode)); + if (node_place == nullptr) { + return nullptr; + } + return new (node_place) RBNode(key); +} + +template +inline RBNode* RBTree::allocate_node(const K& key, const V& val) { + void* node_place = _allocator.allocate(sizeof(RBNode)); + if (node_place == nullptr) { + return nullptr; + } + return new (node_place) RBNode(key, val); +} + +template +inline void RBTree::free_node(RBNode* node) { + precond(node != nullptr); + node->_value.~V(); + _allocator.free(node); +} + +template +inline bool RBTree::upsert(const K& key, const V& val, const RBNode* hint_node) { + Cursor node_cursor = cursor(key, hint_node); + RBNode* node = node_cursor.node(); + if (node != nullptr) { + node->set_val(val); + return true; + } + + node = allocate_node(key, val); + if (node == nullptr) { + return false; + } + insert_at_cursor(node, node_cursor); + return true; +} + +template +inline V* RBTree::find(const K& key) { + Cursor node_cursor = cursor(key); + return node_cursor.found() ? &node_cursor.node()->_value : nullptr; +} + +template +inline V* RBTree::find(const K& key) const { + const Cursor node_cursor = cursor(key); + return node_cursor.found() ? &node_cursor.node()->_value : nullptr; +} + +template +inline void RBTree::remove(RBNode* node) { + Cursor node_cursor = cursor(node); + BaseType::remove_at_cursor(node_cursor); + free_node(node); +} + +template +inline bool RBTree::remove(const K& key) { + Cursor node_cursor = cursor(key); + if (!node_cursor.found()) { + return false; + } + RBNode* node = node_cursor.node(); + BaseType::remove_at_cursor(node_cursor); + free_node((RBNode*)node); + return true; +} + +template +inline void RBTree::remove_all() { + IntrusiveRBNode* to_delete[64]; + int stack_idx = 0; + to_delete[stack_idx++] = BaseType::_root; + + while (stack_idx > 0) { + IntrusiveRBNode* head = to_delete[--stack_idx]; + if (head == nullptr) continue; + to_delete[stack_idx++] = head->_left; + to_delete[stack_idx++] = head->_right; + free_node((RBNode*)head); + } + BaseType::_num_nodes = 0; + BaseType::_root = nullptr; +} + +template +inline void* RBTreeCHeapAllocator::allocate(size_t sz) { + return AllocateHeap(sz, mem_tag, strategy); +} + +template +inline void RBTreeCHeapAllocator::free(void* ptr) { + FreeHeap(ptr); +} + +template +inline RBTreeArenaAllocator::RBTreeArenaAllocator(Arena* arena) : _arena(arena) {} + +template +inline void* RBTreeArenaAllocator::allocate(size_t sz) { + return _arena->Amalloc(sz, strategy); +} + +template +inline void RBTreeArenaAllocator::free(void* ptr) { /* NOP */ } + +template +inline RBTreeResourceAreaAllocator::RBTreeResourceAreaAllocator(ResourceArea* rarea) : _rarea(rarea) {} + +template +inline void* RBTreeResourceAreaAllocator::allocate(size_t sz) { + return _rarea->Amalloc(sz, strategy); +} + +template +inline void RBTreeResourceAreaAllocator::free(void* ptr) { /* NOP */ } + #endif // SHARE_UTILITIES_RBTREE_INLINE_HPP diff --git a/src/java.base/macosx/classes/apple/security/KeychainStore.java b/src/java.base/macosx/classes/apple/security/KeychainStore.java index 6f70fccbb24..63dfc39afe1 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, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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,6 +30,8 @@ import java.security.*; import java.security.cert.*; import java.security.cert.Certificate; import java.security.spec.*; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.*; import javax.crypto.*; @@ -114,7 +116,7 @@ abstract sealed class KeychainStore extends KeyStoreSpi { // SecCertificateRef. When we delete the key we have to delete all of the corresponding // native objects. static class KeyEntry { - Date date; // the creation date of this entry + Instant date; // the creation instant of this entry byte[] protectedPrivKey; char[] password; long keyRef; // SecKeyRef for this key @@ -124,7 +126,7 @@ abstract sealed class KeychainStore extends KeyStoreSpi { // Trusted certificates static class TrustedCertEntry { - Date date; // the creation date of this entry + Instant date; // the creation instant of this entry Certificate cert; long certRef; // SecCertificateRef for this key @@ -405,13 +407,32 @@ abstract sealed class KeychainStore extends KeyStoreSpi { * not exist */ public Date engineGetCreationDate(String alias) { - Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); + final Instant instant = this.engineGetCreationInstant(alias); + if (instant == null) { + return null; + } + return Date.from(instant); + } + + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @since 27 + */ + public Instant engineGetCreationInstant(String alias) { + final Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); if (entry != null) { - if (entry instanceof TrustedCertEntry) { - return new Date(((TrustedCertEntry)entry).date.getTime()); + if (entry instanceof TrustedCertEntry trustedCertEntry) { + return trustedCertEntry.date; } else { - return new Date(((KeyEntry)entry).date.getTime()); + return ((KeyEntry)entry).date; } } else { return null; @@ -447,7 +468,7 @@ abstract sealed class KeychainStore extends KeyStoreSpi { synchronized(entries) { try { KeyEntry entry = new KeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); if (key instanceof PrivateKey) { if ((key.getFormat().equals("PKCS#8")) || @@ -525,7 +546,7 @@ abstract sealed class KeychainStore extends KeyStoreSpi { + "EncryptedPrivateKeyInfo"); } - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); if ((chain != null) && (chain.length != 0)) { @@ -927,9 +948,9 @@ abstract sealed class KeychainStore extends KeyStoreSpi { // Make a creation date. if (creationDate != 0) - tce.date = new Date(creationDate); + tce.date = Instant.ofEpochMilli(creationDate); else - tce.date = new Date(); + tce.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); entries.put(alias.toLowerCase(Locale.ROOT), tce); } catch (Exception e) { @@ -952,9 +973,9 @@ abstract sealed class KeychainStore extends KeyStoreSpi { // Make a creation date. if (creationDate != 0) - ke.date = new Date(creationDate); + ke.date = Instant.ofEpochMilli(creationDate); else - ke.date = new Date(); + ke.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); // Next, create X.509 Certificate objects from the raw data. This is complicated // because a certificate's public key may be too long for Java's default encryption strength. diff --git a/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java b/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java index ad98653b9c2..1e45a4e6a20 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/JceKeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,8 @@ import sun.security.util.Debug; import sun.security.util.IOUtils; import java.io.*; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.*; import java.security.DigestInputStream; import java.security.DigestOutputStream; @@ -70,14 +72,14 @@ public final class JceKeyStore extends KeyStoreSpi { // Private key and supporting certificate chain private static final class PrivateKeyEntry { - Date date; // the creation date of this entry + Instant date; // the creation date of this entry byte[] protectedKey; Certificate[] chain; } // Secret key private static final class SecretKeyEntry { - Date date; // the creation date of this entry + Instant date; // the creation date of this entry SealedObject sealedKey; // Maximum possible length of sealedKey. Used to detect malicious @@ -89,7 +91,7 @@ public final class JceKeyStore extends KeyStoreSpi { // Trusted certificate private static final class TrustedCertEntry { - Date date; // the creation date of this entry + Instant date; // the creation date of this entry Certificate cert; } @@ -213,23 +215,38 @@ public final class JceKeyStore extends KeyStoreSpi { * not exist */ public Date engineGetCreationDate(String alias) { - Date date = null; + final Instant instant = this.engineGetCreationInstant(alias); + if (instant == null) { + return null; + } + return Date.from(instant); + } - Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH)); + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @since 27 + */ + public Instant engineGetCreationInstant(String alias) { + final Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH)); if (entry != null) { - // We have to create a new instance of java.util.Date because - // dates are not immutable if (entry instanceof TrustedCertEntry) { - date = new Date(((TrustedCertEntry)entry).date.getTime()); + return ((TrustedCertEntry)entry).date; } else if (entry instanceof PrivateKeyEntry) { - date = new Date(((PrivateKeyEntry)entry).date.getTime()); + return ((PrivateKeyEntry)entry).date; } else { - date = new Date(((SecretKeyEntry)entry).date.getTime()); + return ((SecretKeyEntry)entry).date; } + } else { + return null; } - - return date; } /** @@ -264,7 +281,7 @@ public final class JceKeyStore extends KeyStoreSpi { if (key instanceof PrivateKey) { PrivateKeyEntry entry = new PrivateKeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); // protect the private key entry.protectedKey = keyProtector.protect((PrivateKey)key); @@ -282,7 +299,7 @@ public final class JceKeyStore extends KeyStoreSpi { } else { SecretKeyEntry entry = new SecretKeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); // seal and store the key entry.sealedKey = keyProtector.seal(key); @@ -325,7 +342,7 @@ public final class JceKeyStore extends KeyStoreSpi { // We assume it's a private key, because there is no standard // (ASN.1) encoding format for wrapped secret keys PrivateKeyEntry entry = new PrivateKeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); entry.protectedKey = key.clone(); if ((chain != null) && @@ -370,7 +387,7 @@ public final class JceKeyStore extends KeyStoreSpi { TrustedCertEntry trustedCertEntry = new TrustedCertEntry(); trustedCertEntry.cert = cert; - trustedCertEntry.date = new Date(); + trustedCertEntry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); entries.put(alias.toLowerCase(Locale.ENGLISH), trustedCertEntry); } } @@ -588,7 +605,7 @@ public final class JceKeyStore extends KeyStoreSpi { dos.writeUTF(alias); // write the (entry creation) date - dos.writeLong(pentry.date.getTime()); + dos.writeLong(pentry.date.toEpochMilli()); // write the protected private key dos.writeInt(pentry.protectedKey.length); @@ -618,7 +635,9 @@ public final class JceKeyStore extends KeyStoreSpi { dos.writeUTF(alias); // write the (entry creation) date - dos.writeLong(((TrustedCertEntry)entry).date.getTime()); + dos.writeLong( + ((TrustedCertEntry)entry).date.toEpochMilli() + ); // write the trusted certificate encoded = ((TrustedCertEntry)entry).cert.getEncoded(); @@ -635,7 +654,9 @@ public final class JceKeyStore extends KeyStoreSpi { dos.writeUTF(alias); // write the (entry creation) date - dos.writeLong(((SecretKeyEntry)entry).date.getTime()); + dos.writeLong( + ((SecretKeyEntry)entry).date.toEpochMilli() + ); // write the sealed key oos = new ObjectOutputStream(dos); @@ -753,7 +774,7 @@ public final class JceKeyStore extends KeyStoreSpi { alias = dis.readUTF(); // read the (entry creation) date - entry.date = new Date(dis.readLong()); + entry.date = Instant.ofEpochMilli(dis.readLong()); // read the private key entry.protectedKey = IOUtils.readExactlyNBytes(dis, dis.readInt()); @@ -798,7 +819,7 @@ public final class JceKeyStore extends KeyStoreSpi { alias = dis.readUTF(); // read the (entry creation) date - entry.date = new Date(dis.readLong()); + entry.date = Instant.ofEpochMilli(dis.readLong()); // read the trusted certificate if (xVersion == 2) { @@ -832,7 +853,7 @@ public final class JceKeyStore extends KeyStoreSpi { alias = dis.readUTF(); // read the (entry creation) date - entry.date = new Date(dis.readLong()); + entry.date = Instant.ofEpochMilli(dis.readLong()); // read the sealed key try { diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java index ffda729a45a..33284d86e2d 100644 --- a/src/java.base/share/classes/java/lang/Character.java +++ b/src/java.base/share/classes/java/lang/Character.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -11233,7 +11233,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character is an Emoji; * {@code false} otherwise. - * @spec https://unicode.org/reports/tr51/ Unicode Emoji + * @spec https://www.unicode.org/reports/tr51/ Unicode Emoji * @since 21 */ public static boolean isEmoji(int codePoint) { @@ -11252,7 +11252,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character has the Emoji Presentation * property; {@code false} otherwise. - * @spec https://unicode.org/reports/tr51/ Unicode Emoji + * @spec https://www.unicode.org/reports/tr51/ Unicode Emoji * @since 21 */ public static boolean isEmojiPresentation(int codePoint) { @@ -11271,7 +11271,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character is an Emoji Modifier; * {@code false} otherwise. - * @spec https://unicode.org/reports/tr51/ Unicode Emoji + * @spec https://www.unicode.org/reports/tr51/ Unicode Emoji * @since 21 */ public static boolean isEmojiModifier(int codePoint) { @@ -11290,7 +11290,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character is an Emoji Modifier Base; * {@code false} otherwise. - * @spec https://unicode.org/reports/tr51/ Unicode Emoji + * @spec https://www.unicode.org/reports/tr51/ Unicode Emoji * @since 21 */ public static boolean isEmojiModifierBase(int codePoint) { @@ -11309,7 +11309,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character is an Emoji Component; * {@code false} otherwise. - * @spec https://unicode.org/reports/tr51/ Unicode Emoji + * @spec https://www.unicode.org/reports/tr51/ Unicode Emoji * @since 21 */ public static boolean isEmojiComponent(int codePoint) { @@ -11328,7 +11328,7 @@ class Character implements java.io.Serializable, Comparable, Constabl * @param codePoint the character (Unicode code point) to be tested. * @return {@code true} if the character is an Extended Pictographic; * {@code false} otherwise. - * @spec https://unicode.org/reports/tr51/ Unicode Emoji + * @spec https://www.unicode.org/reports/tr51/ Unicode Emoji * @since 21 */ public static boolean isExtendedPictographic(int codePoint) { diff --git a/src/java.base/share/classes/java/lang/FdLibm.java b/src/java.base/share/classes/java/lang/FdLibm.java index 73e1da46af4..5a6bdc9b94e 100644 --- a/src/java.base/share/classes/java/lang/FdLibm.java +++ b/src/java.base/share/classes/java/lang/FdLibm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -3508,4 +3508,151 @@ final class FdLibm { return iz; } } + + /** + * Return the Inverse Hyperbolic Sine of x + * + * Method : + * + * + * asinh(x) is defined so that asinh(sinh(alpha)) = alpha, -∞ < alpha < ∞ + * and sinh(asinh(x)) = x, -∞ < x < ∞ + * It can be written as asinh(x) = sign(x) * ln(|x| + sqrt(x^2 + 1)), -∞ < x < ∞ + * 1. Replace x by |x| as the function is odd. + * 2. + * asinh(x) := x, if 1+x^2 = 1, + * := sign(x)*(log(x)+ln2)) for large |x|, else + * := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else + * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) + * + * + * + * Special cases: + * only asinh(±0)=±0 is exact for finite x. + * asinh(NaN) is NaN + * asinh(±∞) is ±∞ + */ + static final class Asinh { + private static final double ln2 = 6.93147180559945286227e-01; + private static final double huge = 1.0e300; + + static double compute(double x) { + double t, w; + int hx, ix; + hx = __HI(x); + ix = hx & 0x7fff_ffff; + if (ix >= 0x7ff0_0000) { + return x + x; // x is inf or NaN + } + if (ix < 0x3e30_0000) { // |x| < 2**-28 + if (huge + x > 1.0) { + return x; // return x inexact except 0 + } + } + if (ix > 0x41b0_0000) { // |x| > 2**28 + w = Log.compute(Math.abs(x)) + ln2; + } else if (ix > 0x4000_0000) { // 2**28 > |x| > 2.0 + t = Math.abs(x); + w = Log.compute(2.0 * t + 1.0 / (Sqrt.compute(x * x + 1.0) + t)); + } else { // 2.0 > |x| > 2**-28 + t = x * x; + w = Log1p.compute(Math.abs(x) + t / (1.0 + Sqrt.compute(1.0 + t))); + } + return hx > 0 ? w : -w; + } + } + + /** + * Return the Inverse Hyperbolic Cosine of x + * + * Method : + * + * + * acosh(x) is defined so that acosh(cosh(alpha)) = alpha, -∞ < alpha < ∞ + * and cosh(acosh(x)) = x, 1 <= x < ∞. + * It can be written as acosh(x) = log(x + sqrt(x^2 - 1)), 1 <= x < ∞. + * acosh(x) := log(x)+ln2, if x is large; else + * := log(2x-1/(sqrt(x*x-1)+x)) if x>2; else + * := log1p(t+sqrt(2.0*t+t*t)); where t=x-1. + * + * + * + * Special cases: + * acosh(x) is NaN with signal if x < 1. + * acosh(NaN) is NaN without signal. + */ + static final class Acosh { + private static final double ln2 = 6.93147180559945286227e-01; + + static double compute(double x) { + double t; + int hx; + hx = __HI(x); + if (hx < 0x3ff0_0000) { // x < 1 */ + return (x - x) / (x - x); + } else if (hx >= 0x41b0_0000) { // x > 2**28 + if (hx >= 0x7ff0_0000) { // x is inf of NaN + return x + x; + } else { + return Log.compute(x) + ln2; // acosh(huge) = log(2x) + } + } else if (((hx - 0x3ff0_0000) | __LO(x)) == 0) { + return 0.0; // acosh(1) = 0 + } else if (hx > 0x4000_0000) { // 2**28 > x > 2 + t = x * x; + return Log.compute(2.0 * x - 1.0 / (x + Sqrt.compute(t - 1.0))); + } else { // 1< x <2 + t = x - 1.0; + return Log1p.compute(t + Sqrt.compute(2.0 * t + t * t)); + } + } + } + + /** + * Return the Inverse Hyperbolic Tangent of x + * Method : + * + * + * atanh(x) is defined so that atanh(tanh(alpha)) = alpha, -∞ < alpha < ∞ + * and tanh(atanh(x)) = x, -1 < x < 1; + * It can be written as atanh(x) = 0.5 * log1p(2 * x/(1-x)), -1 < x < 1; + * 1. + * atanh(x) := 0.5 * log1p(2 * x/(1 - x)), if |x| >= 0.5, + * := 0.5 * log1p(2x + 2x * x/(1 - x)), if |x| < 0.5. + * + * + * + * Special cases: + * only atanh(±0)=±0 is exact for finite x. + * atanh(NaN) is NaN + * atanh(±1) is ±∞ + */ + static final class Atanh { + + static double compute(double x) { + double t; + int hx,ix; + int lx; // unsigned + hx = __HI(x); // high word + lx = __LO(x); // low word + ix = hx & 0x7fff_ffff; + if ((ix | ((lx | (-lx)) >>> 31)) > 0x3ff0_0000) { // |x| > 1 + return (x - x) / (x - x); + } + if (ix == 0x3ff0_0000) { + return x / 0.0; + } + if (ix < 0x3e30_0000 && (HUGE + x) > 0.0) { + return x; // x<2**-28 + } + x = __HI(x, ix); // x <- |x| + if (ix < 0x3fe0_0000) { // x < 0.5 + t = x + x; + t = 0.5 * Log1p.compute(t + t * x / (1.0 - x)); + } else { + t = 0.5 * Log1p.compute((x + x) / (1.0 - x)); + } + return hx >= 0 ? t : -t; + } + } } diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java index 55659bed57b..38a5328fa0b 100644 --- a/src/java.base/share/classes/java/lang/Math.java +++ b/src/java.base/share/classes/java/lang/Math.java @@ -108,11 +108,11 @@ import static java.lang.Double.*; * sin}, {@link cos cos}, {@link tan tan}, {@link asin asin}, {@link * acos acos}, {@link atan atan}, {@link exp exp}, {@link expm1 * expm1}, {@link log log}, {@link log10 log10}, {@link log1p log1p}, - * {@link sinh sinh}, {@link cosh cosh}, {@link tanh tanh}, {@link - * hypot hypot}, and {@link pow pow}. (The {@link sqrt sqrt} - * operation is a required part of IEEE 754 from a different section - * of the standard.) The special case behavior of the recommended - * operations generally follows the guidance of the IEEE 754 + * {@link sinh sinh}, {@link cosh cosh}, {@link tanh tanh}, {@link asinh asinh}, + * {@link acosh acosh}, {@link atanh atanh}, {@link hypot hypot}, and {@link pow pow}. + * (The {@link sqrt sqrt} operation is a required part of IEEE 754 + * from a different section of the standard.) The special case behavior + * of the recommended operations generally follows the guidance of the IEEE 754 * standard. However, the {@code pow} method defines different * behavior for some arguments, as noted in its {@linkplain pow * specification}. The IEEE 754 standard defines its operations to be @@ -2758,6 +2758,94 @@ public final class Math { return StrictMath.tanh(x); } + /** + * Returns the inverse hyperbolic sine of a {@code double} value. + * The inverse hyperbolic sine of x is defined to be the function such that + * asinh({@linkplain Math#sinh sinh(x)}) = x for any x. + * Note that both domain and range of the exact asinh are unrestricted. + *

Special cases: + *

    + * + *
  • If the argument is zero, then the result is a zero with the + * same sign as the argument. + * + *
  • If the argument is infinity, then the result is + * infinity with the same sign as the argument. + * + *
  • If the argument is NaN, then the result is NaN. + * + * + *
+ *

The computed result must be within 2.5 ulps of the exact result. + * @param x The number whose inverse hyperbolic sine is to be returned. + * @return The inverse hyperbolic sine of {@code x}. + * @since 27 + */ + public static double asinh(double x) { + return StrictMath.asinh(x); + } + + + + /** + * Returns the inverse hyperbolic cosine of a {@code double} value. + * The inverse hyperbolic cosine of x is defined to be the function such that + * acosh({@linkplain Math#cosh cosh(x)}) = x for any x >= 0. + * Note that range of the exact acosh(x) is >= 0. + *

Special cases: + *

    + * + *
  • If the argument is positive infinity, then the result is + * positive infinity + * + *
  • If the argument less than 1, then the result is NaN. + * + *
  • If the argument is NaN, then the result is NaN. + * + *
  • If the argument is {@code 1.0}, then the result is positive zero. + * + *
+ *

The computed result must be within 2.5 ulps of the exact result. + * @param x The number whose inverse hyperbolic cosine is to be returned. + * @return The inverse hyperbolic cosine of {@code x}. + * @since 27 + */ + public static double acosh(double x) { + return StrictMath.acosh(x); + } + + /** + * Returns the inverse hyperbolic tangent of a {@code double} value. + * The inverse hyperbolic tangent of x is defined to be the function such that + * atanh({@linkplain Math#tanh tanh(x)}) = x for any x. + * Note that the domain of the exact atanh is (-1; 1), the range is unrestricted. + * + *

Special cases: + *

    + * + *
  • If the argument is NaN, then the result is NaN. + * + *
  • If the argument is zero, then the result is a zero with the + * same sign as the argument. + * + *
  • If the argument is {@code +1.0}, then the result is + * positive infinity. + * + *
  • If the argument is {@code -1.0}, then the result is + * negative infinity. + * + *
  • If the argument is greater than {@code 1.0} in magnitude, then the result is NaN. + * + *
+ *

The computed result must be within 2.5 ulps of the exact result. + * @param x The number whose inverse hyperbolic tangent is to be returned. + * @return The inverse hyperbolic tangent of {@code x}. + * @since 27 + */ + public static double atanh(double x) { + return StrictMath.atanh(x); + } + /** * Returns sqrt(x2 +y2) * without intermediate overflow or underflow. diff --git a/src/java.base/share/classes/java/lang/ProcessBuilder.java b/src/java.base/share/classes/java/lang/ProcessBuilder.java index d461818eedf..bc92ea4ee82 100644 --- a/src/java.base/share/classes/java/lang/ProcessBuilder.java +++ b/src/java.base/share/classes/java/lang/ProcessBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -930,6 +930,12 @@ public final class ProcessBuilder * command interpreters, or the standard C library function * {@code system()}. * + * @implNote + * When the process is {@link #start started}, + * if {#code System.out} and/or {#code System.err} have been + * closed in the current process, the corresponding output + * in the subprocess will be discarded. + * * @return this process builder * @since 1.7 */ diff --git a/src/java.base/share/classes/java/lang/Shutdown.java b/src/java.base/share/classes/java/lang/Shutdown.java index 87c4732a5ce..a9d4d6a28a9 100644 --- a/src/java.base/share/classes/java/lang/Shutdown.java +++ b/src/java.base/share/classes/java/lang/Shutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -55,11 +55,10 @@ class Shutdown { private static int currentRunningHook = -1; /* The preceding static fields are protected by this lock */ - private static class Lock { }; - private static Object lock = new Lock(); + private static final Object lock = new Object(); /* Lock object for the native halt method */ - private static Object haltLock = new Lock(); + private static final Object haltLock = new Object(); /** * Add a new system shutdown hook. Checks the shutdown state and diff --git a/src/java.base/share/classes/java/lang/StrictMath.java b/src/java.base/share/classes/java/lang/StrictMath.java index 499fce73aee..a8f67ef58ba 100644 --- a/src/java.base/share/classes/java/lang/StrictMath.java +++ b/src/java.base/share/classes/java/lang/StrictMath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -76,6 +76,7 @@ import jdk.internal.vm.annotation.IntrinsicCandidate; * {@code exp}, {@code log}, {@code log10}, * {@code cbrt}, {@code atan2}, {@code pow}, * {@code sinh}, {@code cosh}, {@code tanh}, + * {@code asinh}, {@code acosh},{@code atanh}, * {@code hypot}, {@code expm1}, and {@code log1p}. * *

@@ -2170,6 +2171,89 @@ public final class StrictMath { return FdLibm.Tanh.compute(x); } + /** + * Returns the inverse hyperbolic sine of a {@code double} value. + * The inverse hyperbolic sine of x is defined to be the function such that + * asinh({@linkplain Math#sinh sinh(x)}) = x for any x. + * Note that both domain and range of the exact asinh are unrestricted. + *

Special cases: + *

    + * + *
  • If the argument is zero, then the result is a zero with the + * same sign as the argument. + * + *
  • If the argument is infinity, then the result is + * infinity with the same sign as the argument. + * + *
  • If the argument is NaN, then the result is NaN. + * + *
+ * @param x The number whose inverse hyperbolic sine is to be returned. + * @return The inverse hyperbolic sine of {@code x}. + * @since 27 + */ + public static double asinh(double x) { + return FdLibm.Asinh.compute(x); + } + + /** + * Returns the inverse hyperbolic cosine of a {@code double} value. + * The inverse hyperbolic cosine of x is defined to be the function such that + * acosh({@linkplain Math#cosh cosh(x)}) = x for any x >= 0. + * Note that range of the exact acosh(x) is >= 0. + *

Special cases: + *

    + * + *
  • If the argument is positive infinity, then the result is + * positive infinity + * + *
  • If the argument less than {@code 1.0}, then the result is NaN. + * + *
  • If the argument is NaN, then the result is NaN. + * + *
  • If the argument is {@code 1.0}, then the result is positive zero. + * + *
+ * @param x The number whose inverse hyperbolic cosine is to be returned. + * @return The inverse hyperbolic cosine of {@code x}. + * @since 27 + */ + public static double acosh(double x) { + return FdLibm.Acosh.compute(x); + } + + /** + * Returns the inverse hyperbolic tangent of a {@code double} value. + * The inverse hyperbolic tangent of x is defined to be the function such that + * atanh({@linkplain Math#tanh tanh(x)}) = x for any x. + * Note that the domain of the exact atanh is (-1; 1), the range is unrestricted. + * + *

Special cases: + *

    + * + *
  • If the argument is NaN, then the result is NaN. + * + *
  • If the argument is zero, then the result is a zero with the + * same sign as the argument. + * + *
  • If the argument is {@code +1.0}, then the result is + * positive infinity. + * + *
  • If the argument is {@code -1.0}, then the result is + * negative infinity. + * + *
  • If the argument is greater than {@code 1.0} in magnitude, then the result is NaN. + * + *
+ * + * @param x The number whose inverse hyperbolic tangent is to be returned. + * @return The inverse hyperbolic tangent of {@code x}. + * @since 27 + */ + public static double atanh(double x) { + return FdLibm.Atanh.compute(x); + } + /** * Returns sqrt(x2 +y2) * without intermediate overflow or underflow. diff --git a/src/java.base/share/classes/java/lang/StringLatin1.java b/src/java.base/share/classes/java/lang/StringLatin1.java index 21a8b2dd61a..adfd9c6dbab 100644 --- a/src/java.base/share/classes/java/lang/StringLatin1.java +++ b/src/java.base/share/classes/java/lang/StringLatin1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ package java.lang; import java.util.Arrays; import java.util.Locale; +import java.util.Objects; import java.util.Spliterator; import java.util.function.Consumer; import java.util.function.IntConsumer; @@ -39,12 +40,22 @@ import jdk.internal.vm.annotation.IntrinsicCandidate; import static java.lang.String.LATIN1; import static java.lang.String.UTF16; -import static java.lang.String.checkIndex; -import static java.lang.String.checkOffset; +/** + * Latin-1 string operations. + *

+ * Unless stated otherwise, all methods assume that + *

    + *
  • {@code byte[]} arguments denote a Latin-1 string byte array + *
  • indices, offsets, and lengths (typically of type {@code int}) are in + * number of characters, i.e., the number of {@code byte}s/{@code char}s for + * Latin-1 strings, and the number of Unicode + * code units for UTF-16 strings + *
+ */ final class StringLatin1 { static char charAt(byte[] value, int index) { - checkIndex(index, value.length); + String.checkIndex(index, value.length); return (char)(value[index] & 0xff); } @@ -84,8 +95,23 @@ final class StringLatin1 { System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin); } - @IntrinsicCandidate + /** + * {@return {@code true} if provided byte arrays contain identical content; {@code false} otherwise}. + * + * @param value a byte array + * @param other a byte array + * + * @throws NullPointerException if {@code value} or {@code other} is null + */ static boolean equals(byte[] value, byte[] other) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); + return equals0(value, other); + } + + // vmIntrinsics::_equalsL + @IntrinsicCandidate + private static boolean equals0(byte[] value, byte[] other) { if (value.length == other.length) { for (int i = 0; i < value.length; i++) { if (value[i] != other[i]) { @@ -97,33 +123,102 @@ final class StringLatin1 { return false; } - @IntrinsicCandidate + /** + * Lexicographically compares two Latin-1 strings as specified in + * {@link String#compareTo(String) String::compareTo}. + * + * @param value a Latin-1 string byte array + * @param other a Latin-1 string byte array + * + * @return {@code 0} if {@code value} is equal to {@code other}, a value + * less than {@code 0} if {@code value} is lexicographically less than + * {@code other}; a value greater than {@code 0} otherwise. + * + * @throws NullPointerException if {@code value} or {@code other} is null + */ static int compareTo(byte[] value, byte[] other) { - int len1 = value.length; - int len2 = other.length; - return compareTo(value, other, len1, len2); + Objects.requireNonNull(value); + Objects.requireNonNull(other); + return compareTo0(value, other); } + // vmIntrinsics::_compareToL + @IntrinsicCandidate + private static int compareTo0(byte[] value, byte[] other) { + return compareTo(value, other, value.length, other.length); + } + + /** + * Lexicographically compares two Latin-1 string prefixes as specified in + * {@link String#compareTo(String) String::compareTo}. + * + * @param value a Latin-1 string byte array + * @param other a Latin-1 string byte array + * @param len1 the number of characters in {@code value} to compare + * @param len2 the number of characters in {@code other} to compare + * + * @return {@code 0} if the {@code value} prefix is equal to the + * {@code other} prefix, a value less than {@code 0} if the {@code value} + * prefix is lexicographically less than the {@code other} prefix; a + * value greater than {@code 0} otherwise. + * + * @throws NullPointerException if {@code value} or {@code other} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ static int compareTo(byte[] value, byte[] other, int len1, int len2) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); + String.checkOffset(len1, length(value)); + String.checkOffset(len2, length(other)); int lim = Math.min(len1, len2); int k = ArraysSupport.mismatch(value, other, lim); return (k < 0) ? len1 - len2 : getChar(value, k) - getChar(other, k); } - @IntrinsicCandidate + /** + * Lexicographically compares a Latin-1 string to a UTF-16 string as + * specified in {@link String#compareTo(String) String::compareTo}. + * + * @param value a Latin-1 string byte array + * @param other a UTF-16 string byte array + * + * @return {@code 0} if the {@code value} is equal to the {@code other}, a + * value less than {@code 0} if the {@code value} is lexicographically less + * than the {@code other}; a value greater than {@code 0} otherwise. + * + * @throws NullPointerException if {@code value} or {@code other} is null + */ static int compareToUTF16(byte[] value, byte[] other) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); + return compareToUTF16_0(value, other); + } + + // vmIntrinsics::_compareToLU + @IntrinsicCandidate + private static int compareToUTF16_0(byte[] value, byte[] other) { int len1 = length(value); int len2 = StringUTF16.length(other); return compareToUTF16Values(value, other, len1, len2); } - /* - * Checks the boundary and then compares the byte arrays. + /** + * Lexicographically compares a Latin-1 string prefix to a UTF-16 one as + * specified in {@link String#compareTo(String) String::compareTo}. + * + * @param value a Latin-1 string byte array + * @param other a UTF-16 string byte array + * @param len1 the number of characters in {@code value} to compare + * @param len2 the number of characters in {@code other} to compare + * + * @throws NullPointerException if {@code value} or {@code other} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds */ static int compareToUTF16(byte[] value, byte[] other, int len1, int len2) { - checkOffset(len1, length(value)); - checkOffset(len2, StringUTF16.length(other)); - + Objects.requireNonNull(value); + Objects.requireNonNull(other); + String.checkOffset(len1, length(value)); + String.checkOffset(len2, StringUTF16.length(other)); return compareToUTF16Values(value, other, len1, len2); } @@ -139,9 +234,12 @@ final class StringLatin1 { return len1 - len2; } + /** + * Case-insensitive {@link #compareTo(byte[], byte[]) compareTo}. + */ static int compareToCI(byte[] value, byte[] other) { - int len1 = value.length; - int len2 = other.length; + int len1 = value.length; // Implicit null check on `value` + int len2 = other.length; // Implicit null check on `other` int lim = Math.min(len1, len2); for (int k = 0; k < lim; k++) { if (value[k] != other[k]) { @@ -159,7 +257,12 @@ final class StringLatin1 { return len1 - len2; } + /** + * Case-insensitive {@link #compareToUTF16(byte[], byte[]) compareToUTF16}. + */ static int compareToCI_UTF16(byte[] value, byte[] other) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); int len1 = length(value); int len2 = StringUTF16.length(other); int lim = Math.min(len1, len2); @@ -307,16 +410,34 @@ final class StringLatin1 { return ArraysSupport.hashCodeOfUnsigned(value, 0, value.length, 0); } - // Caller must ensure that from- and toIndex are within bounds + /** + * Finds the index of the first character matching the provided one in the + * given Latin-1 string byte array sub-range. {@code -1} is returned if the + * provided character cannot be encoded in Latin-1, or cannot be found in + * the target string sub-range. + * + * @param value a Latin-1 string byte array to search in + * @param ch a character to search for + * @param fromIndex the index (inclusive) of the first character in the sub-range + * @param toIndex the index (exclusive) of the last character in the sub-range + * + * @return the index of the first character matching the provided one in the + * given target string sub-range; {@code -1} otherwise + * + * @throws NullPointerException if {@code value} is null + * @throws StringIndexOutOfBoundsException if the sub-range is out of bounds + */ static int indexOf(byte[] value, int ch, int fromIndex, int toIndex) { + String.checkBoundsBeginEnd(fromIndex, toIndex, value.length); // Implicit null check on `value` if (!canEncode(ch)) { return -1; } - return indexOfChar(value, ch, fromIndex, toIndex); + return indexOfChar0(value, ch, fromIndex, toIndex); } + // vmIntrinsics::_indexOfL_char @IntrinsicCandidate - private static int indexOfChar(byte[] value, int ch, int fromIndex, int max) { + private static int indexOfChar0(byte[] value, int ch, int fromIndex, int max) { byte c = (byte)ch; for (int i = fromIndex; i < max; i++) { if (value[i] == c) { @@ -326,22 +447,67 @@ final class StringLatin1 { return -1; } - @IntrinsicCandidate + /** + * Searches for the first occurrence of {@code str} in {@code value}, and, + * if found, returns the index of the first character of the matching + * {@code value} sub-range; {@code -1} otherwise. + * + * @param value a Latin-1 string byte array to search in + * @param str a Latin-1 string byte array to search for + * + * @return the index of the first character of the matching {@code value} + * sub-range if a match is found; {@code -1} otherwise + * + * @throws NullPointerException if {@code value} or {@code str} is null + */ static int indexOf(byte[] value, byte[] str) { - if (str.length == 0) { - return 0; - } - if (value.length == 0) { - return -1; - } - return indexOf(value, value.length, str, str.length, 0); + Objects.requireNonNull(value); + Objects.requireNonNull(str); + return indexOf0(value, str); } + // vmIntrinsics::_indexOfL @IntrinsicCandidate - static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) { + private static int indexOf0(byte[] value, byte[] str) { + return indexOf0(value, value.length, str, str.length, 0); + } + + /** + * Searches for the first occurrence of the given {@code str} sub-range in + * the given {@code value} sub-range, and, if found, returns the index of + * the first character of the matching {@code value} sub-range; {@code -1} + * otherwise. + * + * @param value a Latin-1 string byte array to search in + * @param valueToIndex the index (exclusive) of the last character in {@code value} + * @param str a Latin-1 string byte array to search for + * @param strToIndex the index (exclusive) of the last character in {@code str} + * @param valueFromIndex the index (inclusive) of the first character in {@code value} + * + * @return the index of the first character of the matching {@code value} + * sub-range if a match is found; {@code -1} otherwise + * + * @throws NullPointerException if {@code value} or {@code str} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ + static int indexOf(byte[] value, int valueToIndex, byte[] str, int strToIndex, int valueFromIndex) { + String.checkBoundsBeginEnd(valueFromIndex, valueToIndex, value.length); // Implicit null check on `value` + String.checkBoundsBeginEnd(0, strToIndex, str.length); // Implicit null check on `str` + return indexOf0(value, valueToIndex, str, strToIndex, valueFromIndex); + } + + // vmIntrinsics::_indexOfIL + @IntrinsicCandidate + private static int indexOf0(byte[] value, int valueToIndex, byte[] str, int strToIndex, int valueFromIndex) { + if (strToIndex == 0) { + return 0; + } + if ((valueToIndex - valueFromIndex) < strToIndex) { + return -1; + } byte first = str[0]; - int max = (valueCount - strCount); - for (int i = fromIndex; i <= max; i++) { + int max = (valueToIndex - strToIndex); + for (int i = valueFromIndex; i <= max; i++) { // Look for first character. if (value[i] != first) { while (++i <= max && value[i] != first); @@ -349,7 +515,7 @@ final class StringLatin1 { // Found first character, now look at the rest of value if (i <= max) { int j = i + 1; - int end = j + strCount - 1; + int end = j + strToIndex - 1; for (int k = 1; j < end && value[j] == str[k]; j++, k++); if (j == end) { // Found whole string. @@ -855,18 +1021,65 @@ final class StringLatin1 { LATIN1); } - // inflatedCopy byte[] -> char[] - @IntrinsicCandidate + /** + * Copies characters from a Latin-1 string byte array sub-range to the + * given {@code char} array sub-range. + *

+ * This effectively inflates the content from a 1 byte per + * character representation to a 2 byte one. + * + * @param src the source Latin-1 string byte array + * @param srcOff the index (inclusive) of the first character in {@code src} + * @param dst the target {@code char} array + * @param dstOff the index (inclusive) of the first character in {@code dst} + * @param len the maximum number of characters to copy + * + * @throws NullPointerException if {@code src} or {@code dst} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ static void inflate(byte[] src, int srcOff, char[] dst, int dstOff, int len) { + String.checkBoundsOffCount(srcOff, len, src.length); // Implicit null check on `src` + String.checkBoundsOffCount(dstOff, len, dst.length); // Implicit null check on `dst` + inflate0(src, srcOff, dst, dstOff, len); + } + + // vmIntrinsics::_inflateStringC + @IntrinsicCandidate + private static void inflate0(byte[] src, int srcOff, char[] dst, int dstOff, int len) { for (int i = 0; i < len; i++) { dst[dstOff++] = (char)(src[srcOff++] & 0xff); } } - // inflatedCopy byte[] -> byte[] - @IntrinsicCandidate + /** + * Copies characters from a Latin-1 string byte array sub-range to a UTF-16 + * one. + *

+ * This effectively inflates the content from a 1 byte per + * character representation to a 2 byte one. + * + * @param src the source Latin-1 string byte array + * @param srcOff the index (inclusive) of the first character in {@code src} + * @param dst the target UTF-16 string byte array + * @param dstOff the index (inclusive) of the first character in {@code dst} + * @param len the maximum number of characters to copy + * + * @throws NullPointerException if {@code src} or {@code dst} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { - StringUTF16.inflate(src, srcOff, dst, dstOff, len); + String.checkBoundsOffCount(srcOff, len, src.length); // Implicit null check on `src` + Objects.requireNonNull(dst); + String.checkBoundsOffCount(dstOff, len, StringUTF16.length(dst)); + inflate0(src, srcOff, dst, dstOff, len); + } + + // vmIntrinsics::_inflateStringB + @IntrinsicCandidate + private static void inflate0(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { + for (int i = 0; i < len; i++) { + StringUTF16.putChar(dst, dstOff++, src[srcOff++] & 0xff); + } } static class CharsSpliterator implements Spliterator.OfInt { diff --git a/src/java.base/share/classes/java/lang/StringUTF16.java b/src/java.base/share/classes/java/lang/StringUTF16.java index 75c9e8239ba..27b9ae54a8a 100644 --- a/src/java.base/share/classes/java/lang/StringUTF16.java +++ b/src/java.base/share/classes/java/lang/StringUTF16.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2025, Alibaba Group Holding Limited. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,6 +28,7 @@ package java.lang; import java.util.Arrays; import java.util.Locale; +import java.util.Objects; import java.util.Spliterator; import java.util.function.Consumer; import java.util.function.IntConsumer; @@ -49,8 +50,13 @@ import static java.lang.String.UTF16; /// it has the same endianness as a char, which is the platform endianness. /// This is ensured in the static initializer of StringUTF16. /// -/// All indices and sizes for byte arrays carrying UTF16 data are in number of -/// chars instead of number of bytes. +/// Unless stated otherwise, all methods assume that +/// +/// - `byte[]` arguments denote a UTF-16 string byte array +/// - indices, offsets, and lengths (typically of type `int`) are in number of +/// characters, i.e., the number of +/// [Unicode code units](Character.html#unicode) for UTF-16 strings, and the +/// number of `byte`s/`char`s for Latin-1 strings final class StringUTF16 { // Return a new byte array for a UTF16-coded string for len chars @@ -388,9 +394,33 @@ final class StringUTF16 { return n; } - // compressedCopy char[] -> byte[] - @IntrinsicCandidate + /** + * Copies the prefix of Latin-1 characters from a {@code char} array + * sub-range to a Latin-1 string byte array sub-range. + *

+ * This effectively compresses the content from a 2 byte per + * character representation to a 1 byte one. + * + * @param src the source {@code char} array + * @param srcOff the index (inclusive) of the first character in {@code src} + * @param dst the target Latin-1 string byte array + * @param dstOff the index (inclusive) of the first character in {@code dst} + * @param len the maximum number of characters to copy + * + * @return the number of characters copied + * + * @throws NullPointerException if {@code src} or {@code dst} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) { + String.checkBoundsOffCount(srcOff, len, src.length); // Implicit null check on `src` + String.checkBoundsOffCount(dstOff, len, dst.length); // Implicit null check on `dst` + return compress0(src, srcOff, dst, dstOff, len); + } + + // vmIntrinsics::_compressStringC + @IntrinsicCandidate + private static int compress0(char[] src, int srcOff, byte[] dst, int dstOff, int len) { for (int i = 0; i < len; i++) { char c = src[srcOff]; if (c > 0xff) { @@ -403,11 +433,34 @@ final class StringUTF16 { return len; } - // compressedCopy byte[] -> byte[] - @IntrinsicCandidate + /** + * Copies the prefix of Latin-1 characters from a UTF-16 string byte array + * sub-range to a Latin-1 one. + *

+ * This effectively compresses the content from a 2 byte per + * character representation to a 1 byte one. + * + * @param src the source UTF-16 string byte array + * @param srcOff the index (inclusive) of the first character in {@code src} + * @param dst the target Latin-1 string byte array + * @param dstOff the index (inclusive) of the first character in {@code dst} + * @param len the maximum number of characters to copy + * + * @return the number of characters copied + * + * @throws NullPointerException if {@code src} or {@code dst} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ static int compress(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { - // We need a range check here because 'getChar' has no checks - checkBoundsOffCount(srcOff, len, src); + Objects.requireNonNull(src); + String.checkBoundsOffCount(srcOff, len, length(src)); + String.checkBoundsOffCount(dstOff, len, dst.length); // Implicit null check on `dst` + return compress0(src, srcOff, dst, dstOff, len); + } + + // vmIntrinsics::_compressStringB + @IntrinsicCandidate + private static int compress0(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { for (int i = 0; i < len; i++) { char c = getChar(src, srcOff); if (c > 0xff) { @@ -446,7 +499,7 @@ final class StringUTF16 { static void getChars(byte[] value, int srcBegin, int srcEnd, char[] dst, int dstBegin) { // We need a range check here because 'getChar' has no checks if (srcBegin < srcEnd) { - checkBoundsOffCount(srcBegin, srcEnd - srcBegin, value); + String.checkBoundsOffCount(srcBegin, srcEnd - srcBegin, length(value)); } for (int i = srcBegin; i < srcEnd; i++) { dst[dstBegin++] = getChar(value, i); @@ -462,20 +515,50 @@ final class StringUTF16 { } } - @IntrinsicCandidate + /** + * Lexicographically compares two UTF-16 strings as specified in + * {@link String#compareTo(String) String::compareTo}. + * + * @param value a UTF-16 string byte array + * @param other a UTF-16 string byte array + * + * @return {@code 0} if {@code value} is equal to {@code other}, a value + * less than {@code 0} if {@code value} is lexicographically less than + * {@code other}; a value greater than {@code 0} otherwise. + * + * @throws NullPointerException if {@code value} or {@code other} is null + */ static int compareTo(byte[] value, byte[] other) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); + return compareTo0(value, other); + } + + // vmIntrinsics::_compareToU + @IntrinsicCandidate + private static int compareTo0(byte[] value, byte[] other) { int len1 = length(value); int len2 = length(other); return compareValues(value, other, len1, len2); } - /* - * Checks the boundary and then compares the byte arrays. + /** + * Lexicographically compares two UTF-16 string prefixes as specified in + * {@link String#compareTo(String) String::compareTo}. + * + * @param value a UTF-16 string byte array + * @param other a UTF-16 string byte array + * @param len1 the number of characters in {@code value} to compare + * @param len2 the number of characters in {@code other} to compare + * + * @throws NullPointerException if {@code value} or {@code other} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds */ static int compareTo(byte[] value, byte[] other, int len1, int len2) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); checkOffset(len1, value); checkOffset(len2, other); - return compareValues(value, other, len1, len2); } @@ -491,16 +574,58 @@ final class StringUTF16 { return len1 - len2; } - @IntrinsicCandidate + /** + * Lexicographically compares a UTF-16 string to a Latin-1 one as specified + * in {@link String#compareTo(String) String::compareTo}. + * + * @param value a UTF-16 string byte array + * @param other a Latin-1 string byte array + * + * @return {@code 0} if {@code value} is equal to {@code other}, a value + * less than {@code 0} if {@code value} is lexicographically less than + * {@code other}; a value greater than {@code 0} otherwise. + * + * @throws NullPointerException if {@code value} or {@code other} is null + */ static int compareToLatin1(byte[] value, byte[] other) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); + return compareToLatin1_0(value, other); + } + + // vmIntrinsics::_compareToUL + @IntrinsicCandidate + private static int compareToLatin1_0(byte[] value, byte[] other) { return -StringLatin1.compareToUTF16(other, value); } + /** + * Lexicographically compares a UTF-16 string prefix to a Latin-1 one as + * specified in {@link String#compareTo(String) String::compareTo}. + * + * @param value a UTF-16 string byte array + * @param other a Latin-1 string byte array + * @param len1 the number of characters from {@code value} to compare + * @param len2 the number of characters from {@code other} to compare + * + * @return {@code 0} if the {@code value} prefix is equal to the + * {@code other} prefix, a value less than {@code 0} if the {@code value} + * prefix is lexicographically less than the {@code other} prefix; a + * value greater than {@code 0} otherwise. + * + * @throws NullPointerException if {@code value} or {@code other} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ static int compareToLatin1(byte[] value, byte[] other, int len1, int len2) { return -StringLatin1.compareToUTF16(other, value, len2, len1); } + /** + * Case-insensitive {@link #compareTo(byte[], byte[]) compareTo}. + */ static int compareToCI(byte[] value, byte[] other) { + Objects.requireNonNull(value); + Objects.requireNonNull(other); return compareToCIImpl(value, 0, length(value), other, 0, length(other)); } @@ -589,6 +714,9 @@ final class StringUTF16 { return cp; } + /** + * Case-insensitive {@link #compareToLatin1(byte[], byte[]) compareToLatin1}. + */ static int compareToCI_Latin1(byte[] value, byte[] other) { return -StringLatin1.compareToCI_UTF16(other, value); } @@ -668,19 +796,52 @@ final class StringUTF16 { return ArraysSupport.hashCodeOfUTF16(value, 0, value.length >> 1, 0); } - // Caller must ensure that from- and toIndex are within bounds + /** + * {@return the index of the first character matching the provided one in + * the given UTF-16 string byte array sub-range; {@code -1} otherwise} + * + * @param value a UTF-16 string byte array to search in + * @param ch a character to search for + * @param fromIndex the index (inclusive) of the first character in the sub-range + * @param toIndex the index (exclusive) of the last character in the sub-range + * + * @throws NullPointerException if {@code value} is null + * @throws StringIndexOutOfBoundsException if the sub-range is out of bounds + */ static int indexOf(byte[] value, int ch, int fromIndex, int toIndex) { + Objects.requireNonNull(value); + checkBoundsBeginEnd(fromIndex, toIndex, value); if (ch < Character.MIN_SUPPLEMENTARY_CODE_POINT) { // handle most cases here (ch is a BMP code point or a // negative value (invalid code point)) - return indexOfChar(value, ch, fromIndex, toIndex); + return indexOfChar0(value, ch, fromIndex, toIndex); } else { return indexOfSupplementary(value, ch, fromIndex, toIndex); } } - @IntrinsicCandidate + /** + * Searches for the first occurrence of {@code str} in {@code value}, and, + * if found, returns the index of the first character of the matching + * {@code value} sub-range; {@code -1} otherwise. + * + * @param value a UTF-16 string byte array to search in + * @param str a UTF-16 string byte array to search for + * + * @return the index of the first character of the matching {@code value} + * sub-range if a match is found; {@code -1} otherwise + * + * @throws NullPointerException if {@code value} or {@code str} is null + */ static int indexOf(byte[] value, byte[] str) { + Objects.requireNonNull(value); + Objects.requireNonNull(str); + return indexOf0(value, str); + } + + // vmIntrinsics::_indexOfU + @IntrinsicCandidate + private static int indexOf0(byte[] value, byte[] str) { if (str.length == 0) { return 0; } @@ -690,22 +851,58 @@ final class StringUTF16 { return indexOfUnsafe(value, length(value), str, length(str), 0); } - @IntrinsicCandidate - static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) { - checkBoundsBeginEnd(fromIndex, valueCount, value); - checkBoundsBeginEnd(0, strCount, str); - return indexOfUnsafe(value, valueCount, str, strCount, fromIndex); + /** + * Searches for the first occurrence of the given {@code str} sub-range in + * the given {@code value} sub-range, and, if found, returns the index of + * the first character of the matching {@code value} sub-range; {@code -1} + * otherwise. + * + * @param value a UTF-16 string byte array to search in + * @param valueToIndex the index (exclusive) of the last character in {@code value} + * @param str a UTF-16 string byte array to search for + * @param strToIndex the index (exclusive) of the last character in {@code str} + * @param valueFromIndex the index (inclusive) of the first character in {@code value} + * + * @return the index of the first character of the matching {@code value} + * sub-range if a match is found; {@code -1} otherwise + * + * @throws NullPointerException if {@code value} or {@code str} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ + static int indexOf(byte[] value, int valueToIndex, byte[] str, int strToIndex, int valueFromIndex) { + Objects.requireNonNull(value); + checkBoundsBeginEnd(valueFromIndex, valueToIndex, value); + Objects.requireNonNull(str); + checkBoundsBeginEnd(0, strToIndex, str); + return indexOf0(value, valueToIndex, str, strToIndex, valueFromIndex); } + // vmIntrinsics::_indexOfIU + @IntrinsicCandidate + private static int indexOf0(byte[] value, int valueToIndex, byte[] str, int strToIndex, int valueFromIndex) { + if (strToIndex == 0) { + return 0; + } + if ((valueToIndex - valueFromIndex) < strToIndex) { + return -1; + } + return indexOfUnsafe(value, valueToIndex, str, strToIndex, valueFromIndex); + } - private static int indexOfUnsafe(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) { - assert fromIndex >= 0; - assert strCount > 0; - assert strCount <= length(str); - assert valueCount >= strCount; + // This method has the following assumptions on its inputs: + // + // - Arrays are not null + // - Sub-ranges are valid + // - The `str` sub-range is not empty + // - The `value` sub-range length is greater than or equal to the `str` sub-range length + private static int indexOfUnsafe(byte[] value, int valueToIndex, byte[] str, int strToIndex, int valueFromIndex) { + assert valueFromIndex >= 0; + assert strToIndex > 0; + assert strToIndex <= length(str); + assert (valueToIndex - valueFromIndex) >= strToIndex; char first = getChar(str, 0); - int max = (valueCount - strCount); - for (int i = fromIndex; i <= max; i++) { + int max = (valueToIndex - strToIndex); + for (int i = valueFromIndex; i <= max; i++) { // Look for first character. if (getChar(value, i) != first) { while (++i <= max && getChar(value, i) != first); @@ -713,7 +910,7 @@ final class StringUTF16 { // Found first character, now look at the rest of value if (i <= max) { int j = i + 1; - int end = j + strCount - 1; + int end = j + strToIndex - 1; for (int k = 1; j < end && getChar(value, j) == getChar(str, k); j++, k++); if (j == end) { // Found whole string. @@ -724,12 +921,29 @@ final class StringUTF16 { return -1; } - /** - * Handles indexOf Latin1 substring in UTF16 string. + * Searches for the first occurrence of the given Latin-1 string byte array + * {@code str} in the given UTF-16 string byte array {@code value}, and, if + * found, returns the index of the first character of the matching + * {@code value} sub-range; {@code -1} otherwise. + * + * @param value a UTF-16 string byte array to search in + * @param str a Latin-1 string byte array to search for + * + * @return the index of the first character of the matching {@code value} + * sub-range if a match is found; {@code -1} otherwise + * + * @throws NullPointerException if {@code value} or {@code str} is null */ - @IntrinsicCandidate static int indexOfLatin1(byte[] value, byte[] str) { + Objects.requireNonNull(value); + Objects.requireNonNull(str); + return indexOfLatin1_0(value, str); + } + + // vmIntrinsics::_indexOfUL + @IntrinsicCandidate + private static int indexOfLatin1_0(byte[] value, byte[] str) { if (str.length == 0) { return 0; } @@ -739,18 +953,54 @@ final class StringUTF16 { return indexOfLatin1Unsafe(value, length(value), str, str.length, 0); } - @IntrinsicCandidate - static int indexOfLatin1(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { - checkBoundsBeginEnd(fromIndex, srcCount, src); - String.checkBoundsBeginEnd(0, tgtCount, tgt.length); - return indexOfLatin1Unsafe(src, srcCount, tgt, tgtCount, fromIndex); + /** + * Searches for the first occurrence of the given Latin-1 string byte array + * {@code tgt} sub-range in the given UTF-16 string byte array {@code src} + * sub-range, and, if found, returns the index of the first character in + * {@code src}; {@code -1} otherwise. + * + * @param src a UTF-16 string byte array to search in + * @param srcToIndex the index (exclusive) of the last character in {@code src} + * @param tgt a Latin-1 string byte array to search for + * @param tgtToIndex the index (exclusive) of the last character in {@code tgt} + * @param tgtFromIndex the index (inclusive) of the first character in {@code src} + * + * @return the index of the first character of the matching {@code src} + * sub-range if a match is found; {@code -1} otherwise + * + * @throws NullPointerException if {@code src} or {@code tgt} is null + * @throws StringIndexOutOfBoundsException if the sub-ranges are out of bounds + */ + static int indexOfLatin1(byte[] src, int srcToIndex, byte[] tgt, int tgtToIndex, int tgtFromIndex) { + Objects.requireNonNull(src); + checkBoundsBeginEnd(tgtFromIndex, srcToIndex, src); + String.checkBoundsBeginEnd(0, tgtToIndex, tgt.length); + return indexOfLatin1_0(src, srcToIndex, tgt, tgtToIndex, tgtFromIndex); } - static int indexOfLatin1Unsafe(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { + // vmIntrinsics::_indexOfIUL + @IntrinsicCandidate + private static int indexOfLatin1_0(byte[] src, int srcToIndex, byte[] tgt, int tgtToIndex, int srcFromIndex) { + if (tgtToIndex == 0) { + return 0; + } + if ((srcToIndex - srcFromIndex) < tgtToIndex) { + return -1; + } + return indexOfLatin1Unsafe(src, srcToIndex, tgt, tgtToIndex, srcFromIndex); + } + + // This method has the following assumptions on its inputs: + // + // - Arrays are not null + // - Sub-ranges are valid + // - The `tgt` sub-range is not empty + // - The `src` sub-range length is greater than or equal to the `tgt` sub-range length + private static int indexOfLatin1Unsafe(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { assert fromIndex >= 0; assert tgtCount > 0; assert tgtCount <= tgt.length; - assert srcCount >= tgtCount; + assert (srcCount - fromIndex) >= tgtCount; char first = (char)(tgt[0] & 0xff); int max = (srcCount - tgtCount); for (int i = fromIndex; i <= max; i++) { @@ -774,8 +1024,9 @@ final class StringUTF16 { return -1; } + // vmIntrinsics::_indexOfU_char @IntrinsicCandidate - private static int indexOfChar(byte[] value, int ch, int fromIndex, int max) { + private static int indexOfChar0(byte[] value, int ch, int fromIndex, int max) { for (int i = fromIndex; i < max; i++) { if (getChar(value, i) == ch) { return i; @@ -1590,7 +1841,7 @@ final class StringUTF16 { } static boolean contentEquals(byte[] v1, byte[] v2, int len) { - checkBoundsOffCount(0, len, v2); + String.checkBoundsOffCount(0, len, length(v2)); for (int i = 0; i < len; i++) { if ((char)(v1[i] & 0xff) != getChar(v2, i)) { return false; @@ -1667,15 +1918,6 @@ final class StringUTF16 { } } - // inflatedCopy byte[] -> byte[] - static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { - // We need a range check here because 'putChar' has no checks - checkBoundsOffCount(dstOff, len, dst); - for (int i = 0; i < len; i++) { - putChar(dst, dstOff++, src[srcOff++] & 0xff); - } - } - // srcCoder == UTF16 && tgtCoder == LATIN1 static int lastIndexOfLatin1(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { @@ -1742,8 +1984,4 @@ final class StringUTF16 { String.checkBoundsBeginEnd(begin, end, length(val)); } - static void checkBoundsOffCount(int offset, int count, byte[] val) { - String.checkBoundsOffCount(offset, count, length(val)); - } - } diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 57d28aca5f4..4890c1af45b 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -1881,8 +1881,8 @@ public class Thread implements Runnable { * been {@link #start() started}. * * @implNote - * For platform threads, the implementation uses a loop of {@code this.wait} - * calls conditioned on {@code this.isAlive}. As a thread terminates the + * This implementation uses a loop of {@code this.wait} calls + * conditioned on {@code this.isAlive}. As a thread terminates the * {@code this.notifyAll} method is invoked. It is recommended that * applications not use {@code wait}, {@code notify}, or * {@code notifyAll} on {@code Thread} instances. @@ -1901,13 +1901,12 @@ public class Thread implements Runnable { public final void join(long millis) throws InterruptedException { if (millis < 0) throw new IllegalArgumentException("timeout value is negative"); - - if (this instanceof VirtualThread vthread) { - if (isAlive()) { - long nanos = MILLISECONDS.toNanos(millis); - vthread.joinNanos(nanos); - } + if (!isAlive()) return; + + // ensure there is a notifyAll to wake up waiters when this thread terminates + if (this instanceof VirtualThread vthread) { + vthread.beforeJoin(); } synchronized (this) { @@ -1936,8 +1935,8 @@ public class Thread implements Runnable { * been {@link #start() started}. * * @implNote - * For platform threads, the implementation uses a loop of {@code this.wait} - * calls conditioned on {@code this.isAlive}. As a thread terminates the + * This implementation uses a loop of {@code this.wait} calls + * conditioned on {@code this.isAlive}. As a thread terminates the * {@code this.notifyAll} method is invoked. It is recommended that * applications not use {@code wait}, {@code notify}, or * {@code notifyAll} on {@code Thread} instances. @@ -1966,16 +1965,6 @@ public class Thread implements Runnable { throw new IllegalArgumentException("nanosecond timeout value out of range"); } - if (this instanceof VirtualThread vthread) { - if (isAlive()) { - // convert arguments to a total in nanoseconds - long totalNanos = MILLISECONDS.toNanos(millis); - totalNanos += Math.min(Long.MAX_VALUE - totalNanos, nanos); - vthread.joinNanos(totalNanos); - } - return; - } - if (nanos > 0 && millis < Long.MAX_VALUE) { millis++; } @@ -2035,10 +2024,6 @@ public class Thread implements Runnable { if (nanos <= 0) return false; - if (this instanceof VirtualThread vthread) { - return vthread.joinNanos(nanos); - } - // convert to milliseconds long millis = MILLISECONDS.convert(nanos, NANOSECONDS); if (nanos > NANOSECONDS.convert(millis, MILLISECONDS)) { diff --git a/src/java.base/share/classes/java/lang/VirtualThread.java b/src/java.base/share/classes/java/lang/VirtualThread.java index 6cd7ccbbba1..f058f967b91 100644 --- a/src/java.base/share/classes/java/lang/VirtualThread.java +++ b/src/java.base/share/classes/java/lang/VirtualThread.java @@ -26,7 +26,6 @@ package java.lang; import java.util.Locale; import java.util.Objects; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ForkJoinPool; @@ -68,7 +67,6 @@ final class VirtualThread extends BaseVirtualThread { private static final long STATE = U.objectFieldOffset(VirtualThread.class, "state"); private static final long PARK_PERMIT = U.objectFieldOffset(VirtualThread.class, "parkPermit"); private static final long CARRIER_THREAD = U.objectFieldOffset(VirtualThread.class, "carrierThread"); - private static final long TERMINATION = U.objectFieldOffset(VirtualThread.class, "termination"); private static final long ON_WAITING_LIST = U.objectFieldOffset(VirtualThread.class, "onWaitingList"); // scheduler and continuation @@ -184,8 +182,8 @@ final class VirtualThread extends BaseVirtualThread { // carrier thread when mounted, accessed by VM private volatile Thread carrierThread; - // termination object when joining, created lazily if needed - private volatile CountDownLatch termination; + // true to notifyAll after this virtual thread terminates + private volatile boolean notifyAllAfterTerminate; /** * Returns the default scheduler. @@ -677,11 +675,11 @@ final class VirtualThread extends BaseVirtualThread { assert carrierThread == null; setState(TERMINATED); - // notify anyone waiting for this virtual thread to terminate - CountDownLatch termination = this.termination; - if (termination != null) { - assert termination.getCount() == 1; - termination.countDown(); + // notifyAll to wakeup any threads waiting for this thread to terminate + if (notifyAllAfterTerminate) { + synchronized (this) { + notifyAll(); + } } // notify container @@ -740,6 +738,13 @@ final class VirtualThread extends BaseVirtualThread { // do nothing } + /** + * Invoked by Thread.join before a thread waits for this virtual thread to terminate. + */ + void beforeJoin() { + notifyAllAfterTerminate = true; + } + /** * Parks until unparked or interrupted. If already unparked then the parking * permit is consumed and this method completes immediately (meaning it doesn't @@ -999,36 +1004,6 @@ final class VirtualThread extends BaseVirtualThread { } } - /** - * Waits up to {@code nanos} nanoseconds for this virtual thread to terminate. - * A timeout of {@code 0} means to wait forever. - * - * @throws InterruptedException if interrupted while waiting - * @return true if the thread has terminated - */ - boolean joinNanos(long nanos) throws InterruptedException { - if (state() == TERMINATED) - return true; - - // ensure termination object exists, then re-check state - CountDownLatch termination = getTermination(); - if (state() == TERMINATED) - return true; - - // wait for virtual thread to terminate - if (nanos == 0) { - termination.await(); - } else { - boolean terminated = termination.await(nanos, NANOSECONDS); - if (!terminated) { - // waiting time elapsed - return false; - } - } - assert state() == TERMINATED; - return true; - } - @Override void blockedOn(Interruptible b) { disableSuspendAndPreempt(); @@ -1239,20 +1214,6 @@ final class VirtualThread extends BaseVirtualThread { return obj == this; } - /** - * Returns the termination object, creating it if needed. - */ - private CountDownLatch getTermination() { - CountDownLatch termination = this.termination; - if (termination == null) { - termination = new CountDownLatch(1); - if (!U.compareAndSetReference(this, TERMINATION, null, termination)) { - termination = this.termination; - } - } - return termination; - } - /** * Returns the lock object to synchronize on when accessing carrierThread. * The lock prevents carrierThread from being reset to null during unmount. diff --git a/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java index 4b6d74b1b2e..be3805cf5b1 100644 --- a/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java +++ b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -746,15 +746,7 @@ abstract class ClassSpecializer.SpeciesDat new Consumer<>() { @Override public void accept(CodeBuilder cob) { - cob.aload(0); // this - final List ctorArgs = AFTER_THIS.fromTypes(superCtorType.parameterList()); - for (Var ca : ctorArgs) { - ca.emitLoadInstruction(cob); - } - - // super(ca...) - cob.invokespecial(superClassDesc, INIT_NAME, methodDesc(superCtorType)); // store down fields Var lastFV = AFTER_THIS.lastOf(ctorArgs); @@ -766,6 +758,12 @@ abstract class ClassSpecializer.SpeciesDat cob.putfield(classDesc, f.name, f.desc); } + // super(ca...) + cob.aload(0); // this + for (Var ca : ctorArgs) { + ca.emitLoadInstruction(cob); + } + cob.invokespecial(superClassDesc, INIT_NAME, methodDesc(superCtorType)); cob.return_(); } }); diff --git a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index 4dac59771e8..d5cfc6f11a2 100644 --- a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 @@ -391,15 +391,15 @@ import sun.invoke.util.Wrapper; new Consumer<>() { @Override public void accept(CodeBuilder cob) { - cob.aload(0) - .invokespecial(CD_Object, INIT_NAME, MTD_void); int parameterCount = factoryType.parameterCount(); for (int i = 0; i < parameterCount; i++) { cob.aload(0) .loadLocal(TypeKind.from(factoryType.parameterType(i)), cob.parameterSlot(i)) .putfield(pool.fieldRefEntry(lambdaClassEntry, pool.nameAndTypeEntry(argName(i), argDescs[i]))); } - cob.return_(); + cob.aload(0) + .invokespecial(CD_Object, INIT_NAME, MTD_void) + .return_(); } }); } diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java index 70592351827..16f5c7e59b8 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2026, 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 @@ -362,10 +362,8 @@ public final class MethodHandleProxies { // (Lookup, MethodHandle target, MethodHandle callerBoundTarget) clb.withMethodBody(INIT_NAME, MTD_void_Lookup_MethodHandle_MethodHandle, 0, cob -> { - cob.aload(0) - .invokespecial(CD_Object, INIT_NAME, MTD_void) - // call ensureOriginalLookup to verify the given Lookup has access - .aload(1) + // call ensureOriginalLookup to verify the given Lookup has access + cob.aload(1) .invokestatic(proxyDesc, ENSURE_ORIGINAL_LOOKUP, MTD_void_Lookup) // this.target = target; .aload(0) @@ -383,7 +381,9 @@ public final class MethodHandleProxies { } // complete - cob.return_(); + cob.aload(0) + .invokespecial(CD_Object, INIT_NAME, MTD_void) + .return_(); }); // private static void ensureOriginalLookup(Lookup) checks if the given Lookup diff --git a/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java b/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java index d3879d4a8fc..ee1892e8878 100644 --- a/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java +++ b/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -60,8 +60,7 @@ public class ReferenceQueue<@jdk.internal.RequiresIdentity T> { private volatile Reference head; private long queueLength = 0; - private static class Lock { }; - private final Lock lock = new Lock(); + private final Object lock = new Object(); /** * Constructs a new reference-object queue. diff --git a/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java b/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java index 18aa6f29f1f..e4b2886404f 100644 --- a/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java +++ b/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -363,9 +363,9 @@ public final class ObjectMethods { * @return the method handle */ private static MethodHandle makeToString(MethodHandles.Lookup lookup, - Class receiverClass, - MethodHandle[] getters, - List names) { + Class receiverClass, + MethodHandle[] getters, + List names) { assert getters.length == names.size(); if (getters.length == 0) { // special case @@ -516,8 +516,8 @@ public final class ObjectMethods { requireNonNull(type); requireNonNull(recordClass); requireNonNull(names); - requireNonNull(getters); - Arrays.stream(getters).forEach(Objects::requireNonNull); + List getterList = List.of(getters); // deep null check + MethodType methodType; if (type instanceof MethodType mt) methodType = mt; @@ -526,7 +526,14 @@ public final class ObjectMethods { if (!MethodHandle.class.equals(type)) throw new IllegalArgumentException(type.toString()); } - List getterList = List.of(getters); + + for (MethodHandle getter : getterList) { + var getterType = getter.type(); + if (getterType.parameterCount() != 1 || getterType.returnType() == void.class || getterType.parameterType(0) != recordClass) { + throw new IllegalArgumentException("Illegal getter type %s for recordClass %s".formatted(getterType, recordClass.getTypeName())); + } + } + MethodHandle handle = switch (methodName) { case "equals" -> { if (methodType != null && !methodType.equals(MethodType.methodType(boolean.class, recordClass, Object.class))) @@ -541,7 +548,7 @@ public final class ObjectMethods { case "toString" -> { if (methodType != null && !methodType.equals(MethodType.methodType(String.class, recordClass))) throw new IllegalArgumentException("Bad method type: " + methodType); - List nameList = "".equals(names) ? List.of() : List.of(names.split(";")); + List nameList = names.isEmpty() ? List.of() : List.of(names.split(";")); if (nameList.size() != getterList.size()) throw new IllegalArgumentException("Name list and accessor list do not match"); yield makeToString(lookup, recordClass, getters, nameList); diff --git a/src/java.base/share/classes/java/security/KeyStore.java b/src/java.base/share/classes/java/security/KeyStore.java index 8f3d4ba29fd..434aa57e3ac 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, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 +30,7 @@ import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.security.cert.CertificateException; import java.security.spec.AlgorithmParameterSpec; +import java.time.Instant; import java.util.*; import javax.crypto.SecretKey; @@ -1182,6 +1183,9 @@ public class KeyStore { /** * Returns the creation date of the entry identified by the given alias. + *

+ * It is recommended to use the {@link #getCreationInstant(String)} + * method instead. * * @param alias the alias name * @@ -1200,6 +1204,32 @@ public class KeyStore { return keyStoreSpi.engineGetCreationDate(alias); } + + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @throws KeyStoreException if the keystore has not been initialized + * (loaded) + * + * @since 27 + */ + public final Instant getCreationInstant(String alias) + throws KeyStoreException + { + if (!initialized) { + throw new KeyStoreException("Uninitialized keystore"); + } + return keyStoreSpi.engineGetCreationInstant(alias); + } + + + /** * Assigns the given key to the given alias, protecting it with the given * password. @@ -1840,6 +1870,7 @@ public class KeyStore { } KeyStore keystore = null; + String matched = null; try (DataInputStream dataStream = new DataInputStream( @@ -1863,8 +1894,10 @@ public class KeyStore { if (CryptoAlgorithmConstraints.permits( "KEYSTORE", ksAlgo)) { keystore = new KeyStore(impl, p, ksAlgo); - break; + } else { + matched = ksAlgo; } + break; } } catch (NoSuchAlgorithmException e) { // ignore @@ -1894,9 +1927,14 @@ public class KeyStore { return keystore; } } - - throw new KeyStoreException("Unrecognized keystore format. " - + "Please load it with a specified type"); + if (matched == null) { + throw new KeyStoreException("Unrecognized keystore format. " + + "Please load it with a specified type"); + } else { + throw new KeyStoreException("Keystore format " + + matched + + " disabled by jdk.crypto.disabledAlgorithms property"); + } } /** diff --git a/src/java.base/share/classes/java/security/KeyStoreSpi.java b/src/java.base/share/classes/java/security/KeyStoreSpi.java index 0b0aa8adf19..5c60f44e4e9 100644 --- a/src/java.base/share/classes/java/security/KeyStoreSpi.java +++ b/src/java.base/share/classes/java/security/KeyStoreSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ package java.security; import java.io.*; +import java.time.Instant; import java.util.*; import java.security.KeyStore.*; @@ -127,6 +128,29 @@ public abstract class KeyStoreSpi { */ public abstract Date engineGetCreationDate(String alias); + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @apiNote Subclasses should override this method to directly return an + * instant. + * + * @implSpec + * The default implementation calls {@code engineGetCreationDate(alias)} + * and returns the output as an {@code Instant} value. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @since 27 + */ + public Instant engineGetCreationInstant(String alias) { + final Date date = engineGetCreationDate(alias); + return date == null ? null : date.toInstant(); + } + /** * Assigns the given key to the given alias, protecting it with the given * password. diff --git a/src/java.base/share/classes/java/util/Scanner.java b/src/java.base/share/classes/java/util/Scanner.java index 3e27325aa0d..948fa595114 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, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,7 +32,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.StringReader; +import java.io.Reader; import java.math.BigDecimal; import java.math.BigInteger; import java.nio.CharBuffer; @@ -800,7 +800,7 @@ public final class Scanner implements Iterator, Closeable { * @param source A string to scan */ public Scanner(String source) { - this(new StringReader(source), WHITESPACE_PATTERN); + this(Reader.of(source), WHITESPACE_PATTERN); } /** diff --git a/src/java.base/share/classes/java/util/TreeMap.java b/src/java.base/share/classes/java/util/TreeMap.java index f8eea8c8d8f..8b6e9dc0bd6 100644 --- a/src/java.base/share/classes/java/util/TreeMap.java +++ b/src/java.base/share/classes/java/util/TreeMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -2138,10 +2138,12 @@ public class TreeMap return null; } public void forEachRemaining(Consumer action) { + Objects.requireNonNull(action); while (hasNext()) action.accept(next()); } public boolean tryAdvance(Consumer action) { + Objects.requireNonNull(action); if (hasNext()) { action.accept(next()); return true; @@ -2176,10 +2178,12 @@ public class TreeMap return null; } public void forEachRemaining(Consumer action) { + Objects.requireNonNull(action); while (hasNext()) action.accept(next()); } public boolean tryAdvance(Consumer action) { + Objects.requireNonNull(action); if (hasNext()) { action.accept(next()); return true; diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java index 9295f0deb59..c4e1839e9fb 100644 --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -3310,7 +3310,7 @@ public class ConcurrentHashMap extends AbstractMap return false; if (tr != null && (tr.parent != t || tr.hash < t.hash)) return false; - if (t.red && tl != null && tl.red && tr != null && tr.red) + if (t.red && (tl != null && tl.red || tr != null && tr.red)) return false; if (tl != null && !checkInvariants(tl)) return false; 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 a198c35c366..140d76c8c91 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -692,7 +692,7 @@ public class ZipFile implements ZipConstants, Closeable { final Set istreams; // List of cached Inflater objects for decompression - Deque inflaterCache; + List inflaterCache; final Cleanable cleanable; @@ -702,7 +702,7 @@ public class ZipFile implements ZipConstants, Closeable { assert zipCoder != null : "null ZipCoder"; this.cleanable = CleanerFactory.cleaner().register(zf, this); this.istreams = Collections.newSetFromMap(new WeakHashMap<>()); - this.inflaterCache = new ArrayDeque<>(); + this.inflaterCache = new ArrayList<>(); this.zsrc = Source.get(file, (mode & OPEN_DELETE) != 0, zipCoder); } @@ -715,10 +715,10 @@ public class ZipFile implements ZipConstants, Closeable { * a new one. */ Inflater getInflater() { - Inflater inf; synchronized (inflaterCache) { - if ((inf = inflaterCache.poll()) != null) { - return inf; + if (!inflaterCache.isEmpty()) { + // return the most recently used Inflater from the cache of not-in-use Inflaters + return inflaterCache.removeLast(); } } return new Inflater(true); @@ -728,7 +728,7 @@ public class ZipFile implements ZipConstants, Closeable { * Releases the specified inflater to the list of available inflaters. */ void releaseInflater(Inflater inf) { - Deque inflaters = this.inflaterCache; + List inflaters = this.inflaterCache; if (inflaters != null) { synchronized (inflaters) { // double checked! @@ -747,13 +747,12 @@ public class ZipFile implements ZipConstants, Closeable { IOException ioe = null; // Release cached inflaters and close the cache first - Deque inflaters = this.inflaterCache; + List inflaters = this.inflaterCache; if (inflaters != null) { synchronized (inflaters) { // no need to double-check as only one thread gets a // chance to execute run() (Cleaner guarantee)... - Inflater inf; - while ((inf = inflaters.poll()) != null) { + for (Inflater inf : inflaters) { inf.end(); } // close inflaters cache @@ -762,23 +761,22 @@ public class ZipFile implements ZipConstants, Closeable { } // Close streams, release their inflaters - if (istreams != null) { - synchronized (istreams) { - if (!istreams.isEmpty()) { - InputStream[] copy = istreams.toArray(new InputStream[0]); - istreams.clear(); - for (InputStream is : copy) { - try { - is.close(); - } catch (IOException e) { - if (ioe == null) ioe = e; - else ioe.addSuppressed(e); - } + synchronized (istreams) { + if (!istreams.isEmpty()) { + InputStream[] copy = istreams.toArray(new InputStream[0]); + istreams.clear(); + for (InputStream is : copy) { + try { + is.close(); + } catch (IOException e) { + if (ioe == null) ioe = e; + else ioe.addSuppressed(e); } } } } + // Release ZIP src if (zsrc != null) { synchronized (zsrc) { @@ -1721,8 +1719,10 @@ public class ZipFile implements ZipConstants, Closeable { this.cen = null; return; // only END header present } - if (end.cenlen > end.endpos) + // Validate END header + if (end.cenlen > end.endpos) { zerror("invalid END header (bad central directory size)"); + } long cenpos = end.endpos - end.cenlen; // position of CEN table // Get position of first local file (LOC) header, taking into // account that there may be a stub prefixed to the ZIP file. @@ -1730,18 +1730,22 @@ public class ZipFile implements ZipConstants, Closeable { if (locpos < 0) { zerror("invalid END header (bad central directory offset)"); } - // read in the CEN if (end.cenlen > MAX_CEN_SIZE) { zerror("invalid END header (central directory size too large)"); } if (end.centot < 0 || end.centot > end.cenlen / CENHDR) { zerror("invalid END header (total entries count too large)"); } - cen = this.cen = new byte[(int)end.cenlen]; - if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen) { + // Validation ensures these are <= Integer.MAX_VALUE + int cenlen = Math.toIntExact(end.cenlen); + int centot = Math.toIntExact(end.centot); + + // read in the CEN + cen = this.cen = new byte[cenlen]; + if (readFullyAt(cen, 0, cen.length, cenpos) != cenlen) { zerror("read CEN tables failed"); } - this.total = Math.toIntExact(end.centot); + this.total = centot; } else { cen = this.cen; this.total = knownTotal; diff --git a/src/java.base/share/classes/javax/crypto/spec/HKDFParameterSpec.java b/src/java.base/share/classes/javax/crypto/spec/HKDFParameterSpec.java index c4ca9e1e183..c5d4f4e5f8f 100644 --- a/src/java.base/share/classes/javax/crypto/spec/HKDFParameterSpec.java +++ b/src/java.base/share/classes/javax/crypto/spec/HKDFParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,7 +50,8 @@ import java.util.Objects; *

* Examples: * {@snippet lang = java: - * // this usage depicts the initialization of an HKDF-Extract AlgorithmParameterSpec + * // this usage depicts the initialization of an HKDF-Extract + * // AlgorithmParameterSpec * AlgorithmParameterSpec derivationSpec = * HKDFParameterSpec.ofExtract() * .addIKM(label) @@ -58,12 +59,14 @@ import java.util.Objects; * .addSalt(salt).extractOnly(); *} * {@snippet lang = java: - * // this usage depicts the initialization of an HKDF-Expand AlgorithmParameterSpec + * // this usage depicts the initialization of an HKDF-Expand + * // AlgorithmParameterSpec * AlgorithmParameterSpec derivationSpec = * HKDFParameterSpec.expandOnly(prk, info, 32); *} * {@snippet lang = java: - * // this usage depicts the initialization of an HKDF-ExtractExpand AlgorithmParameterSpec + * // this usage depicts the initialization of an HKDF-ExtractExpand + * // AlgorithmParameterSpec * AlgorithmParameterSpec derivationSpec = * HKDFParameterSpec.ofExtract() * .addIKM(ikm) @@ -112,8 +115,8 @@ public interface HKDFParameterSpec extends AlgorithmParameterSpec { * * @implNote HKDF implementations will enforce that the length * is not greater than 255 * HMAC length. HKDF implementations - * will also enforce that a {code null} info value is treated as - * zero-length byte array. + * will also enforce that a {@code null} info value is + * treated as zero-length byte array. * * @param info * the optional context and application specific information @@ -261,8 +264,8 @@ public interface HKDFParameterSpec extends AlgorithmParameterSpec { * @implNote HKDF implementations will enforce that the length is * not greater than 255 * HMAC length. Implementations will also * enforce that the prk argument is at least as many bytes as the - * HMAC length. Implementations will also enforce that a {code null} - * info value is treated as zero-length byte array. + * HMAC length. Implementations will also enforce that a + * {@code null} info value is treated as zero-length byte array. * * @param prk * the pseudorandom key (PRK); must not be {@code null} @@ -358,7 +361,7 @@ public interface HKDFParameterSpec extends AlgorithmParameterSpec { * @param prk * the pseudorandom key (PRK); in the case of * {@code ExtractThenExpand}, the {@code prk} argument may be - * {@null} since the output of extract phase is used + * {@code null} since the output of extract phase is used * @param info * the optional context and application specific information * (may be {@code null}); the byte array is cloned to prevent diff --git a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java index 10aa0397f0c..1c565a52c0f 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java +++ b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java @@ -195,10 +195,9 @@ public class BasicImageReader implements AutoCloseable { } if (result.getMajorVersion() != ImageHeader.MAJOR_VERSION || - result.getMinorVersion() != ImageHeader.MINOR_VERSION) { - throw new IOException("The image file \"" + name + "\" is not " + - "the correct version. Major: " + result.getMajorVersion() + - ". Minor: " + result.getMinorVersion()); + result.getMinorVersion() != ImageHeader.MINOR_VERSION) { + throw new ImageVersionMismatchException( + name, result.getMajorVersion(), result.getMinorVersion()); } return result; @@ -447,4 +446,14 @@ public class BasicImageReader implements AutoCloseable { return new ByteArrayInputStream(bytes); } + + public static final class ImageVersionMismatchException extends IOException { + @Deprecated + private static final long serialVersionUID = 1L; + // If needed we could capture major/minor version for use by JImageTask. + ImageVersionMismatchException(String name, int majorVersion, int minorVersion) { + super("The image file \"" + name + "\" is not the correct version. " + + "Major: " + majorVersion + ". Minor: " + minorVersion); + } + } } diff --git a/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java b/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java index de7a5e44b91..c220455e80b 100644 --- a/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java +++ b/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -599,8 +599,8 @@ public class ArraysSupport { if (length > 3) { if (a[aFromIndex] != b[bFromIndex]) return 0; - long aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); - long bOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); + long aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + ((long) aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); + long bOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + ((long) bFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); i = vectorizedMismatch( a, aOffset, b, bOffset, @@ -648,8 +648,8 @@ public class ArraysSupport { if (length > 3) { if (a[aFromIndex] != b[bFromIndex]) return 0; - long aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); - long bOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); + long aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + ((long) aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); + long bOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + ((long) bFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); i = vectorizedMismatch( a, aOffset, b, bOffset, @@ -697,8 +697,8 @@ public class ArraysSupport { if (length > 1) { if (a[aFromIndex] != b[bFromIndex]) return 0; - long aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); - long bOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); + long aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + ((long) aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); + long bOffset = Unsafe.ARRAY_INT_BASE_OFFSET + ((long) bFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); i = vectorizedMismatch( a, aOffset, b, bOffset, @@ -729,8 +729,8 @@ public class ArraysSupport { int i = 0; if (length > 1) { if (Float.floatToRawIntBits(a[aFromIndex]) == Float.floatToRawIntBits(b[bFromIndex])) { - long aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); - long bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); + long aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + ((long) aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); + long bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + ((long) bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); i = vectorizedMismatch( a, aOffset, b, bOffset, @@ -787,8 +787,8 @@ public class ArraysSupport { } if (a[aFromIndex] != b[bFromIndex]) return 0; - long aOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE); - long bOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE); + long aOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + ((long) aFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE); + long bOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + ((long) bFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE); int i = vectorizedMismatch( a, aOffset, b, bOffset, @@ -813,8 +813,8 @@ public class ArraysSupport { } int i = 0; if (Double.doubleToRawLongBits(a[aFromIndex]) == Double.doubleToRawLongBits(b[bFromIndex])) { - long aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); - long bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); + long aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + ((long) aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); + long bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + ((long) bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); i = vectorizedMismatch( a, aOffset, b, bOffset, diff --git a/src/java.base/share/classes/jdk/internal/util/WeakReferenceKey.java b/src/java.base/share/classes/jdk/internal/util/WeakReferenceKey.java index 3fe6d6026d7..0b26aa40c0d 100644 --- a/src/java.base/share/classes/jdk/internal/util/WeakReferenceKey.java +++ b/src/java.base/share/classes/jdk/internal/util/WeakReferenceKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ -88,4 +88,18 @@ final class WeakReferenceKey extends WeakReference implements ReferenceKey public String toString() { return this.getClass().getCanonicalName() + "#" + System.identityHashCode(this); } + + // WeakReferenceKey.equals() is usually executed in the AOT assembly phase. However, + // in some rare occasions, it's not executed (due to peculiarity of hash code and + // memory addressing??). As a result, the constant pool entries used by + // equals() are not resolved. + // + // The JVM calls ensureDeterministicAOTCache() during the AOT assembly phase to ensure + // that the constant pool entries used by equals() are resolved, so that the + // the JDK's default CDS archives have deterministic contents. + private static boolean ensureDeterministicAOTCache() { + WeakReferenceKey k1 = new WeakReferenceKey<>("1", null); + WeakReferenceKey k2 = new WeakReferenceKey<>("2", null); + return k1.equals(k2); + } } diff --git a/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java b/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java index 03f95222a52..23a787971c0 100644 --- a/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java +++ b/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java @@ -336,7 +336,7 @@ public class VectorSupport { @IntrinsicCandidate public static , E> - V libraryUnaryOp(long addr, Class vClass, Class eClass, int length, String debugName, + V libraryUnaryOp(long addr, Class vClass, int laneType, int length, String debugName, V v, UnaryOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; @@ -374,7 +374,7 @@ public class VectorSupport { @IntrinsicCandidate public static - V libraryBinaryOp(long addr, Class vClass, Class eClass, int length, String debugName, + V libraryBinaryOp(long addr, Class vClass, int laneType, int length, String debugName, V v1, V v2, BinaryOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; 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 d30d18df9d6..7e4a6cb90d4 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, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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,12 +30,12 @@ import java.net.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.security.cert.Certificate; import java.util.*; import java.util.jar.*; import java.util.zip.ZipFile; import java.util.zip.ZipEntry; import java.security.CodeSigner; -import java.security.cert.Certificate; import sun.net.www.ParseUtil; /* URL jar file is a common JarFile subtype used for JarURLConnection */ @@ -172,6 +172,7 @@ public class URLJarFile extends JarFile { this.je = je; } + @Override public Attributes getAttributes() throws IOException { if (URLJarFile.this.isSuperMan()) { Map e = URLJarFile.this.superEntries; @@ -184,14 +185,28 @@ public class URLJarFile extends JarFile { return null; } - public java.security.cert.Certificate[] getCertificates() { - Certificate[] certs = je.getCertificates(); - return certs == null? null: certs.clone(); + @Override + public Certificate[] getCertificates() { + // super.getCertificates() returns Certificates that were + // captured by reading the "JarEntry.certs" field when + // the super instance was created. Some JarEntry + // implementations (like java.util.jar.JarFile$JarFileEntry) + // compute certificates lazily, so we explicitly + // call getCertificates() on the underlying JarEntry instead of + // super.getCertificates() + return je.getCertificates(); } + @Override public CodeSigner[] getCodeSigners() { - CodeSigner[] csg = je.getCodeSigners(); - return csg == null? null: csg.clone(); + // super.getCodeSigners() returns CodeSigners that were + // captured by reading the "JarEntry.signers" field when + // the super instance was created. Some JarEntry + // implementations (like java.util.jar.JarFile$JarFileEntry) + // compute codesigners lazily, so we explicitly + // call getCodeSigners() on the underlying JarEntry instead of + // super.getCodeSigners() + return je.getCodeSigners(); } } diff --git a/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java b/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java index 9500a737af7..dc0c8e4d8c9 100644 --- a/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java +++ b/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2026, 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,9 +25,7 @@ package sun.nio.fs; -import java.lang.ref.Cleaner.Cleanable; import jdk.internal.misc.Unsafe; -import jdk.internal.ref.CleanerFactory; /** * A light-weight buffer in native memory. @@ -38,27 +36,17 @@ class NativeBuffer implements AutoCloseable { private final long address; private final int size; - private final Cleanable cleanable; // optional "owner" to avoid copying // (only safe for use by thread-local caches) private Object owner; - private static class Deallocator implements Runnable { - private final long address; - Deallocator(long address) { - this.address = address; - } - public void run() { - unsafe.freeMemory(address); - } - } + // owner thread ID + private long ownerTid; NativeBuffer(int size) { this.address = unsafe.allocateMemory(size); this.size = size; - this.cleanable = CleanerFactory.cleaner() - .register(this, new Deallocator(address)); } @Override @@ -79,16 +67,26 @@ class NativeBuffer implements AutoCloseable { } void free() { - cleanable.clean(); + unsafe.freeMemory(address); } // not synchronized; only safe for use by thread-local caches void setOwner(Object owner) { + Thread thread = Thread.currentThread(); + assert !thread.isVirtual(); + assert ownerTid == 0 || ownerTid == thread.threadId(); this.owner = owner; + this.ownerTid = (owner != null) ? thread.threadId() : 0; } // not synchronized; only safe for use by thread-local caches Object owner() { - return owner; + long tid = Thread.currentThread().threadId(); + assert ownerTid == 0 || ownerTid == tid; + if (ownerTid == tid) { + return owner; + } else { + return null; + } } } diff --git a/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java b/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java index 9b93cce9114..750da8c1a3d 100644 --- a/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java +++ b/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2026, 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 @@ -92,7 +92,8 @@ class NativeBuffers { static NativeBuffer getNativeBuffer(int size) { NativeBuffer buffer = getNativeBufferFromCache(size); if (buffer != null) { - buffer.setOwner(null); + if (!Thread.currentThread().isVirtual()) + buffer.setOwner(null); return buffer; } else { return allocNativeBuffer(size); diff --git a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index f85ba0f9c4b..33e8406a7f6 100644 --- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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,6 +35,8 @@ import java.security.spec.AlgorithmParameterSpec; import java.security.spec.InvalidParameterSpecException; import java.security.spec.KeySpec; import java.security.spec.PKCS8EncodedKeySpec; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.*; import javax.crypto.Cipher; import javax.crypto.SecretKey; @@ -179,7 +181,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { // A keystore entry and associated attributes private static class Entry { - Date date; // the creation date of this entry + Instant date; // the creation date of this entry String alias; byte[] keyId; Set attributes; @@ -212,7 +214,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { CertEntry(X509Certificate cert, byte[] keyId, String alias, ObjectIdentifier[] trustedKeyUsage, Set attributes) { - this.date = new Date(); + this.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); this.cert = cert; this.keyId = keyId; this.alias = alias; @@ -541,9 +543,28 @@ public final class PKCS12KeyStore extends KeyStoreSpi { * not exist */ public Date engineGetCreationDate(String alias) { - Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH)); + final Instant instant = this.engineGetCreationInstant(alias); + if (instant == null) { + return null; + } + return Date.from(instant); + } + + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @since 27 + */ + public Instant engineGetCreationInstant(String alias) { + final Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH)); if (entry != null) { - return new Date(entry.date.getTime()); + return entry.date; } else { return null; } @@ -606,7 +627,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { checkX509Certs(chain); PrivateKeyEntry keyEntry = new PrivateKeyEntry(); - keyEntry.date = new Date(); + keyEntry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); if ((key.getFormat().equals("PKCS#8")) || (key.getFormat().equals("PKCS8"))) { @@ -651,7 +672,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } else if (key instanceof SecretKey) { SecretKeyEntry keyEntry = new SecretKeyEntry(); - keyEntry.date = new Date(); + keyEntry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); // Encode secret key in a PKCS#8 DerOutputStream secretKeyInfo = new DerOutputStream(); @@ -690,7 +711,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { entry.attributes.addAll(attributes); } // set the keyId to current date - entry.keyId = ("Time " + (entry.date).getTime()).getBytes(UTF_8); + entry.keyId = ("Time " + entry.date.toEpochMilli()).getBytes(UTF_8); // set the alias entry.alias = alias.toLowerCase(Locale.ENGLISH); // add the entry @@ -745,7 +766,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } PrivateKeyEntry entry = new PrivateKeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); if (debug != null) { debug.println("Setting a protected private key at alias '" + @@ -753,7 +774,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } // set the keyId to current date - entry.keyId = ("Time " + (entry.date).getTime()).getBytes(UTF_8); + entry.keyId = ("Time " + entry.date.toEpochMilli()).getBytes(UTF_8); // set the alias entry.alias = alias.toLowerCase(Locale.ENGLISH); @@ -2411,21 +2432,22 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } } entry.keyId = keyId; - // restore date if it exists + // restore instant if it exists String keyIdStr = new String(keyId, UTF_8); - Date date = null; + Instant instant = null; if (keyIdStr.startsWith("Time ")) { try { - date = new Date( - Long.parseLong(keyIdStr.substring(5))); + instant = Instant.ofEpochMilli( + Long.parseLong(keyIdStr.substring(5)) + ); } catch (Exception e) { - // date has been initialized to null + // instant has been initialized to null } } - if (date == null) { - date = new Date(); + if (instant == null) { + instant = Instant.now().truncatedTo(ChronoUnit.MILLIS); } - entry.date = date; + entry.date = instant; if (bagItem instanceof PrivateKeyEntry) { keyList.add(entry); diff --git a/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java b/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java index 342df6c5eeb..163454b55fc 100644 --- a/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java +++ b/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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,6 +30,7 @@ import java.net.*; import java.security.*; import java.security.cert.Certificate; import java.security.cert.CertificateException; +import java.time.Instant; import java.util.*; import static java.nio.charset.StandardCharsets.UTF_8; @@ -214,16 +215,32 @@ abstract class DomainKeyStore extends KeyStoreSpi { * not exist */ public Date engineGetCreationDate(String alias) { + final Instant instant = this.engineGetCreationInstant(alias); + return (instant == null) ? null : Date.from(instant); + } + + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @since 27 + */ + public Instant engineGetCreationInstant(String alias) { AbstractMap.SimpleEntry> pair = getKeystoresForReading(alias); - Date date = null; + Instant instant = null; try { String entryAlias = pair.getKey(); for (KeyStore keystore : pair.getValue()) { - date = keystore.getCreationDate(entryAlias); - if (date != null) { + instant = keystore.getCreationInstant(entryAlias); + if (instant != null) { break; } } @@ -231,7 +248,7 @@ abstract class DomainKeyStore extends KeyStoreSpi { throw new IllegalStateException(e); } - return date; + return instant; } @Override diff --git a/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java b/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java index 73ca0c6bf16..f014c2ecbc0 100644 --- a/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java +++ b/src/java.base/share/classes/sun/security/provider/JavaKeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 +30,8 @@ import java.security.*; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; import java.security.cert.CertificateException; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.*; import static java.nio.charset.StandardCharsets.UTF_8; @@ -100,14 +102,14 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { // Private keys and their supporting certificate chains private static class KeyEntry { - Date date; // the creation date of this entry + Instant date; // the creation date of this entry byte[] protectedPrivKey; Certificate[] chain; } // Trusted certificates private static class TrustedCertEntry { - Date date; // the creation date of this entry + Instant date; // the creation date of this entry Certificate cert; } @@ -236,13 +238,31 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { * not exist */ public Date engineGetCreationDate(String alias) { - Object entry = entries.get(convertAlias(alias)); + final Instant instant = this.engineGetCreationInstant(alias); + return instant == null ? null : Date.from(instant); + } + + + + /** + * Returns the instant that the entry identified by the given alias was + * created. + * + * @param alias the alias name + * + * @return the instant that the entry identified by the given alias + * was created, or {@code null} if the given alias does not exist + * + * @since 27 + */ + public Instant engineGetCreationInstant(String alias) { + final Object entry = entries.get(convertAlias(alias)); if (entry != null) { if (entry instanceof TrustedCertEntry) { - return new Date(((TrustedCertEntry)entry).date.getTime()); + return ((TrustedCertEntry)entry).date; } else { - return new Date(((KeyEntry)entry).date.getTime()); + return((KeyEntry)entry).date; } } else { return null; @@ -287,7 +307,7 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { try { synchronized(entries) { KeyEntry entry = new KeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); // Protect the encoding of the key passwordBytes = convertToBytes(password); @@ -350,7 +370,7 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { } KeyEntry entry = new KeyEntry(); - entry.date = new Date(); + entry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); entry.protectedPrivKey = key.clone(); if ((chain != null) && @@ -391,7 +411,7 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { TrustedCertEntry trustedCertEntry = new TrustedCertEntry(); trustedCertEntry.cert = cert; - trustedCertEntry.date = new Date(); + trustedCertEntry.date = Instant.now().truncatedTo(ChronoUnit.MILLIS); entries.put(convertAlias(alias), trustedCertEntry); } } @@ -579,7 +599,7 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { dos.writeUTF(alias); // Write the (entry creation) date - dos.writeLong(((KeyEntry)entry).date.getTime()); + dos.writeLong(((KeyEntry)entry).date.toEpochMilli()); // Write the protected private key dos.writeInt(((KeyEntry)entry).protectedPrivKey.length); @@ -608,7 +628,9 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { dos.writeUTF(alias); // Write the (entry creation) date - dos.writeLong(((TrustedCertEntry)entry).date.getTime()); + dos.writeLong( + ((TrustedCertEntry)entry).date.toEpochMilli() + ); // Write the trusted certificate encoded = ((TrustedCertEntry)entry).cert.getEncoded(); @@ -707,7 +729,7 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { alias = dis.readUTF(); // Read the (entry creation) date - entry.date = new Date(dis.readLong()); + entry.date = Instant.ofEpochMilli(dis.readLong()); // Read the private key entry.protectedPrivKey = @@ -756,7 +778,7 @@ public abstract sealed class JavaKeyStore extends KeyStoreSpi { alias = dis.readUTF(); // Read the (entry creation) date - entry.date = new Date(dis.readLong()); + entry.date = Instant.ofEpochMilli(dis.readLong()); // Read the trusted certificate if (xVersion == 2) { diff --git a/src/java.base/share/classes/sun/security/ssl/Alert.java b/src/java.base/share/classes/sun/security/ssl/Alert.java index d172206326f..fb06b02a5d4 100644 --- a/src/java.base/share/classes/sun/security/ssl/Alert.java +++ b/src/java.base/share/classes/sun/security/ssl/Alert.java @@ -238,7 +238,7 @@ public enum Alert { TransportContext tc = (TransportContext)context; AlertMessage am = new AlertMessage(tc, m); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Received alert message", am); } diff --git a/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java b/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java index f03a65c8410..f56b6f39a44 100644 --- a/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java @@ -157,7 +157,8 @@ final class AlpnExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(SSLExtension.CH_ALPN)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() + && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "Ignore client unavailable extension: " + SSLExtension.CH_ALPN.name); @@ -170,7 +171,8 @@ final class AlpnExtension { String[] laps = chc.sslConfig.applicationProtocols; if ((laps == null) || (laps.length == 0)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "No available application protocols"); } @@ -183,7 +185,8 @@ final class AlpnExtension { int length = ap.getBytes(alpnCharset).length; if (length == 0) { // log the configuration problem - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.severe( "Application protocol name cannot be empty"); } @@ -197,7 +200,8 @@ final class AlpnExtension { listLength += (length + 1); } else { // log the configuration problem - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.severe( "Application protocol name (" + ap + ") exceeds the size limit (" + @@ -212,7 +216,8 @@ final class AlpnExtension { if (listLength > MAX_AP_LIST_LENGTH) { // log the configuration problem - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.severe( "The configured application protocols (" + Arrays.toString(laps) + @@ -266,7 +271,8 @@ final class AlpnExtension { if (!shc.sslConfig.isAvailable(SSLExtension.CH_ALPN)) { shc.applicationProtocol = ""; shc.conContext.applicationProtocol = ""; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "Ignore server unavailable extension: " + SSLExtension.CH_ALPN.name); @@ -288,7 +294,8 @@ final class AlpnExtension { if (noAPSelector && noAlpnProtocols) { shc.applicationProtocol = ""; shc.conContext.applicationProtocol = ""; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore server unenabled extension: " + SSLExtension.CH_ALPN.name); @@ -378,7 +385,8 @@ final class AlpnExtension { (AlpnSpec)shc.handshakeExtensions.get(SSLExtension.CH_ALPN); if (requestedAlps == null) { // Ignore, this extension was not requested and accepted. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + SSLExtension.SH_ALPN.name); @@ -423,7 +431,8 @@ final class AlpnExtension { // Ignore, no negotiated application layer protocol. shc.applicationProtocol = ""; shc.conContext.applicationProtocol = ""; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore, no negotiated application layer protocol"); } diff --git a/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java b/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java index 2d03d5fef98..1444a77aa90 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java @@ -94,7 +94,8 @@ final class CertSignAlgsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable( SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "signature_algorithms_cert extension"); @@ -144,7 +145,8 @@ final class CertSignAlgsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable( SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "signature_algorithms_cert extension"); @@ -235,7 +237,8 @@ final class CertSignAlgsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable( SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "signature_algorithms_cert extension"); @@ -283,7 +286,8 @@ final class CertSignAlgsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable( SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "signature_algorithms_cert extension"); diff --git a/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java b/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java index dd9b7017390..898c8b3d408 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java @@ -144,7 +144,8 @@ final class CertStatusExtension { if (statusType == CertStatusRequestType.OCSP.id) { this.statusRequest = new OCSPStatusRequest(statusType, encoded); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "Unknown certificate status request " + "(status type: " + statusType + ")"); @@ -196,7 +197,8 @@ final class CertStatusExtension { if (type == CertStatusRequestType.OCSP.id) { this.statusResponse = new OCSPStatusResponse(type, respData); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "Unknown certificate status response " + "(status type: " + type + ")"); @@ -557,7 +559,8 @@ final class CertStatusExtension { } if (!chc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + SSLExtension.CH_STATUS_REQUEST.name); @@ -598,7 +601,8 @@ final class CertStatusExtension { ServerHandshakeContext shc = (ServerHandshakeContext)context; if (!shc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Ignore unavailable extension: " + SSLExtension.CH_STATUS_REQUEST.name); } @@ -656,7 +660,8 @@ final class CertStatusExtension { shc.handshakeExtensions.get(SSLExtension.CH_STATUS_REQUEST); if (spec == null) { // Ignore, no status_request extension requested. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Ignore unavailable extension: " + SSLExtension.CH_STATUS_REQUEST.name); } @@ -666,7 +671,8 @@ final class CertStatusExtension { // Is it a session resuming? if (shc.isResumption) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "No status_request response for session resuming"); } @@ -839,7 +845,8 @@ final class CertStatusExtension { statusRequests.add( new OCSPStatusRequest(statusType, encoded)); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "Unknown certificate status request " + "(status type: " + statusType + ")"); @@ -915,7 +922,8 @@ final class CertStatusExtension { } if (!chc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST_V2)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable status_request_v2 extension"); } @@ -957,7 +965,8 @@ final class CertStatusExtension { ServerHandshakeContext shc = (ServerHandshakeContext)context; if (!shc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST_V2)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable status_request_v2 extension"); } @@ -1017,7 +1026,8 @@ final class CertStatusExtension { shc.handshakeExtensions.get(SSLExtension.CH_STATUS_REQUEST_V2); if (spec == null) { // Ignore, no status_request_v2 extension requested. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable status_request_v2 extension"); } @@ -1027,7 +1037,8 @@ final class CertStatusExtension { // Is it a session resuming? if (shc.isResumption) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "No status_request_v2 response for session resumption"); } @@ -1112,7 +1123,8 @@ final class CertStatusExtension { // Stapling needs to be active and have valid data to proceed if (shc.stapleParams == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Stapling is disabled for this connection"); } @@ -1121,7 +1133,8 @@ final class CertStatusExtension { // There needs to be a non-null CertificateEntry to proceed if (shc.currentCertEntry == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Found null CertificateEntry in context"); } return null; @@ -1140,7 +1153,7 @@ final class CertStatusExtension { if (respBytes == null) { // We're done with this entry. Clear it from the context if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("No status response found for " + x509Cert.getSubjectX500Principal()); } @@ -1149,7 +1162,8 @@ final class CertStatusExtension { } // Build a proper response buffer from the stapling information - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("Found status response for " + x509Cert.getSubjectX500Principal() + ", response length: " + respBytes.length); @@ -1208,7 +1222,8 @@ final class CertStatusExtension { respList.add(spec.statusResponse.encodedResponse); chc.handshakeSession.setStatusResponses(respList); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignoring stapled data on resumed session"); } diff --git a/src/java.base/share/classes/sun/security/ssl/CertificateAuthoritiesExtension.java b/src/java.base/share/classes/sun/security/ssl/CertificateAuthoritiesExtension.java index 6be84e8f8fa..60f13e9ddad 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertificateAuthoritiesExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/CertificateAuthoritiesExtension.java @@ -192,7 +192,8 @@ final class CertificateAuthoritiesExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable( SSLExtension.CH_CERTIFICATE_AUTHORITIES)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "certificate_authorities extension"); @@ -205,7 +206,8 @@ final class CertificateAuthoritiesExtension { X509Certificate[] caCerts = chc.sslContext.getX509TrustManager().getAcceptedIssuers(); if (caCerts.length == 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No available certificate authorities"); } @@ -216,7 +218,8 @@ final class CertificateAuthoritiesExtension { List encodedCAs = CertificateAuthoritiesSpec.getEncodedAuthorities(caCerts); if (encodedCAs.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "The number of CAs exceeds the maximum size " + "of the certificate_authorities extension"); @@ -270,7 +273,8 @@ final class CertificateAuthoritiesExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable( SSLExtension.CH_CERTIFICATE_AUTHORITIES)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "certificate_authorities extension"); @@ -319,7 +323,8 @@ final class CertificateAuthoritiesExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable( SSLExtension.CR_CERTIFICATE_AUTHORITIES)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "certificate_authorities extension"); @@ -332,7 +337,8 @@ final class CertificateAuthoritiesExtension { X509Certificate[] caCerts = shc.sslContext.getX509TrustManager().getAcceptedIssuers(); if (caCerts.length == 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No available certificate authorities"); } @@ -343,7 +349,8 @@ final class CertificateAuthoritiesExtension { List encodedCAs = CertificateAuthoritiesSpec.getEncodedAuthorities(caCerts); if (encodedCAs.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Too many certificate authorities to use " + "the certificate_authorities extension"); @@ -397,7 +404,8 @@ final class CertificateAuthoritiesExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable( SSLExtension.CR_CERTIFICATE_AUTHORITIES)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable " + "certificate_authorities extension"); diff --git a/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java b/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java index 2a2db34cab9..c6897d71aa6 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java +++ b/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -265,7 +265,8 @@ final class CertificateMessage { shc.handshakeSession.setLocalCertificates(x509Possession.popCerts); T12CertificateMessage cm = new T12CertificateMessage(shc, x509Possession.popCerts); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced server Certificate handshake message", cm); } @@ -293,7 +294,8 @@ final class CertificateMessage { // an empty cert chain instead. if (x509Possession == null) { if (chc.negotiatedProtocol.useTLS10PlusSpec()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 certificate for client authentication, " + "use empty Certificate message instead"); @@ -302,7 +304,8 @@ final class CertificateMessage { x509Possession = new X509Possession(null, new X509Certificate[0]); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 certificate for client authentication, " + "send a no_certificate alert"); @@ -324,7 +327,8 @@ final class CertificateMessage { } T12CertificateMessage cm = new T12CertificateMessage(chc, x509Possession.popCerts); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced client Certificate handshake message", cm); } @@ -360,13 +364,15 @@ final class CertificateMessage { T12CertificateMessage cm = new T12CertificateMessage(hc, message); if (hc.sslConfig.isClientMode) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming server Certificate handshake message", cm); } onCertificate((ClientHandshakeContext)context, cm); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming client Certificate handshake message", cm); } @@ -501,7 +507,8 @@ final class CertificateMessage { try { thisSubjectAltNames = thisCert.getSubjectAlternativeNames(); } catch (CertificateParsingException cpe) { - if (SSLLogger.isOn() && SSLLogger.isOn("handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Attempt to obtain subjectAltNames extension failed!"); } @@ -511,7 +518,8 @@ final class CertificateMessage { try { prevSubjectAltNames = prevCert.getSubjectAlternativeNames(); } catch (CertificateParsingException cpe) { - if (SSLLogger.isOn() && SSLLogger.isOn("handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Attempt to obtain subjectAltNames extension failed!"); } @@ -980,7 +988,8 @@ final class CertificateMessage { certEnt.extensions.produce(shc, enabledCTExts); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced server Certificate message", cm); } @@ -997,7 +1006,8 @@ final class CertificateMessage { ClientHelloMessage clientHello) { if (hc.peerRequestedCertSignSchemes == null || hc.peerRequestedCertSignSchemes.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No signature_algorithms(_cert) in ClientHello"); } @@ -1008,20 +1018,27 @@ final class CertificateMessage { .stream() .map(ss -> ss.keyAlgorithm) .distinct() - .filter(ka -> SignatureScheme.getPreferableAlgorithm( // Don't select a signature scheme unless - hc.algorithmConstraints, // we will be able to produce - hc.peerRequestedSignatureSchemes, // a CertificateVerify message later + .filter(ka -> SignatureScheme.getPreferableAlgorithm( + // Don't select a signature scheme unless + // we will be able to produce a + // CertificateVerify message later + hc.algorithmConstraints, + hc.peerRequestedSignatureSchemes, ka, hc.negotiatedProtocol) != null - || SSLLogger.logWarning("ssl,handshake", - "Unable to produce CertificateVerify for key algorithm: " + ka)) - .filter(ka -> X509Authentication.valueOfKeyAlgorithm(ka) != null - || SSLLogger.logWarning("ssl,handshake", "Unsupported key algorithm: " + ka)) + || SSLLogger.logWarning(SSLLogger.Opt.HANDSHAKE, + "Unable to produce CertificateVerify for " + + "key algorithm: " + ka)) + .filter(ka -> + X509Authentication.valueOfKeyAlgorithm(ka) != null + || SSLLogger.logWarning(SSLLogger.Opt.HANDSHAKE, + "Unsupported key algorithm: " + ka)) .toArray(String[]::new); SSLPossession pos = X509Authentication .createPossession(hc, supportedKeyTypes); if (pos == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("No available authentication scheme"); } } @@ -1034,14 +1051,16 @@ final class CertificateMessage { SSLPossession pos = choosePossession(chc, clientHello); X509Certificate[] localCerts; if (pos == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No available client authentication scheme"); } localCerts = new X509Certificate[0]; } else { chc.handshakePossessions.add(pos); if (!(pos instanceof X509Possession x509Possession)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 certificate for client authentication"); } @@ -1067,7 +1086,8 @@ final class CertificateMessage { throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, "Failed to produce client Certificate message", ce); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced client Certificate message", cm); } @@ -1103,18 +1123,20 @@ final class CertificateMessage { if (hc.handshakeConsumers.containsKey( SSLHandshake.ENCRYPTED_EXTENSIONS.id)) { throw hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, - "Unexpected Certificate handshake message"); + "Unexpected Certificate handshake message"); } T13CertificateMessage cm = new T13CertificateMessage(hc, message); if (hc.sslConfig.isClientMode) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming server Certificate handshake message", cm); } onConsumeCertificate((ClientHandshakeContext)context, cm); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming client Certificate handshake message", cm); } @@ -1365,5 +1387,4 @@ final class CertificateMessage { return alert; } - } diff --git a/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java b/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java index a297d9d21b2..039399560cd 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java +++ b/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java @@ -297,7 +297,7 @@ final class CertificateRequest { shc.sslContext.getX509TrustManager().getAcceptedIssuers(); T10CertificateRequestMessage crm = new T10CertificateRequestMessage( shc, caCerts, shc.negotiatedCipherSuite.keyExchange); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced CertificateRequest handshake message", crm); } @@ -360,7 +360,7 @@ final class CertificateRequest { T10CertificateRequestMessage crm = new T10CertificateRequestMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateRequest handshake message", crm); } @@ -400,7 +400,8 @@ final class CertificateRequest { } if (clientAlias == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("No available client authentication"); } return; @@ -408,7 +409,8 @@ final class CertificateRequest { PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); if (clientPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("No available client private key"); } return; @@ -416,7 +418,8 @@ final class CertificateRequest { X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); if ((clientCerts == null) || (clientCerts.length == 0)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("No available client certificate"); } return; @@ -655,7 +658,7 @@ final class CertificateRequest { T12CertificateRequestMessage crm = new T12CertificateRequestMessage( shc, caCerts, shc.negotiatedCipherSuite.keyExchange, certReqSignAlgs); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced CertificateRequest handshake message", crm); } @@ -717,7 +720,7 @@ final class CertificateRequest { T12CertificateRequestMessage crm = new T12CertificateRequestMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateRequest handshake message", crm); } @@ -784,7 +787,8 @@ final class CertificateRequest { T12CertificateRequestMessage crm) { if (hc.peerRequestedCertSignSchemes == null || hc.peerRequestedCertSignSchemes.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("No signature and hash algorithms " + "in CertificateRequest"); } @@ -804,26 +808,32 @@ final class CertificateRequest { .stream() .map(ss -> ss.keyAlgorithm) .distinct() - .filter(ka -> SignatureScheme.getPreferableAlgorithm( // Don't select a signature scheme unless - hc.algorithmConstraints, // we will be able to produce - hc.peerRequestedSignatureSchemes, // a CertificateVerify message later + // Don't select a signature scheme unless we will be + // able to produce a CertificateVerify message later + .filter(ka -> SignatureScheme.getPreferableAlgorithm( + hc.algorithmConstraints, + hc.peerRequestedSignatureSchemes, ka, hc.negotiatedProtocol) != null - || SSLLogger.logWarning("ssl,handshake", - "Unable to produce CertificateVerify for key algorithm: " + ka)) + || SSLLogger.logWarning(SSLLogger.Opt.HANDSHAKE, + "Unable to produce CertificateVerify for" + + "key algorithm: " + ka)) .filter(ka -> { var xa = X509Authentication.valueOfKeyAlgorithm(ka); // Any auth object will have a set of allowed key types. - // This set should share at least one common algorithm with - // the CR's allowed key types. - return xa != null && !Collections.disjoint(crKeyTypes, Arrays.asList(xa.keyTypes)) - || SSLLogger.logWarning("ssl,handshake", "Unsupported key algorithm: " + ka); + // This set should share at least one common + // algorithm with the CR's allowed key types. + return xa != null && !Collections.disjoint(crKeyTypes, + Arrays.asList(xa.keyTypes)) + || SSLLogger.logWarning(SSLLogger.Opt.HANDSHAKE, + "Unsupported key algorithm: " + ka); }) .toArray(String[]::new); SSLPossession pos = X509Authentication .createPossession(hc, supportedKeyTypes); if (pos == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("No available authentication scheme"); } } @@ -933,7 +943,8 @@ final class CertificateRequest { SSLExtension[] extTypes = shc.sslConfig.getEnabledExtensions( SSLHandshake.CERTIFICATE_REQUEST, shc.negotiatedProtocol); crm.extensions.produce(shc, extTypes); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced CertificateRequest message", crm); } @@ -985,7 +996,7 @@ final class CertificateRequest { T13CertificateRequestMessage crm = new T13CertificateRequestMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateRequest handshake message", crm); } diff --git a/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java b/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java index c2286f3c422..af1e50d3087 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java +++ b/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java @@ -281,7 +281,7 @@ final class CertificateStatus { new CertificateStatusMessage(chc, message); // Log the message - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming server CertificateStatus handshake message", cst); @@ -325,7 +325,7 @@ final class CertificateStatus { // Create the CertificateStatus message from info in the CertificateStatusMessage csm = new CertificateStatusMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced server CertificateStatus handshake message", csm); } @@ -358,7 +358,8 @@ final class CertificateStatus { // status_request[_v2] extension. 2) The CertificateStatus // message was not sent. This means that cert path checking // was deferred, but must happen immediately. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Server did not send CertificateStatus, " + "checking cert chain without status info."); } diff --git a/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java b/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java index 18ea2b9c3de..47fdef0136d 100644 --- a/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java +++ b/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java @@ -248,7 +248,8 @@ final class CertificateVerify { if (x509Possession == null || x509Possession.popPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 credentials negotiated for CertificateVerify"); } @@ -258,7 +259,7 @@ final class CertificateVerify { S30CertificateVerifyMessage cvm = new S30CertificateVerifyMessage(chc, x509Possession); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced CertificateVerify handshake message", cvm); } @@ -300,7 +301,7 @@ final class CertificateVerify { S30CertificateVerifyMessage cvm = new S30CertificateVerifyMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateVerify handshake message", cvm); } @@ -503,7 +504,8 @@ final class CertificateVerify { if (x509Possession == null || x509Possession.popPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 credentials negotiated for CertificateVerify"); } @@ -513,7 +515,7 @@ final class CertificateVerify { T10CertificateVerifyMessage cvm = new T10CertificateVerifyMessage(chc, x509Possession); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced CertificateVerify handshake message", cvm); } @@ -555,7 +557,7 @@ final class CertificateVerify { T10CertificateVerifyMessage cvm = new T10CertificateVerifyMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateVerify handshake message", cvm); } @@ -754,7 +756,8 @@ final class CertificateVerify { if (x509Possession == null || x509Possession.popPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 credentials negotiated for CertificateVerify"); } @@ -764,7 +767,7 @@ final class CertificateVerify { T12CertificateVerifyMessage cvm = new T12CertificateVerifyMessage(chc, x509Possession); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced CertificateVerify handshake message", cvm); } @@ -806,7 +809,7 @@ final class CertificateVerify { T12CertificateVerifyMessage cvm = new T12CertificateVerifyMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateVerify handshake message", cvm); } @@ -1092,7 +1095,8 @@ final class CertificateVerify { if (x509Possession == null || x509Possession.popPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No X.509 credentials negotiated for CertificateVerify"); } @@ -1113,7 +1117,7 @@ final class CertificateVerify { X509Possession x509Possession) throws IOException { T13CertificateVerifyMessage cvm = new T13CertificateVerifyMessage(shc, x509Possession); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced server CertificateVerify handshake message", cvm); } @@ -1130,7 +1134,7 @@ final class CertificateVerify { X509Possession x509Possession) throws IOException { T13CertificateVerifyMessage cvm = new T13CertificateVerifyMessage(chc, x509Possession); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced client CertificateVerify handshake message", cvm); } @@ -1173,7 +1177,7 @@ final class CertificateVerify { T13CertificateVerifyMessage cvm = new T13CertificateVerifyMessage(hc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming CertificateVerify handshake message", cvm); } diff --git a/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java b/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java index d3eac8f13af..2907fc4d7b9 100644 --- a/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java +++ b/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java @@ -108,7 +108,7 @@ final class ChangeCipherSpec { ") and protocol version (" + hc.negotiatedProtocol + ")"); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced ChangeCipherSpec message"); } @@ -142,7 +142,7 @@ final class ChangeCipherSpec { throw tc.fatal(Alert.UNEXPECTED_MESSAGE, "Malformed or unexpected ChangeCipherSpec message"); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Consuming ChangeCipherSpec message"); } @@ -237,7 +237,7 @@ final class ChangeCipherSpec { throw tc.fatal(Alert.UNEXPECTED_MESSAGE, "Malformed or unexpected ChangeCipherSpec message"); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Consuming ChangeCipherSpec message"); } diff --git a/src/java.base/share/classes/sun/security/ssl/ClientHello.java b/src/java.base/share/classes/sun/security/ssl/ClientHello.java index 421673d625d..2bb1233b4c8 100644 --- a/src/java.base/share/classes/sun/security/ssl/ClientHello.java +++ b/src/java.base/share/classes/sun/security/ssl/ClientHello.java @@ -431,7 +431,7 @@ final class ClientHello { if (!session.isRejoinable()) { session = null; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, the session is not rejoinable"); } @@ -444,7 +444,7 @@ final class ClientHello { if (!chc.isNegotiable(sessionSuite)) { session = null; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, unavailable session cipher suite"); } @@ -457,7 +457,7 @@ final class ClientHello { if (!chc.isNegotiable(sessionVersion)) { session = null; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, unavailable protocol version"); } @@ -514,7 +514,7 @@ final class ClientHello { session.getIdentificationProtocol(); if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("Can't resume, endpoint id" + " algorithm does not match, requested: " + identityAlg + ", cached: " + sessionIdentityAlg); @@ -524,7 +524,8 @@ final class ClientHello { } if (session != null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("Try resuming session", session); } @@ -548,7 +549,7 @@ final class ClientHello { } if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "No new session is allowed, so try to resume " + "the session cipher suite only", sessionSuite); @@ -634,7 +635,8 @@ final class ClientHello { SSLHandshake.CLIENT_HELLO, chc.activeProtocols); chm.extensions.produce(chc, extTypes); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced ClientHello handshake message", chm); } @@ -700,7 +702,8 @@ final class ClientHello { // // The HelloVerifyRequest consumer should have updated the // ClientHello handshake message with cookie. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced ClientHello(cookie) handshake message", chc.initialClientHelloMsg); @@ -734,7 +737,8 @@ final class ClientHello { // TLS 1.3 // The HelloRetryRequest consumer should have updated the // ClientHello handshake message with cookie. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced ClientHello(HRR) handshake message", chc.initialClientHelloMsg); @@ -790,7 +794,7 @@ final class ClientHello { ClientHelloMessage chm = new ClientHelloMessage(shc, message, enabledExtensions); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Consuming ClientHello handshake message", chm); } @@ -820,7 +824,7 @@ final class ClientHello { negotiateProtocol(context, clientHello.clientVersion); } context.negotiatedProtocol = negotiatedProtocol; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Negotiated protocol version: " + negotiatedProtocol.name); } @@ -981,7 +985,7 @@ final class ClientHello { (previous != null) && previous.isRejoinable(); if (!resumingSession) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "the existing session is not rejoinable"); @@ -994,7 +998,7 @@ final class ClientHello { if (sessionProtocol != shc.negotiatedProtocol) { resumingSession = false; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, not the same protocol version"); } @@ -1009,7 +1013,7 @@ final class ClientHello { } catch (SSLPeerUnverifiedException e) { resumingSession = false; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "client authentication is required"); @@ -1024,7 +1028,7 @@ final class ClientHello { (!clientHello.cipherSuites.contains(suite))) { resumingSession = false; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "the session cipher suite is absent"); @@ -1040,7 +1044,7 @@ final class ClientHello { previous.getIdentificationProtocol(); if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("Can't resume, endpoint id" + " algorithm does not match, requested: " + identityAlg + ", cached: " + sessionIdentityAlg); @@ -1055,7 +1059,7 @@ final class ClientHello { shc.resumingSession = resumingSession ? previous : null; if (!resumingSession && SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Session not resumed."); } } @@ -1322,7 +1326,7 @@ final class ClientHello { (previous != null) && previous.isRejoinable(); if (!resumingSession) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "the existing session is not rejoinable"); @@ -1335,7 +1339,7 @@ final class ClientHello { if (sessionProtocol != shc.negotiatedProtocol) { resumingSession = false; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, not the same protocol version"); } @@ -1351,7 +1355,7 @@ final class ClientHello { } catch (SSLPeerUnverifiedException e) { resumingSession = false; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "client authentication is required"); @@ -1366,7 +1370,7 @@ final class ClientHello { (!clientHello.cipherSuites.contains(suite))) { resumingSession = false; if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "the session cipher suite is absent"); diff --git a/src/java.base/share/classes/sun/security/ssl/CookieExtension.java b/src/java.base/share/classes/sun/security/ssl/CookieExtension.java index b42cea082e0..e5cb3371d75 100644 --- a/src/java.base/share/classes/sun/security/ssl/CookieExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/CookieExtension.java @@ -117,7 +117,8 @@ public class CookieExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(SSLExtension.CH_COOKIE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable cookie extension"); } @@ -154,7 +155,8 @@ public class CookieExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SSLExtension.CH_COOKIE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable cookie extension"); } @@ -218,7 +220,8 @@ public class CookieExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SSLExtension.HRR_COOKIE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable cookie extension"); } @@ -253,7 +256,8 @@ public class CookieExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(SSLExtension.HRR_COOKIE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable cookie extension"); } @@ -280,7 +284,8 @@ public class CookieExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SSLExtension.HRR_COOKIE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable cookie extension"); } diff --git a/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java index 53f9896a3e4..63031e2b0db 100644 --- a/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java @@ -187,7 +187,7 @@ final class DHClientKeyExchange { chc.handshakePossessions.add(dhePossession); DHClientKeyExchangeMessage ckem = new DHClientKeyExchangeMessage(chc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced DH ClientKeyExchange handshake message", ckem); } @@ -268,7 +268,7 @@ final class DHClientKeyExchange { DHClientKeyExchangeMessage ckem = new DHClientKeyExchangeMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming DH ClientKeyExchange handshake message", ckem); } diff --git a/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java index 7d94598f5cf..afef70a29d5 100644 --- a/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java @@ -481,7 +481,7 @@ final class DHServerKeyExchange { ServerHandshakeContext shc = (ServerHandshakeContext)context; DHServerKeyExchangeMessage skem = new DHServerKeyExchangeMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced DH ServerKeyExchange handshake message", skem); } @@ -512,7 +512,7 @@ final class DHServerKeyExchange { DHServerKeyExchangeMessage skem = new DHServerKeyExchangeMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming DH ServerKeyExchange handshake message", skem); } diff --git a/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java b/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java index e880f36e846..91759ae6c4b 100644 --- a/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -125,7 +125,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { return null; } - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw read", packet); } @@ -150,7 +150,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { int contentLen = ((packet.get() & 0xFF) << 8) | (packet.get() & 0xFF); // pos: 11, 12 - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine("READ: " + ProtocolVersion.nameOf(majorVersion, minorVersion) + " " + ContentType.nameOf(contentType) + ", length = " + @@ -162,7 +162,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (this.readEpoch > recordEpoch) { // Reset the position of the packet buffer. packet.position(recLim); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine("READ: discard this old record", recordEnS); } return null; @@ -181,7 +181,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { packet.position(recLim); - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Premature record (epoch), discard it."); } @@ -223,7 +224,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { plaintextFragment = plaintext.fragment; contentType = plaintext.contentType; } catch (GeneralSecurityException gse) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Discard invalid record: " + gse); } @@ -241,7 +242,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // Cleanup the handshake reassembler if necessary. if ((reassembler != null) && (reassembler.handshakeEpoch < recordEpoch)) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Cleanup the handshake reassembler"); } @@ -273,7 +275,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (hsFrag == null) { // invalid, discard this record - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Invalid handshake message, discard it."); } @@ -296,7 +299,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { return pt == null ? null : new Plaintext[] { pt }; } - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("The reassembler is not initialized yet."); } @@ -356,7 +360,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { int remaining = plaintextFragment.remaining(); if (remaining < handshakeHeaderSize) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Discard invalid record: " + "too small record to hold a handshake fragment"); } @@ -368,7 +372,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // Fail fast for unknown handshake message. byte handshakeType = plaintextFragment.get(); // pos: 0 if (!SSLHandshake.isKnown(handshakeType)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Discard invalid record: " + "unknown handshake type size, Handshake.msg_type = " + (handshakeType & 0xFF)); @@ -404,7 +408,7 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { ((plaintextFragment.get() & 0xFF) << 8) | (plaintextFragment.get() & 0xFF); // pos: 9-11 if ((remaining - handshakeHeaderSize) < fragmentLength) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Discard invalid record: " + "not a complete handshake fragment in the record"); } @@ -748,7 +752,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // It's OK to discard retransmission as the handshake hash // is computed as if each handshake message had been sent // as a single fragment. - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Have got the full message, discard it."); } @@ -767,9 +772,11 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { } // The ranges SHOULD NOT overlap. - if (hole.offset > hsf.fragmentOffset || hole.limit < fragmentLimit) { + if (hole.offset > hsf.fragmentOffset || + hole.limit < fragmentLimit) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Discard invalid record: " + "handshake fragment ranges are overlapping"); } @@ -837,9 +844,11 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { } // Read the random (32 bytes) if (fragmentData.remaining() < 32) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { - SSLLogger.fine("Rejected client hello fragment (bad random len) " + - "fo=" + hsf.fragmentOffset + " fl=" + hsf.fragmentLength); + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { + SSLLogger.fine("Rejected client hello fragment" + + "(bad random len) fo=" + + hsf.fragmentOffset + " fl=" + hsf.fragmentLength); } return null; } @@ -861,9 +870,11 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // Cookie byte[] cookie = Record.getBytes8(fragmentData); if (firstHello && cookie.length != 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { - SSLLogger.fine("Rejected initial client hello fragment (bad cookie len) " + - "fo=" + hsf.fragmentOffset + " fl=" + hsf.fragmentLength); + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { + SSLLogger.fine("Rejected initial client hello " + + " fragment (bad cookie len) fo=" + + hsf.fragmentOffset + " fl=" + hsf.fragmentLength); } return null; } @@ -897,9 +908,11 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { } } } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Rejected client hello fragment " + - "fo=" + hsf.fragmentOffset + " fl=" + hsf.fragmentLength); + "fo=" + hsf.fragmentOffset + " fl=" + + hsf.fragmentLength); } return null; } @@ -1029,7 +1042,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { int previousEpoch = nextRecordEpoch - 1; if (rf.recordEpoch < previousEpoch) { // Too old to use, discard this record. - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Too old epoch to use this record, discard it."); } @@ -1075,7 +1089,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (!isDesired) { // Too old to use, discard this retransmitted record - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Too old retransmission to use, discard it."); } @@ -1088,7 +1103,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // Previously disordered record for the current epoch. // // Should have been retransmitted. Discard this record. - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Lagging behind record (sequence), discard it."); } @@ -1126,7 +1142,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { Plaintext acquirePlaintext() throws SSLProtocolException { if (bufferedFragments.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("No received handshake messages"); } return null; @@ -1147,7 +1164,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // Reset the next handshake flight. resetHandshakeFlight(precedingFlight); - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Received a retransmission flight."); } @@ -1159,7 +1177,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { } if (!flightIsReady) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "The handshake flight is not ready to use: " + handshakeFlight.handshakeType); @@ -1244,7 +1263,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (readEpoch != rFrag.recordEpoch) { if (readEpoch > rFrag.recordEpoch) { // discard old records - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Discard old buffered ciphertext fragments."); } @@ -1256,7 +1276,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { flightIsReady = false; } - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Not yet ready to decrypt the cached fragments."); } @@ -1273,7 +1294,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { plaintextFragment = plaintext.fragment; rFrag.contentType = plaintext.contentType; } catch (GeneralSecurityException gse) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Discard invalid record: ", gse); } @@ -1295,7 +1317,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (hsFrag == null) { // invalid, discard this record - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Invalid handshake fragment, discard it", plaintextFragment); @@ -1446,7 +1469,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (expectCCSFlight) { // Have the ChangeCipherSpec/Finished flight been received? boolean isReady = hasFinishedMessage(); - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Has the final flight been received? " + isReady); } @@ -1454,7 +1478,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { return isReady; } - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("No flight is received yet."); } @@ -1467,7 +1492,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // single handshake message flight boolean isReady = hasCompleted(flightType); - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Is the handshake message completed? " + isReady); } @@ -1481,7 +1507,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (flightType == SSLHandshake.SERVER_HELLO.id) { // Firstly, check the first flight handshake message. if (!hasCompleted(flightType)) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "The ServerHello message is not completed yet."); } @@ -1493,7 +1520,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // an abbreviated handshake // if (hasFinishedMessage()) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("It's an abbreviated handshake."); } @@ -1507,7 +1535,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { SSLHandshake.SERVER_HELLO_DONE.id); if ((holes == null) || !holes.isEmpty()) { // Not yet got the final message of the flight. - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Not yet got the ServerHelloDone message"); } @@ -1519,7 +1548,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { boolean isReady = hasCompleted(bufferedFragments, handshakeFlight.minMessageSeq, handshakeFlight.maxMessageSeq); - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Is the ServerHello flight (message " + handshakeFlight.minMessageSeq + "-" + @@ -1542,7 +1572,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // Firstly, check the first flight handshake message. if (!hasCompleted(flightType)) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "The ClientKeyExchange or client Certificate " + "message is not completed yet."); @@ -1556,7 +1587,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (needClientVerify(bufferedFragments) && !hasCompleted(SSLHandshake.CERTIFICATE_VERIFY.id)) { - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Not yet have the CertificateVerify message"); } @@ -1567,7 +1599,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { if (!hasFinishedMessage()) { // not yet have the ChangeCipherSpec/Finished messages - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Not yet have the ChangeCipherSpec and " + "Finished messages"); @@ -1580,7 +1613,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { boolean isReady = hasCompleted(bufferedFragments, handshakeFlight.minMessageSeq, handshakeFlight.maxMessageSeq); - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Is the ClientKeyExchange flight (message " + handshakeFlight.minMessageSeq + "-" + @@ -1594,7 +1628,8 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { // // Otherwise, need to receive more handshake messages. // - if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Need to receive more handshake messages"); } @@ -1741,4 +1776,3 @@ final class DTLSInputRecord extends InputRecord implements DTLSRecord { } } } - diff --git a/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java b/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java index 6bb23b72ef9..c69f00afba1 100644 --- a/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java @@ -92,7 +92,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { void changeWriteCiphers(SSLWriteCipher writeCipher, boolean useChangeCipherSpec) { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "change_cipher_spec message"); } @@ -120,7 +120,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { @Override void encodeAlert(byte level, byte description) { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "alert message: " + Alert.nameOf(description)); } @@ -137,7 +137,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { @Override void encodeChangeCipherSpec() { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "change_cipher_spec message"); } @@ -154,7 +154,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { void encodeHandshake(byte[] source, int offset, int length) { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "handshake message", ByteBuffer.wrap(source, offset, length)); @@ -179,14 +179,14 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { if (isClosed) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "application data or cached messages"); } return null; } else if (isCloseWaiting) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "application data"); } @@ -201,7 +201,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { ByteBuffer destination) throws IOException { if (writeCipher.authenticator.seqNumOverflow()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( "sequence number extremely close to overflow " + "(2^64-1 packets). Closing connection."); @@ -269,7 +269,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { destination.limit(destination.position()); destination.position(dstContent); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.APPLICATION_DATA.name + @@ -282,7 +282,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { dstPos, dstLim, headerSize, protocolVersion); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { ByteBuffer temporary = destination.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); @@ -497,7 +497,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { dstBuf.limit(dstBuf.position()); dstBuf.position(dstContent); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.nameOf(memo.contentType) + @@ -511,7 +511,7 @@ final class DTLSOutputRecord extends OutputRecord implements DTLSRecord { ProtocolVersion.valueOf(memo.majorVersion, memo.minorVersion)); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { ByteBuffer temporary = dstBuf.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); diff --git a/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java index a626f6f34d0..00060963d08 100644 --- a/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java @@ -199,7 +199,7 @@ final class ECDHClientKeyExchange { ECDHClientKeyExchangeMessage cke = new ECDHClientKeyExchangeMessage( chc, sslPossession.encode()); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced ECDH ClientKeyExchange handshake message", cke); } @@ -308,7 +308,7 @@ final class ECDHClientKeyExchange { // parse either handshake message containing either EC/XEC. ECDHClientKeyExchangeMessage cke = new ECDHClientKeyExchangeMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming ECDH ClientKeyExchange handshake message", cke); } @@ -397,7 +397,7 @@ final class ECDHClientKeyExchange { new ECDHClientKeyExchangeMessage( chc, sslPossession.encode()); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced ECDHE ClientKeyExchange handshake message", cke); } @@ -490,7 +490,7 @@ final class ECDHClientKeyExchange { // parse the EC/XEC handshake message ECDHClientKeyExchangeMessage cke = new ECDHClientKeyExchangeMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming ECDHE ClientKeyExchange handshake message", cke); } diff --git a/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java index 82e888ef98f..9a2c21db05c 100644 --- a/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java @@ -489,7 +489,7 @@ final class ECDHServerKeyExchange { ServerHandshakeContext shc = (ServerHandshakeContext)context; ECDHServerKeyExchangeMessage skem = new ECDHServerKeyExchangeMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced ECDH ServerKeyExchange handshake message", skem); } @@ -522,7 +522,7 @@ final class ECDHServerKeyExchange { // AlgorithmConstraints are checked during decoding ECDHServerKeyExchangeMessage skem = new ECDHServerKeyExchangeMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming ECDH ServerKeyExchange handshake message", skem); } diff --git a/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java b/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java index de61e44b258..64d0aea80bb 100644 --- a/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java @@ -171,7 +171,8 @@ final class ECPointFormatsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(CH_EC_POINT_FORMATS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable ec_point_formats extension"); } @@ -193,7 +194,7 @@ final class ECPointFormatsExtension { return extData; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Need no ec_point_formats extension"); } @@ -221,7 +222,8 @@ final class ECPointFormatsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(CH_EC_POINT_FORMATS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable ec_point_formats extension"); } diff --git a/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java b/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java index bc34e6fe113..8379d5f6cab 100644 --- a/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java +++ b/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java @@ -134,7 +134,7 @@ final class EncryptedExtensions { SSLHandshake.ENCRYPTED_EXTENSIONS, shc.negotiatedProtocol); eem.extensions.produce(shc, extTypes); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced EncryptedExtensions message", eem); } @@ -168,7 +168,7 @@ final class EncryptedExtensions { EncryptedExtensionsMessage eem = new EncryptedExtensionsMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming EncryptedExtensions handshake message", eem); } diff --git a/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java b/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java index a6bedd9e205..91e5fa499db 100644 --- a/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java @@ -119,7 +119,8 @@ final class ExtendedMasterSecretExtension { if (!chc.sslConfig.isAvailable(CH_EXTENDED_MASTER_SECRET) || !SSLConfiguration.useExtendedMasterSecret || !chc.conContext.protocolVersion.useTLS10PlusSpec()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extended_master_secret extension"); } @@ -162,7 +163,8 @@ final class ExtendedMasterSecretExtension { if (!shc.sslConfig.isAvailable(CH_EXTENDED_MASTER_SECRET) || !SSLConfiguration.useExtendedMasterSecret || !shc.negotiatedProtocol.useTLS10PlusSpec()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Ignore unavailable extension: " + CH_EXTENDED_MASTER_SECRET.name); } @@ -182,7 +184,8 @@ final class ExtendedMasterSecretExtension { // with a full handshake. shc.isResumption = false; shc.resumingSession = null; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "abort session resumption which did not use " + "Extended Master Secret extension"); @@ -213,7 +216,8 @@ final class ExtendedMasterSecretExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(CH_EXTENDED_MASTER_SECRET) || !SSLConfiguration.useExtendedMasterSecret) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Ignore unavailable extension: " + CH_EXTENDED_MASTER_SECRET.name); } @@ -252,7 +256,8 @@ final class ExtendedMasterSecretExtension { } else { // Otherwise, continue with a full handshake. shc.isResumption = false; shc.resumingSession = null; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "abort session resumption, " + "missing Extended Master Secret extension"); diff --git a/src/java.base/share/classes/sun/security/ssl/Finished.java b/src/java.base/share/classes/sun/security/ssl/Finished.java index 4238ced8f01..bf2d2230719 100644 --- a/src/java.base/share/classes/sun/security/ssl/Finished.java +++ b/src/java.base/share/classes/sun/security/ssl/Finished.java @@ -390,7 +390,7 @@ final class Finished { // Change write cipher and delivery ChangeCipherSpec message. ChangeCipherSpec.t10Producer.produce(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced client Finished handshake message", fm); } @@ -453,7 +453,7 @@ final class Finished { // Change write cipher and delivery ChangeCipherSpec message. ChangeCipherSpec.t10Producer.produce(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced server Finished handshake message", fm); } @@ -542,7 +542,7 @@ final class Finished { private void onConsumeFinished(ClientHandshakeContext chc, ByteBuffer message) throws IOException { FinishedMessage fm = new FinishedMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming server Finished handshake message", fm); } @@ -602,7 +602,7 @@ final class Finished { } FinishedMessage fm = new FinishedMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming client Finished handshake message", fm); } @@ -681,7 +681,7 @@ final class Finished { chc.handshakeHash.update(); FinishedMessage fm = new FinishedMessage(chc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced client Finished handshake message", fm); } @@ -778,7 +778,7 @@ final class Finished { shc.handshakeHash.update(); FinishedMessage fm = new FinishedMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced server Finished handshake message", fm); } @@ -930,7 +930,7 @@ final class Finished { } FinishedMessage fm = new FinishedMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming server Finished handshake message", fm); } @@ -1073,7 +1073,7 @@ final class Finished { } FinishedMessage fm = new FinishedMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming client Finished handshake message", fm); } diff --git a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java index a5f340d5203..54a2650c058 100644 --- a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java +++ b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java @@ -284,14 +284,16 @@ abstract class HandshakeContext implements ConnectionContext { found = true; break; } - } else if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "Ignore unsupported cipher suite: " + suite + " for " + protocol.name); } } - if (!found && (SSLLogger.isOn()) && SSLLogger.isOn("handshake")) { + if (!found && (SSLLogger.isOn()) && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No available cipher suite for " + protocol.name); } @@ -335,7 +337,8 @@ abstract class HandshakeContext implements ConnectionContext { } if (!isSupported && - SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore unsupported cipher suite: " + suite); } @@ -556,7 +559,8 @@ abstract class HandshakeContext implements ConnectionContext { cachedStatus.put(groupType, groupAvailable); if (!groupAvailable && - SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine( "No activated named group in " + groupType); } @@ -570,13 +574,15 @@ abstract class HandshakeContext implements ConnectionContext { } } - if (!retval && SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + if (!retval && SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("No active named group(s), ignore " + suite); } return retval; - } else if (SSLLogger.isOn() && SSLLogger.isOn("verbose")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("Ignore disabled cipher suite: " + suite); } diff --git a/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java b/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java index 61571cfd03b..b46de0514f8 100644 --- a/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java +++ b/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java @@ -61,7 +61,7 @@ public class HandshakeOutStream extends ByteArrayOutputStream { if (!outputRecord.isClosed()) { outputRecord.encodeHandshake(buf, 0, count); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "handshake messages", ByteBuffer.wrap(buf, 0, count)); } diff --git a/src/java.base/share/classes/sun/security/ssl/HelloRequest.java b/src/java.base/share/classes/sun/security/ssl/HelloRequest.java index b207e1071b0..d2d3b033e80 100644 --- a/src/java.base/share/classes/sun/security/ssl/HelloRequest.java +++ b/src/java.base/share/classes/sun/security/ssl/HelloRequest.java @@ -101,7 +101,7 @@ final class HelloRequest { ServerHandshakeContext shc = (ServerHandshakeContext)context; HelloRequestMessage hrm = new HelloRequestMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced HelloRequest handshake message", hrm); } @@ -137,7 +137,7 @@ final class HelloRequest { ServerHandshakeContext shc = (ServerHandshakeContext)context; HelloRequestMessage hrm = new HelloRequestMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced HelloRequest handshake message", hrm); } @@ -177,7 +177,7 @@ final class HelloRequest { // be sent by the server at any time. Please don't clean up this // handshake consumer. HelloRequestMessage hrm = new HelloRequestMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming HelloRequest handshake message", hrm); } @@ -190,7 +190,8 @@ final class HelloRequest { } if (!chc.conContext.secureRenegotiation) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Continue with insecure renegotiation"); } @@ -206,7 +207,8 @@ final class HelloRequest { // SSLHandshake.CLIENT_HELLO.produce(context, hrm); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore HelloRequest, handshaking is in progress"); } diff --git a/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java b/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java index 1922a4339bb..5c0833eef5c 100644 --- a/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java +++ b/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java @@ -140,7 +140,7 @@ final class HelloVerifyRequest { HelloVerifyRequestMessage hvrm = new HelloVerifyRequestMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced HelloVerifyRequest handshake message", hvrm); } @@ -197,7 +197,7 @@ final class HelloVerifyRequest { HelloVerifyRequestMessage hvrm = new HelloVerifyRequestMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming HelloVerifyRequest handshake message", hvrm); } diff --git a/src/java.base/share/classes/sun/security/ssl/KAKeyDerivation.java b/src/java.base/share/classes/sun/security/ssl/KAKeyDerivation.java index af62faf4706..39e82b50435 100644 --- a/src/java.base/share/classes/sun/security/ssl/KAKeyDerivation.java +++ b/src/java.base/share/classes/sun/security/ssl/KAKeyDerivation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, 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 @@ -214,13 +214,13 @@ public class KAKeyDerivation implements SSLKeyDerivation { var decapsulator = kem.newDecapsulator(localPrivateKey); sharedSecret = decapsulator.decapsulate( keyshare, 0, decapsulator.secretSize(), - "Generic"); + "TlsPremasterSecret"); } else { // Using traditional DH-style Key Agreement KeyAgreement ka = KeyAgreement.getInstance(algorithmName); ka.init(localPrivateKey); ka.doPhase(peerPublicKey, true); - sharedSecret = ka.generateSecret("Generic"); + sharedSecret = ka.generateSecret("TlsPremasterSecret"); } return deriveHandshakeSecret(type, sharedSecret); diff --git a/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java b/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java index 0d2cbb8f529..67780afea4f 100644 --- a/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java @@ -93,7 +93,8 @@ final class KeyShareExtension { Record.putInt16(m, namedGroupId); Record.putBytes16(m, keyExchange); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Unlikely IOException", ioe); } @@ -225,7 +226,8 @@ final class KeyShareExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(SSLExtension.CH_KEY_SHARE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable key_share extension"); } @@ -240,7 +242,8 @@ final class KeyShareExtension { namedGroups = chc.clientRequestedNamedGroups; if (namedGroups == null || namedGroups.isEmpty()) { // No supported groups. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore key_share extension, no supported groups"); } @@ -290,7 +293,8 @@ final class KeyShareExtension { NamedGroup ng) { SSLKeyExchange ke = SSLKeyExchange.valueOf(ng); if (ke == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No key exchange for named group " + ng.name); } @@ -328,7 +332,8 @@ final class KeyShareExtension { ServerHandshakeContext shc = (ServerHandshakeContext)context; if (shc.handshakeExtensions.containsKey(SSLExtension.CH_KEY_SHARE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "The key_share extension has been loaded"); } @@ -337,7 +342,8 @@ final class KeyShareExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SSLExtension.CH_KEY_SHARE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable key_share extension"); } @@ -352,7 +358,7 @@ final class KeyShareExtension { if (ng == null || !NamedGroup.isActivatable(shc.sslConfig, shc.algorithmConstraints, ng)) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unsupported named group: " + NamedGroup.nameOf(entry.namedGroupId)); @@ -367,7 +373,7 @@ final class KeyShareExtension { if (!isCredentialPermitted(shc.algorithmConstraints, kaCred)) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "key share entry of " + ng + " does not " + "comply with algorithm constraints"); @@ -376,7 +382,8 @@ final class KeyShareExtension { credentials.add(kaCred); } } catch (GeneralSecurityException ex) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Cannot decode named group: " + NamedGroup.nameOf(entry.namedGroupId)); @@ -520,7 +527,8 @@ final class KeyShareExtension { SSLExtension.CH_KEY_SHARE); if (kss == null) { // Unlikely, no key_share extension requested. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore, no client key_share extension"); } @@ -529,7 +537,8 @@ final class KeyShareExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SSLExtension.SH_KEY_SHARE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore, no available server key_share extension"); } @@ -540,7 +549,8 @@ final class KeyShareExtension { if ((shc.handshakeCredentials == null) || shc.handshakeCredentials.isEmpty()) { // Unlikely, HelloRetryRequest should be used earlier. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No available client key share entries"); } @@ -560,7 +570,8 @@ final class KeyShareExtension { SSLKeyExchange ke = SSLKeyExchange.valueOf(ng); if (ke == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No key exchange for named group " + ng.name); } @@ -624,7 +635,8 @@ final class KeyShareExtension { if (keyShare == null) { // Unlikely, HelloRetryRequest should be used instead earlier. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No available server key_share extension"); } @@ -757,7 +769,7 @@ final class KeyShareExtension { ClientHandshakeContext chc = (ClientHandshakeContext)context; // Cannot use the previous requested key shares anymore. - if (SSLLogger.isOn() && SSLLogger.isOn("handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No key_share extension in ServerHello, " + "cleanup the key shares if necessary"); @@ -850,7 +862,8 @@ final class KeyShareExtension { for (NamedGroup ng : shc.clientRequestedNamedGroups) { if (NamedGroup.isActivatable(shc.sslConfig, shc.algorithmConstraints, ng)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "HelloRetryRequest selected named group: " + ng.name); diff --git a/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java b/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java index 4e5a9683079..db7ea170a23 100644 --- a/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java +++ b/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java @@ -191,7 +191,7 @@ final class KeyUpdate { // The consuming happens in client side only. PostHandshakeContext hc = (PostHandshakeContext)context; KeyUpdateMessage km = new KeyUpdateMessage(hc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming KeyUpdate post-handshake message", km); } @@ -235,7 +235,7 @@ final class KeyUpdate { rc.baseSecret = nplus1; hc.conContext.inputRecord.changeReadCiphers(rc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("KeyUpdate: read key updated"); } } catch (GeneralSecurityException gse) { @@ -276,7 +276,7 @@ final class KeyUpdate { return null; } KeyUpdateMessage km = (KeyUpdateMessage)message; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced KeyUpdate post-handshake message", km); } @@ -328,7 +328,7 @@ final class KeyUpdate { // changeWriteCiphers() implementation. wc.baseSecret = nplus1; hc.conContext.outputRecord.changeWriteCiphers(wc, km.status.id); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("KeyUpdate: write key updated"); } diff --git a/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java b/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java index a6c376ad962..fc471f77fbc 100644 --- a/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java @@ -176,7 +176,8 @@ final class MaxFragExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(CH_MAX_FRAGMENT_LENGTH)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable max_fragment_length extension"); } @@ -213,7 +214,8 @@ final class MaxFragExtension { } else { // log and ignore, no MFL extension. chc.maxFragmentLength = -1; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No available max_fragment_length extension can " + "be used for fragment size of " + @@ -243,7 +245,8 @@ final class MaxFragExtension { ServerHandshakeContext shc = (ServerHandshakeContext)context; if (!shc.sslConfig.isAvailable(CH_MAX_FRAGMENT_LENGTH)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable max_fragment_length extension"); } @@ -288,7 +291,8 @@ final class MaxFragExtension { MaxFragLenSpec spec = (MaxFragLenSpec) shc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH); if (spec == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable max_fragment_length extension"); } @@ -305,7 +309,8 @@ final class MaxFragExtension { // For better interoperability, abort the maximum // fragment length negotiation, rather than terminate // the connection with a fatal alert. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Abort the maximum fragment length negotiation, " + "may overflow the maximum packet size limit."); @@ -413,7 +418,8 @@ final class MaxFragExtension { // For better interoperability, abort the maximum // fragment length negotiation, rather than terminate // the connection with a fatal alert. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Abort the maximum fragment length negotiation, " + "may overflow the maximum packet size limit."); @@ -455,7 +461,8 @@ final class MaxFragExtension { MaxFragLenSpec spec = (MaxFragLenSpec) shc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH); if (spec == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable max_fragment_length extension"); } @@ -472,7 +479,8 @@ final class MaxFragExtension { // For better interoperability, abort the maximum // fragment length negotiation, rather than terminate // the connection with a fatal alert. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Abort the maximum fragment length negotiation, " + "may overflow the maximum packet size limit."); @@ -578,7 +586,8 @@ final class MaxFragExtension { // For better interoperability, abort the maximum // fragment length negotiation, rather than terminate // the connection with a fatal alert. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Abort the maximum fragment length negotiation, " + "may overflow the maximum packet size limit."); diff --git a/src/java.base/share/classes/sun/security/ssl/NamedGroup.java b/src/java.base/share/classes/sun/security/ssl/NamedGroup.java index 02524e67656..430408d54b7 100644 --- a/src/java.base/share/classes/sun/security/ssl/NamedGroup.java +++ b/src/java.base/share/classes/sun/security/ssl/NamedGroup.java @@ -330,7 +330,8 @@ enum NamedGroup { | NoSuchAlgorithmException exp) { if (namedGroupSpec != NamedGroupSpec.NAMED_GROUP_XDH) { mediator = false; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No AlgorithmParameters or KeyFactory for " + name, exp); @@ -352,7 +353,8 @@ enum NamedGroup { // AlgorithmParameters.getInstance(name); } catch (NoSuchAlgorithmException nsae) { mediator = false; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "No AlgorithmParameters for " + name, nsae); } @@ -445,7 +447,7 @@ enum NamedGroup { NamedGroup ng = NamedGroup.nameOf(ss); if (ng == null || !ng.isAvailable) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore the named group (" + ss + "), unsupported or unavailable"); @@ -912,7 +914,8 @@ enum NamedGroup { namedGroups = customizedNames; } else { if (defaultNames.length == 0) { - SSLLogger.logWarning("ssl", "No default named groups"); + SSLLogger.logWarning(SSLLogger.Opt.SSL, + "No default named groups"); } namedGroups = defaultNames; } diff --git a/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java b/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java index 89b0a72bb32..ae632334de2 100644 --- a/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java +++ b/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java @@ -202,7 +202,8 @@ final class NewSessionTicket { this.ticket = Record.getBytes16(m); if (ticket.length == 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "No ticket in the NewSessionTicket handshake message"); } @@ -329,7 +330,8 @@ final class NewSessionTicket { if (hc instanceof ServerHandshakeContext) { // Is this session resumable? if (!hc.handshakeSession.isRejoinable()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No session ticket produced: " + "session is not resumable"); } @@ -347,7 +349,8 @@ final class NewSessionTicket { SSLExtension.PSK_KEY_EXCHANGE_MODES); if (pkemSpec == null || !pkemSpec.contains(PskKeyExchangeMode.PSK_DHE_KE)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No session ticket produced: " + "client does not support psk_dhe_ke"); } @@ -358,7 +361,8 @@ final class NewSessionTicket { // Check if we have sent a PSK already, then we know it is // using an allowable PSK exchange key mode. if (!hc.handshakeSession.isPSKable()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No session ticket produced: " + "No session ticket allowed in this session"); } @@ -372,7 +376,8 @@ final class NewSessionTicket { hc.sslContext.engineGetServerSessionContext(); int sessionTimeoutSeconds = sessionCache.getSessionTimeout(); if (sessionTimeoutSeconds > MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No session ticket produced: " + "session timeout is too long"); } @@ -459,7 +464,8 @@ final class NewSessionTicket { if (!nstm.isValid()) { hc.statelessResumption = false; } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced NewSessionTicket stateless " + "post-handshake message", nstm); } @@ -474,7 +480,8 @@ final class NewSessionTicket { sessionCache.getSessionTimeout(), hc.sslContext.getSecureRandom(), nonce, newId.getId()); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced NewSessionTicket " + "post-handshake message", nstm); } @@ -488,7 +495,7 @@ final class NewSessionTicket { return nstm; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No NewSessionTicket created"); } @@ -526,7 +533,8 @@ final class NewSessionTicket { shc.sslContext.engineGetServerSessionContext(); int sessionTimeoutSeconds = sessionCache.getSessionTimeout(); if (sessionTimeoutSeconds > MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Session timeout is too long. No ticket sent."); } @@ -540,7 +548,7 @@ final class NewSessionTicket { NewSessionTicketMessage nstm = new T12NewSessionTicketMessage(shc, sessionTimeoutSeconds, new SessionTicketSpec().encrypt(shc, sessionCopy)); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced NewSessionTicket stateless handshake message", nstm); @@ -579,7 +587,7 @@ final class NewSessionTicket { HandshakeContext hc = (HandshakeContext)context; NewSessionTicketMessage nstm = new T13NewSessionTicketMessage(hc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming NewSessionTicket message", nstm); } @@ -590,7 +598,8 @@ final class NewSessionTicket { // discard tickets with timeout 0 if (nstm.ticketLifetime <= 0 || nstm.ticketLifetime > MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Discarding NewSessionTicket with lifetime " + nstm.ticketLifetime, nstm); @@ -599,7 +608,8 @@ final class NewSessionTicket { } if (sessionCache.getSessionTimeout() > MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Session cache lifetime is too long. " + "Discarding ticket."); @@ -611,7 +621,8 @@ final class NewSessionTicket { SecretKey resumptionMasterSecret = sessionToSave.getResumptionMasterSecret(); if (resumptionMasterSecret == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Session has no resumption master secret. " + "Ignoring ticket."); @@ -637,7 +648,7 @@ final class NewSessionTicket { sessionCopy.setPskIdentity(nstm.ticket); sessionCache.put(sessionCopy, sessionCopy.isPSK()); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("MultiNST PSK (Server): " + Utilities.toHexString(Arrays.copyOf(nstm.ticket, 16))); } @@ -665,7 +676,8 @@ final class NewSessionTicket { NewSessionTicketMessage nstm = new T12NewSessionTicketMessage(hc, message); if (nstm.ticket.length == 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("NewSessionTicket ticket was empty"); } return; @@ -674,7 +686,8 @@ final class NewSessionTicket { // discard tickets with timeout 0 if (nstm.ticketLifetime <= 0 || nstm.ticketLifetime > MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Discarding NewSessionTicket with lifetime " + nstm.ticketLifetime, nstm); @@ -686,7 +699,8 @@ final class NewSessionTicket { hc.sslContext.engineGetClientSessionContext(); if (sessionCache.getSessionTimeout() > MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Session cache lifetime is too long. " + "Discarding ticket."); @@ -695,7 +709,7 @@ final class NewSessionTicket { } hc.handshakeSession.setPskIdentity(nstm.ticket); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Consuming NewSessionTicket\n" + nstm); } } diff --git a/src/java.base/share/classes/sun/security/ssl/OutputRecord.java b/src/java.base/share/classes/sun/security/ssl/OutputRecord.java index 416d5d1b5ef..7a188ccf476 100644 --- a/src/java.base/share/classes/sun/security/ssl/OutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/OutputRecord.java @@ -188,7 +188,7 @@ abstract class OutputRecord recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "change_cipher_spec message"); } @@ -222,7 +222,7 @@ abstract class OutputRecord recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "key_update handshake message"); } diff --git a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java index b99c0175838..87d97580bcb 100644 --- a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java @@ -341,7 +341,8 @@ final class PreSharedKeyExtension { ServerHandshakeContext shc = (ServerHandshakeContext)context; // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SSLExtension.CH_PRE_SHARED_KEY)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable pre_shared_key extension"); } @@ -394,7 +395,7 @@ final class PreSharedKeyExtension { } if (b == null || s == null) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Stateless session ticket invalid"); } @@ -402,7 +403,8 @@ final class PreSharedKeyExtension { } if (s != null && canRejoin(clientHello, shc, s)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Resuming session: ", s); } @@ -436,7 +438,7 @@ final class PreSharedKeyExtension { // Check protocol version if (result && s.getProtocolVersion() != shc.negotiatedProtocol) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("Can't resume, incorrect protocol version"); } @@ -450,7 +452,7 @@ final class PreSharedKeyExtension { s.getPeerPrincipal(); } catch (SSLPeerUnverifiedException e) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, " + "client authentication is required"); @@ -466,7 +468,8 @@ final class PreSharedKeyExtension { if (result && !shc.localSupportedCertSignAlgs.containsAll(sessionSigAlgs)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Can't resume. Session uses different " + "signature algorithms"); } @@ -481,7 +484,7 @@ final class PreSharedKeyExtension { String sessionIdentityAlg = s.getIdentificationProtocol(); if (!identityAlg.equalsIgnoreCase(sessionIdentityAlg)) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest("Can't resume, endpoint id" + " algorithm does not match, requested: " + @@ -495,7 +498,7 @@ final class PreSharedKeyExtension { if (result && (!shc.isNegotiable(s.getSuite()) || !clientHello.cipherSuites.contains(s.getSuite()))) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Can't resume, unavailable session cipher suite"); } @@ -653,7 +656,8 @@ final class PreSharedKeyExtension { // The producing happens in client side only. ClientHandshakeContext chc = (ClientHandshakeContext)context; if (!chc.isResumption || chc.resumingSession == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No session to resume."); } return null; @@ -663,7 +667,8 @@ final class PreSharedKeyExtension { Collection sessionSigAlgs = chc.resumingSession.getLocalSupportedSignatureSchemes(); if (!chc.localSupportedCertSignAlgs.containsAll(sessionSigAlgs)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Existing session uses different " + "signature algorithms"); } @@ -673,7 +678,8 @@ final class PreSharedKeyExtension { // The session must have a pre-shared key SecretKey psk = chc.resumingSession.getPreSharedKey(); if (psk == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Existing session has no PSK."); } return null; @@ -687,7 +693,8 @@ final class PreSharedKeyExtension { } if (chc.pskIdentity == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "PSK has no identity, or identity was already used"); } @@ -699,7 +706,7 @@ final class PreSharedKeyExtension { chc.sslContext.engineGetClientSessionContext(); sessionCache.remove(chc.resumingSession.getSessionId(), true); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Found resumable session. Preparing PSK message."); SSLLogger.fine( @@ -836,7 +843,7 @@ final class PreSharedKeyExtension { public void absent(ConnectionContext context, HandshakeMessage message) throws IOException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Handling pre_shared_key absence."); } @@ -901,7 +908,7 @@ final class PreSharedKeyExtension { } SHPreSharedKeySpec shPsk = new SHPreSharedKeySpec(chc, buffer); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Received pre_shared_key extension: ", shPsk); } @@ -911,7 +918,7 @@ final class PreSharedKeyExtension { "Selected identity index is not in correct range."); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Resuming session: ", chc.resumingSession); } @@ -925,7 +932,7 @@ final class PreSharedKeyExtension { HandshakeMessage message) throws IOException { ClientHandshakeContext chc = (ClientHandshakeContext)context; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Handling pre_shared_key absence."); } diff --git a/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java b/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java index 8f5cc000494..42e914fcaf8 100644 --- a/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java +++ b/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java @@ -246,7 +246,7 @@ final class PredefinedDHParameterSpecs { Matcher spacesMatcher = spacesPattern.matcher(property); property = spacesMatcher.replaceAll(""); - if (SSLLogger.isOn() && SSLLogger.isOn("sslctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.fine( "The Security Property " + PROPERTY_NAME + ": " + property); @@ -262,7 +262,8 @@ final class PredefinedDHParameterSpecs { String primeModulus = paramsFinder.group(1); BigInteger p = new BigInteger(primeModulus, 16); if (!p.isProbablePrime(PRIME_CERTAINTY)) { - if (SSLLogger.isOn() && SSLLogger.isOn("sslctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.fine( "Prime modulus p in Security Property, " + PROPERTY_NAME + ", is not a prime: " + @@ -279,7 +280,8 @@ final class PredefinedDHParameterSpecs { DHParameterSpec spec = new DHParameterSpec(p, g); defaultParams.put(primeLen, spec); } - } else if (SSLLogger.isOn() && SSLLogger.isOn("sslctx")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.fine("Invalid Security Property, " + PROPERTY_NAME + ", definition"); } diff --git a/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java b/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java index 6c306839b5a..4b641e157a6 100644 --- a/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java @@ -184,7 +184,8 @@ final class PskKeyExchangeModesExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable( SSLExtension.PSK_KEY_EXCHANGE_MODES)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable psk_key_exchange_modes extension"); } @@ -216,7 +217,8 @@ final class PskKeyExchangeModesExtension { if (!spec.contains(PskKeyExchangeMode.PSK_DHE_KE)) { shc.isResumption = false; shc.resumingSession = null; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "abort session resumption, " + "no supported psk_dhe_ke PSK key exchange mode"); @@ -247,7 +249,8 @@ final class PskKeyExchangeModesExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable( SSLExtension.PSK_KEY_EXCHANGE_MODES)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore unavailable psk_key_exchange_modes extension"); } @@ -287,7 +290,8 @@ final class PskKeyExchangeModesExtension { if (shc.isResumption) { // resumingSession may not be set shc.isResumption = false; shc.resumingSession = null; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "abort session resumption, " + "no supported psk_dhe_ke PSK key exchange mode"); diff --git a/src/java.base/share/classes/sun/security/ssl/QuicEngineOutputRecord.java b/src/java.base/share/classes/sun/security/ssl/QuicEngineOutputRecord.java index 7e307ba9d27..3a91906971f 100644 --- a/src/java.base/share/classes/sun/security/ssl/QuicEngineOutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/QuicEngineOutputRecord.java @@ -75,14 +75,14 @@ final class QuicEngineOutputRecord extends OutputRecord implements SSLRecord { recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "alert message: " + Alert.nameOf(description)); } return; } if (level == Alert.Level.WARNING.level) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Suppressing warning-level " + "alert message: " + Alert.nameOf(description)); } @@ -90,7 +90,7 @@ final class QuicEngineOutputRecord extends OutputRecord implements SSLRecord { } if (alert != null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Suppressing subsequent alert: " + description + ", original: " + alert.id); } @@ -109,7 +109,7 @@ final class QuicEngineOutputRecord extends OutputRecord implements SSLRecord { recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "handshake message", ByteBuffer.wrap(source, offset, length)); diff --git a/src/java.base/share/classes/sun/security/ssl/QuicKeyManager.java b/src/java.base/share/classes/sun/security/ssl/QuicKeyManager.java index 4613dcf96ff..634396868df 100644 --- a/src/java.base/share/classes/sun/security/ssl/QuicKeyManager.java +++ b/src/java.base/share/classes/sun/security/ssl/QuicKeyManager.java @@ -244,7 +244,7 @@ sealed abstract class QuicKeyManager if (toDiscard == null) { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("discarding keys (keyphase=" + toDiscard.writeCipher.getKeyPhase() + ") of " + this.keySpace + " key space"); @@ -389,7 +389,7 @@ sealed abstract class QuicKeyManager if (toDiscard == null) { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("discarding keys (keyphase=" + toDiscard.writeCipher.getKeyPhase() + ") of " + this.keySpace + " key space"); @@ -570,7 +570,7 @@ sealed abstract class QuicKeyManager if (series == null) { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("discarding key (series) of " + this.keySpace + " key space"); } @@ -611,7 +611,7 @@ sealed abstract class QuicKeyManager if (series.canUseOldDecryptKey(packetNumber)) { final QuicReadCipher oldReadCipher = series.old; assert oldReadCipher != null : "old key is unexpectedly null"; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("using old read key to decrypt packet: " + packetNumber + ", with incoming key phase: " + keyPhase + ", current key phase: " + @@ -624,7 +624,7 @@ sealed abstract class QuicKeyManager if (!series.current.usedByBothEndpoints() && series.current.writeCipher.hasEncryptedAny() && oneRttContext.getLargestPeerAckedPN() - >= series.current.writeCipher.lowestEncryptedPktNum()) { + >= series.current.writeCipher.lowestEncryptedPktNum()) { // RFC-9001, section 6.2: // An endpoint that receives an acknowledgment that is // carried in a packet protected with old keys where any @@ -633,7 +633,7 @@ sealed abstract class QuicKeyManager // KEY_UPDATE_ERROR. This indicates that a peer has // received and acknowledged a packet that initiates a key // update, but has not updated keys in response. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("peer used incorrect key, was" + " expected to use updated key of" + " key phase: " + currentKeyPhase + @@ -646,7 +646,7 @@ sealed abstract class QuicKeyManager } return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("detected ONE_RTT key update, current key " + "phase: " + currentKeyPhase + ", incoming key phase: " + keyPhase @@ -717,7 +717,7 @@ sealed abstract class QuicKeyManager } final long numEncrypted = cipher.getNumEncrypted(); if (numEncrypted >= 0.8 * confidentialityLimit) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("about to reach confidentiality limit, " + "attempting to initiate a 1-RTT key update," + " packet number: " + @@ -732,7 +732,7 @@ sealed abstract class QuicKeyManager : "key phase of updated key unexpectedly matches " + "the key phase " + cipher.getKeyPhase() + " of current keys"; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( "1-RTT key update initiated, new key phase: " + newKeyPhase); @@ -755,7 +755,7 @@ sealed abstract class QuicKeyManager // current key phase. This ensures that keys are // available to both peers before // another key update can be initiated. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( "skipping key update initiation because peer " + "hasn't yet sent us a packet encrypted with " + @@ -803,7 +803,7 @@ sealed abstract class QuicKeyManager // (we avoid timing attacks by not generating // keys during decryption, our key generation // only happens during encryption) - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("next keys unavailable," + " won't decrypt a packet which appears to be" + " a key update"); @@ -815,7 +815,7 @@ sealed abstract class QuicKeyManager // use the next keys to attempt decrypting currentKeySeries.next.readCipher.decryptPacket(packetNumber, packet, headerLength, output); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( "decrypted using next keys for peer-initiated" + " key update; will now switch to new key phase: " + @@ -1025,14 +1025,14 @@ sealed abstract class QuicKeyManager // update the key series this.keySeries = newSeries; if (oldReadCipher != null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( "discarding old read key of key phase: " + oldReadCipher.getKeyPhase()); } oldReadCipher.discard(false); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("discarding write key of key phase: " + writeCipherToDiscard.getKeyPhase()); } diff --git a/src/java.base/share/classes/sun/security/ssl/QuicTLSEngineImpl.java b/src/java.base/share/classes/sun/security/ssl/QuicTLSEngineImpl.java index 18790a58c11..74975fc1e5b 100644 --- a/src/java.base/share/classes/sun/security/ssl/QuicTLSEngineImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/QuicTLSEngineImpl.java @@ -560,7 +560,7 @@ public final class QuicTLSEngineImpl implements QuicTLSEngine, SSLTransport { // incoming crypto buffer is null. Validate message type, // check if size is available byte messageType = payload.get(payload.position()); - if (SSLLogger.isOn()) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Received message of type 0x" + Integer.toHexString(messageType & 0xFF)); } @@ -835,7 +835,7 @@ public final class QuicTLSEngineImpl implements QuicTLSEngine, SSLTransport { final boolean confirmed = HANDSHAKE_STATE_HANDLE.compareAndSet(this, NEED_SEND_HANDSHAKE_DONE, HANDSHAKE_CONFIRMED); if (confirmed) { - if (SSLLogger.isOn()) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("QuicTLSEngine (server) marked handshake " + "state as HANDSHAKE_CONFIRMED"); } @@ -853,7 +853,7 @@ public final class QuicTLSEngineImpl implements QuicTLSEngine, SSLTransport { final boolean confirmed = HANDSHAKE_STATE_HANDLE.compareAndSet(this, NEED_RECV_HANDSHAKE_DONE, HANDSHAKE_CONFIRMED); if (confirmed) { - if (SSLLogger.isOn()) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( "QuicTLSEngine (client) received HANDSHAKE_DONE," + " marking state as HANDSHAKE_DONE"); diff --git a/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java index ec91cb4509a..53d239c9318 100644 --- a/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java @@ -190,7 +190,7 @@ final class RSAClientKeyExchange { throw chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, "Cannot generate RSA premaster secret", gse); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced RSA ClientKeyExchange handshake message", ckem); } @@ -270,7 +270,7 @@ final class RSAClientKeyExchange { RSAClientKeyExchangeMessage ckem = new RSAClientKeyExchangeMessage(shc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming RSA ClientKeyExchange handshake message", ckem); } diff --git a/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java index d176d7311d0..d204fddb13c 100644 --- a/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java @@ -149,7 +149,8 @@ final class RSAKeyExchange { needFailover = !KeyUtil.isOracleJCEProvider( cipher.getProvider().getName()); } catch (InvalidKeyException | UnsupportedOperationException iue) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("The Cipher provider " + safeProviderName(cipher) + " caused exception: " + iue.getMessage()); @@ -196,7 +197,8 @@ final class RSAKeyExchange { try { return cipher.getProvider().toString(); } catch (Exception e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Retrieving The Cipher provider name" + " caused exception ", e); } @@ -204,7 +206,8 @@ final class RSAKeyExchange { try { return cipher.toString() + " (provider name not available)"; } catch (Exception e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Retrieving The Cipher name" + " caused exception ", e); } @@ -219,7 +222,7 @@ final class RSAKeyExchange { int clientVersion, int serverVersion, byte[] encodedSecret, SecureRandom generator) throws GeneralSecurityException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Generating a premaster secret"); } @@ -234,7 +237,8 @@ final class RSAKeyExchange { } catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException iae) { // unlikely to happen, otherwise, must be a provider exception - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("RSA premaster secret generation error", iae); } diff --git a/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java b/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java index 4ab1cdf1f93..0c0fec10449 100644 --- a/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java +++ b/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java @@ -264,7 +264,7 @@ final class RSAServerKeyExchange { RSAServerKeyExchangeMessage skem = new RSAServerKeyExchangeMessage( shc, x509Possession, rsaPossession); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced RSA ServerKeyExchange handshake message", skem); } @@ -296,7 +296,7 @@ final class RSAServerKeyExchange { RSAServerKeyExchangeMessage skem = new RSAServerKeyExchangeMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming RSA ServerKeyExchange handshake message", skem); } diff --git a/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java b/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java index b744914b31d..0d3d8bd039c 100644 --- a/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java @@ -138,7 +138,8 @@ final class RenegoInfoExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(CH_RENEGOTIATION_INFO)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable renegotiation_info extension"); } @@ -182,7 +183,8 @@ final class RenegoInfoExtension { return extData; } else { // not secure renegotiation if (HandshakeContext.allowUnsafeRenegotiation) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("Using insecure renegotiation"); } @@ -216,7 +218,8 @@ final class RenegoInfoExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(CH_RENEGOTIATION_INFO)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Ignore unavailable extension: " + CH_RENEGOTIATION_INFO.name); } @@ -280,7 +283,8 @@ final class RenegoInfoExtension { for (int id : clientHello.cipherSuiteIds) { if (id == CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV.id) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Safe renegotiation, using the SCSV signaling"); } @@ -294,7 +298,8 @@ final class RenegoInfoExtension { "Failed to negotiate the use of secure renegotiation"); } // otherwise, allow legacy hello message - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("Warning: No renegotiation " + "indication in ClientHello, allow legacy ClientHello"); } @@ -306,13 +311,15 @@ final class RenegoInfoExtension { "Inconsistent secure renegotiation indication"); } else { // renegotiation, not secure if (HandshakeContext.allowUnsafeRenegotiation) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("Using insecure renegotiation"); } } else { // Unsafe renegotiation should have been aborted in // earlier processes. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Terminate insecure renegotiation"); } throw shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, @@ -345,7 +352,8 @@ final class RenegoInfoExtension { if (requestedSpec == null && !shc.conContext.secureRenegotiation) { // Ignore, no renegotiation_info extension or SCSV signaling // requested. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable renegotiation_info extension"); } @@ -354,7 +362,8 @@ final class RenegoInfoExtension { if (!shc.conContext.secureRenegotiation) { // Ignore, no secure renegotiation is negotiated. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "No secure renegotiation has been negotiated"); } @@ -515,7 +524,8 @@ final class RenegoInfoExtension { "Failed to negotiate the use of secure renegotiation"); } // otherwise, allow legacy hello message - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("Warning: No renegotiation " + "indication in ServerHello, allow legacy ServerHello"); } @@ -527,13 +537,15 @@ final class RenegoInfoExtension { "Inconsistent secure renegotiation indication"); } else { // renegotiation, not secure if (HandshakeContext.allowUnsafeRenegotiation) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("Using insecure renegotiation"); } } else { // Unsafe renegotiation should have been aborted in // earlier processes. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Terminate insecure renegotiation"); } throw chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, diff --git a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java index 594766ea0fd..d3207a7aa63 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java @@ -454,7 +454,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints { .equalsIgnoreCase(paramDigestAlg)); } catch (InvalidParameterSpecException e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Invalid AlgorithmParameters: " + parameters + "; Error: " + e.getMessage()); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLCipher.java b/src/java.base/share/classes/sun/security/ssl/SSLCipher.java index 5dfa5be3420..9d1d6dabaec 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLCipher.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLCipher.java @@ -392,7 +392,8 @@ enum SSLCipher { if (values[1].contains(tag[0])) { index = 0; } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("jdk.tls.keyLimits: Unknown action: " + entry); } @@ -413,13 +414,14 @@ enum SSLCipher { "Length exceeded limits"); } } catch (NumberFormatException e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("jdk.tls.keyLimits: " + e.getMessage() + ": " + entry); } continue; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("jdk.tls.keyLimits: entry = " + entry + ". " + values[0] + ":" + tag[index] + " = " + size); } @@ -468,7 +470,7 @@ enum SSLCipher { Cipher.getInstance(transformation); return true; } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Transformation " + transformation + " is" + " not available."); } @@ -860,7 +862,8 @@ enum SSLCipher { "JCE provider " + cipher.getProvider().getName(), sbe); } pt.position(pos); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext after DECRYPTION", pt.duplicate()); } @@ -930,7 +933,8 @@ enum SSLCipher { authenticator.increaseSequenceNumber(); } - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.finest( "Padded plaintext before ENCRYPTION", bb.duplicate()); } @@ -1050,7 +1054,8 @@ enum SSLCipher { "JCE provider " + cipher.getProvider().getName(), sbe); } - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Padded plaintext after DECRYPTION", pt.duplicate().position(pos)); @@ -1182,7 +1187,7 @@ enum SSLCipher { int len = addPadding(bb, blockSize); bb.position(pos); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Padded plaintext before ENCRYPTION", bb.duplicate()); @@ -1326,7 +1331,8 @@ enum SSLCipher { "JCE provider " + cipher.getProvider().getName(), sbe); } - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine("Padded plaintext after DECRYPTION", pt.duplicate().position(pos)); } @@ -1478,7 +1484,8 @@ enum SSLCipher { int len = addPadding(bb, blockSize); bb.position(pos); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Padded plaintext before ENCRYPTION", bb.duplicate()); @@ -1650,7 +1657,8 @@ enum SSLCipher { pt.position(pos); pt.limit(pos + len); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext after DECRYPTION", pt.duplicate()); } @@ -1737,7 +1745,8 @@ enum SSLCipher { // DON'T encrypt the nonce for AEAD mode. int len, pos = bb.position(); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext before ENCRYPTION", bb.duplicate()); @@ -1823,7 +1832,7 @@ enum SSLCipher { keyLimitCountdown = cipherLimits.getOrDefault( algorithm.toUpperCase(Locale.ENGLISH) + ":" + tag[0], 0L); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("KeyLimit read side: algorithm = " + algorithm + ":" + tag[0] + "\ncountdown value = " + keyLimitCountdown); @@ -1932,7 +1941,8 @@ enum SSLCipher { contentType = pt.get(i); pt.limit(i); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext after DECRYPTION", pt.duplicate()); } @@ -1984,7 +1994,7 @@ enum SSLCipher { keyLimitCountdown = cipherLimits.getOrDefault( algorithm.toUpperCase(Locale.ENGLISH) + ":" + tag[0], 0L); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("KeyLimit write side: algorithm = " + algorithm + ":" + tag[0] + "\ncountdown value = " + keyLimitCountdown); @@ -2026,7 +2036,8 @@ enum SSLCipher { cipher.updateAAD(aad); int len, pos = bb.position(); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext before ENCRYPTION", bb.duplicate()); @@ -2182,7 +2193,8 @@ enum SSLCipher { pt.position(pos); pt.limit(pos + len); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext after DECRYPTION", pt.duplicate()); } @@ -2231,7 +2243,7 @@ enum SSLCipher { keyLimitCountdown = cipherLimits.getOrDefault( algorithm.toUpperCase(Locale.ENGLISH) + ":" + tag[0], 0L); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("algorithm = " + algorithm + ":" + tag[0] + "\ncountdown value = " + keyLimitCountdown); @@ -2273,7 +2285,8 @@ enum SSLCipher { // DON'T encrypt the nonce for AEAD mode. int pos = bb.position(); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext before ENCRYPTION", bb.duplicate()); @@ -2450,7 +2463,8 @@ enum SSLCipher { contentType = pt.get(i); pt.limit(i); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext after DECRYPTION", pt.duplicate()); } @@ -2499,7 +2513,7 @@ enum SSLCipher { keyLimitCountdown = cipherLimits.getOrDefault( algorithm.toUpperCase(Locale.ENGLISH) + ":" + tag[0], 0L); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("algorithm = " + algorithm + ":" + tag[0] + "\ncountdown value = " + keyLimitCountdown); @@ -2541,7 +2555,8 @@ enum SSLCipher { cipher.updateAAD(aad); int pos = bb.position(); - if (SSLLogger.isOn() && SSLLogger.isOn("plaintext")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PLAINTEXT)) { SSLLogger.fine( "Plaintext before ENCRYPTION", bb.duplicate()); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java b/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java index 3c68c669d05..1cc29e29477 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java @@ -202,7 +202,7 @@ final class SSLConfiguration implements Cloneable { nstServerCount > 10) { serverNewSessionTicketCount = SERVER_NST_DEFAULT; if (nstServerCount != null && SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "jdk.tls.server.newSessionTicketCount defaults to " + SERVER_NST_DEFAULT + " as the property was not " + @@ -210,7 +210,7 @@ final class SSLConfiguration implements Cloneable { } } else { serverNewSessionTicketCount = nstServerCount; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "jdk.tls.server.newSessionTicketCount set to " + serverNewSessionTicketCount); @@ -569,7 +569,7 @@ final class SSLConfiguration implements Cloneable { String property = System.getProperty(propertyName); // this method is called from class initializer; logging here // will occasionally pin threads and deadlock if called from a virtual thread - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx") + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX) && !Thread.currentThread().isVirtual()) { SSLLogger.fine( "System property " + propertyName + " is set to '" + @@ -598,8 +598,9 @@ final class SSLConfiguration implements Cloneable { if (scheme != null && scheme.isAvailable) { signatureSchemes.add(schemeName); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx") - && !Thread.currentThread().isVirtual()) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX) + && !Thread.currentThread().isVirtual()) { SSLLogger.fine( "The current installed providers do not " + "support signature scheme: " + schemeName); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java index be324eb0949..a1cc3ee112f 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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.security.*; import java.security.cert.*; import java.util.*; import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; import javax.net.ssl.*; import sun.security.provider.certpath.AlgorithmChecker; import sun.security.ssl.SSLAlgorithmConstraints.SIGNATURE_CONSTRAINTS_MODE; @@ -104,11 +105,11 @@ public abstract class SSLContextImpl extends SSLContextSpi { * first connection to time out and fail. Make sure it is * primed and ready by getting some initial output from it. */ - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.finest("trigger seeding of SecureRandom"); } secureRandom.nextInt(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.finest("done seeding of SecureRandom"); } @@ -143,7 +144,7 @@ public abstract class SSLContextImpl extends SSLContextSpi { return (X509ExtendedKeyManager)km; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.warning( "X509KeyManager passed to SSLContext.init(): need an " + "X509ExtendedKeyManager for SSLEngine use"); @@ -246,7 +247,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { contextLock.lock(); try { if (statusResponseManager == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.finest( "Initializing StatusResponseManager"); } @@ -365,13 +367,24 @@ public abstract class SSLContextImpl extends SSLContextSpi { Collection allowedCipherSuites, List protocols) { LinkedHashSet suites = new LinkedHashSet<>(); + List disabledSuites = null; + List unAvailableSuites = null; + + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { + disabledSuites = new ArrayList<>(); + unAvailableSuites = new ArrayList<>(); + } + if (protocols != null && (!protocols.isEmpty())) { for (CipherSuite suite : allowedCipherSuites) { if (!suite.isAvailable()) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { + unAvailableSuites.add(suite.name); + } continue; } - boolean isSupported = false; for (ProtocolVersion protocol : protocols) { if (!suite.supports(protocol) || !suite.bulkCipher.isAvailable()) { @@ -382,27 +395,43 @@ public abstract class SSLContextImpl extends SSLContextSpi { EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), suite.name, null)) { suites.add(suite); - isSupported = true; } else if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,sslctx,verbose")) { - SSLLogger.fine( - "Ignore disabled cipher suite: " + suite.name); + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { + disabledSuites.add(suite.name); } break; } - - if (!isSupported && SSLLogger.isOn() && - SSLLogger.isOn("ssl,sslctx,verbose")) { - SSLLogger.finest( - "Ignore unsupported cipher suite: " + suite); - } } } + if(SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { + logSuites("Ignore disabled cipher suites for protocols: ", + protocols, disabledSuites); + logSuites("Ignore unavailable cipher suites for protocols: ", + protocols, unAvailableSuites); + logSuites("Available cipher suites for protocols: ", + protocols, suites); + + } return new ArrayList<>(suites); } + private static void logSuites(String message, + List protocols, + Collection suites) { + if (suites.isEmpty()) { + return; + } + String protocolStr = protocols.stream() + .map(pv -> pv.name) + .collect(Collectors.joining(", ", "[", "]")); + String suiteStr = String.join(", ", + suites.stream().map(Object::toString).collect(Collectors.toList())); + SSLLogger.finest(message + protocolStr + System.lineSeparator() + + Utilities.wrapText("[" + suiteStr + "]", 140)); + } + /* * Get the customized cipher suites specified by the given system property. */ @@ -410,7 +439,7 @@ public abstract class SSLContextImpl extends SSLContextSpi { String propertyName) { String property = System.getProperty(propertyName); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.fine( "System property " + propertyName + " is set to '" + property + "'"); @@ -437,7 +466,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { try { suite = CipherSuite.nameOf(cipherSuiteNames[i]); } catch (IllegalArgumentException iae) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.fine( "Unknown or unsupported cipher suite name: " + cipherSuiteNames[i]); @@ -449,17 +479,22 @@ public abstract class SSLContextImpl extends SSLContextSpi { if (suite != null && suite.isAvailable()) { cipherSuites.add(suite); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { SSLLogger.fine( "The current installed providers do not " + "support cipher suite: " + cipherSuiteNames[i]); } } } - + if (cipherSuites.isEmpty() && SSLLogger.isOn() + && SSLLogger.isOn(SSLLogger.Opt.SSLCTX)) { + SSLLogger.fine( + "No cipher suites satisfy property: " + propertyName + + ". Returning empty list"); + } return cipherSuites; } - return Collections.emptyList(); } @@ -527,9 +562,6 @@ public abstract class SSLContextImpl extends SSLContextSpi { private static final List supportedProtocols; private static final List serverDefaultProtocols; - private static final List supportedCipherSuites; - private static final List serverDefaultCipherSuites; - static { supportedProtocols = Arrays.asList( ProtocolVersion.TLS13, @@ -547,13 +579,15 @@ public abstract class SSLContextImpl extends SSLContextSpi { ProtocolVersion.TLS11, ProtocolVersion.TLS10 }); - - supportedCipherSuites = getApplicableSupportedCipherSuites( - supportedProtocols); - serverDefaultCipherSuites = getApplicableEnabledCipherSuites( - serverDefaultProtocols, false); } + private static final LazyConstant> + supportedCipherSuites = LazyConstant.of(() -> + getApplicableSupportedCipherSuites(supportedProtocols)); + private static final LazyConstant> + serverDefaultCipherSuites = LazyConstant.of(() -> + getApplicableEnabledCipherSuites(serverDefaultProtocols, false)); + @Override List getSupportedProtocolVersions() { return supportedProtocols; @@ -561,7 +595,7 @@ public abstract class SSLContextImpl extends SSLContextSpi { @Override List getSupportedCipherSuites() { - return supportedCipherSuites; + return supportedCipherSuites.get(); } @Override @@ -571,7 +605,7 @@ public abstract class SSLContextImpl extends SSLContextSpi { @Override List getServerDefaultCipherSuites() { - return serverDefaultCipherSuites; + return serverDefaultCipherSuites.get(); } @Override @@ -811,10 +845,18 @@ public abstract class SSLContextImpl extends SSLContextSpi { clientDefaultCipherSuites = getApplicableEnabledCipherSuites( clientDefaultProtocols, true); - serverDefaultCipherSuites = - getApplicableEnabledCipherSuites( - serverDefaultProtocols, false); - + // getApplicableEnabledCipherSuites returns same CS List if + // no customized CS in use and protocols are same. Can avoid + // the getApplicableEnabledCipherSuites call + if (clientCustomizedCipherSuites.isEmpty() && + serverCustomizedCipherSuites.isEmpty() && + clientDefaultProtocols.equals(serverDefaultProtocols)) { + serverDefaultCipherSuites = clientDefaultCipherSuites; + } else { + serverDefaultCipherSuites = + getApplicableEnabledCipherSuites( + serverDefaultProtocols, false); + } } else { // unlikely to be used clientDefaultProtocols = null; @@ -907,7 +949,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { tmMediator = getTrustManagers(); } catch (Exception e) { reserved = e; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.warning( "Failed to load default trust managers", e); } @@ -919,7 +962,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { kmMediator = getKeyManagers(); } catch (Exception e) { reserved = e; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.warning( "Failed to load default key managers", e); } @@ -977,7 +1021,7 @@ public abstract class SSLContextImpl extends SSLContextSpi { String defaultKeyStore = props.get("keyStore"); String defaultKeyStoreType = props.get("keyStoreType"); String defaultKeyStoreProvider = props.get("keyStoreProvider"); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.fine("keyStore is : " + defaultKeyStore); SSLLogger.fine("keyStore type is : " + defaultKeyStoreType); @@ -1007,7 +1051,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { // Try to initialize key store. if ((defaultKeyStoreType.length()) != 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.finest("init keystore"); } if (defaultKeyStoreProvider.isEmpty()) { @@ -1030,7 +1075,7 @@ public abstract class SSLContextImpl extends SSLContextSpi { /* * Try to initialize key manager. */ - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.fine("init keymanager of type " + KeyManagerFactory.getDefaultAlgorithm()); } @@ -1068,7 +1113,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { // exception object, which may be not garbage collection // friendly as 'reservedException' is a static filed. reserved = new KeyManagementException(e.getMessage()); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.warning( "Failed to load default SSLContext", e); } @@ -1097,7 +1143,8 @@ public abstract class SSLContextImpl extends SSLContextSpi { super.engineInit(DefaultManagersHolder.keyManagers, DefaultManagersHolder.trustManagers, null); } catch (Exception e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,defaultctx")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.DEFAULTCTX)) { SSLLogger.fine("default context init failed: ", e); } throw e; diff --git a/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java index 5e23e6ee37b..5052f9bc9f4 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java @@ -330,7 +330,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport { // application data may be discarded accordingly. As could // be an issue for some applications. This impact can be // mitigated by sending the last flight twice. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,verbose")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.finest("retransmit the last flight messages"); } @@ -397,7 +397,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport { if ((conContext.handshakeContext == null) && !conContext.isOutboundClosed() && !conContext.isBroken) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("trigger key update"); } beginHandshake(); @@ -419,7 +419,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport { !conContext.isOutboundClosed() && !conContext.isInboundClosed() && !conContext.isBroken) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("trigger NST"); } conContext.conSession.updateNST = false; @@ -612,7 +612,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport { } catch (SSLException ssle) { // Need to discard invalid records for DTLS protocols. if (sslContext.isDTLS()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,verbose")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.finest("Discard invalid DTLS records", ssle); } @@ -780,7 +780,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("Closing inbound of SSLEngine"); } @@ -819,7 +819,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("Closing outbound of SSLEngine"); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java index 6e08fc71664..00ca3b06369 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java @@ -172,7 +172,7 @@ final class SSLEngineInputRecord extends InputRecord implements SSLRecord { return null; } - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw read", packet); } @@ -209,7 +209,7 @@ final class SSLEngineInputRecord extends InputRecord implements SSLRecord { byte minorVersion = packet.get(); // pos: 2 int contentLen = Record.getInt16(packet); // pos: 3, 4 - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "READ: " + ProtocolVersion.nameOf(majorVersion, minorVersion) + @@ -388,7 +388,7 @@ final class SSLEngineInputRecord extends InputRecord implements SSLRecord { * error message, one that's treated as fatal by * clients (Otherwise we'll hang.) */ - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "Requested to negotiate unsupported SSLv2!"); } @@ -410,7 +410,8 @@ final class SSLEngineInputRecord extends InputRecord implements SSLRecord { ByteBuffer converted = convertToClientHello(packet); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine( "[Converted] ClientHello", converted); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java index 1c8751e66fe..0ed3755afa4 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java @@ -73,7 +73,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { @Override void encodeAlert(byte level, byte description) { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "alert message: " + Alert.nameOf(description)); } @@ -91,7 +91,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { void encodeHandshake(byte[] source, int offset, int length) { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "handshake message", ByteBuffer.wrap(source, offset, length)); @@ -138,7 +138,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { @Override void encodeChangeCipherSpec() { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "change_cipher_spec message"); } @@ -171,14 +171,14 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { if (isClosed) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "application data or cached messages"); } return null; } else if (isCloseWaiting) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "application data"); } @@ -193,7 +193,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { ByteBuffer destination) throws IOException { if (writeCipher.authenticator.seqNumOverflow()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( "sequence number extremely close to overflow " + "(2^64-1 packets). Closing connection."); @@ -275,7 +275,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { destination.limit(destination.position()); destination.position(dstContent); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.APPLICATION_DATA.name + @@ -288,7 +288,8 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { dstPos, dstLim, headerSize, protocolVersion); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { ByteBuffer temporary = destination.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); @@ -317,7 +318,8 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { // // Please don't change the limit of the destination buffer. destination.put(SSLRecord.v2NoCipher); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", SSLRecord.v2NoCipher); } @@ -332,13 +334,13 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { // // Please don't change the limit of the destination buffer. if (SSLLogger.isOn()) { - if (SSLLogger.isOn("record")) { + if (SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine(Thread.currentThread().getName() + ", WRITE: SSLv2 ClientHello message" + ", length = " + v2ClientHello.remaining()); } - if (SSLLogger.isOn("packet")) { + if (SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", v2ClientHello); } } @@ -525,7 +527,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { dstBuf.limit(dstBuf.position()); dstBuf.position(dstContent); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.nameOf(memo.contentType) + @@ -543,7 +545,8 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { memo.encodeCipher.dispose(); } - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { ByteBuffer temporary = dstBuf.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLExtension.java b/src/java.base/share/classes/sun/security/ssl/SSLExtension.java index 47a0d0b0e44..aacb9420748 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLExtension.java @@ -844,7 +844,7 @@ enum SSLExtension implements SSLStringizer { String property = System.getProperty(propertyName); // this method is called from class initializer; logging here // will occasionally pin threads and deadlock if called from a virtual thread - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,sslctx") + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSLCTX) && !Thread.currentThread().isVirtual()) { SSLLogger.fine( "System property " + propertyName + " is set to '" + diff --git a/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java b/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java index 66f6293302e..c325890a3b6 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java @@ -93,7 +93,8 @@ final class SSLExtensions { // However, the implementation of the limit is complicated // and inefficient, and may not worthy the maintenance. isSupported = false; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Received buggy supported_groups extension " + "in the ServerHello handshake message"); @@ -143,7 +144,8 @@ final class SSLExtensions { m.get(extData); logMap.put(extId, extData); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unknown or unsupported extension", toString(extId, extData)); @@ -171,7 +173,8 @@ final class SSLExtensions { for (SSLExtension extension : extensions) { if (context.negotiatedProtocol != null && !extension.isAvailable(context.negotiatedProtocol)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unsupported extension: " + extension.name); } @@ -181,7 +184,8 @@ final class SSLExtensions { if (!extMap.containsKey(extension)) { if (extension.onLoadAbsence != null) { extension.absentOnLoad(context, handshakeMessage); - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + extension.name); } @@ -190,7 +194,8 @@ final class SSLExtensions { if (extension.onLoadConsumer == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore unsupported extension: " + extension.name); } @@ -200,7 +205,7 @@ final class SSLExtensions { ByteBuffer m = ByteBuffer.wrap(extMap.get(extension)); extension.consumeOnLoad(context, handshakeMessage, m); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Consumed extension: " + extension.name); } } @@ -215,7 +220,8 @@ final class SSLExtensions { if (!extMap.containsKey(extension)) { if (extension.onTradeAbsence != null) { extension.absentOnTrade(context, handshakeMessage); - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + extension.name); } @@ -223,7 +229,8 @@ final class SSLExtensions { } if (extension.onTradeConsumer == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore impact of unsupported extension: " + extension.name); @@ -232,7 +239,7 @@ final class SSLExtensions { } extension.consumeOnTrade(context, handshakeMessage); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Populated with extension: " + extension.name); } } @@ -245,7 +252,8 @@ final class SSLExtensions { SSLExtension[] extensions) throws IOException { for (SSLExtension extension : extensions) { if (extMap.containsKey(extension)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore, duplicated extension: " + extension.name); @@ -254,7 +262,8 @@ final class SSLExtensions { } if (extension.networkProducer == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore, no extension producer defined: " + extension.name); @@ -267,7 +276,8 @@ final class SSLExtensions { extMap.put(extension, encoded); encodedLength += encoded.length + 4; // extension_type (2) // extension_data length(2) - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { // The extension is not available in the context. SSLLogger.fine( "Ignore, context unavailable extension: " + @@ -284,7 +294,8 @@ final class SSLExtensions { SSLExtension[] extensions) throws IOException { for (SSLExtension extension : extensions) { if (extension.networkProducer == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore, no extension producer defined: " + extension.name); @@ -305,7 +316,8 @@ final class SSLExtensions { encodedLength += encoded.length + 4; // extension_type (2) // extension_data length(2) - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { // The extension is not available in the context. SSLLogger.fine( "Ignore, context unavailable extension: " + diff --git a/src/java.base/share/classes/sun/security/ssl/SSLLogger.java b/src/java.base/share/classes/sun/security/ssl/SSLLogger.java index 7fa6fbf91b5..786cd01ac05 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLLogger.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLLogger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,42 +49,90 @@ import static sun.security.ssl.Utilities.LINE_SEP; /** * Implementation of SSL logger. - * + *

* If the system property "javax.net.debug" is not defined, the debug logging * is turned off. If the system property "javax.net.debug" is defined as * empty, the debug logger is specified by System.getLogger("javax.net.ssl"), * and applications can customize and configure the logger or use external * logging mechanisms. If the system property "javax.net.debug" is defined - * and non-empty, a private debug logger implemented in this class is used. + * and non-empty, a private debug logger which logs to System.err is used. */ public final class SSLLogger implements System.Logger { private static final System.Logger logger; - private static final String property; - private static final boolean isOn; + // High level boolean to track whether logging is active (i.e. all/ssl). + // Further checks may be necessary to determine if data is logged. + private static final boolean logging; private final String loggerName; private final boolean useCompactFormat; - static { String p = System.getProperty("javax.net.debug"); if (p != null) { if (p.isEmpty()) { - property = ""; logger = System.getLogger("javax.net.ssl"); + Opt.ALL.on = true; } else { - property = p.toLowerCase(Locale.ENGLISH); - if (property.equals("help")) { + p = p.toLowerCase(Locale.ENGLISH); + if (p.contains("help")) { + // help option calls exit(0) help(); } - + // configure expanded logging mode in constructor logger = new SSLLogger("javax.net.ssl", p); + if (p.contains("all")) { + Opt.ALL.on = true; + } else { + for (Opt o : Opt.values()) { + // deal with special "_" options later + if (o.component.contains("_")) { + continue; + } + + if (p.contains(o.component)) { + o.on = true; + // remove pattern to avoid it being reused + // e.g. "ssl,sslctx" parsing + p = p.replaceFirst(o.component, ""); + } + } + + // "record" and "handshake" subcomponents allow + // extra configuration options + if (Opt.HANDSHAKE.on && p.contains("verbose")) { + Opt.HANDSHAKE_VERBOSE.on = true; + } + + if (Opt.RECORD.on) { + if (p.contains("packet")) { + Opt.RECORD_PACKET.on = true; + } + if (p.contains("plaintext")) { + Opt.RECORD_PLAINTEXT.on = true; + } + } + // finally, if only "ssl" component is declared, then + // enable all subcomponents. "ssl" logs all activity + // except for the "data" and "packet" categories + if (Opt.SSL.on && + EnumSet.allOf(Opt.class) + .stream() + .noneMatch(o -> o.on && o.isSubComponent)) { + for (Opt opt : Opt.values()) { + if (opt.isSubComponent) { + opt.on = true; + } + } + } + } } - isOn = true; + + // javax.net.debug would be misconfigured property with respect + // to logging if value didn't contain "all" or "ssl" + logging = Opt.ALL.on || Opt.SSL.on; } else { - property = null; logger = null; - isOn = false; + logging = false; } } @@ -94,52 +142,17 @@ public final class SSLLogger implements System.Logger { this.useCompactFormat = !options.contains("expand"); } - /** - * Return true if the "javax.net.debug" property contains the - * debug check points, or System.Logger is used. - */ - public static boolean isOn(String checkPoints) { - if (property == null) { // debugging is turned off - return false; - } else if (property.isEmpty()) { // use System.Logger - return true; - } // use provider logger - - String[] options = checkPoints.split(","); - for (String option : options) { - option = option.trim(); - if (!SSLLogger.hasOption(option)) { - return false; - } - } - - return true; - } - @ForceInline public static boolean isOn() { - return isOn; + return logging; } - private static boolean hasOption(String option) { - option = option.toLowerCase(Locale.ENGLISH); - if (property.contains("all")) { - return true; - } else { - // remove first occurrence of "sslctx" since - // it interferes with search for "ssl" - String modified = property.replaceFirst("sslctx", ""); - if (modified.contains("ssl")) { - // don't enable data and plaintext options by default - if (!(option.equals("data") - || option.equals("packet") - || option.equals("plaintext"))) { - return true; - } - } - } + /** + * Return true if the specific DebugOption is enabled or ALL is enabled + */ - return property.contains(option); + public static boolean isOn(Opt option) { + return Opt.ALL.on || option.on; } public static void severe(String msg, Object... params) { @@ -188,33 +201,42 @@ public final class SSLLogger implements System.Logger { } private static void help() { - System.err.println(); - System.err.println("help print the help messages"); - System.err.println("expand expand debugging information"); - System.err.println(); - System.err.println("all turn on all debugging"); - System.err.println("ssl turn on ssl debugging"); - System.err.println(); - System.err.println("The following can be used with ssl:"); - System.err.println("\trecord enable per-record tracing"); - System.err.println("\thandshake print each handshake message"); - System.err.println("\tkeygen print key generation data"); - System.err.println("\tsession print session activity"); - System.err.println("\tdefaultctx print default SSL initialization"); - System.err.println("\tsslctx print SSLContext tracing"); - System.err.println("\tsessioncache print session cache tracing"); - System.err.println("\tkeymanager print key manager tracing"); - System.err.println("\ttrustmanager print trust manager tracing"); - System.err.println("\tpluggability print pluggability tracing"); - System.err.println(); - System.err.println("\thandshake debugging can be widened with:"); - System.err.println("\tdata hex dump of each handshake message"); - System.err.println("\tverbose verbose handshake message printing"); - System.err.println(); - System.err.println("\trecord debugging can be widened with:"); - System.err.println("\tplaintext hex dump of record plaintext"); - System.err.println("\tpacket print raw SSL/TLS packets"); - System.err.println(); + System.err.printf("%n%-16s %s%n", "help", + "print this help message and exit"); + System.err.printf("%-16s %s%n%n", "expand", + "expanded (less compact) output format"); + System.err.printf("%-16s %s%n", "all", "turn on all debugging"); + System.err.printf("%-16s %s%n%n", "ssl", "turn on ssl debugging"); + System.err.printf("The following filters can be used with ssl:%n%n"); + System.err.printf(" %-14s %s%n", "defaultctx", + "print default SSL initialization"); + System.err.printf(" %-14s %s%n", "handshake", + "print each handshake message"); + System.err.printf(" %-12s %s%n", "verbose", + "verbose handshake message printing (widens handshake)"); + System.err.printf(" %-14s %s%n", "keymanager", + "print key manager tracing"); + System.err.printf(" %-14s %s%n", "record", + "enable per-record tracing"); + System.err.printf(" %-12s %s%n", "packet", + "print raw SSL/TLS packets (widens record)"); + System.err.printf(" %-12s %s%n", "plaintext", + "hex dump of record plaintext (widens record)"); + System.err.printf(" %-14s %s%n", "respmgr", + "print OCSP response tracing"); + System.err.printf(" %-14s %s%n", "session", + "print session activity"); + System.err.printf(" %-14s %s%n", "sessioncache", + "print session cache tracing"); + System.err.printf(" %-14s %s%n", "sslctx", + "print SSLContext tracing"); + System.err.printf(" %-14s %s%n", "trustmanager", + "print trust manager tracing"); + System.err.printf("%nIf \"ssl\" is specified by itself," + + " all non-widening filters are enabled.%n"); + System.err.printf("%nSpecifying \"ssl\" with additional filter" + + " options produces general%nSSL debug messages plus just" + + " the selected categories.%n%n"); System.exit(0); } @@ -228,8 +250,8 @@ public final class SSLLogger implements System.Logger { // Logs a warning message and always returns false. This method // can be used as an OR Predicate to add a log in a stream filter. - public static boolean logWarning(String option, String s) { - if (SSLLogger.isOn() && SSLLogger.isOn(option)) { + static boolean logWarning(Opt option, String s) { + if (SSLLogger.isOn() && option.on) { SSLLogger.warning(s); } return false; @@ -240,11 +262,6 @@ public final class SSLLogger implements System.Logger { return loggerName; } - @Override - public boolean isLoggable(Level level) { - return level != Level.OFF; - } - @Override public void log(Level level, ResourceBundle rb, String message, Throwable thrwbl) { @@ -273,11 +290,59 @@ public final class SSLLogger implements System.Logger { } } + @Override + public boolean isLoggable(Level level) { + return level != Level.OFF; + } + + /** + * Enum representing possible debug options for JSSE debugging. + *

+ * ALL and SSL are considered master components. Entries without an + * underscore ("_"), and not ALL or SSL, are subcomponents. Entries + * with an underscore ("_") denote options specific to subcomponents. + *

+ * Fields: + * - 'component': Lowercase name of the option. + * - 'isSubComponent': True for subcomponents. + * - 'on': Indicates whether the option is enabled. Some rule based logic + * is used to determine value of this field. + *

+ * Enabling subcomponents fine-tunes (filters) debug output. + */ + public enum Opt { + ALL, + DEFAULTCTX, + HANDSHAKE, + HANDSHAKE_VERBOSE, + KEYMANAGER, + RECORD, + RECORD_PACKET, + RECORD_PLAINTEXT, + RESPMGR, + SESSION, + SESSIONCACHE, // placeholder for 8344685 + SSLCTX, + TRUSTMANAGER, + SSL; // define ssl last, helps with sslctx matching later. + + final String component; + final boolean isSubComponent; + boolean on; + + Opt() { + this.component = this.toString().toLowerCase(Locale.ENGLISH); + this.isSubComponent = !(component.contains("_") || + component.equals("all") || + component.equals("ssl")); + } + } + private static class SSLSimpleFormatter { private static final String PATTERN = "yyyy-MM-dd kk:mm:ss.SSS z"; private static final DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern(PATTERN, Locale.ENGLISH) - .withZone(ZoneId.systemDefault()); + .withZone(ZoneId.systemDefault()); private static final MessageFormat basicCertFormat = new MessageFormat( """ @@ -293,68 +358,68 @@ public final class SSLLogger implements System.Logger { Locale.ENGLISH); private static final MessageFormat extendedCertFormat = - new MessageFormat( - """ - "version" : "v{0}", - "serial number" : "{1}", - "signature algorithm": "{2}", - "issuer" : "{3}", - "not before" : "{4}", - "not after" : "{5}", - "subject" : "{6}", - "subject public key" : "{7}", - "extensions" : [ - {8} - ] - """, - Locale.ENGLISH); + new MessageFormat( + """ + "version" : "v{0}", + "serial number" : "{1}", + "signature algorithm": "{2}", + "issuer" : "{3}", + "not before" : "{4}", + "not after" : "{5}", + "subject" : "{6}", + "subject public key" : "{7}", + "extensions" : [ + {8} + ] + """, + Locale.ENGLISH); private static final MessageFormat messageFormatNoParas = - new MessageFormat( - """ - '{' - "logger" : "{0}", - "level" : "{1}", - "thread id" : "{2}", - "thread name" : "{3}", - "time" : "{4}", - "caller" : "{5}", - "message" : "{6}" - '}' - """, - Locale.ENGLISH); + new MessageFormat( + """ + '{' + "logger" : "{0}", + "level" : "{1}", + "thread id" : "{2}", + "thread name" : "{3}", + "time" : "{4}", + "caller" : "{5}", + "message" : "{6}" + '}' + """, + Locale.ENGLISH); private static final MessageFormat messageCompactFormatNoParas = - new MessageFormat( - "{0}|{1}|{2}|{3}|{4}|{5}|{6}" + LINE_SEP, - Locale.ENGLISH); + new MessageFormat( + "{0}|{1}|{2}|{3}|{4}|{5}|{6}" + LINE_SEP, + Locale.ENGLISH); private static final MessageFormat messageFormatWithParas = - new MessageFormat( - """ - '{' - "logger" : "{0}", - "level" : "{1}", - "thread id" : "{2}", - "thread name" : "{3}", - "time" : "{4}", - "caller" : "{5}", - "message" : "{6}", - "specifics" : [ - {7} - ] - '}' - """, - Locale.ENGLISH); + new MessageFormat( + """ + '{' + "logger" : "{0}", + "level" : "{1}", + "thread id" : "{2}", + "thread name" : "{3}", + "time" : "{4}", + "caller" : "{5}", + "message" : "{6}", + "specifics" : [ + {7} + ] + '}' + """, + Locale.ENGLISH); private static final MessageFormat messageCompactFormatWithParas = - new MessageFormat( - """ - {0}|{1}|{2}|{3}|{4}|{5}|{6} ( - {7} - ) - """, - Locale.ENGLISH); + new MessageFormat( + """ + {0}|{1}|{2}|{3}|{4}|{5}|{6} ( + {7} + ) + """, + Locale.ENGLISH); private static final MessageFormat keyObjectFormat = new MessageFormat( """ @@ -368,7 +433,7 @@ public final class SSLLogger implements System.Logger { // log message // ... private static String format(SSLLogger logger, Level level, - String message, Object... parameters) { + String message, Object ... parameters) { if (parameters == null || parameters.length == 0) { Object[] messageFields = { @@ -417,7 +482,7 @@ public final class SSLLogger implements System.Logger { .findFirst().orElse("unknown caller")); } - private static String formatParameters(Object... parameters) { + private static String formatParameters(Object ... parameters) { StringBuilder builder = new StringBuilder(512); boolean isFirst = true; for (Object parameter : parameters) { @@ -427,22 +492,21 @@ public final class SSLLogger implements System.Logger { builder.append("," + LINE_SEP); } - if (parameter instanceof Throwable) { - builder.append(formatThrowable((Throwable) parameter)); - } else if (parameter instanceof Certificate) { - builder.append(formatCertificate((Certificate) parameter)); - } else if (parameter instanceof ByteArrayInputStream) { + if (parameter instanceof Throwable t) { + builder.append(formatThrowable(t)); + } else if (parameter instanceof Certificate c) { + builder.append(formatCertificate(c)); + } else if (parameter instanceof ByteArrayInputStream bis) { + builder.append(formatByteArrayInputStream(bis)); + } else if (parameter instanceof ByteBuffer bb) { + builder.append(formatByteBuffer((bb))); + } else if (parameter instanceof byte[] bytes) { builder.append(formatByteArrayInputStream( - (ByteArrayInputStream) parameter)); - } else if (parameter instanceof ByteBuffer) { - builder.append(formatByteBuffer((ByteBuffer) parameter)); - } else if (parameter instanceof byte[]) { - builder.append(formatByteArrayInputStream( - new ByteArrayInputStream((byte[]) parameter))); + new ByteArrayInputStream(bytes))); } else if (parameter instanceof Map.Entry) { @SuppressWarnings("unchecked") Map.Entry mapParameter = - (Map.Entry) parameter; + (Map.Entry)parameter; builder.append(formatMapEntry(mapParameter)); } else { builder.append(formatObject(parameter)); @@ -592,15 +656,15 @@ public final class SSLLogger implements System.Logger { builder.append(" ]"); formatted = builder.toString(); - } else if (value instanceof byte[]) { + } else if (value instanceof byte[] bytes) { formatted = "\"" + key + "\": \"" + - Utilities.toHexString((byte[]) value) + "\""; - } else if (value instanceof Byte) { + Utilities.toHexString((bytes)) + "\""; + } else if (value instanceof Byte b) { formatted = "\"" + key + "\": \"" + - HexFormat.of().toHexDigits((byte) value) + "\""; + HexFormat.of().toHexDigits(b) + "\""; } else { formatted = "\"" + key + "\": " + - "\"" + value.toString() + "\""; + "\"" + value.toString() + "\""; } return Utilities.indent(formatted); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java b/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java index 4de29b7570a..533b7f9a52d 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java @@ -151,7 +151,8 @@ enum SSLMasterKeyDerivation implements SSLKeyDerivationGenerator { // // For RSA premaster secrets, do not signal a protocol error // due to the Bleichenbacher attack. See comments further down. - if (SSLLogger.isOn() && SSLLogger.isOn("handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("RSA master secret generation error.", iae); } throw new ProviderException(iae); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java index f713f723ea0..9b35d5a1222 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java @@ -339,7 +339,8 @@ final class SSLSessionContextImpl implements SSLSessionContext { if (t < 0 || t > NewSessionTicket.MAX_TICKET_LIFETIME) { timeout = DEFAULT_SESSION_TIMEOUT; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Invalid timeout given " + "jdk.tls.server.sessionTicketTimeout: " + t + ". Set to default value " + timeout); @@ -349,7 +350,8 @@ final class SSLSessionContextImpl implements SSLSessionContext { } } catch (NumberFormatException e) { setSessionTimeout(DEFAULT_SESSION_TIMEOUT); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Invalid timeout for " + "jdk.tls.server.sessionTicketTimeout: " + s + ". Set to default value " + timeout); @@ -363,7 +365,7 @@ final class SSLSessionContextImpl implements SSLSessionContext { if (defaultCacheLimit >= 0) { return defaultCacheLimit; - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + } else if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "invalid System Property javax.net.ssl.sessionCacheSize, " + "use the default session cache size (" + @@ -371,7 +373,7 @@ final class SSLSessionContextImpl implements SSLSessionContext { } } catch (Exception e) { // unlikely, log it for safe - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "the System Property javax.net.ssl.sessionCacheSize is " + "not available, use the default value (" + diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java index f3a4b964158..af0b8909d30 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java @@ -223,7 +223,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { this.identificationProtocol = hc.sslConfig.identificationProtocol; this.boundValues = new ConcurrentHashMap<>(); - if (SSLLogger.isOn() && SSLLogger.isOn("session")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SESSION)) { SSLLogger.finest("Session initialized: " + this); } } @@ -256,7 +256,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { this.maximumPacketSize = baseSession.maximumPacketSize; this.boundValues = baseSession.boundValues; - if (SSLLogger.isOn() && SSLLogger.isOn("session")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SESSION)) { SSLLogger.finest("Session initialized: " + this); } } @@ -455,7 +455,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { if (same) { this.localCerts = ((X509Possession) pos).popCerts; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,session")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SESSION)) { SSLLogger.fine("Restored " + len + " local certificates from session ticket" + " for algorithms " + Arrays.toString(certAlgs)); @@ -463,7 +463,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { } else { this.localCerts = null; this.invalidated = true; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,session")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SESSION)) { SSLLogger.warning("Local certificates can not be restored " + "from session ticket " + "for algorithms " + Arrays.toString(certAlgs)); @@ -482,7 +482,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { // If there is no getMasterSecret with TLS1.2 or under, do not resume. if (!protocolVersion.useTLS13PlusSpec() && getMasterSecret().getEncoded() == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("No MasterSecret, cannot make stateless" + " ticket"); } @@ -490,7 +490,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { } if (boundValues != null && boundValues.size() > 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("There are boundValues, cannot make" + " stateless ticket"); } @@ -862,7 +862,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { void setSuite(CipherSuite suite) { cipherSuite = suite; - if (SSLLogger.isOn() && SSLLogger.isOn("session")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SESSION)) { SSLLogger.finest("Negotiating session: " + this); } } @@ -1132,7 +1132,7 @@ final class SSLSessionImpl extends ExtendedSSLSession { return; } invalidated = true; - if (SSLLogger.isOn() && SSLLogger.isOn("session")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SESSION)) { SSLLogger.finest("Invalidated session: " + this); } for (SSLSessionImpl child : childSessions) { diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java index ab01a9d85be..f603cc22949 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java @@ -370,7 +370,7 @@ public final class SSLSocketImpl // start handshaking, if failed, the connection will be closed. ensureNegotiated(false); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.severe("handshake failed", ioe); } @@ -573,7 +573,7 @@ public final class SSLSocketImpl return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("duplex close of SSLSocket"); } @@ -591,7 +591,7 @@ public final class SSLSocketImpl } } catch (IOException ioe) { // ignore the exception - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("SSLSocket duplex close failed. Debug info only. Exception details:", ioe); } } finally { @@ -601,7 +601,7 @@ public final class SSLSocketImpl closeSocket(false); } catch (IOException ioe) { // ignore the exception - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("SSLSocket close failed. Debug info only. Exception details:", ioe); } } finally { @@ -696,7 +696,8 @@ public final class SSLSocketImpl "close_notify message cannot be sent."); } else { super.shutdownOutput(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "SSLSocket output duplex close failed: " + "SO_LINGER timeout, " + @@ -717,7 +718,8 @@ public final class SSLSocketImpl // failed to send the close_notify message. // conContext.conSession.invalidate(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "Invalidate the session: SO_LINGER timeout, " + "close_notify message cannot be sent."); @@ -832,7 +834,7 @@ public final class SSLSocketImpl return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("close inbound of SSLSocket"); } @@ -868,7 +870,7 @@ public final class SSLSocketImpl return; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("close outbound of SSLSocket"); } conContext.closeOutbound(); @@ -1027,7 +1029,7 @@ public final class SSLSocketImpl // filed is checked here, in case the closing process is // still in progress. if (hasDepleted) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("The input stream has been depleted"); } @@ -1048,7 +1050,8 @@ public final class SSLSocketImpl // Double check if the input stream has been depleted. if (hasDepleted) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("The input stream is closing"); } @@ -1134,7 +1137,7 @@ public final class SSLSocketImpl @Override public void close() throws IOException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("Closing input stream"); } @@ -1142,7 +1145,7 @@ public final class SSLSocketImpl SSLSocketImpl.this.close(); } catch (IOException ioe) { // ignore the exception - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("input stream close failed. Debug info only. Exception details:", ioe); } } @@ -1218,7 +1221,7 @@ public final class SSLSocketImpl socketInputRecord.deplete( conContext.isNegotiated && (getSoTimeout() > 0)); } catch (Exception ex) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "input stream close depletion failed", ex); } @@ -1327,7 +1330,7 @@ public final class SSLSocketImpl @Override public void close() throws IOException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("Closing output stream"); } @@ -1335,7 +1338,7 @@ public final class SSLSocketImpl SSLSocketImpl.this.close(); } catch (IOException ioe) { // ignore the exception - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("output stream close failed. Debug info only. Exception details:", ioe); } } @@ -1543,7 +1546,7 @@ public final class SSLSocketImpl if ((conContext.handshakeContext == null) && !conContext.isOutboundClosed() && !conContext.isBroken) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("trigger key update"); } startHandshake(); @@ -1562,7 +1565,7 @@ public final class SSLSocketImpl !conContext.isOutboundClosed() && !conContext.isInboundClosed() && !conContext.isBroken) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("trigger new session ticket"); } conContext.conSession.updateNST = false; @@ -1670,7 +1673,7 @@ public final class SSLSocketImpl * This method never returns normally, it always throws an IOException. */ private void handleException(Exception cause) throws IOException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("handling exception", cause); } @@ -1747,7 +1750,7 @@ public final class SSLSocketImpl @Override public void shutdown() throws IOException { if (!isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("close the underlying socket"); } @@ -1773,7 +1776,7 @@ public final class SSLSocketImpl } private void closeSocket(boolean selfInitiated) throws IOException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("close the SSL connection " + (selfInitiated ? "(initiative)" : "(passive)")); } @@ -1828,7 +1831,7 @@ public final class SSLSocketImpl * transport without waiting for the responding close_notify. */ private void waitForClose() throws IOException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("wait for close_notify or alert"); } @@ -1838,7 +1841,8 @@ public final class SSLSocketImpl try { Plaintext plainText = decode(null); // discard and continue - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( "discard plaintext while waiting for close", plainText); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java index ce7ab630730..fd9c4b171e7 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java @@ -210,7 +210,7 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord { int contentLen = ((header[3] & 0xFF) << 8) + (header[4] & 0xFF); // pos: 3, 4 - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "READ: " + ProtocolVersion.nameOf(majorVersion, minorVersion) + @@ -243,7 +243,7 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord { readFully(contentLen); recordBody.flip(); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "READ: " + ProtocolVersion.nameOf(majorVersion, minorVersion) + @@ -407,12 +407,12 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord { os.write(SSLRecord.v2NoCipher); // SSLv2Hello if (SSLLogger.isOn()) { - if (SSLLogger.isOn("record")) { + if (SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "Requested to negotiate unsupported SSLv2!"); } - if (SSLLogger.isOn("packet")) { + if (SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", SSLRecord.v2NoCipher); } } @@ -445,7 +445,8 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord { ByteBuffer converted = convertToClientHello(recordBody); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine( "[Converted] ClientHello", converted); } @@ -488,13 +489,14 @@ final class SSLSocketInputRecord extends InputRecord implements SSLRecord { private static int read(InputStream is, byte[] buf, int off, int len) throws IOException { int readLen = is.read(buf, off, len); if (readLen < 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw read: EOF"); } throw new EOFException("SSL peer shut down incorrectly"); } - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { ByteBuffer bb = ByteBuffer.wrap(buf, off, readLen); SSLLogger.fine("Raw read", bb); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java index e83ad15db22..43f0580550a 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java @@ -55,7 +55,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "alert message: " + Alert.nameOf(description)); } @@ -67,7 +67,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { write(level); write(description); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine("WRITE: " + protocolVersion.name + " " + ContentType.ALERT.name + "(" + Alert.nameOf(description) + ")" + @@ -81,7 +81,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", (new ByteArrayInputStream(buf, 0, count))); } @@ -99,7 +100,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "handshake message", ByteBuffer.wrap(source, offset, length)); @@ -127,7 +128,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { int limit = v2ClientHello.limit(); handshakeHash.deliver(record, 2, (limit - 2)); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: SSLv2 ClientHello message" + ", length = " + limit); @@ -141,7 +143,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { deliverStream.write(record, 0, limit); deliverStream.flush(); - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", (new ByteArrayInputStream(record, 0, limit))); } @@ -177,7 +180,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.HANDSHAKE.name + @@ -191,7 +194,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", (new ByteArrayInputStream(buf, 0, count))); } @@ -212,7 +216,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { recordLock.lock(); try { if (isClosed()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound has closed, ignore outbound " + "change_cipher_spec message"); } @@ -231,7 +235,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { deliverStream.write(buf, 0, count); // may throw IOException // deliverStream.flush(); // flush in Finished - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", (new ByteArrayInputStream(buf, 0, count))); } @@ -257,7 +262,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { return; } - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.HANDSHAKE.name + @@ -271,7 +276,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", (new ByteArrayInputStream(buf, 0, count))); } @@ -293,7 +299,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { } if (writeCipher.authenticator.seqNumOverflow()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( "sequence number extremely close to overflow " + "(2^64-1 packets). Closing connection."); @@ -330,7 +336,7 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { count = position; write(source, offset, fragLen); - if (SSLLogger.isOn() && SSLLogger.isOn("record")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RECORD)) { SSLLogger.fine( "WRITE: " + protocolVersion.name + " " + ContentType.APPLICATION_DATA.name + @@ -345,7 +351,8 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (SSLLogger.isOn() && SSLLogger.isOn("packet")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RECORD_PACKET)) { SSLLogger.fine("Raw write", (new ByteArrayInputStream(buf, 0, count))); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLTransport.java b/src/java.base/share/classes/sun/security/ssl/SSLTransport.java index 9298e016f63..50bff1e6d21 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLTransport.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLTransport.java @@ -113,7 +113,7 @@ interface SSLTransport { // Code to deliver SSLv2 error message for SSL/TLS connections. if (!context.sslContext.isDTLS()) { context.outputRecord.encodeV2NoCipher(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("may be talking to SSLv2"); } } @@ -161,7 +161,8 @@ interface SSLTransport { if (context.handshakeContext != null && context.handshakeContext.sslConfig.enableRetransmissions && context.sslContext.isDTLS()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("retransmitted handshake flight"); } @@ -181,7 +182,8 @@ interface SSLTransport { // Note that JDK does not support 0-RTT yet. Otherwise, it is // needed to check early_data. if (!context.isNegotiated) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("unexpected application data " + "before handshake completion"); } diff --git a/src/java.base/share/classes/sun/security/ssl/ServerHello.java b/src/java.base/share/classes/sun/security/ssl/ServerHello.java index 0567c861e18..6980c216697 100644 --- a/src/java.base/share/classes/sun/security/ssl/ServerHello.java +++ b/src/java.base/share/classes/sun/security/ssl/ServerHello.java @@ -365,7 +365,7 @@ final class ServerHello { shc.sslConfig.getEnabledExtensions( SSLHandshake.SERVER_HELLO, shc.negotiatedProtocol); shm.extensions.produce(shc, serverHelloExtensions); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced ServerHello handshake message", shm); } @@ -440,7 +440,8 @@ final class ServerHello { } // The cipher suite has been negotiated. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("use cipher suite " + cs.name); } @@ -453,7 +454,8 @@ final class ServerHello { if (ke != null) { SSLPossession[] hcds = ke.createPossessions(shc); if ((hcds != null) && (hcds.length != 0)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "use legacy cipher suite " + cs.name); } @@ -598,7 +600,7 @@ final class ServerHello { shc.sslConfig.getEnabledExtensions( SSLHandshake.SERVER_HELLO, shc.negotiatedProtocol); shm.extensions.produce(shc, serverHelloExtensions); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Produced ServerHello handshake message", shm); } @@ -768,14 +770,16 @@ final class ServerHello { } // The cipher suite has been negotiated. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("use cipher suite " + cs.name); } return cs; } if (legacySuite != null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "use legacy cipher suite " + legacySuite.name); } @@ -828,7 +832,7 @@ final class ServerHello { shc.sslConfig.getEnabledExtensions( SSLHandshake.HELLO_RETRY_REQUEST, shc.negotiatedProtocol); hhrm.extensions.produce(shc, serverHelloExtensions); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced HelloRetryRequest handshake message", hhrm); } @@ -890,7 +894,7 @@ final class ServerHello { shc.sslConfig.getEnabledExtensions( SSLHandshake.MESSAGE_HASH, shc.negotiatedProtocol); hhrm.extensions.produce(shc, serverHelloExtensions); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Reproduced HelloRetryRequest handshake message", hhrm); } @@ -931,7 +935,7 @@ final class ServerHello { } ServerHelloMessage shm = new ServerHelloMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Consuming ServerHello handshake message", shm); } @@ -976,7 +980,7 @@ final class ServerHello { } chc.negotiatedProtocol = serverVersion; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Negotiated protocol version: " + serverVersion.name); } @@ -1031,7 +1035,7 @@ final class ServerHello { chc.conContext.protocolVersion = chc.negotiatedProtocol; chc.conContext.outputRecord.setVersion(chc.negotiatedProtocol); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Negotiated protocol version: " + serverVersion.name); } @@ -1177,7 +1181,8 @@ final class ServerHello { chc.handshakeSession = new SSLSessionImpl(chc, chc.negotiatedCipherSuite, newId); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Locally assigned Session Id: " + newId.toString()); } @@ -1249,7 +1254,7 @@ final class ServerHello { private static void setUpPskKD(HandshakeContext hc, SecretKey psk) throws SSLHandshakeException { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Using PSK to derive early secret"); } diff --git a/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java b/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java index f38fdb2656b..e188f698f4b 100644 --- a/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java +++ b/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java @@ -93,7 +93,7 @@ final class ServerHelloDone { ServerHandshakeContext shc = (ServerHandshakeContext)context; ServerHelloDoneMessage shdm = new ServerHelloDoneMessage(shc); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Produced ServerHelloDone handshake message", shdm); } @@ -147,7 +147,7 @@ final class ServerHelloDone { ServerHelloDoneMessage shdm = new ServerHelloDoneMessage(chc, message); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Consuming ServerHelloDone handshake message", shdm); } diff --git a/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java b/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java index 1dbfcdba4df..0e232b17dda 100644 --- a/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java @@ -216,7 +216,8 @@ final class ServerNameExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(CH_SERVER_NAME)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore unavailable server_name extension"); } @@ -261,7 +262,7 @@ final class ServerNameExtension { return extData; } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("Unable to indicate server name"); } return null; @@ -287,7 +288,8 @@ final class ServerNameExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(CH_SERVER_NAME)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + CH_SERVER_NAME.name); } @@ -305,7 +307,8 @@ final class ServerNameExtension { if (!shc.sslConfig.sniMatchers.isEmpty()) { sni = chooseSni(shc.sslConfig.sniMatchers, spec.serverNames); if (sni != null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "server name indication (" + sni + ") is accepted"); @@ -322,7 +325,8 @@ final class ServerNameExtension { // connection with a "missing_extension" alert. // // We do not reject client without SNI extension currently. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "no server name matchers, " + "ignore server name indication"); @@ -347,7 +351,8 @@ final class ServerNameExtension { // so don't include the pre-shared key in the // ServerHello handshake message shc.handshakeExtensions.remove(SH_PRE_SHARED_KEY); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "abort session resumption, " + "different server name indication used"); @@ -441,7 +446,8 @@ final class ServerNameExtension { CHServerNamesSpec spec = (CHServerNamesSpec) shc.handshakeExtensions.get(CH_SERVER_NAME); if (spec == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable extension: " + SH_SERVER_NAME.name); } @@ -451,7 +457,8 @@ final class ServerNameExtension { // When resuming a session, the server MUST NOT include a // server_name extension in the server hello. if (shc.isResumption || shc.negotiatedServerName == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "No expected server name indication response"); } @@ -528,7 +535,8 @@ final class ServerNameExtension { CHServerNamesSpec spec = (CHServerNamesSpec) shc.handshakeExtensions.get(CH_SERVER_NAME); if (spec == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "Ignore unavailable extension: " + EE_SERVER_NAME.name); } @@ -538,7 +546,8 @@ final class ServerNameExtension { // When resuming a session, the server MUST NOT include a // server_name extension in the server hello. if (shc.isResumption || shc.negotiatedServerName == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest( "No expected server name indication response"); } diff --git a/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java b/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java index de375cdfd98..e58422073c6 100644 --- a/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java @@ -93,7 +93,8 @@ final class SessionTicketExtension { kt = Integer.parseInt(s) * 1000; // change to ms if (kt < 0 || kt > NewSessionTicket.MAX_TICKET_LIFETIME) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Invalid timeout for " + "jdk.tls.server.statelessKeyTimeout: " + kt + ". Set to default value " + @@ -103,7 +104,7 @@ final class SessionTicketExtension { } } catch (NumberFormatException e) { kt = TIMEOUT_DEFAULT; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Invalid timeout for " + "jdk.tls.server.statelessKeyTimeout: " + s + ". Set to default value " + TIMEOUT_DEFAULT + @@ -253,7 +254,8 @@ final class SessionTicketExtension { Integer.BYTES + iv.length + 1, encrypted.length); return result; } catch (Exception e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Encryption failed." + e); } return new byte[0]; @@ -295,7 +297,8 @@ final class SessionTicketExtension { return out; } catch (Exception e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Decryption failed." + e); } } @@ -310,7 +313,7 @@ final class SessionTicketExtension { gos.write(input, 0, decompressedLen); gos.finish(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("decompressed bytes: " + decompressedLen + "; compressed bytes: " + baos.size()); } @@ -329,7 +332,7 @@ final class SessionTicketExtension { new ByteArrayInputStream(bytes))) { byte[] out = gis.readAllBytes(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("compressed bytes: " + compressedLen + "; decompressed bytes: " + out.length); } @@ -395,7 +398,8 @@ final class SessionTicketExtension { // If the context does not allow stateless tickets, exit if (!((SSLSessionContextImpl)chc.sslContext. engineGetClientSessionContext()).statelessEnabled()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Stateless resumption not supported"); } return null; @@ -407,7 +411,8 @@ final class SessionTicketExtension { if (!chc.isResumption || chc.resumingSession == null || chc.resumingSession.getPskIdentity() == null || chc.resumingSession.getProtocolVersion().useTLS13PlusSpec()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Stateless resumption supported"); } return new byte[0]; @@ -451,7 +456,8 @@ final class SessionTicketExtension { shc.statelessResumption = true; if (buffer.remaining() == 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Client accepts session tickets."); } return; @@ -463,11 +469,13 @@ final class SessionTicketExtension { if (b != null) { shc.resumingSession = new SSLSessionImpl(shc, b); shc.isResumption = true; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Valid stateless session ticket found"); } } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Invalid stateless session ticket found"); } } @@ -547,7 +555,7 @@ final class SessionTicketExtension { // Disable stateless resumption if server doesn't send the extension. if (chc.statelessResumption) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.info( "Server doesn't support stateless resumption"); } diff --git a/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java b/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java index dddeb523516..41ed1b9462b 100644 --- a/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java @@ -182,7 +182,8 @@ final class SignatureAlgorithmsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable( SSLExtension.CH_SIGNATURE_ALGORITHMS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable signature_algorithms extension"); } @@ -218,7 +219,8 @@ final class SignatureAlgorithmsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable( SSLExtension.CH_SIGNATURE_ALGORITHMS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable signature_algorithms extension"); } diff --git a/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java b/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java index b91fc17fd29..ba9a6f4fc4e 100644 --- a/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java +++ b/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java @@ -204,7 +204,8 @@ enum SignatureScheme { NoSuchAlgorithmException | RuntimeException exp) { // Signature.getParameters() may throw RuntimeException. mediator = false; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "RSASSA-PSS signature with " + hash + " is not supported by the underlying providers", exp); @@ -297,7 +298,8 @@ enum SignatureScheme { Signature.getInstance(algorithm); } catch (Exception e) { mediator = false; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Signature algorithm, " + algorithm + ", is not supported by the underlying providers"); @@ -424,7 +426,7 @@ enum SignatureScheme { if (ss != null) { schemesToCheck.add(ss); } else { - SSLLogger.logWarning("ssl,handshake", "Unavailable " + SSLLogger.logWarning(SSLLogger.Opt.HANDSHAKE, "Unavailable " + "configured signature scheme: " + name); } } @@ -433,7 +435,7 @@ enum SignatureScheme { for (SignatureScheme ss: schemesToCheck) { if (!ss.isAvailable) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore unsupported signature scheme: " + ss.name); } @@ -452,12 +454,12 @@ enum SignatureScheme { if (ss.isPermitted(constraints, scopes)) { supported.add(ss); } else if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore disabled signature scheme: " + ss.name); } } else if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore inactive signature scheme: " + ss.name); } @@ -476,7 +478,8 @@ enum SignatureScheme { for (int ssid : algorithmIds) { SignatureScheme ss = SignatureScheme.valueOf(ssid); if (ss == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Unsupported signature scheme: " + SignatureScheme.nameOf(ssid)); @@ -486,7 +489,8 @@ enum SignatureScheme { && ss.isAllowed(constraints, protocolVersion, scopes)) { supported.add(ss); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Unsupported signature scheme: " + ss.name); } @@ -546,7 +550,7 @@ enum SignatureScheme { } if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore the signature algorithm (" + ss + "), unsupported EC parameter spec: " + params); @@ -575,7 +579,7 @@ enum SignatureScheme { } if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore the legacy signature algorithm (" + ss + "), unsupported EC parameter spec: " + params); @@ -661,7 +665,7 @@ enum SignatureScheme { } catch (NoSuchAlgorithmException | InvalidKeyException | InvalidAlgorithmParameterException nsae) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.finest( "Ignore unsupported signature algorithm (" + this.name + ")", nsae); 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 d8c4a8ccc3e..2a4dc80eb42 100644 --- a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java +++ b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java @@ -119,13 +119,13 @@ final class StatusResponseManager { if (cert.getExtensionValue( PKIXExtensions.OCSPNoCheck_Id.toString()) != null) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "OCSP NoCheck extension found. OCSP will be skipped"); } return null; } else if (defaultResponder != null && respOverride) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Responder override: URI is " + defaultResponder); } @@ -165,7 +165,7 @@ final class StatusResponseManager { Map responseMap = new HashMap<>(); List requestList = new ArrayList<>(); - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Beginning check: Type = " + type + ", Chain length = " + chain.length); @@ -192,7 +192,8 @@ final class StatusResponseManager { requestList.add(new OCSPFetchCall(sInfo, ocspReq)); } } catch (IOException exc) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Exception during CertId creation: ", exc); } @@ -219,14 +220,15 @@ final class StatusResponseManager { requestList.add(new OCSPFetchCall(sInfo, ocspReq)); } } catch (IOException exc) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Exception during CertId creation: ", exc); } } } } else { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("Unsupported status request type: " + type); } } @@ -257,7 +259,8 @@ final class StatusResponseManager { // that, otherwise just log the ExecutionException Throwable cause = Optional.ofNullable( exc.getCause()).orElse(exc); - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("Exception during OCSP fetch: " + cause); } @@ -267,12 +270,13 @@ final class StatusResponseManager { responseMap.put(info.cert, info.responseData.ocspBytes); } else if (SSLLogger.isOn() && - SSLLogger.isOn("respmgr")) { + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Completed task had no response data"); } } else { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("Found cancelled task"); } } @@ -280,7 +284,8 @@ final class StatusResponseManager { } catch (InterruptedException intex) { // Log and reset the interrupted state Thread.currentThread().interrupt(); - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("Interrupt occurred while fetching: " + intex); } @@ -308,7 +313,8 @@ final class StatusResponseManager { for (Extension ext : ocspRequest.extensions) { if (ext.getId().equals( PKIXExtensions.OCSPNonce_Id.toString())) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Nonce extension found, skipping cache check"); } @@ -323,14 +329,14 @@ final class StatusResponseManager { // and do not return it as a cache hit. if (respEntry != null && respEntry.nextUpdate != null && respEntry.nextUpdate.before(new Date())) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "nextUpdate threshold exceeded, purging from cache"); } respEntry = null; } - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Check cache for SN" + Debug.toString(cid.getSerialNumber()) + ": " + (respEntry != null ? "HIT" : "MISS")); @@ -493,7 +499,7 @@ final class StatusResponseManager { */ @Override public StatusInfo call() { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Starting fetch for SN " + Debug.toString(statInfo.cid.getSerialNumber())); @@ -505,13 +511,15 @@ final class StatusResponseManager { if (statInfo.responder == null) { // If we have no URI then there's nothing to do // but return. - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Null URI detected, OCSP fetch aborted"); } return statInfo; } else { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Attempting fetch from " + statInfo.responder); } @@ -541,7 +549,8 @@ final class StatusResponseManager { statInfo.cid); // Get the response status and act on it appropriately - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("OCSP Status: " + cacheEntry.status + " (" + respBytes.length + " bytes)"); } @@ -554,7 +563,8 @@ final class StatusResponseManager { addToCache(statInfo.cid, cacheEntry); } } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("Caught exception: ", ioe); } } @@ -573,12 +583,14 @@ final class StatusResponseManager { // If no cache lifetime has been set on entries then // don't cache this response if there is no nextUpdate field if (entry.nextUpdate == null && cacheLifetime == 0) { - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine("Not caching this OCSP response"); } } else { responseCache.put(certId, entry); - if (SSLLogger.isOn() && SSLLogger.isOn("respmgr")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.RESPMGR)) { SSLLogger.fine( "Added response for SN " + Debug.toString(certId.getSerialNumber()) + @@ -600,7 +612,7 @@ final class StatusResponseManager { // is necessary. Also, we will only staple if we're doing a full // handshake. if (!shc.sslContext.isStaplingEnabled(false) || shc.isResumption) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("Staping disabled or is a resumed session"); } return null; @@ -623,7 +635,8 @@ final class StatusResponseManager { // selection yet, only accept a request if the ResponderId field // is empty. Finally, we'll only do this in (D)TLS 1.2 or earlier. if (statReqV2 != null && !shc.negotiatedProtocol.useTLS13PlusSpec()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("SH Processing status_request_v2 extension"); } // RFC 6961 stapling @@ -661,7 +674,7 @@ final class StatusResponseManager { type = CertStatusRequestType.valueOf(req.statusType); } else { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Warning: No suitable request " + "found in the status_request_v2 extension."); } @@ -678,7 +691,8 @@ final class StatusResponseManager { // we will try processing an asserted status_request. if ((statReq != null) && (ext == null || type == null || req == null)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE_VERBOSE)) { SSLLogger.fine("SH Processing status_request extension"); } ext = SSLExtension.CH_STATUS_REQUEST; @@ -692,7 +706,8 @@ final class StatusResponseManager { if (ocspReq.responderIds.isEmpty()) { req = ocspReq; } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Warning: No suitable request " + "found in the status_request extension."); } @@ -704,7 +719,7 @@ final class StatusResponseManager { // find a suitable StatusRequest, then stapling is disabled. // The ext, type and req variables must have been set to continue. if (type == null || req == null || ext == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine("No suitable status_request or " + "status_request_v2, stapling is disabled"); } @@ -721,7 +736,7 @@ final class StatusResponseManager { } if (x509Possession == null) { // unlikely - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Warning: no X.509 certificates found. " + "Stapling is disabled."); } @@ -743,7 +758,8 @@ final class StatusResponseManager { responses = statRespMgr.get(fetchType, req, certs, shc.statusRespTimeout, TimeUnit.MILLISECONDS); if (!responses.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Response manager returned " + responses.size() + " entries."); } @@ -753,7 +769,7 @@ final class StatusResponseManager { byte[] respDER = responses.get(certs[0]); if (respDER == null || respDER.length == 0) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Warning: Null or zero-length " + "response found for leaf certificate. " + "Stapling is disabled."); @@ -763,7 +779,8 @@ final class StatusResponseManager { } params = new StaplingParameters(ext, type, req, responses); } else { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Warning: no OCSP responses obtained. " + "Stapling is disabled."); } @@ -771,7 +788,7 @@ final class StatusResponseManager { } else { // This should not happen, but if lazy initialization of the // StatusResponseManager doesn't occur we should turn off stapling. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.finest("Warning: lazy initialization " + "of the StatusResponseManager failed. " + "Stapling is disabled."); diff --git a/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java b/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java index 1fa2356d1de..7775a2bca97 100644 --- a/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java @@ -129,8 +129,8 @@ final class SunX509KeyManagerImpl extends X509KeyManagerCertChecking { X509Credentials cred = new X509Credentials((PrivateKey) key, (X509Certificate[]) certs); credentialsMap.put(alias, cred); - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { - SSLLogger.fine("found key for : " + alias, (Object[]) certs); + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { + SSLLogger.fine("found key for : " + alias, (Object[])certs); } } } @@ -315,7 +315,8 @@ final class SunX509KeyManagerImpl extends X509KeyManagerCertChecking { } if (results == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("KeyMgr: no matching key found"); } return null; diff --git a/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java b/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java index 67cb37988a1..28e81e52866 100644 --- a/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java @@ -164,7 +164,8 @@ final class SupportedGroupsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(CH_SUPPORTED_GROUPS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable supported_groups extension"); } @@ -177,7 +178,8 @@ final class SupportedGroupsExtension { for (String name : chc.sslConfig.namedGroups) { NamedGroup ng = NamedGroup.nameOf(name); if (ng == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unspecified named group: " + name); } @@ -193,14 +195,16 @@ final class SupportedGroupsExtension { ng.isSupported(chc.activeCipherSuites) && ng.isPermitted(chc.algorithmConstraints)) { namedGroups.add(ng); - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore inactive or disabled named group: " + ng.name); } } if (namedGroups.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("no available named group"); } @@ -244,7 +248,8 @@ final class SupportedGroupsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(CH_SUPPORTED_GROUPS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable supported_groups extension"); } @@ -319,7 +324,8 @@ final class SupportedGroupsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(EE_SUPPORTED_GROUPS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable supported_groups extension"); } @@ -336,7 +342,7 @@ final class SupportedGroupsExtension { NamedGroup ng = NamedGroup.nameOf(name); if (ng == null) { if (SSLLogger.isOn() && - SSLLogger.isOn("ssl,handshake")) { + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unspecified named group: " + name); } @@ -352,14 +358,16 @@ final class SupportedGroupsExtension { ng.isSupported(shc.activeCipherSuites) && ng.isPermitted(shc.algorithmConstraints)) { namedGroups.add(ng); - } else if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + } else if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore inactive or disabled named group: " + ng.name); } } if (namedGroups.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning("no available named group"); } @@ -399,7 +407,8 @@ final class SupportedGroupsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(EE_SUPPORTED_GROUPS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable supported_groups extension"); } diff --git a/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java b/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java index 58597c3008c..90c315a57c5 100644 --- a/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java +++ b/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java @@ -168,7 +168,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(CH_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + CH_SUPPORTED_VERSIONS.name); @@ -216,7 +217,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(CH_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + CH_SUPPORTED_VERSIONS.name); @@ -308,7 +310,8 @@ final class SupportedVersionsExtension { shc.handshakeExtensions.get(CH_SUPPORTED_VERSIONS); if (svs == null) { // Unlikely, no key_share extension requested. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.warning( "Ignore unavailable supported_versions extension"); } @@ -317,7 +320,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(SH_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + SH_SUPPORTED_VERSIONS.name); @@ -356,7 +360,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(SH_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + SH_SUPPORTED_VERSIONS.name); @@ -399,7 +404,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(HRR_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + HRR_SUPPORTED_VERSIONS.name); @@ -441,7 +447,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!chc.sslConfig.isAvailable(HRR_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "Ignore unavailable extension: " + HRR_SUPPORTED_VERSIONS.name); @@ -483,7 +490,8 @@ final class SupportedVersionsExtension { // Is it a supported and enabled extension? if (!shc.sslConfig.isAvailable(HRR_SUPPORTED_VERSIONS)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.HANDSHAKE)) { SSLLogger.fine( "[Reproduce] Ignore unavailable extension: " + HRR_SUPPORTED_VERSIONS.name); diff --git a/src/java.base/share/classes/sun/security/ssl/TransportContext.java b/src/java.base/share/classes/sun/security/ssl/TransportContext.java index 35bdd2fff36..1c68c13bbdc 100644 --- a/src/java.base/share/classes/sun/security/ssl/TransportContext.java +++ b/src/java.base/share/classes/sun/security/ssl/TransportContext.java @@ -269,7 +269,7 @@ final class TransportContext implements ConnectionContext { try { outputRecord.encodeAlert(Alert.Level.WARNING.level, alert.id); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "Warning: failed to send warning alert " + alert, ioe); } @@ -329,7 +329,7 @@ final class TransportContext implements ConnectionContext { // so we'll do it here. if (closeReason != null) { if (cause == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "Closed transport, general or untracked problem"); } @@ -340,7 +340,7 @@ final class TransportContext implements ConnectionContext { if (cause instanceof SSLException) { throw (SSLException)cause; } else { // unlikely, but just in case. - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "Closed transport, unexpected rethrowing", cause); } @@ -363,7 +363,7 @@ final class TransportContext implements ConnectionContext { } // shutdown the transport - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.severe("Fatal (" + alert + "): " + diagnostic, cause); } @@ -379,7 +379,7 @@ final class TransportContext implements ConnectionContext { try { inputRecord.close(); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Fatal: input record closure failed", ioe); } @@ -410,7 +410,7 @@ final class TransportContext implements ConnectionContext { try { outputRecord.encodeAlert(Alert.Level.FATAL.level, alert.id); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "Fatal: failed to send fatal alert " + alert, ioe); } @@ -423,7 +423,7 @@ final class TransportContext implements ConnectionContext { try { outputRecord.close(); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Fatal: output record closure failed", ioe); } @@ -439,7 +439,7 @@ final class TransportContext implements ConnectionContext { try { transport.shutdown(); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("Fatal: transport closure failed", ioe); } @@ -525,7 +525,7 @@ final class TransportContext implements ConnectionContext { passiveInboundClose(); } } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("inbound closure failed", ioe); } } @@ -582,7 +582,7 @@ final class TransportContext implements ConnectionContext { try { initiateOutboundClose(); } catch (IOException ioe) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning("outbound closure failed", ioe); } } diff --git a/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java b/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java index 8b89fecefa8..584a125710e 100644 --- a/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java @@ -48,24 +48,28 @@ abstract class TrustManagerFactoryImpl extends TrustManagerFactorySpi { trustManager = getInstance(TrustStoreManager.getTrustedCerts()); } catch (SecurityException se) { // eat security exceptions but report other throwables - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "SunX509: skip default keystore", se); } } catch (Error err) { - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "SunX509: skip default keystore", err); } throw err; } catch (RuntimeException re) { - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "SunX509: skip default keystore", re); } throw re; } catch (Exception e) { - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "SunX509: skip default keystore", e); } diff --git a/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java b/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java index a44f3a4e32d..0f0bfa4bfa8 100644 --- a/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java +++ b/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java @@ -108,7 +108,8 @@ final class TrustStoreManager { this.storeFile = storeFile; this.lastModified = lastModified; - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "trustStore is: " + storeName + "\n" + "trustStore type is: " + storeType + "\n" + @@ -152,7 +153,7 @@ final class TrustStoreManager { // Not break, the file is inaccessible. if (SSLLogger.isOn() && - SSLLogger.isOn("trustmanager")) { + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "Inaccessible trust store: " + fileName); @@ -267,7 +268,8 @@ final class TrustStoreManager { } // Reload a new key store. - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("Reload the trust store"); } @@ -321,7 +323,8 @@ final class TrustStoreManager { // Reload the trust store if needed. if (ks == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("Reload the trust store"); } ks = loadKeyStore(descriptor); @@ -329,12 +332,14 @@ final class TrustStoreManager { } // Reload trust certs from the key store. - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("Reload trust certs"); } certs = loadTrustedCerts(ks); - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("Reloaded " + certs.size() + " trust certs"); } @@ -355,7 +360,8 @@ final class TrustStoreManager { descriptor.storeFile == null) { // No file available, no KeyStore available. - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("No available key store"); } @@ -382,7 +388,8 @@ final class TrustStoreManager { ks.load(bis, password); } catch (FileNotFoundException fnfe) { // No file available, no KeyStore available. - if (SSLLogger.isOn() && SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "Not available key store: " + descriptor.storeName); } diff --git a/src/java.base/share/classes/sun/security/ssl/Utilities.java b/src/java.base/share/classes/sun/security/ssl/Utilities.java index 458551b9d8a..cfd39aecac2 100644 --- a/src/java.base/share/classes/sun/security/ssl/Utilities.java +++ b/src/java.base/share/classes/sun/security/ssl/Utilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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,7 +70,7 @@ final class Utilities { SNIServerName serverName = sniList.get(i); if (serverName.getType() == StandardConstants.SNI_HOST_NAME) { sniList.set(i, sniHostName); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( "the previous server name in SNI (" + serverName + ") was replaced with (" + sniHostName + ")"); @@ -116,7 +116,7 @@ final class Utilities { return new SNIHostName(hostname); } catch (IllegalArgumentException iae) { // don't bother to handle illegal host_name - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine(hostname + "\" " + "is not a legal HostName for server name indication"); } @@ -168,6 +168,35 @@ final class Utilities { return builder.toString(); } + static String wrapText(String text, int maxWidth) { + if (text == null || text.isEmpty() || maxWidth <= 0) { + return ""; + } + StringBuilder result = new StringBuilder(); + String[] values = text.split(",\\s*"); + StringBuilder line = new StringBuilder(); + + for (int i = 0; i < values.length; i++) { + String value = values[i]; + // If adding this value would exceed maxWidth + if (line.length() > 0) { + // +1 for the comma + if (line.length() + 1 + value.length() > maxWidth) { + result.append(line).append(LINE_SEP); + line.setLength(0); + } else { + line.append(","); + } + } + line.append(value); + } + // Append any remaining line + if (line.length() > 0) { + result.append(line); + } + return result.toString(); + } + static String byte16HexString(int id) { return "0x" + HEX_FORMATTER.toHexDigits((short)id); } diff --git a/src/java.base/share/classes/sun/security/ssl/X509Authentication.java b/src/java.base/share/classes/sun/security/ssl/X509Authentication.java index 6aedff02c34..bdb2dd7706f 100644 --- a/src/java.base/share/classes/sun/security/ssl/X509Authentication.java +++ b/src/java.base/share/classes/sun/security/ssl/X509Authentication.java @@ -201,7 +201,7 @@ enum X509Authentication implements SSLAuthentication { private static SSLPossession createClientPossession( ClientHandshakeContext chc, String[] keyTypes) { X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("X509KeyManager class: " + km.getClass().getName()); } @@ -243,7 +243,7 @@ enum X509Authentication implements SSLAuthentication { } if (clientAlias == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("No X.509 cert selected for " + Arrays.toString(keyTypes)); } @@ -252,7 +252,7 @@ enum X509Authentication implements SSLAuthentication { PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); if (clientPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( clientAlias + " is not a private key entry"); } @@ -261,7 +261,7 @@ enum X509Authentication implements SSLAuthentication { X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); if ((clientCerts == null) || (clientCerts.length == 0)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest(clientAlias + " is a private key entry with no cert chain stored"); } @@ -270,7 +270,7 @@ enum X509Authentication implements SSLAuthentication { String privateKeyAlgorithm = clientPrivateKey.getAlgorithm(); if (!Arrays.asList(keyTypes).contains(privateKeyAlgorithm)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( clientAlias + " private key algorithm " + privateKeyAlgorithm + " not in request list"); @@ -280,7 +280,7 @@ enum X509Authentication implements SSLAuthentication { String publicKeyAlgorithm = clientCerts[0].getPublicKey().getAlgorithm(); if (!privateKeyAlgorithm.equals(publicKeyAlgorithm)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( clientAlias + " private or public key is not of " + "same algorithm: " + @@ -296,7 +296,7 @@ enum X509Authentication implements SSLAuthentication { private static SSLPossession createServerPossession( ServerHandshakeContext shc, String[] keyTypes) { X509ExtendedKeyManager km = shc.sslContext.getX509KeyManager(); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("X509KeyManager class: " + km.getClass().getName()); } @@ -337,7 +337,7 @@ enum X509Authentication implements SSLAuthentication { } if (serverAlias == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest("No X.509 cert selected for " + keyType); } continue; @@ -345,7 +345,7 @@ enum X509Authentication implements SSLAuthentication { PrivateKey serverPrivateKey = km.getPrivateKey(serverAlias); if (serverPrivateKey == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( serverAlias + " is not a private key entry"); } @@ -354,7 +354,7 @@ enum X509Authentication implements SSLAuthentication { X509Certificate[] serverCerts = km.getCertificateChain(serverAlias); if ((serverCerts == null) || (serverCerts.length == 0)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.finest( serverAlias + " is not a certificate entry"); } @@ -364,7 +364,7 @@ enum X509Authentication implements SSLAuthentication { PublicKey serverPublicKey = serverCerts[0].getPublicKey(); if ((!serverPrivateKey.getAlgorithm().equals(keyType)) || (!serverPublicKey.getAlgorithm().equals(keyType))) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( serverAlias + " private or public key is not of " + keyType + " algorithm"); @@ -379,7 +379,7 @@ enum X509Authentication implements SSLAuthentication { if (!shc.negotiatedProtocol.useTLS13PlusSpec() && keyType.equals("EC")) { if (!(serverPublicKey instanceof ECPublicKey)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning(serverAlias + " public key is not an instance of ECPublicKey"); } @@ -398,7 +398,8 @@ enum X509Authentication implements SSLAuthentication { ((shc.clientRequestedNamedGroups != null) && !shc.clientRequestedNamedGroups.contains(namedGroup))) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.warning( "Unsupported named group (" + namedGroup + ") used in the " + serverAlias + " certificate"); diff --git a/src/java.base/share/classes/sun/security/ssl/X509KeyManagerCertChecking.java b/src/java.base/share/classes/sun/security/ssl/X509KeyManagerCertChecking.java index 2a1f01273bd..6d26558847c 100644 --- a/src/java.base/share/classes/sun/security/ssl/X509KeyManagerCertChecking.java +++ b/src/java.base/share/classes/sun/security/ssl/X509KeyManagerCertChecking.java @@ -116,7 +116,7 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { } if (keyIndex == -1) { - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("Ignore alias " + alias + ": key algorithm does not match"); } @@ -134,7 +134,8 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { } } if (!found) { - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine( "Ignore alias " + alias + ": issuers do not match"); @@ -150,7 +151,7 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { !conformsToAlgorithmConstraints(constraints, chain, checkType.getValidator())) { - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("Ignore alias " + alias + ": certificate chain does not conform to " + "algorithm constraints"); @@ -219,7 +220,7 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { checker.init(false); } catch (CertPathValidatorException cpve) { // unlikely to happen - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine( "Cannot initialize algorithm constraints checker", cpve); @@ -235,7 +236,8 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { // We don't care about the unresolved critical extensions. checker.check(cert, Collections.emptySet()); } catch (CertPathValidatorException cpve) { - if (SSLLogger.isOn() && SSLLogger.isOn("keymanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("Certificate does not conform to " + "algorithm constraints", cert, cpve); } @@ -393,7 +395,7 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { } catch (IllegalArgumentException iae) { // unlikely to happen, just in case ... if (SSLLogger.isOn() && - SSLLogger.isOn("keymanager")) { + SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("Illegal server name: " + serverName); } @@ -409,7 +411,7 @@ abstract class X509KeyManagerCertChecking extends X509ExtendedKeyManager { cert, idAlgorithm); } catch (CertificateException e) { if (SSLLogger.isOn() && - SSLLogger.isOn("keymanager")) { + SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine( "Certificate identity does not match " + "Server Name Indication (SNI): " diff --git a/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java b/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java index 72f079db175..be982bfd192 100644 --- a/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java @@ -228,7 +228,7 @@ final class X509KeyManagerImpl extends X509KeyManagerCertChecking { || (secondDot - firstDot < 2) || (alias.length() - secondDot < 2)) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.warning("Invalid alias format: " + alias); } return null; @@ -255,7 +255,7 @@ final class X509KeyManagerImpl extends X509KeyManagerCertChecking { NoSuchAlgorithmException | IndexOutOfBoundsException e) { // ignore and only log exception - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.warning("Exception thrown while getting an alias " + alias + ": " + e); } @@ -296,7 +296,7 @@ final class X509KeyManagerImpl extends X509KeyManagerCertChecking { for (EntryStatus status : results) { if (status.checkResult == CheckResult.OK) { if (SSLLogger.isOn() - && SSLLogger.isOn("ssl,keymanager")) { + && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("Choosing key: " + status); } return makeAlias(status); @@ -312,13 +312,13 @@ final class X509KeyManagerImpl extends X509KeyManagerCertChecking { } } if (allResults == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("No matching key found"); } return null; } Collections.sort(allResults); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine( "No good matching key found, " + "returning best match out of", allResults); @@ -358,13 +358,13 @@ final class X509KeyManagerImpl extends X509KeyManagerCertChecking { } } if (allResults == null || allResults.isEmpty()) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("No matching alias found"); } return null; } Collections.sort(allResults); - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,keymanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.KEYMANAGER)) { SSLLogger.fine("Getting aliases", allResults); } return toAliases(allResults); diff --git a/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java b/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java index 40ee01d284a..209e315b59d 100644 --- a/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java @@ -74,7 +74,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager { this.trustedCerts = trustedCerts; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,trustmanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("adding as trusted certificates", (Object[])trustedCerts.toArray(new X509Certificate[0])); } @@ -91,7 +91,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager { trustedCerts = v.getTrustedCertificates(); serverValidator = v; - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,trustmanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("adding as trusted certificates", (Object[])trustedCerts.toArray(new X509Certificate[0])); } @@ -294,7 +294,7 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager { null, checkClientTrusted ? null : authType); } - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,trustmanager")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("Found trusted certificate", trustedChain[trustedChain.length - 1]); } @@ -328,7 +328,8 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager { hostname = new SNIHostName(sniName.getEncoded()); } catch (IllegalArgumentException iae) { // unlikely to happen, just in case ... - if (SSLLogger.isOn() && SSLLogger.isOn("ssl,trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine("Illegal server name: " + sniName); } } diff --git a/src/java.base/share/classes/sun/security/util/DomainName.java b/src/java.base/share/classes/sun/security/util/DomainName.java index 465c155ab87..82a5179e9b5 100644 --- a/src/java.base/share/classes/sun/security/util/DomainName.java +++ b/src/java.base/share/classes/sun/security/util/DomainName.java @@ -192,7 +192,7 @@ class DomainName { } return getRules(tld, new ZipInputStream(pubSuffixStream)); } catch (IOException e) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine( "cannot parse public suffix data for " + tld + ": " + e.getMessage()); @@ -209,8 +209,8 @@ class DomainName { is = new FileInputStream(f); } catch (FileNotFoundException e) { } if (is == null) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl") && - SSLLogger.isOn("trustmanager")) { + if (SSLLogger.isOn() && + SSLLogger.isOn(SSLLogger.Opt.TRUSTMANAGER)) { SSLLogger.fine( "lib/security/public_suffix_list.dat not found"); } @@ -230,7 +230,7 @@ class DomainName { } } if (!found) { - if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) { + if (SSLLogger.isOn() && SSLLogger.isOn(SSLLogger.Opt.SSL)) { SSLLogger.fine("Domain " + tld + " not found"); } return null; diff --git a/src/java.base/share/legal/gcc.md b/src/java.base/share/legal/gcc.md new file mode 100644 index 00000000000..b78ca12caa9 --- /dev/null +++ b/src/java.base/share/legal/gcc.md @@ -0,0 +1,2084 @@ +## GCC - libgcc and libstdc++ 14.2.0 + +### GNU GENERAL PUBLIC LICENSE v3 + +``` + Version 3, 29 June 2007 + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + Preamble + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + The precise terms and conditions for copying, distribution and +modification follow. + TERMS AND CONDITIONS + 0. Definitions. + "This License" refers to version 3 of the GNU General Public License. + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + A "covered work" means either the unmodified Program or a work based +on the Program. + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + 1. Source Code. + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + The Corresponding Source for a work in source code form is that +same work. + 2. Basic Permissions. + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + 4. Conveying Verbatim Copies. + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + 5. Conveying Modified Source Versions. + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + 6. Conveying Non-Source Forms. + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + 7. Additional Terms. + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + 8. Termination. + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + 9. Acceptance Not Required for Having Copies. + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + 10. Automatic Licensing of Downstream Recipients. + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + 11. Patents. + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + 12. No Surrender of Others' Freedom. + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + 13. Use with the GNU Affero General Public License. + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + 14. Revised Versions of this License. + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + 15. Disclaimer of Warranty. + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + 16. Limitation of Liability. + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + 17. Interpretation of Sections 15 and 16. + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + END OF TERMS AND CONDITIONS + How to Apply These Terms to Your New Programs + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + Copyright (C) + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program 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 for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +Also add information on how to contact you by electronic and paper mail. + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. +``` + +### GCC RUNTIME LIBRARY EXCEPTION v3.1 + +``` +Version 3.1, 31 March 2009 +Copyright (C) 2009 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. +0. Definitions. +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. +1. Grant of Additional Permission. +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. +2. No Weakening of GCC Copyleft. +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. +``` + +### GNU GENERAL PUBLIC LICENSE v2 + +``` + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + Preamble + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + NO WARRANTY + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + Copyright (C) + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + This program 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 for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Also add information on how to contact you by electronic and paper mail. +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + , 1 April 1989 + Ty Coon, President of Vice +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. +``` + +### GNU LESSER GENERAL PUBLIC LICENSE v3 + +``` + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + 0. Additional Definitions. + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + 1. Exception to Section 3 of the GNU GPL. + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + 2. Conveying Modified Versions. + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + 3. Object Code Incorporating Material from Library Header Files. + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + b) Accompany the object code with a copy of the GNU GPL and this license + document. + 4. Combined Works. + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + d) Do one of the following: + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + 5. Combined Libraries. + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + 6. Revised Versions of the GNU Lesser General Public License. + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. +``` + +### GNU LESSER GENERAL PUBLIC LICENSE v2.1 + +``` + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + Preamble + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + a) The modified work must itself be a software library. + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + NO WARRANTY + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + Copyright (C) + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library 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 + Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Also add information on how to contact you by electronic and paper mail. +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + , 1 April 1990 + Ty Coon, President of Vice +That's all there is to it! +``` + +### GNU Free Documentation License v1.3 + +``` + GNU Free Documentation License + Version 1.3, 3 November 2008 + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. +0. PREAMBLE +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +1. APPLICABILITY AND DEFINITIONS +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. +The "publisher" means any person or entity that distributes copies of +the Document to the public. +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +2. VERBATIM COPYING +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +3. COPYING IN QUANTITY +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. +4. MODIFICATIONS +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +5. COMBINING DOCUMENTS +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". +6. COLLECTIONS OF DOCUMENTS +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. +7. AGGREGATION WITH INDEPENDENT WORKS +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +8. TRANSLATION +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +9. TERMINATION +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +10. FUTURE REVISIONS OF THIS LICENSE +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +11. RELICENSING +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +ADDENDUM: How to use this License for your documents +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +``` + +### The Regents of the University of California + +``` +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. [rescinded 22 July 1999] + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +``` + +### The Go Authors + +``` +Copyright (c) 2009 The Go Authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +### Apache License v2.0 + +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + 1. Definitions. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + END OF TERMS AND CONDITIONS + APPENDIX: How to apply the Apache License to your work. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + Copyright [yyyy] [name of copyright owner] + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + diff --git a/src/java.base/share/legal/zlib.md b/src/java.base/share/legal/zlib.md index fcc5457bf5b..c729c4248d4 100644 --- a/src/java.base/share/legal/zlib.md +++ b/src/java.base/share/legal/zlib.md @@ -1,9 +1,9 @@ -## zlib v1.3.1 +## zlib v1.3.2 ### zlib License

 
-Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
+Copyright (C) 1995-2026 Jean-loup Gailly and Mark Adler
 
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
diff --git a/src/java.base/share/man/java.md b/src/java.base/share/man/java.md
index 956a6aa144b..8cfccff5abe 100644
--- a/src/java.base/share/man/java.md
+++ b/src/java.base/share/man/java.md
@@ -2454,8 +2454,8 @@ Java HotSpot VM.
 
 [`-XX:InitialRAMPercentage=`]{#-XX_InitialRAMPercentage}*percent*
 :   Sets the initial amount of memory that the JVM will use for the Java heap
-    before applying ergonomics heuristics as a percentage of the maximum amount
-    determined as described in the `-XX:MaxRAM` option.
+    before applying ergonomics heuristics as a percentage of the available memory
+    to the JVM process.
 
     The following example shows how to set the percentage of the initial
     amount of memory used for the Java heap:
@@ -2575,9 +2575,8 @@ Java HotSpot VM.
 
 [`-XX:MaxRAMPercentage=`]{#-XX_MaxRAMPercentage}*percent*
 :   Sets the maximum amount of memory that the JVM may use for the Java heap
-    before applying ergonomics heuristics as a percentage of the maximum amount
-    determined as described in the `-XX:MaxRAM` option. The default value is 25
-    percent.
+    before applying ergonomics heuristics as a percentage of the available memory
+    to the JVM process. The default value is 25 percent.
 
     Specifying this option disables automatic use of compressed oops if
     the combined result of this and other options influencing the maximum amount
@@ -2591,9 +2590,9 @@ Java HotSpot VM.
 
 [`-XX:MinRAMPercentage=`]{#-XX_MinRAMPercentage}*percent*
 :   Sets the maximum amount of memory that the JVM may use for the Java heap
-    before applying ergonomics heuristics as a percentage of the maximum amount
-    determined as described in the `-XX:MaxRAM` option for small heaps. A small
-    heap is a heap of approximately 125 MB. The default value is 50 percent.
+    before applying ergonomics heuristics as a percentage of the available memory
+    to the JVM process for small heaps. A small heap is a heap of approximately
+    125 MB. The default value is 50 percent.
 
     The following example shows how to set the percentage of the maximum amount
     of memory used for the Java heap for small heaps:
@@ -2939,25 +2938,6 @@ they're used.
     (`-XX:+UseParallelGC` or `-XX:+UseG1GC`). Other collectors employing multiple
     threads always perform reference processing in parallel.
 
-[`-XX:MaxRAM=`]{#-XX_MaxRAM}*size*
-:   Sets the maximum amount of memory that the JVM may use for the Java heap
-    before applying ergonomics heuristics. The default value is the amount of
-    available memory to the JVM process.
-
-    The maximum amount of available memory to the JVM process is the minimum
-    of the machine's physical memory and any constraints set by the environment
-    (e.g. container).
-
-    Specifying this option disables automatic use of compressed oops if
-    the combined result of this and other options influencing the maximum amount
-    of memory is larger than the range of memory addressable by compressed oops.
-    See `-XX:UseCompressedOops` for further information about compressed oops.
-
-    The following example shows how to set the maximum amount of available
-    memory for sizing the Java heap to 2 GB:
-
-    >   `-XX:MaxRAM=2G`
-
 [`-XX:+AggressiveHeap`]{#-XX__AggressiveHeap}
 :   Enables Java heap optimization. This sets various parameters to be
     optimal for long-running jobs with intensive memory allocation, based on
@@ -2967,8 +2947,8 @@ they're used.
 [`-XX:+NeverActAsServerClassMachine`]{#-XX__NeverActAsServerClassMachine}
 :   Enable the "Client VM emulation" mode which only uses the C1 JIT compiler,
     a 32Mb CodeCache and the Serial GC. The maximum amount of memory that the
-    JVM may use (controlled by the `-XX:MaxRAM=n` flag) is set to 1GB by default.
-    The string "emulated-client" is added to the JVM version string.
+    JVM may use is set to 1GB by default. The string "emulated-client" is added
+    to the JVM version string.
 
     By default the flag is set to `true` only on Windows in 32-bit mode and
     `false` in all other cases.
diff --git a/src/java.base/share/native/libzip/zlib/ChangeLog b/src/java.base/share/native/libzip/zlib/ChangeLog
index b801a1031ec..312753edade 100644
--- a/src/java.base/share/native/libzip/zlib/ChangeLog
+++ b/src/java.base/share/native/libzip/zlib/ChangeLog
@@ -1,6 +1,57 @@
 
                 ChangeLog file for zlib
 
+Changes in 1.3.2 (17 Feb 2026)
+- Continued rewrite of CMake build [Vollstrecker]
+- Various portability improvements
+- Various github workflow additions and improvements
+- Check for negative lengths in crc32_combine functions
+- Copy only the initialized window contents in inflateCopy
+- Prevent the use of insecure functions without an explicit request
+- Add compressBound_z and deflateBound_z functions for large values
+- Use atomics to build inflate fixed tables once
+- Add definition of ZLIB_INSECURE to build tests with c89 and c94
+- Add --undefined option to ./configure for UBSan checker
+- Copy only the initialized deflate state in deflateCopy
+- Zero inflate state on allocation
+- Remove untgz from contrib
+- Add _z versions of the compress and uncompress functions
+- Vectorize the CRC-32 calculation on the s390x
+- Set bit 11 of the zip header flags in minizip if UTF-8
+- Update OS/400 support
+- Add a test to configure to check for a working compiler
+- Check for invalid NULL pointer inputs to zlib operations
+- Add --mandir to ./configure to specify manual directory
+- Add LICENSE.Info-Zip to contrib/minizip
+- Remove vstudio projects in lieu of cmake-generated projects
+- Replace strcpy() with memcpy() in contrib/minizip
+
+Changes in 1.3.1.2 (8 Dec 2025)
+- Improve portability to RISC OS
+- Permit compiling contrib/minizip/unzip.c with decryption
+- Enable build of shared library on AIX
+- Make deflateBound() more conservative and handle Z_STREAM_END
+- Add zipAlreadyThere() to minizip zip.c to help avoid duplicates
+- Make z_off_t 64 bits by default
+- Add deflateUsed() function to get the used bits in the last byte
+- Avoid out-of-bounds pointer arithmetic in inflateCopy()
+- Add Haiku to configure for proper LDSHARED settings
+- Add Bazel targets
+- Complete rewrite of CMake build [Vollstrecker]
+- Clarify the use of errnum in gzerror()
+- Note that gzseek() requests are deferred until the next operation
+- Note the use of gzungetc() to run a deferred seek while reading
+- Fix bug in inflatePrime() for 16-bit ints
+- Add a "G" option to force gzip, disabling transparency in gzread()
+- Improve the discrimination between trailing garbage and bad gzip
+- Allow gzflush() to write empty gzip members
+- Remove redundant frees of point list on error in examples/zran.c
+- Clarify the use of inflateGetHeader()
+- Update links to the RFCs
+- Return all available uncompressed data on error in gzread.c
+- Support non-blocking devices in the gz* routines
+- Various other small improvements
+
 Changes in 1.3.1 (22 Jan 2024)
 - Reject overflows of zip header fields in minizip
 - Fix bug in inflateSync() for data held in bit buffer
diff --git a/src/java.base/share/native/libzip/zlib/README b/src/java.base/share/native/libzip/zlib/README
index c5f917540b6..2b1e6f36fe3 100644
--- a/src/java.base/share/native/libzip/zlib/README
+++ b/src/java.base/share/native/libzip/zlib/README
@@ -1,10 +1,10 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.3.1 is a general purpose data compression library.  All the code is
-thread safe.  The data format used by the zlib library is described by RFCs
-(Request for Comments) 1950 to 1952 in the files
-http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
-rfc1952 (gzip format).
+zlib 1.3.2 is a general purpose data compression library.  All the code is
+thread safe (though see the FAQ for caveats).  The data format used by the zlib
+library is described by RFCs (Request for Comments) 1950 to 1952 at
+https://datatracker.ietf.org/doc/html/rfc1950 (zlib format), rfc1951 (deflate
+format) and rfc1952 (gzip format).
 
 All functions of the compression library are documented in the file zlib.h
 (volunteer to write man pages welcome, contact zlib@gzip.org).  A usage example
@@ -21,17 +21,17 @@ make_vms.com.
 
 Questions about zlib should be sent to , or to Gilles Vollant
  for the Windows DLL version.  The zlib home page is
-http://zlib.net/ .  Before reporting a problem, please check this site to
+https://zlib.net/ .  Before reporting a problem, please check this site to
 verify that you have the latest version of zlib; otherwise get the latest
 version and check whether the problem still exists or not.
 
-PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
+PLEASE read the zlib FAQ https://zlib.net/zlib_faq.html before asking for help.
 
 Mark Nelson  wrote an article about zlib for the Jan.  1997
 issue of Dr.  Dobb's Journal; a copy of the article is available at
-https://marknelson.us/posts/1997/01/01/zlib-engine.html .
+https://zlib.net/nelson/ .
 
-The changes made in version 1.3.1 are documented in the file ChangeLog.
+The changes made in version 1.3.2 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 
@@ -43,9 +43,9 @@ can be found at https://github.com/pmqs/IO-Compress .
 
 A Python interface to zlib written by A.M. Kuchling  is
 available in Python 1.5 and later versions, see
-http://docs.python.org/library/zlib.html .
+https://docs.python.org/3/library/zlib.html .
 
-zlib is built into tcl: http://wiki.tcl.tk/4610 .
+zlib is built into tcl: https://wiki.tcl-lang.org/page/zlib .
 
 An experimental package to read and write files in .zip format, written on top
 of zlib by Gilles Vollant , is available in the
@@ -69,9 +69,7 @@ Notes for some targets:
 - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
   other compilers. Use "make test" to check your compiler.
 
-- gzdopen is not supported on RISCOS or BEOS.
-
-- For PalmOs, see http://palmzlib.sourceforge.net/
+- For PalmOs, see https://palmzlib.sourceforge.net/
 
 
 Acknowledgments:
@@ -83,7 +81,7 @@ Acknowledgments:
 
 Copyright notice:
 
- (C) 1995-2024 Jean-loup Gailly and Mark Adler
+ (C) 1995-2026 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
diff --git a/src/java.base/share/native/libzip/zlib/compress.c b/src/java.base/share/native/libzip/zlib/compress.c
index d7421379673..54346ad2a2f 100644
--- a/src/java.base/share/native/libzip/zlib/compress.c
+++ b/src/java.base/share/native/libzip/zlib/compress.c
@@ -23,7 +23,7 @@
  */
 
 /* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -42,13 +42,19 @@
      compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
    memory, Z_BUF_ERROR if there was not enough room in the output buffer,
    Z_STREAM_ERROR if the level parameter is invalid.
+
+     The _z versions of the functions take size_t length arguments.
 */
-int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
-                      uLong sourceLen, int level) {
+int ZEXPORT compress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
+                        z_size_t sourceLen, int level) {
     z_stream stream;
     int err;
     const uInt max = (uInt)-1;
-    uLong left;
+    z_size_t left;
+
+    if ((sourceLen > 0 && source == NULL) ||
+        destLen == NULL || (*destLen > 0 && dest == NULL))
+        return Z_STREAM_ERROR;
 
     left = *destLen;
     *destLen = 0;
@@ -67,23 +73,36 @@ int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
 
     do {
         if (stream.avail_out == 0) {
-            stream.avail_out = left > (uLong)max ? max : (uInt)left;
+            stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
             left -= stream.avail_out;
         }
         if (stream.avail_in == 0) {
-            stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
+            stream.avail_in = sourceLen > (z_size_t)max ? max :
+                                                          (uInt)sourceLen;
             sourceLen -= stream.avail_in;
         }
         err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
     } while (err == Z_OK);
 
-    *destLen = stream.total_out;
+    *destLen = (z_size_t)(stream.next_out - dest);
     deflateEnd(&stream);
     return err == Z_STREAM_END ? Z_OK : err;
 }
-
+int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
+                      uLong sourceLen, int level) {
+    int ret;
+    z_size_t got = *destLen;
+    ret = compress2_z(dest, &got, source, sourceLen, level);
+    *destLen = (uLong)got;
+    return ret;
+}
 /* ===========================================================================
  */
+int ZEXPORT compress_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
+                       z_size_t sourceLen) {
+    return compress2_z(dest, destLen, source, sourceLen,
+                       Z_DEFAULT_COMPRESSION);
+}
 int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
                      uLong sourceLen) {
     return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
@@ -93,7 +112,12 @@ int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
      If the default memLevel or windowBits for deflateInit() is changed, then
    this function needs to be updated.
  */
-uLong ZEXPORT compressBound(uLong sourceLen) {
-    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
-           (sourceLen >> 25) + 13;
+z_size_t ZEXPORT compressBound_z(z_size_t sourceLen) {
+    z_size_t bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+                     (sourceLen >> 25) + 13;
+    return bound < sourceLen ? (z_size_t)-1 : bound;
+}
+uLong ZEXPORT compressBound(uLong sourceLen) {
+    z_size_t bound = compressBound_z(sourceLen);
+    return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
 }
diff --git a/src/java.base/share/native/libzip/zlib/deflate.c b/src/java.base/share/native/libzip/zlib/deflate.c
index 57fc6802bb8..0ec56ec5691 100644
--- a/src/java.base/share/native/libzip/zlib/deflate.c
+++ b/src/java.base/share/native/libzip/zlib/deflate.c
@@ -23,7 +23,7 @@
  */
 
 /* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
+ * Copyright (C) 1995-2026 Jean-loup Gailly and Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -61,7 +61,7 @@
  *  REFERENCES
  *
  *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- *      Available in http://tools.ietf.org/html/rfc1951
+ *      Available at https://datatracker.ietf.org/doc/html/rfc1951
  *
  *      A description of the Rabin and Karp algorithm is given in the book
  *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
@@ -76,7 +76,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.3.2 Copyright 1995-2026 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -194,8 +194,8 @@ local const config configuration_table[10] = {
 #define CLEAR_HASH(s) \
     do { \
         s->head[s->hash_size - 1] = NIL; \
-        zmemzero((Bytef *)s->head, \
-                 (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
+        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
+        s->slid = 0; \
     } while (0)
 
 /* ===========================================================================
@@ -219,8 +219,8 @@ local void slide_hash(deflate_state *s) {
         m = *--p;
         *p = (Pos)(m >= wsize ? m - wsize : NIL);
     } while (--n);
-    n = wsize;
 #ifndef FASTEST
+    n = wsize;
     p = &s->prev[n];
     do {
         m = *--p;
@@ -230,6 +230,7 @@ local void slide_hash(deflate_state *s) {
          */
     } while (--n);
 #endif
+    s->slid = 1;
 }
 
 /* ===========================================================================
@@ -283,7 +284,14 @@ local void fill_window(deflate_state *s) {
         more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
 
         /* Deal with !@#$% 64K limit: */
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4127)
+#endif
         if (sizeof(int) <= 2) {
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
             if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
                 more = wsize;
 
@@ -455,6 +463,7 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
     if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
     s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
     if (s == Z_NULL) return Z_MEM_ERROR;
+    zmemzero(s, sizeof(deflate_state));
     strm->state = (struct internal_state FAR *)s;
     s->strm = strm;
     s->status = INIT_STATE;     /* to pass state test in deflateReset() */
@@ -736,10 +745,23 @@ int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head) {
 /* ========================================================================= */
 int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits) {
     if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
-    if (pending != Z_NULL)
-        *pending = strm->state->pending;
     if (bits != Z_NULL)
         *bits = strm->state->bi_valid;
+    if (pending != Z_NULL) {
+        *pending = (unsigned)strm->state->pending;
+        if (*pending != strm->state->pending) {
+            *pending = (unsigned)-1;
+            return Z_BUF_ERROR;
+        }
+    }
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateUsed(z_streamp strm, int *bits) {
+    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
+    if (bits != Z_NULL)
+        *bits = strm->state->bi_used;
     return Z_OK;
 }
 
@@ -855,28 +877,34 @@ int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy,
  *
  * Shifts are used to approximate divisions, for speed.
  */
-uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
+z_size_t ZEXPORT deflateBound_z(z_streamp strm, z_size_t sourceLen) {
     deflate_state *s;
-    uLong fixedlen, storelen, wraplen;
+    z_size_t fixedlen, storelen, wraplen, bound;
 
     /* upper bound for fixed blocks with 9-bit literals and length 255
        (memLevel == 2, which is the lowest that may not use stored blocks) --
        ~13% overhead plus a small constant */
     fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) +
                (sourceLen >> 9) + 4;
+    if (fixedlen < sourceLen)
+        fixedlen = (z_size_t)-1;
 
     /* upper bound for stored blocks with length 127 (memLevel == 1) --
        ~4% overhead plus a small constant */
     storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
                (sourceLen >> 11) + 7;
+    if (storelen < sourceLen)
+        storelen = (z_size_t)-1;
 
-    /* if can't get parameters, return larger bound plus a zlib wrapper */
-    if (deflateStateCheck(strm))
-        return (fixedlen > storelen ? fixedlen : storelen) + 6;
+    /* if can't get parameters, return larger bound plus a wrapper */
+    if (deflateStateCheck(strm)) {
+        bound = fixedlen > storelen ? fixedlen : storelen;
+        return bound + 18 < bound ? (z_size_t)-1 : bound + 18;
+    }
 
     /* compute wrapper length */
     s = strm->state;
-    switch (s->wrap) {
+    switch (s->wrap < 0 ? -s->wrap : s->wrap) {
     case 0:                                 /* raw deflate */
         wraplen = 0;
         break;
@@ -906,18 +934,25 @@ uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
         break;
 #endif
     default:                                /* for compiler happiness */
-        wraplen = 6;
+        wraplen = 18;
     }
 
     /* if not default parameters, return one of the conservative bounds */
-    if (s->w_bits != 15 || s->hash_bits != 8 + 7)
-        return (s->w_bits <= s->hash_bits && s->level ? fixedlen : storelen) +
-               wraplen;
+    if (s->w_bits != 15 || s->hash_bits != 8 + 7) {
+        bound = s->w_bits <= s->hash_bits && s->level ? fixedlen :
+                                                        storelen;
+        return bound + wraplen < bound ? (z_size_t)-1 : bound + wraplen;
+    }
 
     /* default settings: return tight bound for that case -- ~0.03% overhead
        plus a small constant */
-    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
-           (sourceLen >> 25) + 13 - 6 + wraplen;
+    bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+            (sourceLen >> 25) + 13 - 6 + wraplen;
+    return bound < sourceLen ? (z_size_t)-1 : bound;
+}
+uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
+    z_size_t bound = deflateBound_z(strm, sourceLen);
+    return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
 }
 
 /* =========================================================================
@@ -941,8 +976,8 @@ local void flush_pending(z_streamp strm) {
     deflate_state *s = strm->state;
 
     _tr_flush_bits(s);
-    len = s->pending;
-    if (len > strm->avail_out) len = strm->avail_out;
+    len = s->pending > strm->avail_out ? strm->avail_out :
+                                         (unsigned)s->pending;
     if (len == 0) return;
 
     zmemcpy(strm->next_out, s->pending_out, len);
@@ -962,8 +997,8 @@ local void flush_pending(z_streamp strm) {
 #define HCRC_UPDATE(beg) \
     do { \
         if (s->gzhead->hcrc && s->pending > (beg)) \
-            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
-                                s->pending - (beg)); \
+            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
+                                  s->pending - (beg)); \
     } while (0)
 
 /* ========================================================================= */
@@ -1097,8 +1132,8 @@ int ZEXPORT deflate(z_streamp strm, int flush) {
                 put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
             }
             if (s->gzhead->hcrc)
-                strm->adler = crc32(strm->adler, s->pending_buf,
-                                    s->pending);
+                strm->adler = crc32_z(strm->adler, s->pending_buf,
+                                      s->pending);
             s->gzindex = 0;
             s->status = EXTRA_STATE;
         }
@@ -1106,9 +1141,9 @@ int ZEXPORT deflate(z_streamp strm, int flush) {
     if (s->status == EXTRA_STATE) {
         if (s->gzhead->extra != Z_NULL) {
             ulg beg = s->pending;   /* start of bytes to update crc */
-            uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
+            ulg left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
             while (s->pending + left > s->pending_buf_size) {
-                uInt copy = s->pending_buf_size - s->pending;
+                ulg copy = s->pending_buf_size - s->pending;
                 zmemcpy(s->pending_buf + s->pending,
                         s->gzhead->extra + s->gzindex, copy);
                 s->pending = s->pending_buf_size;
@@ -1319,12 +1354,13 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
 
     ss = source->state;
 
-    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+    zmemcpy(dest, source, sizeof(z_stream));
 
     ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
     if (ds == Z_NULL) return Z_MEM_ERROR;
+    zmemzero(ds, sizeof(deflate_state));
     dest->state = (struct internal_state FAR *) ds;
-    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
+    zmemcpy(ds, ss, sizeof(deflate_state));
     ds->strm = dest;
 
     ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
@@ -1337,18 +1373,23 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
         deflateEnd (dest);
         return Z_MEM_ERROR;
     }
-    /* following zmemcpy do not work for 16-bit MSDOS */
-    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
-    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
-    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
-    zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS);
+    /* following zmemcpy's do not work for 16-bit MSDOS */
+    zmemcpy(ds->window, ss->window, ss->high_water);
+    zmemcpy(ds->prev, ss->prev,
+            (ss->slid || ss->strstart - ss->insert > ds->w_size ? ds->w_size :
+                ss->strstart - ss->insert) * sizeof(Pos));
+    zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
 
     ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+    zmemcpy(ds->pending_out, ss->pending_out, ss->pending);
 #ifdef LIT_MEM
     ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1));
     ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2);
+    zmemcpy(ds->d_buf, ss->d_buf, ss->sym_next * sizeof(ush));
+    zmemcpy(ds->l_buf, ss->l_buf, ss->sym_next);
 #else
     ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
+    zmemcpy(ds->sym_buf, ss->sym_buf, ss->sym_next);
 #endif
 
     ds->l_desc.dyn_tree = ds->dyn_ltree;
@@ -1371,9 +1412,9 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
  */
 local uInt longest_match(deflate_state *s, IPos cur_match) {
     unsigned chain_length = s->max_chain_length;/* max hash chain length */
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                      /* matched string */
-    register int len;                           /* length of current match */
+    Bytef *scan = s->window + s->strstart;      /* current string */
+    Bytef *match;                               /* matched string */
+    int len;                                    /* length of current match */
     int best_len = (int)s->prev_length;         /* best match length so far */
     int nice_match = s->nice_match;             /* stop if match long enough */
     IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
@@ -1388,13 +1429,13 @@ local uInt longest_match(deflate_state *s, IPos cur_match) {
     /* Compare two bytes at a time. Note: this is not always beneficial.
      * Try with and without -DUNALIGNED_OK to check.
      */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
-    register ush scan_start = *(ushf*)scan;
-    register ush scan_end   = *(ushf*)(scan + best_len - 1);
+    Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+    ush scan_start = *(ushf*)scan;
+    ush scan_end   = *(ushf*)(scan + best_len - 1);
 #else
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-    register Byte scan_end1  = scan[best_len - 1];
-    register Byte scan_end   = scan[best_len];
+    Bytef *strend = s->window + s->strstart + MAX_MATCH;
+    Byte scan_end1  = scan[best_len - 1];
+    Byte scan_end   = scan[best_len];
 #endif
 
     /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
@@ -1518,10 +1559,10 @@ local uInt longest_match(deflate_state *s, IPos cur_match) {
  * Optimized version for FASTEST only
  */
 local uInt longest_match(deflate_state *s, IPos cur_match) {
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                       /* matched string */
-    register int len;                           /* length of current match */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+    Bytef *scan = s->window + s->strstart;      /* current string */
+    Bytef *match;                               /* matched string */
+    int len;                                    /* length of current match */
+    Bytef *strend = s->window + s->strstart + MAX_MATCH;
 
     /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
      * It is easy to get rid of this optimization if necessary.
@@ -1581,7 +1622,7 @@ local uInt longest_match(deflate_state *s, IPos cur_match) {
 local void check_match(deflate_state *s, IPos start, IPos match, int length) {
     /* check that the match is indeed a match */
     Bytef *back = s->window + (int)match, *here = s->window + start;
-    IPos len = length;
+    IPos len = (IPos)length;
     if (match == (IPos)-1) {
         /* match starts one byte before the current window -- just compare the
            subsequent length-1 bytes */
@@ -1653,13 +1694,14 @@ local block_state deflate_stored(deflate_state *s, int flush) {
      * this is 32K. This can be as small as 507 bytes for memLevel == 1. For
      * large input and output buffers, the stored block size will be larger.
      */
-    unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size);
+    unsigned min_block = (unsigned)(MIN(s->pending_buf_size - 5, s->w_size));
 
     /* Copy as many min_block or larger stored blocks directly to next_out as
      * possible. If flushing, copy the remaining available input to next_out as
      * stored blocks, if there is enough space.
      */
-    unsigned len, left, have, last = 0;
+    int last = 0;
+    unsigned len, left, have;
     unsigned used = s->strm->avail_in;
     do {
         /* Set len to the maximum size block that we can copy directly with the
@@ -1667,12 +1709,12 @@ local block_state deflate_stored(deflate_state *s, int flush) {
          * would be copied from what's left in the window.
          */
         len = MAX_STORED;       /* maximum deflate stored block length */
-        have = (s->bi_valid + 42) >> 3;         /* number of header bytes */
+        have = ((unsigned)s->bi_valid + 42) >> 3;   /* bytes in header */
         if (s->strm->avail_out < have)          /* need room for header */
             break;
             /* maximum stored block length that will fit in avail_out: */
         have = s->strm->avail_out - have;
-        left = s->strstart - s->block_start;    /* bytes left in window */
+        left = (unsigned)(s->strstart - s->block_start);    /* window bytes */
         if (len > (ulg)left + s->strm->avail_in)
             len = left + s->strm->avail_in;     /* limit len to the input */
         if (len > have)
@@ -1695,10 +1737,10 @@ local block_state deflate_stored(deflate_state *s, int flush) {
         _tr_stored_block(s, (char *)0, 0L, last);
 
         /* Replace the lengths in the dummy stored block with len. */
-        s->pending_buf[s->pending - 4] = len;
-        s->pending_buf[s->pending - 3] = len >> 8;
-        s->pending_buf[s->pending - 2] = ~len;
-        s->pending_buf[s->pending - 1] = ~len >> 8;
+        s->pending_buf[s->pending - 4] = (Bytef)len;
+        s->pending_buf[s->pending - 3] = (Bytef)(len >> 8);
+        s->pending_buf[s->pending - 2] = (Bytef)~len;
+        s->pending_buf[s->pending - 1] = (Bytef)(~len >> 8);
 
         /* Write the stored block header bytes. */
         flush_pending(s->strm);
@@ -1769,8 +1811,10 @@ local block_state deflate_stored(deflate_state *s, int flush) {
         s->high_water = s->strstart;
 
     /* If the last block was written to next_out, then done. */
-    if (last)
+    if (last) {
+        s->bi_used = 8;
         return finish_done;
+    }
 
     /* If flushing and all input has been consumed, then done. */
     if (flush != Z_NO_FLUSH && flush != Z_FINISH &&
@@ -1778,7 +1822,7 @@ local block_state deflate_stored(deflate_state *s, int flush) {
         return block_done;
 
     /* Fill the window with any remaining input. */
-    have = s->window_size - s->strstart;
+    have = (unsigned)(s->window_size - s->strstart);
     if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) {
         /* Slide the window down. */
         s->block_start -= s->w_size;
@@ -1805,11 +1849,11 @@ local block_state deflate_stored(deflate_state *s, int flush) {
      * have enough input for a worthy block, or if flushing and there is enough
      * room for the remaining input as a stored block in the pending buffer.
      */
-    have = (s->bi_valid + 42) >> 3;         /* number of header bytes */
+    have = ((unsigned)s->bi_valid + 42) >> 3;   /* bytes in header */
         /* maximum stored block length that will fit in pending: */
-    have = MIN(s->pending_buf_size - have, MAX_STORED);
+    have = (unsigned)MIN(s->pending_buf_size - have, MAX_STORED);
     min_block = MIN(have, s->w_size);
-    left = s->strstart - s->block_start;
+    left = (unsigned)(s->strstart - s->block_start);
     if (left >= min_block ||
         ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH &&
          s->strm->avail_in == 0 && left <= have)) {
@@ -1822,6 +1866,8 @@ local block_state deflate_stored(deflate_state *s, int flush) {
     }
 
     /* We've done all we can with the available input and output. */
+    if (last)
+        s->bi_used = 8;
     return last ? finish_started : need_more;
 }
 
@@ -1870,7 +1916,7 @@ local block_state deflate_fast(deflate_state *s, int flush) {
             /* longest_match() sets match_start */
         }
         if (s->match_length >= MIN_MATCH) {
-            check_match(s, s->strstart, s->match_start, s->match_length);
+            check_match(s, s->strstart, s->match_start, (int)s->match_length);
 
             _tr_tally_dist(s, s->strstart - s->match_start,
                            s->match_length - MIN_MATCH, bflush);
@@ -1992,7 +2038,7 @@ local block_state deflate_slow(deflate_state *s, int flush) {
             uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
             /* Do not insert strings in hash table beyond this. */
 
-            check_match(s, s->strstart - 1, s->prev_match, s->prev_length);
+            check_match(s, s->strstart - 1, s->prev_match, (int)s->prev_length);
 
             _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
                            s->prev_length - MIN_MATCH, bflush);
@@ -2100,7 +2146,7 @@ local block_state deflate_rle(deflate_state *s, int flush) {
 
         /* Emit match if have run of MIN_MATCH or longer, else emit literal */
         if (s->match_length >= MIN_MATCH) {
-            check_match(s, s->strstart, s->strstart - 1, s->match_length);
+            check_match(s, s->strstart, s->strstart - 1, (int)s->match_length);
 
             _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
 
diff --git a/src/java.base/share/native/libzip/zlib/deflate.h b/src/java.base/share/native/libzip/zlib/deflate.h
index 830d46b8894..5b6246ee3c4 100644
--- a/src/java.base/share/native/libzip/zlib/deflate.h
+++ b/src/java.base/share/native/libzip/zlib/deflate.h
@@ -23,7 +23,7 @@
  */
 
 /* deflate.h -- internal compression state
- * Copyright (C) 1995-2024 Jean-loup Gailly
+ * Copyright (C) 1995-2026 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -295,6 +295,9 @@ typedef struct internal_state {
     /* Number of valid bits in bi_buf.  All bits above the last valid bit
      * are always zero.
      */
+    int bi_used;
+    /* Last number of used bits when going to a byte boundary.
+     */
 
     ulg high_water;
     /* High water mark offset in window for initialized bytes -- bytes above
@@ -303,6 +306,9 @@ typedef struct internal_state {
      * updated to the new high water mark.
      */
 
+    int slid;
+    /* True if the hash table has been slid since it was cleared. */
+
 } FAR deflate_state;
 
 /* Output a byte on the stream.
diff --git a/src/java.base/share/native/libzip/zlib/gzguts.h b/src/java.base/share/native/libzip/zlib/gzguts.h
index 8cce2c69d24..0be646016ed 100644
--- a/src/java.base/share/native/libzip/zlib/gzguts.h
+++ b/src/java.base/share/native/libzip/zlib/gzguts.h
@@ -23,7 +23,7 @@
  */
 
 /* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004-2024 Mark Adler
+ * Copyright (C) 2004-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -41,6 +41,18 @@
 #  define ZLIB_INTERNAL
 #endif
 
+#if defined(_WIN32)
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  ifndef _CRT_SECURE_NO_WARNINGS
+#    define _CRT_SECURE_NO_WARNINGS
+#  endif
+#  ifndef _CRT_NONSTDC_NO_DEPRECATE
+#    define _CRT_NONSTDC_NO_DEPRECATE
+#  endif
+#endif
+
 #include 
 #include "zlib.h"
 #ifdef STDC
@@ -49,8 +61,8 @@
 #  include 
 #endif
 
-#ifndef _POSIX_SOURCE
-#  define _POSIX_SOURCE
+#ifndef _POSIX_C_SOURCE
+#  define _POSIX_C_SOURCE 200112L
 #endif
 #include 
 
@@ -60,19 +72,13 @@
 
 #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
 #  include 
+#  include 
 #endif
 
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(WIDECHAR)
 #  define WIDECHAR
 #endif
 
-#ifdef WINAPI_FAMILY
-#  define open _open
-#  define read _read
-#  define write _write
-#  define close _close
-#endif
-
 #ifdef NO_DEFLATE       /* for compatibility with old definition */
 #  define NO_GZCOMPRESS
 #endif
@@ -96,33 +102,28 @@
 #endif
 
 #ifndef HAVE_VSNPRINTF
-#  ifdef MSDOS
+#  if !defined(NO_vsnprintf) && \
+      (defined(MSDOS) || defined(__TURBOC__) || defined(__SASC) || \
+       defined(VMS) || defined(__OS400) || defined(__MVS__))
 /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
    but for now we just assume it doesn't. */
 #    define NO_vsnprintf
 #  endif
-#  ifdef __TURBOC__
-#    define NO_vsnprintf
-#  endif
 #  ifdef WIN32
 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
-#      if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
-#         define vsnprintf _vsnprintf
+#    if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+#      ifndef vsnprintf
+#        define vsnprintf _vsnprintf
 #      endif
 #    endif
-#  endif
-#  ifdef __SASC
-#    define NO_vsnprintf
-#  endif
-#  ifdef VMS
-#    define NO_vsnprintf
-#  endif
-#  ifdef __OS400__
-#    define NO_vsnprintf
-#  endif
-#  ifdef __MVS__
-#    define NO_vsnprintf
+#  elif !defined(__STDC_VERSION__) || __STDC_VERSION__-0 < 199901L
+/* Otherwise if C89/90, assume no C99 snprintf() or vsnprintf() */
+#    ifndef NO_snprintf
+#      define NO_snprintf
+#    endif
+#    ifndef NO_vsnprintf
+#      define NO_vsnprintf
+#    endif
 #  endif
 #endif
 
@@ -206,7 +207,9 @@ typedef struct {
     unsigned char *out;     /* output buffer (double-sized when reading) */
     int direct;             /* 0 if processing gzip, 1 if transparent */
         /* just for reading */
+    int junk;               /* -1 = start, 1 = junk candidate, 0 = in gzip */
     int how;                /* 0: get header, 1: copy, 2: decompress */
+    int again;              /* true if EAGAIN or EWOULDBLOCK on last i/o */
     z_off64_t start;        /* where the gzip data started, for rewinding */
     int eof;                /* true if end of input file reached */
     int past;               /* true if read requested past end */
@@ -216,7 +219,6 @@ typedef struct {
     int reset;              /* true if a reset is pending after a Z_FINISH */
         /* seek request */
     z_off64_t skip;         /* amount to skip (already rewound if backwards) */
-    int seek;               /* true if seek request pending */
         /* error information */
     int err;                /* error code */
     char *msg;              /* error message */
diff --git a/src/java.base/share/native/libzip/zlib/gzlib.c b/src/java.base/share/native/libzip/zlib/gzlib.c
index 0f4dfae64a0..9489bcc1f12 100644
--- a/src/java.base/share/native/libzip/zlib/gzlib.c
+++ b/src/java.base/share/native/libzip/zlib/gzlib.c
@@ -23,21 +23,21 @@
  */
 
 /* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004-2024 Mark Adler
+ * Copyright (C) 2004-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
 #include "gzguts.h"
 
-#if defined(_WIN32) && !defined(__BORLANDC__)
+#if defined(__DJGPP__)
+#  define LSEEK llseek
+#elif defined(_WIN32) && !defined(__BORLANDC__) && !defined(UNDER_CE)
 #  define LSEEK _lseeki64
-#else
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#elif defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
 #  define LSEEK lseek64
 #else
 #  define LSEEK lseek
 #endif
-#endif
 
 #if defined UNDER_CE
 
@@ -76,7 +76,7 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error) {
             msgbuf[chars] = 0;
         }
 
-        wcstombs(buf, msgbuf, chars + 1);
+        wcstombs(buf, msgbuf, chars + 1);       /* assumes buf is big enough */
         LocalFree(msgbuf);
     }
     else {
@@ -96,10 +96,12 @@ local void gz_reset(gz_statep state) {
         state->eof = 0;             /* not at end of file */
         state->past = 0;            /* have not read past end yet */
         state->how = LOOK;          /* look for gzip header */
+        state->junk = -1;           /* mark first member */
     }
     else                            /* for writing ... */
         state->reset = 0;           /* no deflateReset pending */
-    state->seek = 0;                /* no seek request pending */
+    state->again = 0;               /* no stalled i/o yet */
+    state->skip = 0;                /* no seek request pending */
     gz_error(state, Z_OK, NULL);    /* clear error */
     state->x.pos = 0;               /* no uncompressed data yet */
     state->strm.avail_in = 0;       /* no input data yet */
@@ -109,16 +111,13 @@ local void gz_reset(gz_statep state) {
 local gzFile gz_open(const void *path, int fd, const char *mode) {
     gz_statep state;
     z_size_t len;
-    int oflag;
-#ifdef O_CLOEXEC
-    int cloexec = 0;
-#endif
+    int oflag = 0;
 #ifdef O_EXCL
     int exclusive = 0;
 #endif
 
     /* check input */
-    if (path == NULL)
+    if (path == NULL || mode == NULL)
         return NULL;
 
     /* allocate gzFile structure to return */
@@ -127,6 +126,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
         return NULL;
     state->size = 0;            /* no buffers allocated yet */
     state->want = GZBUFSIZE;    /* requested buffer size */
+    state->err = Z_OK;          /* no error yet */
     state->msg = NULL;          /* no error message yet */
 
     /* interpret mode */
@@ -157,7 +157,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
                 break;
 #ifdef O_CLOEXEC
             case 'e':
-                cloexec = 1;
+                oflag |= O_CLOEXEC;
                 break;
 #endif
 #ifdef O_EXCL
@@ -177,6 +177,14 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
             case 'F':
                 state->strategy = Z_FIXED;
                 break;
+            case 'G':
+                state->direct = -1;
+                break;
+#ifdef O_NONBLOCK
+            case 'N':
+                oflag |= O_NONBLOCK;
+                break;
+#endif
             case 'T':
                 state->direct = 1;
                 break;
@@ -192,22 +200,30 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
         return NULL;
     }
 
-    /* can't force transparent read */
+    /* direct is 0, 1 if "T", or -1 if "G" (last "G" or "T" wins) */
     if (state->mode == GZ_READ) {
-        if (state->direct) {
+        if (state->direct == 1) {
+            /* can't force a transparent read */
             free(state);
             return NULL;
         }
-        state->direct = 1;      /* for empty file */
+        if (state->direct == 0)
+            /* default when reading is auto-detect of gzip vs. transparent --
+               start with a transparent assumption in case of an empty file */
+            state->direct = 1;
     }
+    else if (state->direct == -1) {
+        /* "G" has no meaning when writing -- disallow it */
+        free(state);
+        return NULL;
+    }
+    /* if reading, direct == 1 for auto-detect, -1 for gzip only; if writing or
+       appending, direct == 0 for gzip, 1 for transparent (copy in to out) */
 
     /* save the path name for error messages */
 #ifdef WIDECHAR
-    if (fd == -2) {
+    if (fd == -2)
         len = wcstombs(NULL, path, 0);
-        if (len == (z_size_t)-1)
-            len = 0;
-    }
     else
 #endif
         len = strlen((const char *)path);
@@ -217,29 +233,29 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
         return NULL;
     }
 #ifdef WIDECHAR
-    if (fd == -2)
+    if (fd == -2) {
         if (len)
             wcstombs(state->path, path, len + 1);
         else
             *(state->path) = 0;
+    }
     else
 #endif
+    {
 #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
         (void)snprintf(state->path, len + 1, "%s", (const char *)path);
 #else
         strcpy(state->path, path);
 #endif
+    }
 
     /* compute the flags for open() */
-    oflag =
+    oflag |=
 #ifdef O_LARGEFILE
         O_LARGEFILE |
 #endif
 #ifdef O_BINARY
         O_BINARY |
-#endif
-#ifdef O_CLOEXEC
-        (cloexec ? O_CLOEXEC : 0) |
 #endif
         (state->mode == GZ_READ ?
          O_RDONLY :
@@ -252,11 +268,23 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
            O_APPEND)));
 
     /* open the file with the appropriate flags (or just use fd) */
-    state->fd = fd > -1 ? fd : (
+    if (fd == -1)
+        state->fd = open((const char *)path, oflag, 0666);
 #ifdef WIDECHAR
-        fd == -2 ? _wopen(path, oflag, 0666) :
+    else if (fd == -2)
+        state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
 #endif
-        open((const char *)path, oflag, 0666));
+    else {
+#ifdef O_NONBLOCK
+        if (oflag & O_NONBLOCK)
+            fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
+#endif
+#ifdef O_CLOEXEC
+        if (oflag & O_CLOEXEC)
+            fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
+#endif
+        state->fd = fd;
+    }
     if (state->fd == -1) {
         free(state->path);
         free(state);
@@ -383,9 +411,10 @@ z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
     /* normalize offset to a SEEK_CUR specification */
     if (whence == SEEK_SET)
         offset -= state->x.pos;
-    else if (state->seek)
-        offset += state->skip;
-    state->seek = 0;
+    else {
+        offset += state->past ? 0 : state->skip;
+        state->skip = 0;
+    }
 
     /* if within raw area while reading, just go there */
     if (state->mode == GZ_READ && state->how == COPY &&
@@ -396,7 +425,7 @@ z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
         state->x.have = 0;
         state->eof = 0;
         state->past = 0;
-        state->seek = 0;
+        state->skip = 0;
         gz_error(state, Z_OK, NULL);
         state->strm.avail_in = 0;
         state->x.pos += offset;
@@ -425,10 +454,7 @@ z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
     }
 
     /* request skip (if not zero) */
-    if (offset) {
-        state->seek = 1;
-        state->skip = offset;
-    }
+    state->skip = offset;
     return state->x.pos + offset;
 }
 
@@ -452,7 +478,7 @@ z_off64_t ZEXPORT gztell64(gzFile file) {
         return -1;
 
     /* return position */
-    return state->x.pos + (state->seek ? state->skip : 0);
+    return state->x.pos + (state->past ? 0 : state->skip);
 }
 
 /* -- see zlib.h -- */
@@ -559,7 +585,7 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
     }
 
     /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
-    if (err != Z_OK && err != Z_BUF_ERROR)
+    if (err != Z_OK && err != Z_BUF_ERROR && !state->again)
         state->x.have = 0;
 
     /* set error code, and if no message, then done */
@@ -596,6 +622,7 @@ unsigned ZLIB_INTERNAL gz_intmax(void) {
     return INT_MAX;
 #else
     unsigned p = 1, q;
+
     do {
         q = p;
         p <<= 1;
diff --git a/src/java.base/share/native/libzip/zlib/gzread.c b/src/java.base/share/native/libzip/zlib/gzread.c
index 7b9c9df5fa1..89144d2e56f 100644
--- a/src/java.base/share/native/libzip/zlib/gzread.c
+++ b/src/java.base/share/native/libzip/zlib/gzread.c
@@ -23,7 +23,7 @@
  */
 
 /* gzread.c -- zlib functions for reading gzip files
- * Copyright (C) 2004-2017 Mark Adler
+ * Copyright (C) 2004-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -32,23 +32,36 @@
 /* Use read() to load a buffer -- return -1 on error, otherwise 0.  Read from
    state->fd, and update state->eof, state->err, and state->msg as appropriate.
    This function needs to loop on read(), since read() is not guaranteed to
-   read the number of bytes requested, depending on the type of descriptor. */
+   read the number of bytes requested, depending on the type of descriptor. It
+   also needs to loop to manage the fact that read() returns an int. If the
+   descriptor is non-blocking and read() returns with no data in order to avoid
+   blocking, then gz_load() will return 0 if some data has been read, or -1 if
+   no data has been read. Either way, state->again is set true to indicate a
+   non-blocking event. If errno is non-zero on return, then there was an error
+   signaled from read().  *have is set to the number of bytes read. */
 local int gz_load(gz_statep state, unsigned char *buf, unsigned len,
                   unsigned *have) {
     int ret;
     unsigned get, max = ((unsigned)-1 >> 2) + 1;
 
+    state->again = 0;
+    errno = 0;
     *have = 0;
     do {
         get = len - *have;
         if (get > max)
             get = max;
-        ret = read(state->fd, buf + *have, get);
+        ret = (int)read(state->fd, buf + *have, get);
         if (ret <= 0)
             break;
         *have += (unsigned)ret;
     } while (*have < len);
     if (ret < 0) {
+        if (errno == EAGAIN || errno == EWOULDBLOCK) {
+            state->again = 1;
+            if (*have != 0)
+                return 0;
+        }
         gz_error(state, Z_ERRNO, zstrerror());
         return -1;
     }
@@ -74,10 +87,14 @@ local int gz_avail(gz_statep state) {
         if (strm->avail_in) {       /* copy what's there to the start */
             unsigned char *p = state->in;
             unsigned const char *q = strm->next_in;
-            unsigned n = strm->avail_in;
-            do {
-                *p++ = *q++;
-            } while (--n);
+
+            if (q != p) {
+                unsigned n = strm->avail_in;
+
+                do {
+                    *p++ = *q++;
+                } while (--n);
+            }
         }
         if (gz_load(state, state->in + strm->avail_in,
                     state->size - strm->avail_in, &got) == -1)
@@ -128,39 +145,44 @@ local int gz_look(gz_statep state) {
         }
     }
 
-    /* get at least the magic bytes in the input buffer */
-    if (strm->avail_in < 2) {
-        if (gz_avail(state) == -1)
-            return -1;
-        if (strm->avail_in == 0)
-            return 0;
-    }
-
-    /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
-       a logical dilemma here when considering the case of a partially written
-       gzip file, to wit, if a single 31 byte is written, then we cannot tell
-       whether this is a single-byte file, or just a partially written gzip
-       file -- for here we assume that if a gzip file is being written, then
-       the header will be written in a single operation, so that reading a
-       single byte is sufficient indication that it is not a gzip file) */
-    if (strm->avail_in > 1 &&
-            strm->next_in[0] == 31 && strm->next_in[1] == 139) {
+    /* if transparent reading is disabled, which would only be at the start, or
+       if we're looking for a gzip member after the first one, which is not at
+       the start, then proceed directly to look for a gzip member next */
+    if (state->direct == -1 || state->junk == 0) {
         inflateReset(strm);
         state->how = GZIP;
+        state->junk = state->junk != -1;
         state->direct = 0;
         return 0;
     }
 
-    /* no gzip header -- if we were decoding gzip before, then this is trailing
-       garbage.  Ignore the trailing garbage and finish. */
-    if (state->direct == 0) {
-        strm->avail_in = 0;
-        state->eof = 1;
-        state->x.have = 0;
+    /* otherwise we're at the start with auto-detect -- we check to see if the
+       first four bytes could be gzip header in order to decide whether or not
+       this will be a transparent read */
+
+    /* load any header bytes into the input buffer -- if the input is empty,
+       then it's not an error as this is a transparent read of zero bytes */
+    if (gz_avail(state) == -1)
+        return -1;
+    if (strm->avail_in == 0 || (state->again && strm->avail_in < 4))
+        /* if non-blocking input stalled before getting four bytes, then
+           return and wait until a later call has accumulated enough */
+        return 0;
+
+    /* see if this is (likely) gzip input -- if the first four bytes are
+       consistent with a gzip header, then go look for the first gzip member,
+       otherwise proceed to copy the input transparently */
+    if (strm->avail_in > 3 &&
+            strm->next_in[0] == 31 && strm->next_in[1] == 139 &&
+            strm->next_in[2] == 8 && strm->next_in[3] < 32) {
+        inflateReset(strm);
+        state->how = GZIP;
+        state->junk = 1;
+        state->direct = 0;
         return 0;
     }
 
-    /* doing raw i/o, copy any leftover input to output -- this assumes that
+    /* doing raw i/o: copy any leftover input to output -- this assumes that
        the output buffer is larger than the input buffer, which also assures
        space for gzungetc() */
     state->x.next = state->out;
@@ -168,15 +190,17 @@ local int gz_look(gz_statep state) {
     state->x.have = strm->avail_in;
     strm->avail_in = 0;
     state->how = COPY;
-    state->direct = 1;
     return 0;
 }
 
 /* Decompress from input to the provided next_out and avail_out in the state.
    On return, state->x.have and state->x.next point to the just decompressed
-   data.  If the gzip stream completes, state->how is reset to LOOK to look for
-   the next gzip stream or raw data, once state->x.have is depleted.  Returns 0
-   on success, -1 on failure. */
+   data. If the gzip stream completes, state->how is reset to LOOK to look for
+   the next gzip stream or raw data, once state->x.have is depleted. Returns 0
+   on success, -1 on failure. If EOF is reached when looking for more input to
+   complete the gzip member, then an unexpected end of file error is raised.
+   If there is no more input, but state->again is true, then EOF has not been
+   reached, and no error is raised. */
 local int gz_decomp(gz_statep state) {
     int ret = Z_OK;
     unsigned had;
@@ -186,28 +210,41 @@ local int gz_decomp(gz_statep state) {
     had = strm->avail_out;
     do {
         /* get more input for inflate() */
-        if (strm->avail_in == 0 && gz_avail(state) == -1)
-            return -1;
+        if (strm->avail_in == 0 && gz_avail(state) == -1) {
+            ret = state->err;
+            break;
+        }
         if (strm->avail_in == 0) {
-            gz_error(state, Z_BUF_ERROR, "unexpected end of file");
+            if (!state->again)
+                gz_error(state, Z_BUF_ERROR, "unexpected end of file");
             break;
         }
 
         /* decompress and handle errors */
         ret = inflate(strm, Z_NO_FLUSH);
+        if (strm->avail_out < had)
+            /* any decompressed data marks this as a real gzip stream */
+            state->junk = 0;
         if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
             gz_error(state, Z_STREAM_ERROR,
                      "internal error: inflate stream corrupt");
-            return -1;
+            break;
         }
         if (ret == Z_MEM_ERROR) {
             gz_error(state, Z_MEM_ERROR, "out of memory");
-            return -1;
+            break;
         }
         if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
+            if (state->junk == 1) {             /* trailing garbage is ok */
+                strm->avail_in = 0;
+                state->eof = 1;
+                state->how = LOOK;
+                ret = Z_OK;
+                break;
+            }
             gz_error(state, Z_DATA_ERROR,
                      strm->msg == NULL ? "compressed data error" : strm->msg);
-            return -1;
+            break;
         }
     } while (strm->avail_out && ret != Z_STREAM_END);
 
@@ -216,11 +253,14 @@ local int gz_decomp(gz_statep state) {
     state->x.next = strm->next_out - state->x.have;
 
     /* if the gzip stream completed successfully, look for another */
-    if (ret == Z_STREAM_END)
+    if (ret == Z_STREAM_END) {
+        state->junk = 0;
         state->how = LOOK;
+        return 0;
+    }
 
-    /* good decompression */
-    return 0;
+    /* return decompression status */
+    return ret != Z_OK ? -1 : 0;
 }
 
 /* Fetch data and put it in the output buffer.  Assumes state->x.have is 0.
@@ -251,25 +291,31 @@ local int gz_fetch(gz_statep state) {
             strm->next_out = state->out;
             if (gz_decomp(state) == -1)
                 return -1;
+            break;
+        default:
+            gz_error(state, Z_STREAM_ERROR, "state corrupt");
+            return -1;
         }
     } while (state->x.have == 0 && (!state->eof || strm->avail_in));
     return 0;
 }
 
-/* Skip len uncompressed bytes of output.  Return -1 on error, 0 on success. */
-local int gz_skip(gz_statep state, z_off64_t len) {
+/* Skip state->skip (> 0) uncompressed bytes of output.  Return -1 on error, 0
+   on success. */
+local int gz_skip(gz_statep state) {
     unsigned n;
 
     /* skip over len bytes or reach end-of-file, whichever comes first */
-    while (len)
+    do {
         /* skip over whatever is in output buffer */
         if (state->x.have) {
-            n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
-                (unsigned)len : state->x.have;
+            n = GT_OFF(state->x.have) ||
+                (z_off64_t)state->x.have > state->skip ?
+                (unsigned)state->skip : state->x.have;
             state->x.have -= n;
             state->x.next += n;
             state->x.pos += n;
-            len -= n;
+            state->skip -= n;
         }
 
         /* output buffer empty -- return if we're at the end of the input */
@@ -282,30 +328,32 @@ local int gz_skip(gz_statep state, z_off64_t len) {
             if (gz_fetch(state) == -1)
                 return -1;
         }
+    } while (state->skip);
     return 0;
 }
 
 /* Read len bytes into buf from file, or less than len up to the end of the
-   input.  Return the number of bytes read.  If zero is returned, either the
-   end of file was reached, or there was an error.  state->err must be
-   consulted in that case to determine which. */
+   input. Return the number of bytes read. If zero is returned, either the end
+   of file was reached, or there was an error. state->err must be consulted in
+   that case to determine which. If there was an error, but some uncompressed
+   bytes were read before the error, then that count is returned. The error is
+   still recorded, and so is deferred until the next call. */
 local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
     z_size_t got;
     unsigned n;
+    int err;
 
     /* if len is zero, avoid unnecessary operations */
     if (len == 0)
         return 0;
 
     /* process a skip request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_skip(state, state->skip) == -1)
-            return 0;
-    }
+    if (state->skip && gz_skip(state) == -1)
+        return 0;
 
     /* get len bytes to buf, or less than len if at the end */
     got = 0;
+    err = 0;
     do {
         /* set n to the maximum amount of len that fits in an unsigned int */
         n = (unsigned)-1;
@@ -319,37 +367,36 @@ local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
             memcpy(buf, state->x.next, n);
             state->x.next += n;
             state->x.have -= n;
+            if (state->err != Z_OK)
+                /* caught deferred error from gz_fetch() */
+                err = -1;
         }
 
         /* output buffer empty -- return if we're at the end of the input */
-        else if (state->eof && state->strm.avail_in == 0) {
-            state->past = 1;        /* tried to read past end */
+        else if (state->eof && state->strm.avail_in == 0)
             break;
-        }
 
         /* need output data -- for small len or new stream load up our output
-           buffer */
+           buffer, so that gzgetc() can be fast */
         else if (state->how == LOOK || n < (state->size << 1)) {
             /* get more output, looking for header if required */
-            if (gz_fetch(state) == -1)
-                return 0;
+            if (gz_fetch(state) == -1 && state->x.have == 0)
+                /* if state->x.have != 0, error will be caught after copy */
+                err = -1;
             continue;       /* no progress yet -- go back to copy above */
             /* the copy above assures that we will leave with space in the
                output buffer, allowing at least one gzungetc() to succeed */
         }
 
         /* large len -- read directly into user buffer */
-        else if (state->how == COPY) {      /* read directly */
-            if (gz_load(state, (unsigned char *)buf, n, &n) == -1)
-                return 0;
-        }
+        else if (state->how == COPY)        /* read directly */
+            err = gz_load(state, (unsigned char *)buf, n, &n);
 
         /* large len -- decompress directly into user buffer */
         else {  /* state->how == GZIP */
             state->strm.avail_out = n;
             state->strm.next_out = (unsigned char *)buf;
-            if (gz_decomp(state) == -1)
-                return 0;
+            err = gz_decomp(state);
             n = state->x.have;
             state->x.have = 0;
         }
@@ -359,7 +406,11 @@ local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
         buf = (char *)buf + n;
         got += n;
         state->x.pos += n;
-    } while (len);
+    } while (len && !err);
+
+    /* note read past eof */
+    if (len && state->eof)
+        state->past = 1;
 
     /* return number of bytes read into user buffer */
     return got;
@@ -369,16 +420,18 @@ local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
 int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
     gz_statep state;
 
-    /* get internal structure */
+    /* get internal structure and check that it's for reading */
     if (file == NULL)
         return -1;
     state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-            (state->err != Z_OK && state->err != Z_BUF_ERROR))
+    if (state->mode != GZ_READ)
         return -1;
 
+    /* check that there was no (serious) error */
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
+        return -1;
+    gz_error(state, Z_OK, NULL);
+
     /* since an int is returned, make sure len fits in one, otherwise return
        with an error (this avoids a flaw in the interface) */
     if ((int)len < 0) {
@@ -390,28 +443,40 @@ int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
     len = (unsigned)gz_read(state, buf, len);
 
     /* check for an error */
-    if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR)
-        return -1;
+    if (len == 0) {
+        if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+            return -1;
+        if (state->again) {
+            /* non-blocking input stalled after some input was read, but no
+               uncompressed bytes were produced -- let the application know
+               this isn't EOF */
+            gz_error(state, Z_ERRNO, zstrerror());
+            return -1;
+        }
+    }
 
-    /* return the number of bytes read (this is assured to fit in an int) */
+    /* return the number of bytes read */
     return (int)len;
 }
 
 /* -- see zlib.h -- */
-z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file) {
+z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
+                         gzFile file) {
     z_size_t len;
     gz_statep state;
 
-    /* get internal structure */
+    /* get internal structure and check that it's for reading */
     if (file == NULL)
         return 0;
     state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-            (state->err != Z_OK && state->err != Z_BUF_ERROR))
+    if (state->mode != GZ_READ)
         return 0;
 
+    /* check that there was no (serious) error */
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
+        return 0;
+    gz_error(state, Z_OK, NULL);
+
     /* compute bytes to read -- error on overflow */
     len = nitems * size;
     if (size && len / size != nitems) {
@@ -433,16 +498,18 @@ int ZEXPORT gzgetc(gzFile file) {
     unsigned char buf[1];
     gz_statep state;
 
-    /* get internal structure */
+    /* get internal structure and check that it's for reading */
     if (file == NULL)
         return -1;
     state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-        (state->err != Z_OK && state->err != Z_BUF_ERROR))
+    if (state->mode != GZ_READ)
         return -1;
 
+    /* check that there was no (serious) error */
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
+        return -1;
+    gz_error(state, Z_OK, NULL);
+
     /* try output buffer (no need to check for skip request) */
     if (state->x.have) {
         state->x.have--;
@@ -462,26 +529,25 @@ int ZEXPORT gzgetc_(gzFile file) {
 int ZEXPORT gzungetc(int c, gzFile file) {
     gz_statep state;
 
-    /* get internal structure */
+    /* get internal structure and check that it's for reading */
     if (file == NULL)
         return -1;
     state = (gz_statep)file;
-
-    /* in case this was just opened, set up the input buffer */
-    if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
-        (void)gz_look(state);
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-        (state->err != Z_OK && state->err != Z_BUF_ERROR))
+    if (state->mode != GZ_READ)
         return -1;
 
+    /* in case this was just opened, set up the input buffer */
+    if (state->how == LOOK && state->x.have == 0)
+        (void)gz_look(state);
+
+    /* check that there was no (serious) error */
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
+        return -1;
+    gz_error(state, Z_OK, NULL);
+
     /* process a skip request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_skip(state, state->skip) == -1)
-            return -1;
-    }
+    if (state->skip && gz_skip(state) == -1)
+        return -1;
 
     /* can't push EOF */
     if (c < 0)
@@ -507,6 +573,7 @@ int ZEXPORT gzungetc(int c, gzFile file) {
     if (state->x.next == state->out) {
         unsigned char *src = state->out + state->x.have;
         unsigned char *dest = state->out + (state->size << 1);
+
         while (src > state->out)
             *--dest = *--src;
         state->x.next = dest;
@@ -526,32 +593,31 @@ char * ZEXPORT gzgets(gzFile file, char *buf, int len) {
     unsigned char *eol;
     gz_statep state;
 
-    /* check parameters and get internal structure */
+    /* check parameters, get internal structure, and check that it's for
+       reading */
     if (file == NULL || buf == NULL || len < 1)
         return NULL;
     state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-        (state->err != Z_OK && state->err != Z_BUF_ERROR))
+    if (state->mode != GZ_READ)
         return NULL;
 
-    /* process a skip request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_skip(state, state->skip) == -1)
-            return NULL;
-    }
+    /* check that there was no (serious) error */
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
+        return NULL;
+    gz_error(state, Z_OK, NULL);
 
-    /* copy output bytes up to new line or len - 1, whichever comes first --
-       append a terminating zero to the string (we don't check for a zero in
-       the contents, let the user worry about that) */
+    /* process a skip request */
+    if (state->skip && gz_skip(state) == -1)
+        return NULL;
+
+    /* copy output up to a new line, len-1 bytes, or there is no more output,
+       whichever comes first */
     str = buf;
     left = (unsigned)len - 1;
     if (left) do {
         /* assure that something is in the output buffer */
         if (state->x.have == 0 && gz_fetch(state) == -1)
-            return NULL;                /* error */
+            break;                      /* error */
         if (state->x.have == 0) {       /* end of file */
             state->past = 1;            /* read past end */
             break;                      /* return what we have */
@@ -572,7 +638,9 @@ char * ZEXPORT gzgets(gzFile file, char *buf, int len) {
         buf += n;
     } while (left && eol == NULL);
 
-    /* return terminated string, or if nothing, end of file */
+    /* append a terminating zero to the string (we don't check for a zero in
+       the contents, let the user worry about that) -- return the terminated
+       string, or if nothing was read, NULL */
     if (buf == str)
         return NULL;
     buf[0] = 0;
@@ -594,7 +662,7 @@ int ZEXPORT gzdirect(gzFile file) {
         (void)gz_look(state);
 
     /* return 1 if transparent, 0 if processing a gzip stream */
-    return state->direct;
+    return state->direct == 1;
 }
 
 /* -- see zlib.h -- */
@@ -602,12 +670,10 @@ int ZEXPORT gzclose_r(gzFile file) {
     int ret, err;
     gz_statep state;
 
-    /* get internal structure */
+    /* get internal structure and check that it's for reading */
     if (file == NULL)
         return Z_STREAM_ERROR;
     state = (gz_statep)file;
-
-    /* check that we're reading */
     if (state->mode != GZ_READ)
         return Z_STREAM_ERROR;
 
diff --git a/src/java.base/share/native/libzip/zlib/gzwrite.c b/src/java.base/share/native/libzip/zlib/gzwrite.c
index 008b03e7021..b11c318d543 100644
--- a/src/java.base/share/native/libzip/zlib/gzwrite.c
+++ b/src/java.base/share/native/libzip/zlib/gzwrite.c
@@ -23,7 +23,7 @@
  */
 
 /* gzwrite.c -- zlib functions for writing gzip files
- * Copyright (C) 2004-2019 Mark Adler
+ * Copyright (C) 2004-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -98,9 +98,13 @@ local int gz_comp(gz_statep state, int flush) {
     /* write directly if requested */
     if (state->direct) {
         while (strm->avail_in) {
+            errno = 0;
+            state->again = 0;
             put = strm->avail_in > max ? max : strm->avail_in;
-            writ = write(state->fd, strm->next_in, put);
+            writ = (int)write(state->fd, strm->next_in, put);
             if (writ < 0) {
+                if (errno == EAGAIN || errno == EWOULDBLOCK)
+                    state->again = 1;
                 gz_error(state, Z_ERRNO, zstrerror());
                 return -1;
             }
@@ -112,8 +116,9 @@ local int gz_comp(gz_statep state, int flush) {
 
     /* check for a pending reset */
     if (state->reset) {
-        /* don't start a new gzip member unless there is data to write */
-        if (strm->avail_in == 0)
+        /* don't start a new gzip member unless there is data to write and
+           we're not flushing */
+        if (strm->avail_in == 0 && flush == Z_NO_FLUSH)
             return 0;
         deflateReset(strm);
         state->reset = 0;
@@ -127,10 +132,14 @@ local int gz_comp(gz_statep state, int flush) {
         if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
             (flush != Z_FINISH || ret == Z_STREAM_END))) {
             while (strm->next_out > state->x.next) {
+                errno = 0;
+                state->again = 0;
                 put = strm->next_out - state->x.next > (int)max ? max :
                       (unsigned)(strm->next_out - state->x.next);
-                writ = write(state->fd, state->x.next, put);
+                writ = (int)write(state->fd, state->x.next, put);
                 if (writ < 0) {
+                    if (errno == EAGAIN || errno == EWOULDBLOCK)
+                        state->again = 1;
                     gz_error(state, Z_ERRNO, zstrerror());
                     return -1;
                 }
@@ -162,10 +171,12 @@ local int gz_comp(gz_statep state, int flush) {
     return 0;
 }
 
-/* Compress len zeros to output.  Return -1 on a write error or memory
-   allocation failure by gz_comp(), or 0 on success. */
-local int gz_zero(gz_statep state, z_off64_t len) {
-    int first;
+/* Compress state->skip (> 0) zeros to output.  Return -1 on a write error or
+   memory allocation failure by gz_comp(), or 0 on success. state->skip is
+   updated with the number of successfully written zeros, in case there is a
+   stall on a non-blocking write destination. */
+local int gz_zero(gz_statep state) {
+    int first, ret;
     unsigned n;
     z_streamp strm = &(state->strm);
 
@@ -173,29 +184,34 @@ local int gz_zero(gz_statep state, z_off64_t len) {
     if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
         return -1;
 
-    /* compress len zeros (len guaranteed > 0) */
+    /* compress state->skip zeros */
     first = 1;
-    while (len) {
-        n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
-            (unsigned)len : state->size;
+    do {
+        n = GT_OFF(state->size) || (z_off64_t)state->size > state->skip ?
+            (unsigned)state->skip : state->size;
         if (first) {
             memset(state->in, 0, n);
             first = 0;
         }
         strm->avail_in = n;
         strm->next_in = state->in;
+        ret = gz_comp(state, Z_NO_FLUSH);
+        n -= strm->avail_in;
         state->x.pos += n;
-        if (gz_comp(state, Z_NO_FLUSH) == -1)
+        state->skip -= n;
+        if (ret == -1)
             return -1;
-        len -= n;
-    }
+    } while (state->skip);
     return 0;
 }
 
 /* Write len bytes from buf to file.  Return the number of bytes written.  If
-   the returned value is less than len, then there was an error. */
+   the returned value is less than len, then there was an error. If the error
+   was a non-blocking stall, then the number of bytes consumed is returned.
+   For any other error, 0 is returned. */
 local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
     z_size_t put = len;
+    int ret;
 
     /* if len is zero, avoid unnecessary operations */
     if (len == 0)
@@ -206,16 +222,13 @@ local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
         return 0;
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return 0;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        return 0;
 
     /* for small len, copy to input buffer, otherwise compress directly */
     if (len < state->size) {
         /* copy to input buffer, compress when full */
-        do {
+        for (;;) {
             unsigned have, copy;
 
             if (state->strm.avail_in == 0)
@@ -230,9 +243,11 @@ local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
             state->x.pos += copy;
             buf = (const char *)buf + copy;
             len -= copy;
-            if (len && gz_comp(state, Z_NO_FLUSH) == -1)
-                return 0;
-        } while (len);
+            if (len == 0)
+                break;
+            if (gz_comp(state, Z_NO_FLUSH) == -1)
+                return state->again ? put - len : 0;
+        }
     }
     else {
         /* consume whatever's left in the input buffer */
@@ -243,13 +258,16 @@ local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
         state->strm.next_in = (z_const Bytef *)buf;
         do {
             unsigned n = (unsigned)-1;
+
             if (n > len)
                 n = (unsigned)len;
             state->strm.avail_in = n;
+            ret = gz_comp(state, Z_NO_FLUSH);
+            n -= state->strm.avail_in;
             state->x.pos += n;
-            if (gz_comp(state, Z_NO_FLUSH) == -1)
-                return 0;
             len -= n;
+            if (ret == -1)
+                return state->again ? put - len : 0;
         } while (len);
     }
 
@@ -266,9 +284,10 @@ int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) {
         return 0;
     state = (gz_statep)file;
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return 0;
+    gz_error(state, Z_OK, NULL);
 
     /* since an int is returned, make sure len fits in one, otherwise return
        with an error (this avoids a flaw in the interface) */
@@ -292,9 +311,10 @@ z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems,
         return 0;
     state = (gz_statep)file;
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return 0;
+    gz_error(state, Z_OK, NULL);
 
     /* compute bytes to read -- error on overflow */
     len = nitems * size;
@@ -320,16 +340,14 @@ int ZEXPORT gzputc(gzFile file, int c) {
     state = (gz_statep)file;
     strm = &(state->strm);
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return -1;
+    gz_error(state, Z_OK, NULL);
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return -1;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        return -1;
 
     /* try writing to input buffer for speed (state->size == 0 if buffer not
        initialized) */
@@ -362,9 +380,10 @@ int ZEXPORT gzputs(gzFile file, const char *s) {
         return -1;
     state = (gz_statep)file;
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return -1;
+    gz_error(state, Z_OK, NULL);
 
     /* write string */
     len = strlen(s);
@@ -373,16 +392,47 @@ int ZEXPORT gzputs(gzFile file, const char *s) {
         return -1;
     }
     put = gz_write(state, s, len);
-    return put < len ? -1 : (int)len;
+    return len && put == 0 ? -1 : (int)put;
 }
 
+#if (((!defined(STDC) && !defined(Z_HAVE_STDARG_H)) || !defined(NO_vsnprintf)) && \
+     (defined(STDC) || defined(Z_HAVE_STDARG_H) || !defined(NO_snprintf))) || \
+    defined(ZLIB_INSECURE)
+/* If the second half of the input buffer is occupied, write out the contents.
+   If there is any input remaining due to a non-blocking stall on write, move
+   it to the start of the buffer. Return true if this did not open up the
+   second half of the buffer.  state->err should be checked after this to
+   handle a gz_comp() error. */
+local int gz_vacate(gz_statep state) {
+    z_streamp strm;
+
+    strm = &(state->strm);
+    if (strm->next_in + strm->avail_in <= state->in + state->size)
+        return 0;
+    (void)gz_comp(state, Z_NO_FLUSH);
+    if (strm->avail_in == 0) {
+        strm->next_in = state->in;
+        return 0;
+    }
+    memmove(state->in, strm->next_in, strm->avail_in);
+    strm->next_in = state->in;
+    return strm->avail_in > state->size;
+}
+#endif
+
 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
 #include 
 
 /* -- see zlib.h -- */
 int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) {
-    int len;
-    unsigned left;
+#if defined(NO_vsnprintf) && !defined(ZLIB_INSECURE)
+#warning "vsnprintf() not available -- gzprintf() stub returns Z_STREAM_ERROR"
+#warning "you can recompile with ZLIB_INSECURE defined to use vsprintf()"
+    /* prevent use of insecure vsprintf(), unless purposefully requested */
+    (void)file, (void)format, (void)va;
+    return Z_STREAM_ERROR;
+#else
+    int len, ret;
     char *next;
     gz_statep state;
     z_streamp strm;
@@ -393,24 +443,34 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) {
     state = (gz_statep)file;
     strm = &(state->strm);
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return Z_STREAM_ERROR;
+    gz_error(state, Z_OK, NULL);
 
     /* make sure we have some buffer space */
     if (state->size == 0 && gz_init(state) == -1)
         return state->err;
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return state->err;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        return state->err;
 
     /* do the printf() into the input buffer, put length in len -- the input
-       buffer is double-sized just for this function, so there is guaranteed to
-       be state->size bytes available after the current contents */
+       buffer is double-sized just for this function, so there should be
+       state->size bytes available after the current contents */
+    ret = gz_vacate(state);
+    if (state->err) {
+        if (ret && state->again) {
+            /* There was a non-blocking stall on write, resulting in the part
+               of the second half of the output buffer being occupied.  Return
+               a Z_BUF_ERROR to let the application know that this gzprintf()
+               needs to be retried. */
+            gz_error(state, Z_BUF_ERROR, "stalled write on gzprintf");
+        }
+        if (!state->again)
+            return state->err;
+    }
     if (strm->avail_in == 0)
         strm->next_in = state->in;
     next = (char *)(state->in + (strm->next_in - state->in) + strm->avail_in);
@@ -436,19 +496,16 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) {
     if (len == 0 || (unsigned)len >= state->size || next[state->size - 1] != 0)
         return 0;
 
-    /* update buffer and position, compress first half if past that */
+    /* update buffer and position */
     strm->avail_in += (unsigned)len;
     state->x.pos += len;
-    if (strm->avail_in >= state->size) {
-        left = strm->avail_in - state->size;
-        strm->avail_in = state->size;
-        if (gz_comp(state, Z_NO_FLUSH) == -1)
-            return state->err;
-        memmove(state->in, state->in + state->size, left);
-        strm->next_in = state->in;
-        strm->avail_in = left;
-    }
+
+    /* write out buffer if more than half is occupied */
+    ret = gz_vacate(state);
+    if (state->err && !state->again)
+        return state->err;
     return len;
+#endif
 }
 
 int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) {
@@ -468,6 +525,17 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3,
                        int a4, int a5, int a6, int a7, int a8, int a9, int a10,
                        int a11, int a12, int a13, int a14, int a15, int a16,
                        int a17, int a18, int a19, int a20) {
+#if defined(NO_snprintf) && !defined(ZLIB_INSECURE)
+#warning "snprintf() not available -- gzprintf() stub returns Z_STREAM_ERROR"
+#warning "you can recompile with ZLIB_INSECURE defined to use sprintf()"
+    /* prevent use of insecure sprintf(), unless purposefully requested */
+    (void)file, (void)format, (void)a1, (void)a2, (void)a3, (void)a4, (void)a5,
+    (void)a6, (void)a7, (void)a8, (void)a9, (void)a10, (void)a11, (void)a12,
+    (void)a13, (void)a14, (void)a15, (void)a16, (void)a17, (void)a18,
+    (void)a19, (void)a20;
+    return Z_STREAM_ERROR;
+#else
+    int ret;
     unsigned len, left;
     char *next;
     gz_statep state;
@@ -483,24 +551,34 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3,
     if (sizeof(int) != sizeof(void *))
         return Z_STREAM_ERROR;
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return Z_STREAM_ERROR;
+    gz_error(state, Z_OK, NULL);
 
     /* make sure we have some buffer space */
     if (state->size == 0 && gz_init(state) == -1)
-        return state->error;
+        return state->err;
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return state->error;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        return state->err;
 
     /* do the printf() into the input buffer, put length in len -- the input
        buffer is double-sized just for this function, so there is guaranteed to
        be state->size bytes available after the current contents */
+    ret = gz_vacate(state);
+    if (state->err) {
+        if (ret && state->again) {
+            /* There was a non-blocking stall on write, resulting in the part
+               of the second half of the output buffer being occupied.  Return
+               a Z_BUF_ERROR to let the application know that this gzprintf()
+               needs to be retried. */
+            gz_error(state, Z_BUF_ERROR, "stalled write on gzprintf");
+        }
+        if (!state->again)
+            return state->err;
+    }
     if (strm->avail_in == 0)
         strm->next_in = state->in;
     next = (char *)(strm->next_in + strm->avail_in);
@@ -534,16 +612,13 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3,
     /* update buffer and position, compress first half if past that */
     strm->avail_in += len;
     state->x.pos += len;
-    if (strm->avail_in >= state->size) {
-        left = strm->avail_in - state->size;
-        strm->avail_in = state->size;
-        if (gz_comp(state, Z_NO_FLUSH) == -1)
-            return state->err;
-        memmove(state->in, state->in + state->size, left);
-        strm->next_in = state->in;
-        strm->avail_in = left;
-    }
+
+    /* write out buffer if more than half is occupied */
+    ret = gz_vacate(state);
+    if (state->err && !state->again)
+        return state->err;
     return (int)len;
+#endif
 }
 
 #endif
@@ -557,20 +632,18 @@ int ZEXPORT gzflush(gzFile file, int flush) {
         return Z_STREAM_ERROR;
     state = (gz_statep)file;
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
+    /* check that we're writing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
         return Z_STREAM_ERROR;
+    gz_error(state, Z_OK, NULL);
 
     /* check flush parameter */
     if (flush < 0 || flush > Z_FINISH)
         return Z_STREAM_ERROR;
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return state->err;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        return state->err;
 
     /* compress remaining data with requested flush */
     (void)gz_comp(state, flush);
@@ -588,20 +661,19 @@ int ZEXPORT gzsetparams(gzFile file, int level, int strategy) {
     state = (gz_statep)file;
     strm = &(state->strm);
 
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct)
+    /* check that we're compressing and that there's no (serious) error */
+    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again) ||
+            state->direct)
         return Z_STREAM_ERROR;
+    gz_error(state, Z_OK, NULL);
 
     /* if no change is requested, then do nothing */
     if (level == state->level && strategy == state->strategy)
         return Z_OK;
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return state->err;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        return state->err;
 
     /* change compression parameters for subsequent input */
     if (state->size) {
@@ -630,11 +702,8 @@ int ZEXPORT gzclose_w(gzFile file) {
         return Z_STREAM_ERROR;
 
     /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            ret = state->err;
-    }
+    if (state->skip && gz_zero(state) == -1)
+        ret = state->err;
 
     /* flush, free memory, and close file */
     if (gz_comp(state, Z_FINISH) == -1)
diff --git a/src/java.base/share/native/libzip/zlib/infback.c b/src/java.base/share/native/libzip/zlib/infback.c
index f680e2cdbdc..0becbb9eb4f 100644
--- a/src/java.base/share/native/libzip/zlib/infback.c
+++ b/src/java.base/share/native/libzip/zlib/infback.c
@@ -23,7 +23,7 @@
  */
 
 /* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2022 Mark Adler
+ * Copyright (C) 1995-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -70,7 +70,7 @@ int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
 #ifdef Z_SOLO
         return Z_STREAM_ERROR;
 #else
-    strm->zfree = zcfree;
+        strm->zfree = zcfree;
 #endif
     state = (struct inflate_state FAR *)ZALLOC(strm, 1,
                                                sizeof(struct inflate_state));
@@ -87,57 +87,6 @@ int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
     return Z_OK;
 }
 
-/*
-   Return state with length and distance decoding tables and index sizes set to
-   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
-   If BUILDFIXED is defined, then instead this routine builds the tables the
-   first time it's called, and returns those tables the first time and
-   thereafter.  This reduces the size of the code by about 2K bytes, in
-   exchange for a little execution time.  However, BUILDFIXED should not be
-   used for threaded applications, since the rewriting of the tables and virgin
-   may not be thread-safe.
- */
-local void fixedtables(struct inflate_state FAR *state) {
-#ifdef BUILDFIXED
-    static int virgin = 1;
-    static code *lenfix, *distfix;
-    static code fixed[544];
-
-    /* build fixed huffman tables if first call (may not be thread safe) */
-    if (virgin) {
-        unsigned sym, bits;
-        static code *next;
-
-        /* literal/length table */
-        sym = 0;
-        while (sym < 144) state->lens[sym++] = 8;
-        while (sym < 256) state->lens[sym++] = 9;
-        while (sym < 280) state->lens[sym++] = 7;
-        while (sym < 288) state->lens[sym++] = 8;
-        next = fixed;
-        lenfix = next;
-        bits = 9;
-        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
-        /* distance table */
-        sym = 0;
-        while (sym < 32) state->lens[sym++] = 5;
-        distfix = next;
-        bits = 5;
-        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
-        /* do this just once */
-        virgin = 0;
-    }
-#else /* !BUILDFIXED */
-#   include "inffixed.h"
-#endif /* BUILDFIXED */
-    state->lencode = lenfix;
-    state->lenbits = 9;
-    state->distcode = distfix;
-    state->distbits = 5;
-}
-
 /* Macros for inflateBack(): */
 
 /* Load returned state from inflate_fast() */
@@ -317,7 +266,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
                 state->mode = STORED;
                 break;
             case 1:                             /* fixed block */
-                fixedtables(state);
+                inflate_fixed(state);
                 Tracev((stderr, "inflate:     fixed codes block%s\n",
                         state->last ? " (last)" : ""));
                 state->mode = LEN;              /* decode codes */
@@ -327,8 +276,8 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
                         state->last ? " (last)" : ""));
                 state->mode = TABLE;
                 break;
-            case 3:
-                strm->msg = (char *)"invalid block type";
+            default:
+                strm->msg = (z_const char *)"invalid block type";
                 state->mode = BAD;
             }
             DROPBITS(2);
@@ -339,7 +288,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             BYTEBITS();                         /* go to byte boundary */
             NEEDBITS(32);
             if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
-                strm->msg = (char *)"invalid stored block lengths";
+                strm->msg = (z_const char *)"invalid stored block lengths";
                 state->mode = BAD;
                 break;
             }
@@ -377,7 +326,8 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             DROPBITS(4);
 #ifndef PKZIP_BUG_WORKAROUND
             if (state->nlen > 286 || state->ndist > 30) {
-                strm->msg = (char *)"too many length or distance symbols";
+                strm->msg = (z_const char *)
+                    "too many length or distance symbols";
                 state->mode = BAD;
                 break;
             }
@@ -399,7 +349,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             ret = inflate_table(CODES, state->lens, 19, &(state->next),
                                 &(state->lenbits), state->work);
             if (ret) {
-                strm->msg = (char *)"invalid code lengths set";
+                strm->msg = (z_const char *)"invalid code lengths set";
                 state->mode = BAD;
                 break;
             }
@@ -422,7 +372,8 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
                         NEEDBITS(here.bits + 2);
                         DROPBITS(here.bits);
                         if (state->have == 0) {
-                            strm->msg = (char *)"invalid bit length repeat";
+                            strm->msg = (z_const char *)
+                                "invalid bit length repeat";
                             state->mode = BAD;
                             break;
                         }
@@ -445,7 +396,8 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
                         DROPBITS(7);
                     }
                     if (state->have + copy > state->nlen + state->ndist) {
-                        strm->msg = (char *)"invalid bit length repeat";
+                        strm->msg = (z_const char *)
+                            "invalid bit length repeat";
                         state->mode = BAD;
                         break;
                     }
@@ -459,7 +411,8 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
 
             /* check for end-of-block code (better have one) */
             if (state->lens[256] == 0) {
-                strm->msg = (char *)"invalid code -- missing end-of-block";
+                strm->msg = (z_const char *)
+                    "invalid code -- missing end-of-block";
                 state->mode = BAD;
                 break;
             }
@@ -473,7 +426,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
                                 &(state->lenbits), state->work);
             if (ret) {
-                strm->msg = (char *)"invalid literal/lengths set";
+                strm->msg = (z_const char *)"invalid literal/lengths set";
                 state->mode = BAD;
                 break;
             }
@@ -482,7 +435,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
                             &(state->next), &(state->distbits), state->work);
             if (ret) {
-                strm->msg = (char *)"invalid distances set";
+                strm->msg = (z_const char *)"invalid distances set";
                 state->mode = BAD;
                 break;
             }
@@ -541,7 +494,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
 
             /* invalid code */
             if (here.op & 64) {
-                strm->msg = (char *)"invalid literal/length code";
+                strm->msg = (z_const char *)"invalid literal/length code";
                 state->mode = BAD;
                 break;
             }
@@ -573,7 +526,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             }
             DROPBITS(here.bits);
             if (here.op & 64) {
-                strm->msg = (char *)"invalid distance code";
+                strm->msg = (z_const char *)"invalid distance code";
                 state->mode = BAD;
                 break;
             }
@@ -588,7 +541,7 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
             }
             if (state->offset > state->wsize - (state->whave < state->wsize ?
                                                 left : 0)) {
-                strm->msg = (char *)"invalid distance too far back";
+                strm->msg = (z_const char *)"invalid distance too far back";
                 state->mode = BAD;
                 break;
             }
diff --git a/src/java.base/share/native/libzip/zlib/inffast.c b/src/java.base/share/native/libzip/zlib/inffast.c
index e86dd78d801..1ce89512ec4 100644
--- a/src/java.base/share/native/libzip/zlib/inffast.c
+++ b/src/java.base/share/native/libzip/zlib/inffast.c
@@ -23,7 +23,7 @@
  */
 
 /* inffast.c -- fast decoding
- * Copyright (C) 1995-2017 Mark Adler
+ * Copyright (C) 1995-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -179,7 +179,8 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
                 dist += (unsigned)hold & ((1U << op) - 1);
 #ifdef INFLATE_STRICT
                 if (dist > dmax) {
-                    strm->msg = (char *)"invalid distance too far back";
+                    strm->msg = (z_const char *)
+                        "invalid distance too far back";
                     state->mode = BAD;
                     break;
                 }
@@ -192,8 +193,8 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
                     op = dist - op;             /* distance back in window */
                     if (op > whave) {
                         if (state->sane) {
-                            strm->msg =
-                                (char *)"invalid distance too far back";
+                            strm->msg = (z_const char *)
+                                "invalid distance too far back";
                             state->mode = BAD;
                             break;
                         }
@@ -289,7 +290,7 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
                 goto dodist;
             }
             else {
-                strm->msg = (char *)"invalid distance code";
+                strm->msg = (z_const char *)"invalid distance code";
                 state->mode = BAD;
                 break;
             }
@@ -304,7 +305,7 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
             break;
         }
         else {
-            strm->msg = (char *)"invalid literal/length code";
+            strm->msg = (z_const char *)"invalid literal/length code";
             state->mode = BAD;
             break;
         }
diff --git a/src/java.base/share/native/libzip/zlib/inffixed.h b/src/java.base/share/native/libzip/zlib/inffixed.h
index f0a4ef1c4e8..d234b018c87 100644
--- a/src/java.base/share/native/libzip/zlib/inffixed.h
+++ b/src/java.base/share/native/libzip/zlib/inffixed.h
@@ -22,97 +22,97 @@
  * questions.
  */
 
-    /* inffixed.h -- table for decoding fixed codes
-     * Generated automatically by makefixed().
-     */
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by makefixed().
+ */
 
-    /* WARNING: this file should *not* be used by applications.
-       It is part of the implementation of this library and is
-       subject to change. Applications should only use zlib.h.
-     */
+/* WARNING: this file should *not* be used by applications.
+   It is part of the implementation of this library and is
+   subject to change. Applications should only use zlib.h.
+ */
 
-    static const code lenfix[512] = {
-        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
-        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
-        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
-        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
-        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
-        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
-        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
-        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
-        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
-        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
-        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
-        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
-        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
-        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
-        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
-        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
-        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
-        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
-        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
-        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
-        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
-        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
-        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
-        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
-        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
-        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
-        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
-        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
-        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
-        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
-        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
-        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
-        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
-        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
-        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
-        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
-        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
-        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
-        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
-        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
-        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
-        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
-        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
-        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
-        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
-        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
-        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
-        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
-        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
-        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
-        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
-        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
-        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
-        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
-        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
-        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
-        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
-        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
-        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
-        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
-        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
-        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
-        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
-        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
-        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
-        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
-        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
-        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
-        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
-        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
-        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
-        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
-        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
-        {0,9,255}
-    };
+static const code lenfix[512] = {
+    {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
+    {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
+    {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
+    {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
+    {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
+    {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
+    {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
+    {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
+    {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
+    {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
+    {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
+    {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
+    {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
+    {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
+    {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
+    {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
+    {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
+    {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+    {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
+    {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
+    {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
+    {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
+    {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
+    {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
+    {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
+    {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
+    {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
+    {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
+    {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
+    {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
+    {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
+    {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
+    {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
+    {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
+    {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
+    {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
+    {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
+    {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
+    {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
+    {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
+    {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
+    {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
+    {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
+    {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
+    {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
+    {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
+    {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
+    {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+    {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
+    {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
+    {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
+    {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
+    {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
+    {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
+    {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
+    {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
+    {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
+    {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
+    {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
+    {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
+    {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
+    {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
+    {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
+    {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
+    {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
+    {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+    {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
+    {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
+    {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
+    {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
+    {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
+    {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
+    {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
+    {0,9,255}
+};
 
-    static const code distfix[32] = {
-        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
-        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
-        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
-        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
-        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
-        {22,5,193},{64,5,0}
-    };
+static const code distfix[32] = {
+    {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
+    {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
+    {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
+    {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
+    {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
+    {22,5,193},{64,5,0}
+};
diff --git a/src/java.base/share/native/libzip/zlib/inflate.c b/src/java.base/share/native/libzip/zlib/inflate.c
index 3370cfe9565..c548f98f6de 100644
--- a/src/java.base/share/native/libzip/zlib/inflate.c
+++ b/src/java.base/share/native/libzip/zlib/inflate.c
@@ -23,7 +23,7 @@
  */
 
 /* inflate.c -- zlib decompression
- * Copyright (C) 1995-2022 Mark Adler
+ * Copyright (C) 1995-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -109,12 +109,6 @@
 #include "inflate.h"
 #include "inffast.h"
 
-#ifdef MAKEFIXED
-#  ifndef BUILDFIXED
-#    define BUILDFIXED
-#  endif
-#endif
-
 local int inflateStateCheck(z_streamp strm) {
     struct inflate_state FAR *state;
     if (strm == Z_NULL ||
@@ -134,6 +128,7 @@ int ZEXPORT inflateResetKeep(z_streamp strm) {
     state = (struct inflate_state FAR *)strm->state;
     strm->total_in = strm->total_out = state->total = 0;
     strm->msg = Z_NULL;
+    strm->data_type = 0;
     if (state->wrap)        /* to support ill-conceived Java test suite */
         strm->adler = state->wrap & 1;
     state->mode = HEAD;
@@ -226,6 +221,7 @@ int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
     state = (struct inflate_state FAR *)
             ZALLOC(strm, 1, sizeof(struct inflate_state));
     if (state == Z_NULL) return Z_MEM_ERROR;
+    zmemzero(state, sizeof(struct inflate_state));
     Tracev((stderr, "inflate: allocated\n"));
     strm->state = (struct internal_state FAR *)state;
     state->strm = strm;
@@ -258,123 +254,11 @@ int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) {
     }
     if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
     value &= (1L << bits) - 1;
-    state->hold += (unsigned)value << state->bits;
+    state->hold += (unsigned long)value << state->bits;
     state->bits += (uInt)bits;
     return Z_OK;
 }
 
-/*
-   Return state with length and distance decoding tables and index sizes set to
-   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
-   If BUILDFIXED is defined, then instead this routine builds the tables the
-   first time it's called, and returns those tables the first time and
-   thereafter.  This reduces the size of the code by about 2K bytes, in
-   exchange for a little execution time.  However, BUILDFIXED should not be
-   used for threaded applications, since the rewriting of the tables and virgin
-   may not be thread-safe.
- */
-local void fixedtables(struct inflate_state FAR *state) {
-#ifdef BUILDFIXED
-    static int virgin = 1;
-    static code *lenfix, *distfix;
-    static code fixed[544];
-
-    /* build fixed huffman tables if first call (may not be thread safe) */
-    if (virgin) {
-        unsigned sym, bits;
-        static code *next;
-
-        /* literal/length table */
-        sym = 0;
-        while (sym < 144) state->lens[sym++] = 8;
-        while (sym < 256) state->lens[sym++] = 9;
-        while (sym < 280) state->lens[sym++] = 7;
-        while (sym < 288) state->lens[sym++] = 8;
-        next = fixed;
-        lenfix = next;
-        bits = 9;
-        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
-        /* distance table */
-        sym = 0;
-        while (sym < 32) state->lens[sym++] = 5;
-        distfix = next;
-        bits = 5;
-        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
-        /* do this just once */
-        virgin = 0;
-    }
-#else /* !BUILDFIXED */
-#   include "inffixed.h"
-#endif /* BUILDFIXED */
-    state->lencode = lenfix;
-    state->lenbits = 9;
-    state->distcode = distfix;
-    state->distbits = 5;
-}
-
-#ifdef MAKEFIXED
-#include 
-
-/*
-   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also
-   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes
-   those tables to stdout, which would be piped to inffixed.h.  A small program
-   can simply call makefixed to do this:
-
-    void makefixed(void);
-
-    int main(void)
-    {
-        makefixed();
-        return 0;
-    }
-
-   Then that can be linked with zlib built with MAKEFIXED defined and run:
-
-    a.out > inffixed.h
- */
-void makefixed(void)
-{
-    unsigned low, size;
-    struct inflate_state state;
-
-    fixedtables(&state);
-    puts("    /* inffixed.h -- table for decoding fixed codes");
-    puts("     * Generated automatically by makefixed().");
-    puts("     */");
-    puts("");
-    puts("    /* WARNING: this file should *not* be used by applications.");
-    puts("       It is part of the implementation of this library and is");
-    puts("       subject to change. Applications should only use zlib.h.");
-    puts("     */");
-    puts("");
-    size = 1U << 9;
-    printf("    static const code lenfix[%u] = {", size);
-    low = 0;
-    for (;;) {
-        if ((low % 7) == 0) printf("\n        ");
-        printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
-               state.lencode[low].bits, state.lencode[low].val);
-        if (++low == size) break;
-        putchar(',');
-    }
-    puts("\n    };");
-    size = 1U << 5;
-    printf("\n    static const code distfix[%u] = {", size);
-    low = 0;
-    for (;;) {
-        if ((low % 6) == 0) printf("\n        ");
-        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
-               state.distcode[low].val);
-        if (++low == size) break;
-        putchar(',');
-    }
-    puts("\n    };");
-}
-#endif /* MAKEFIXED */
-
 /*
    Update the window with the last wsize (normally 32K) bytes written before
    returning.  If window does not exist yet, create it.  This is only called
@@ -666,12 +550,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             if (
 #endif
                 ((BITS(8) << 8) + (hold >> 8)) % 31) {
-                strm->msg = (char *)"incorrect header check";
+                strm->msg = (z_const char *)"incorrect header check";
                 state->mode = BAD;
                 break;
             }
             if (BITS(4) != Z_DEFLATED) {
-                strm->msg = (char *)"unknown compression method";
+                strm->msg = (z_const char *)"unknown compression method";
                 state->mode = BAD;
                 break;
             }
@@ -680,7 +564,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             if (state->wbits == 0)
                 state->wbits = len;
             if (len > 15 || len > state->wbits) {
-                strm->msg = (char *)"invalid window size";
+                strm->msg = (z_const char *)"invalid window size";
                 state->mode = BAD;
                 break;
             }
@@ -696,12 +580,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             NEEDBITS(16);
             state->flags = (int)(hold);
             if ((state->flags & 0xff) != Z_DEFLATED) {
-                strm->msg = (char *)"unknown compression method";
+                strm->msg = (z_const char *)"unknown compression method";
                 state->mode = BAD;
                 break;
             }
             if (state->flags & 0xe000) {
-                strm->msg = (char *)"unknown header flags set";
+                strm->msg = (z_const char *)"unknown header flags set";
                 state->mode = BAD;
                 break;
             }
@@ -817,7 +701,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             if (state->flags & 0x0200) {
                 NEEDBITS(16);
                 if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
-                    strm->msg = (char *)"header crc mismatch";
+                    strm->msg = (z_const char *)"header crc mismatch";
                     state->mode = BAD;
                     break;
                 }
@@ -864,7 +748,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                 state->mode = STORED;
                 break;
             case 1:                             /* fixed block */
-                fixedtables(state);
+                inflate_fixed(state);
                 Tracev((stderr, "inflate:     fixed codes block%s\n",
                         state->last ? " (last)" : ""));
                 state->mode = LEN_;             /* decode codes */
@@ -878,8 +762,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                         state->last ? " (last)" : ""));
                 state->mode = TABLE;
                 break;
-            case 3:
-                strm->msg = (char *)"invalid block type";
+            default:
+                strm->msg = (z_const char *)"invalid block type";
                 state->mode = BAD;
             }
             DROPBITS(2);
@@ -888,7 +772,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             BYTEBITS();                         /* go to byte boundary */
             NEEDBITS(32);
             if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
-                strm->msg = (char *)"invalid stored block lengths";
+                strm->msg = (z_const char *)"invalid stored block lengths";
                 state->mode = BAD;
                 break;
             }
@@ -929,7 +813,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             DROPBITS(4);
 #ifndef PKZIP_BUG_WORKAROUND
             if (state->nlen > 286 || state->ndist > 30) {
-                strm->msg = (char *)"too many length or distance symbols";
+                strm->msg = (z_const char *)
+                    "too many length or distance symbols";
                 state->mode = BAD;
                 break;
             }
@@ -947,12 +832,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             while (state->have < 19)
                 state->lens[order[state->have++]] = 0;
             state->next = state->codes;
-            state->lencode = (const code FAR *)(state->next);
+            state->lencode = state->distcode = (const code FAR *)(state->next);
             state->lenbits = 7;
             ret = inflate_table(CODES, state->lens, 19, &(state->next),
                                 &(state->lenbits), state->work);
             if (ret) {
-                strm->msg = (char *)"invalid code lengths set";
+                strm->msg = (z_const char *)"invalid code lengths set";
                 state->mode = BAD;
                 break;
             }
@@ -976,7 +861,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                         NEEDBITS(here.bits + 2);
                         DROPBITS(here.bits);
                         if (state->have == 0) {
-                            strm->msg = (char *)"invalid bit length repeat";
+                            strm->msg = (z_const char *)
+                                "invalid bit length repeat";
                             state->mode = BAD;
                             break;
                         }
@@ -999,7 +885,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                         DROPBITS(7);
                     }
                     if (state->have + copy > state->nlen + state->ndist) {
-                        strm->msg = (char *)"invalid bit length repeat";
+                        strm->msg = (z_const char *)
+                            "invalid bit length repeat";
                         state->mode = BAD;
                         break;
                     }
@@ -1013,7 +900,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
 
             /* check for end-of-block code (better have one) */
             if (state->lens[256] == 0) {
-                strm->msg = (char *)"invalid code -- missing end-of-block";
+                strm->msg = (z_const char *)
+                    "invalid code -- missing end-of-block";
                 state->mode = BAD;
                 break;
             }
@@ -1027,7 +915,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
                                 &(state->lenbits), state->work);
             if (ret) {
-                strm->msg = (char *)"invalid literal/lengths set";
+                strm->msg = (z_const char *)"invalid literal/lengths set";
                 state->mode = BAD;
                 break;
             }
@@ -1036,7 +924,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
                             &(state->next), &(state->distbits), state->work);
             if (ret) {
-                strm->msg = (char *)"invalid distances set";
+                strm->msg = (z_const char *)"invalid distances set";
                 state->mode = BAD;
                 break;
             }
@@ -1090,7 +978,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                 break;
             }
             if (here.op & 64) {
-                strm->msg = (char *)"invalid literal/length code";
+                strm->msg = (z_const char *)"invalid literal/length code";
                 state->mode = BAD;
                 break;
             }
@@ -1128,7 +1016,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             DROPBITS(here.bits);
             state->back += here.bits;
             if (here.op & 64) {
-                strm->msg = (char *)"invalid distance code";
+                strm->msg = (z_const char *)"invalid distance code";
                 state->mode = BAD;
                 break;
             }
@@ -1145,7 +1033,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             }
 #ifdef INFLATE_STRICT
             if (state->offset > state->dmax) {
-                strm->msg = (char *)"invalid distance too far back";
+                strm->msg = (z_const char *)"invalid distance too far back";
                 state->mode = BAD;
                 break;
             }
@@ -1160,7 +1048,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                 copy = state->offset - copy;
                 if (copy > state->whave) {
                     if (state->sane) {
-                        strm->msg = (char *)"invalid distance too far back";
+                        strm->msg = (z_const char *)
+                            "invalid distance too far back";
                         state->mode = BAD;
                         break;
                     }
@@ -1219,7 +1108,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
                      state->flags ? hold :
 #endif
                      ZSWAP32(hold)) != state->check) {
-                    strm->msg = (char *)"incorrect data check";
+                    strm->msg = (z_const char *)"incorrect data check";
                     state->mode = BAD;
                     break;
                 }
@@ -1233,7 +1122,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
             if (state->wrap && state->flags) {
                 NEEDBITS(32);
                 if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
-                    strm->msg = (char *)"incorrect length check";
+                    strm->msg = (z_const char *)"incorrect length check";
                     state->mode = BAD;
                     break;
                 }
@@ -1464,7 +1353,6 @@ int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
     struct inflate_state FAR *state;
     struct inflate_state FAR *copy;
     unsigned char FAR *window;
-    unsigned wsize;
 
     /* check input */
     if (inflateStateCheck(source) || dest == Z_NULL)
@@ -1475,6 +1363,7 @@ int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
     copy = (struct inflate_state FAR *)
            ZALLOC(source, 1, sizeof(struct inflate_state));
     if (copy == Z_NULL) return Z_MEM_ERROR;
+    zmemzero(copy, sizeof(struct inflate_state));
     window = Z_NULL;
     if (state->window != Z_NULL) {
         window = (unsigned char FAR *)
@@ -1486,8 +1375,8 @@ int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
     }
 
     /* copy state */
-    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
-    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+    zmemcpy(dest, source, sizeof(z_stream));
+    zmemcpy(copy, state, sizeof(struct inflate_state));
     copy->strm = dest;
     if (state->lencode >= state->codes &&
         state->lencode <= state->codes + ENOUGH - 1) {
@@ -1495,10 +1384,8 @@ int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
         copy->distcode = copy->codes + (state->distcode - state->codes);
     }
     copy->next = copy->codes + (state->next - state->codes);
-    if (window != Z_NULL) {
-        wsize = 1U << state->wbits;
-        zmemcpy(window, state->window, wsize);
-    }
+    if (window != Z_NULL)
+        zmemcpy(window, state->window, state->whave);
     copy->window = window;
     dest->state = (struct internal_state FAR *)copy;
     return Z_OK;
diff --git a/src/java.base/share/native/libzip/zlib/inflate.h b/src/java.base/share/native/libzip/zlib/inflate.h
index 2cc56dd7fd4..7828fb5db38 100644
--- a/src/java.base/share/native/libzip/zlib/inflate.h
+++ b/src/java.base/share/native/libzip/zlib/inflate.h
@@ -124,7 +124,7 @@ struct inflate_state {
     unsigned char FAR *window;  /* allocated sliding window, if needed */
         /* bit accumulator */
     unsigned long hold;         /* input bit accumulator */
-    unsigned bits;              /* number of bits in "in" */
+    unsigned bits;              /* number of bits in hold */
         /* for string and stored block copying */
     unsigned length;            /* literal or length of data to copy */
     unsigned offset;            /* distance back to copy string from */
diff --git a/src/java.base/share/native/libzip/zlib/inftrees.c b/src/java.base/share/native/libzip/zlib/inftrees.c
index c4913bc4359..5f5d6b4baef 100644
--- a/src/java.base/share/native/libzip/zlib/inftrees.c
+++ b/src/java.base/share/native/libzip/zlib/inftrees.c
@@ -23,17 +23,31 @@
  */
 
 /* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2024 Mark Adler
+ * Copyright (C) 1995-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
+#ifdef MAKEFIXED
+#  ifndef BUILDFIXED
+#    define BUILDFIXED
+#  endif
+#endif
+#ifdef BUILDFIXED
+#  define Z_ONCE
+#endif
+
 #include "zutil.h"
 #include "inftrees.h"
+#include "inflate.h"
+
+#ifndef NULL
+#  define NULL 0
+#endif
 
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.3.1 Copyright 1995-2024 Mark Adler ";
+   " inflate 1.3.2 Copyright 1995-2026 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -71,9 +85,9 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
     unsigned mask;              /* mask for low root bits */
     code here;                  /* table entry for duplication */
     code FAR *next;             /* next available space in table */
-    const unsigned short FAR *base;     /* base value table to use */
-    const unsigned short FAR *extra;    /* extra bits table to use */
-    unsigned match;             /* use base and extra for symbol >= match */
+    const unsigned short FAR *base = NULL;  /* base value table to use */
+    const unsigned short FAR *extra = NULL; /* extra bits table to use */
+    unsigned match = 0;         /* use base and extra for symbol >= match */
     unsigned short count[MAXBITS+1];    /* number of codes of each length */
     unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
     static const unsigned short lbase[31] = { /* Length codes 257..285 base */
@@ -81,7 +95,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 75};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -199,7 +213,6 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
     /* set up for code type */
     switch (type) {
     case CODES:
-        base = extra = work;    /* dummy value--not used */
         match = 20;
         break;
     case LENS:
@@ -207,10 +220,9 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
         extra = lext;
         match = 257;
         break;
-    default:    /* DISTS */
+    case DISTS:
         base = dbase;
         extra = dext;
-        match = 0;
     }
 
     /* initialize state for loop */
@@ -321,3 +333,116 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
     *bits = root;
     return 0;
 }
+
+#ifdef BUILDFIXED
+/*
+  If this is compiled with BUILDFIXED defined, and if inflate will be used in
+  multiple threads, and if atomics are not available, then inflate() must be
+  called with a fixed block (e.g. 0x03 0x00) to initialize the tables and must
+  return before any other threads are allowed to call inflate.
+ */
+
+static code *lenfix, *distfix;
+static code fixed[544];
+
+/* State for z_once(). */
+local z_once_t built = Z_ONCE_INIT;
+
+local void buildtables(void) {
+    unsigned sym, bits;
+    static code *next;
+    unsigned short lens[288], work[288];
+
+    /* literal/length table */
+    sym = 0;
+    while (sym < 144) lens[sym++] = 8;
+    while (sym < 256) lens[sym++] = 9;
+    while (sym < 280) lens[sym++] = 7;
+    while (sym < 288) lens[sym++] = 8;
+    next = fixed;
+    lenfix = next;
+    bits = 9;
+    inflate_table(LENS, lens, 288, &(next), &(bits), work);
+
+    /* distance table */
+    sym = 0;
+    while (sym < 32) lens[sym++] = 5;
+    distfix = next;
+    bits = 5;
+    inflate_table(DISTS, lens, 32, &(next), &(bits), work);
+}
+#else /* !BUILDFIXED */
+#  include "inffixed.h"
+#endif /* BUILDFIXED */
+
+/*
+   Return state with length and distance decoding tables and index sizes set to
+   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
+   If BUILDFIXED is defined, then instead this routine builds the tables the
+   first time it's called, and returns those tables the first time and
+   thereafter.  This reduces the size of the code by about 2K bytes, in
+   exchange for a little execution time.  However, BUILDFIXED should not be
+   used for threaded applications if atomics are not available, as it will
+   not be thread-safe.
+ */
+void inflate_fixed(struct inflate_state FAR *state) {
+#ifdef BUILDFIXED
+    z_once(&built, buildtables);
+#endif /* BUILDFIXED */
+    state->lencode = lenfix;
+    state->lenbits = 9;
+    state->distcode = distfix;
+    state->distbits = 5;
+}
+
+#ifdef MAKEFIXED
+#include 
+
+/*
+   Write out the inffixed.h that will be #include'd above.  Defining MAKEFIXED
+   also defines BUILDFIXED, so the tables are built on the fly.  main() writes
+   those tables to stdout, which would directed to inffixed.h. Compile this
+   along with zutil.c:
+
+       cc -DMAKEFIXED -o fix inftrees.c zutil.c
+       ./fix > inffixed.h
+ */
+int main(void) {
+    unsigned low, size;
+    struct inflate_state state;
+
+    inflate_fixed(&state);
+    puts("/* inffixed.h -- table for decoding fixed codes");
+    puts(" * Generated automatically by makefixed().");
+    puts(" */");
+    puts("");
+    puts("/* WARNING: this file should *not* be used by applications.");
+    puts("   It is part of the implementation of this library and is");
+    puts("   subject to change. Applications should only use zlib.h.");
+    puts(" */");
+    puts("");
+    size = 1U << 9;
+    printf("static const code lenfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 7) == 0) printf("\n    ");
+        printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+               state.lencode[low].bits, state.lencode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n};");
+    size = 1U << 5;
+    printf("\nstatic const code distfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 6) == 0) printf("\n    ");
+        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
+               state.distcode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n};");
+    return 0;
+}
+#endif /* MAKEFIXED */
diff --git a/src/java.base/share/native/libzip/zlib/inftrees.h b/src/java.base/share/native/libzip/zlib/inftrees.h
index 3e2e889301d..b9b4fc2fb2b 100644
--- a/src/java.base/share/native/libzip/zlib/inftrees.h
+++ b/src/java.base/share/native/libzip/zlib/inftrees.h
@@ -23,7 +23,7 @@
  */
 
 /* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005, 2010 Mark Adler
+ * Copyright (C) 1995-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -84,3 +84,5 @@ typedef enum {
 int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
                                 unsigned codes, code FAR * FAR *table,
                                 unsigned FAR *bits, unsigned short FAR *work);
+struct inflate_state;
+void ZLIB_INTERNAL inflate_fixed(struct inflate_state FAR *state);
diff --git a/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java b/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java
index 3296c5f2fad..dfde58f0122 100644
--- a/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java
+++ b/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java
@@ -1,4 +1,4 @@
-Changes from zlib 1.3.1
+Changes in JDK's in-tree zlib compared to upstream zlib 1.3.2
 
 (1) renamed adler32.c -> zadler32.c, crc32c -> zcrc32.c
 
diff --git a/src/java.base/share/native/libzip/zlib/trees.c b/src/java.base/share/native/libzip/zlib/trees.c
index bbfa9deee5b..cc7b136bcf6 100644
--- a/src/java.base/share/native/libzip/zlib/trees.c
+++ b/src/java.base/share/native/libzip/zlib/trees.c
@@ -23,7 +23,7 @@
  */
 
 /* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2024 Jean-loup Gailly
+ * Copyright (C) 1995-2026 Jean-loup Gailly
  * detect_data_type() function provided freely by Cosmin Truta, 2006
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
@@ -136,7 +136,7 @@ local int base_dist[D_CODES];
 
 #else
 #  include "trees.h"
-#endif /* GEN_TREES_H */
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
 
 struct static_tree_desc_s {
     const ct_data *static_tree;  /* static tree or NULL */
@@ -176,7 +176,7 @@ local TCONST static_tree_desc static_bl_desc =
  * IN assertion: 1 <= len <= 15
  */
 local unsigned bi_reverse(unsigned code, int len) {
-    register unsigned res = 0;
+    unsigned res = 0;
     do {
         res |= code & 1;
         code >>= 1, res <<= 1;
@@ -208,10 +208,11 @@ local void bi_windup(deflate_state *s) {
     } else if (s->bi_valid > 0) {
         put_byte(s, (Byte)s->bi_buf);
     }
+    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
     s->bi_buf = 0;
     s->bi_valid = 0;
 #ifdef ZLIB_DEBUG
-    s->bits_sent = (s->bits_sent + 7) & ~7;
+    s->bits_sent = (s->bits_sent + 7) & ~(ulg)7;
 #endif
 }
 
@@ -490,6 +491,7 @@ void ZLIB_INTERNAL _tr_init(deflate_state *s) {
 
     s->bi_buf = 0;
     s->bi_valid = 0;
+    s->bi_used = 0;
 #ifdef ZLIB_DEBUG
     s->compressed_len = 0L;
     s->bits_sent = 0L;
@@ -748,7 +750,7 @@ local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
         if (++count < max_count && curlen == nextlen) {
             continue;
         } else if (count < min_count) {
-            s->bl_tree[curlen].Freq += count;
+            s->bl_tree[curlen].Freq += (ush)count;
         } else if (curlen != 0) {
             if (curlen != prevlen) s->bl_tree[curlen].Freq++;
             s->bl_tree[REP_3_6].Freq++;
@@ -841,7 +843,7 @@ local int build_bl_tree(deflate_state *s) {
     }
     /* Update opt_len to include the bit length tree and counts */
     s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
-    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+    Tracev((stderr, "\ndyn trees: dyn %lu, stat %lu",
             s->opt_len, s->static_len));
 
     return max_blindex;
@@ -867,13 +869,13 @@ local void send_all_trees(deflate_state *s, int lcodes, int dcodes,
         Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
         send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
     }
-    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+    Tracev((stderr, "\nbl tree: sent %lu", s->bits_sent));
 
     send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
-    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+    Tracev((stderr, "\nlit tree: sent %lu", s->bits_sent));
 
     send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
-    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+    Tracev((stderr, "\ndist tree: sent %lu", s->bits_sent));
 }
 
 /* ===========================================================================
@@ -956,7 +958,7 @@ local void compress_block(deflate_state *s, const ct_data *ltree,
             extra = extra_dbits[code];
             if (extra != 0) {
                 dist -= (unsigned)base_dist[code];
-                send_bits(s, dist, extra);   /* send the extra distance bits */
+                send_bits(s, (int)dist, extra); /* send the extra bits */
             }
         } /* literal or match pair ? */
 
@@ -1030,11 +1032,11 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
 
         /* Construct the literal and distance trees */
         build_tree(s, (tree_desc *)(&(s->l_desc)));
-        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+        Tracev((stderr, "\nlit data: dyn %lu, stat %lu", s->opt_len,
                 s->static_len));
 
         build_tree(s, (tree_desc *)(&(s->d_desc)));
-        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+        Tracev((stderr, "\ndist data: dyn %lu, stat %lu", s->opt_len,
                 s->static_len));
         /* At this point, opt_len and static_len are the total bit lengths of
          * the compressed block data, excluding the tree representations.
@@ -1107,7 +1109,7 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
 #endif
     }
     Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
-           s->compressed_len - 7*last));
+           s->compressed_len - 7*(ulg)last));
 }
 
 /* ===========================================================================
diff --git a/src/java.base/share/native/libzip/zlib/uncompr.c b/src/java.base/share/native/libzip/zlib/uncompr.c
index 219c1d264d5..25da59461c3 100644
--- a/src/java.base/share/native/libzip/zlib/uncompr.c
+++ b/src/java.base/share/native/libzip/zlib/uncompr.c
@@ -23,7 +23,7 @@
  */
 
 /* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -47,24 +47,24 @@
    memory, Z_BUF_ERROR if there was not enough room in the output buffer, or
    Z_DATA_ERROR if the input data was corrupted, including if the input data is
    an incomplete zlib stream.
+
+     The _z versions of the functions take size_t length arguments.
 */
-int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,
-                        uLong *sourceLen) {
+int ZEXPORT uncompress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
+                          z_size_t *sourceLen) {
     z_stream stream;
     int err;
     const uInt max = (uInt)-1;
-    uLong len, left;
-    Byte buf[1];    /* for detection of incomplete stream when *destLen == 0 */
+    z_size_t len, left;
+
+    if (sourceLen == NULL || (*sourceLen > 0 && source == NULL) ||
+        destLen == NULL || (*destLen > 0 && dest == NULL))
+        return Z_STREAM_ERROR;
 
     len = *sourceLen;
-    if (*destLen) {
-        left = *destLen;
-        *destLen = 0;
-    }
-    else {
-        left = 1;
-        dest = buf;
-    }
+    left = *destLen;
+    if (left == 0 && dest == Z_NULL)
+        dest = (Bytef *)&stream.reserved;       /* next_out cannot be NULL */
 
     stream.next_in = (z_const Bytef *)source;
     stream.avail_in = 0;
@@ -80,30 +80,46 @@ int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,
 
     do {
         if (stream.avail_out == 0) {
-            stream.avail_out = left > (uLong)max ? max : (uInt)left;
+            stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
             left -= stream.avail_out;
         }
         if (stream.avail_in == 0) {
-            stream.avail_in = len > (uLong)max ? max : (uInt)len;
+            stream.avail_in = len > (z_size_t)max ? max : (uInt)len;
             len -= stream.avail_in;
         }
         err = inflate(&stream, Z_NO_FLUSH);
     } while (err == Z_OK);
 
-    *sourceLen -= len + stream.avail_in;
-    if (dest != buf)
-        *destLen = stream.total_out;
-    else if (stream.total_out && err == Z_BUF_ERROR)
-        left = 1;
+    /* Set len and left to the unused input data and unused output space. Set
+       *sourceLen to the amount of input consumed. Set *destLen to the amount
+       of data produced. */
+    len += stream.avail_in;
+    left += stream.avail_out;
+    *sourceLen -= len;
+    *destLen -= left;
 
     inflateEnd(&stream);
     return err == Z_STREAM_END ? Z_OK :
            err == Z_NEED_DICT ? Z_DATA_ERROR  :
-           err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
+           err == Z_BUF_ERROR && len == 0 ? Z_DATA_ERROR :
            err;
 }
-
+int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,
+                        uLong *sourceLen) {
+    int ret;
+    z_size_t got = *destLen, used = *sourceLen;
+    ret = uncompress2_z(dest, &got, source, &used);
+    *sourceLen = (uLong)used;
+    *destLen = (uLong)got;
+    return ret;
+}
+int ZEXPORT uncompress_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
+                         z_size_t sourceLen) {
+    z_size_t used = sourceLen;
+    return uncompress2_z(dest, destLen, source, &used);
+}
 int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
                        uLong sourceLen) {
-    return uncompress2(dest, destLen, source, &sourceLen);
+    uLong used = sourceLen;
+    return uncompress2(dest, destLen, source, &used);
 }
diff --git a/src/java.base/share/native/libzip/zlib/zconf.h b/src/java.base/share/native/libzip/zlib/zconf.h
index 46204222f5d..d4589739a0a 100644
--- a/src/java.base/share/native/libzip/zlib/zconf.h
+++ b/src/java.base/share/native/libzip/zlib/zconf.h
@@ -23,7 +23,7 @@
  */
 
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -57,7 +57,10 @@
 #  ifndef Z_SOLO
 #    define compress              z_compress
 #    define compress2             z_compress2
+#    define compress_z            z_compress_z
+#    define compress2_z           z_compress2_z
 #    define compressBound         z_compressBound
+#    define compressBound_z       z_compressBound_z
 #  endif
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
@@ -68,6 +71,7 @@
 #  define crc32_z               z_crc32_z
 #  define deflate               z_deflate
 #  define deflateBound          z_deflateBound
+#  define deflateBound_z        z_deflateBound_z
 #  define deflateCopy           z_deflateCopy
 #  define deflateEnd            z_deflateEnd
 #  define deflateGetDictionary  z_deflateGetDictionary
@@ -83,6 +87,7 @@
 #  define deflateSetDictionary  z_deflateSetDictionary
 #  define deflateSetHeader      z_deflateSetHeader
 #  define deflateTune           z_deflateTune
+#  define deflateUsed           z_deflateUsed
 #  define deflate_copyright     z_deflate_copyright
 #  define get_crc_table         z_get_crc_table
 #  ifndef Z_SOLO
@@ -152,9 +157,12 @@
 #  define inflate_copyright     z_inflate_copyright
 #  define inflate_fast          z_inflate_fast
 #  define inflate_table         z_inflate_table
+#  define inflate_fixed         z_inflate_fixed
 #  ifndef Z_SOLO
 #    define uncompress            z_uncompress
 #    define uncompress2           z_uncompress2
+#    define uncompress_z          z_uncompress_z
+#    define uncompress2_z         z_uncompress2_z
 #  endif
 #  define zError                z_zError
 #  ifndef Z_SOLO
@@ -258,10 +266,12 @@
 #  endif
 #endif
 
-#if defined(ZLIB_CONST) && !defined(z_const)
-#  define z_const const
-#else
-#  define z_const
+#ifndef z_const
+#  ifdef ZLIB_CONST
+#    define z_const const
+#  else
+#    define z_const
+#  endif
 #endif
 
 #ifdef Z_SOLO
@@ -457,11 +467,11 @@ typedef uLong FAR uLongf;
    typedef unsigned long z_crc_t;
 #endif
 
-#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
+#if HAVE_UNISTD_H-0     /* may be set to #if 1 by ./configure */
 #  define Z_HAVE_UNISTD_H
 #endif
 
-#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
+#if HAVE_STDARG_H-0     /* may be set to #if 1 by ./configure */
 #  define Z_HAVE_STDARG_H
 #endif
 
@@ -494,12 +504,8 @@ typedef uLong FAR uLongf;
 #endif
 
 #ifndef Z_HAVE_UNISTD_H
-#  ifdef __WATCOMC__
-#    define Z_HAVE_UNISTD_H
-#  endif
-#endif
-#ifndef Z_HAVE_UNISTD_H
-#  if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+#  if defined(__WATCOMC__) || defined(__GO32__) || \
+      (defined(_LARGEFILE64_SOURCE) && !defined(_WIN32))
 #    define Z_HAVE_UNISTD_H
 #  endif
 #endif
@@ -534,17 +540,19 @@ typedef uLong FAR uLongf;
 #endif
 
 #ifndef z_off_t
-#  define z_off_t long
+#  define z_off_t long long
 #endif
 
 #if !defined(_WIN32) && defined(Z_LARGE64)
 #  define z_off64_t off64_t
+#elif defined(__MINGW32__)
+#  define z_off64_t long long
+#elif defined(_WIN32) && !defined(__GNUC__)
+#  define z_off64_t __int64
+#elif defined(__GO32__)
+#  define z_off64_t offset_t
 #else
-#  if defined(_WIN32) && !defined(__GNUC__)
-#    define z_off64_t __int64
-#  else
-#    define z_off64_t z_off_t
-#  endif
+#  define z_off64_t z_off_t
 #endif
 
 /* MVS linker does not support external names larger than 8 bytes */
diff --git a/src/java.base/share/native/libzip/zlib/zcrc32.c b/src/java.base/share/native/libzip/zlib/zcrc32.c
index 3f918f76b7c..133cbe158aa 100644
--- a/src/java.base/share/native/libzip/zlib/zcrc32.c
+++ b/src/java.base/share/native/libzip/zlib/zcrc32.c
@@ -23,7 +23,7 @@
  */
 
 /* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2022 Mark Adler
+ * Copyright (C) 1995-2026 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  *
  * This interleaved implementation of a CRC makes use of pipelined multiple
@@ -48,11 +48,18 @@
 #  include 
 #  ifndef DYNAMIC_CRC_TABLE
 #    define DYNAMIC_CRC_TABLE
-#  endif /* !DYNAMIC_CRC_TABLE */
-#endif /* MAKECRCH */
+#  endif
+#endif
+#ifdef DYNAMIC_CRC_TABLE
+#  define Z_ONCE
+#endif
 
 #include "zutil.h"      /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */
 
+#ifdef HAVE_S390X_VX
+#  include "contrib/crc32vx/crc32_vx_hooks.h"
+#endif
+
  /*
   A CRC of a message is computed on N braids of words in the message, where
   each word consists of W bytes (4 or 8). If N is 3, for example, then three
@@ -123,7 +130,8 @@
 #endif
 
 /* If available, use the ARM processor CRC32 instruction. */
-#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
+#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && \
+    defined(W) && W == 8
 #  define ARMCRC32
 #endif
 
@@ -176,10 +184,10 @@ local z_word_t byte_swap(z_word_t word) {
   Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
   reflected. For speed, this requires that a not be zero.
  */
-local z_crc_t multmodp(z_crc_t a, z_crc_t b) {
-    z_crc_t m, p;
+local uLong multmodp(uLong a, uLong b) {
+    uLong m, p;
 
-    m = (z_crc_t)1 << 31;
+    m = (uLong)1 << 31;
     p = 0;
     for (;;) {
         if (a & m) {
@@ -195,12 +203,12 @@ local z_crc_t multmodp(z_crc_t a, z_crc_t b) {
 
 /*
   Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
-  initialized.
+  initialized. n must not be negative.
  */
-local z_crc_t x2nmodp(z_off64_t n, unsigned k) {
-    z_crc_t p;
+local uLong x2nmodp(z_off64_t n, unsigned k) {
+    uLong p;
 
-    p = (z_crc_t)1 << 31;           /* x^0 == 1 */
+    p = (uLong)1 << 31;             /* x^0 == 1 */
     while (n) {
         if (n & 1)
             p = multmodp(x2n_table[k & 31], p);
@@ -228,83 +236,8 @@ local z_crc_t FAR crc_table[256];
    local void write_table64(FILE *, const z_word_t FAR *, int);
 #endif /* MAKECRCH */
 
-/*
-  Define a once() function depending on the availability of atomics. If this is
-  compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in
-  multiple threads, and if atomics are not available, then get_crc_table() must
-  be called to initialize the tables and must return before any threads are
-  allowed to compute or combine CRCs.
- */
-
-/* Definition of once functionality. */
-typedef struct once_s once_t;
-
-/* Check for the availability of atomics. */
-#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \
-    !defined(__STDC_NO_ATOMICS__)
-
-#include 
-
-/* Structure for once(), which must be initialized with ONCE_INIT. */
-struct once_s {
-    atomic_flag begun;
-    atomic_int done;
-};
-#define ONCE_INIT {ATOMIC_FLAG_INIT, 0}
-
-/*
-  Run the provided init() function exactly once, even if multiple threads
-  invoke once() at the same time. The state must be a once_t initialized with
-  ONCE_INIT.
- */
-local void once(once_t *state, void (*init)(void)) {
-    if (!atomic_load(&state->done)) {
-        if (atomic_flag_test_and_set(&state->begun))
-            while (!atomic_load(&state->done))
-                ;
-        else {
-            init();
-            atomic_store(&state->done, 1);
-        }
-    }
-}
-
-#else   /* no atomics */
-
-/* Structure for once(), which must be initialized with ONCE_INIT. */
-struct once_s {
-    volatile int begun;
-    volatile int done;
-};
-#define ONCE_INIT {0, 0}
-
-/* Test and set. Alas, not atomic, but tries to minimize the period of
-   vulnerability. */
-local int test_and_set(int volatile *flag) {
-    int was;
-
-    was = *flag;
-    *flag = 1;
-    return was;
-}
-
-/* Run the provided init() function once. This is not thread-safe. */
-local void once(once_t *state, void (*init)(void)) {
-    if (!state->done) {
-        if (test_and_set(&state->begun))
-            while (!state->done)
-                ;
-        else {
-            init();
-            state->done = 1;
-        }
-    }
-}
-
-#endif
-
 /* State for once(). */
-local once_t made = ONCE_INIT;
+local z_once_t made = Z_ONCE_INIT;
 
 /*
   Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
@@ -350,7 +283,7 @@ local void make_crc_table(void) {
     p = (z_crc_t)1 << 30;         /* x^1 */
     x2n_table[0] = p;
     for (n = 1; n < 32; n++)
-        x2n_table[n] = p = multmodp(p, p);
+        x2n_table[n] = p = (z_crc_t)multmodp(p, p);
 
 #ifdef W
     /* initialize the braiding tables -- needs x2n_table[] */
@@ -553,11 +486,11 @@ local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) {
     int k;
     z_crc_t i, p, q;
     for (k = 0; k < w; k++) {
-        p = x2nmodp((n * w + 3 - k) << 3, 0);
+        p = (z_crc_t)x2nmodp((n * w + 3 - k) << 3, 0);
         ltl[k][0] = 0;
         big[w - 1 - k][0] = 0;
         for (i = 1; i < 256; i++) {
-            ltl[k][i] = q = multmodp(i << 24, p);
+            ltl[k][i] = q = (z_crc_t)multmodp(i << 24, p);
             big[w - 1 - k][i] = byte_swap(q);
         }
     }
@@ -572,7 +505,7 @@ local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) {
  */
 const z_crc_t FAR * ZEXPORT get_crc_table(void) {
 #ifdef DYNAMIC_CRC_TABLE
-    once(&made, make_crc_table);
+    z_once(&made, make_crc_table);
 #endif /* DYNAMIC_CRC_TABLE */
     return (const z_crc_t FAR *)crc_table;
 }
@@ -596,9 +529,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table(void) {
 #define Z_BATCH_ZEROS 0xa10d3d0c    /* computed from Z_BATCH = 3990 */
 #define Z_BATCH_MIN 800             /* fewest words in a final batch */
 
-unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
-                              z_size_t len) {
-    z_crc_t val;
+uLong ZEXPORT crc32_z(uLong crc, const unsigned char FAR *buf, z_size_t len) {
+    uLong val;
     z_word_t crc1, crc2;
     const z_word_t *word;
     z_word_t val0, val1, val2;
@@ -609,7 +541,7 @@ unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
     if (buf == Z_NULL) return 0;
 
 #ifdef DYNAMIC_CRC_TABLE
-    once(&made, make_crc_table);
+    z_once(&made, make_crc_table);
 #endif /* DYNAMIC_CRC_TABLE */
 
     /* Pre-condition the CRC */
@@ -664,7 +596,7 @@ unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
         }
         word += 3 * last;
         num -= 3 * last;
-        val = x2nmodp(last, 6);
+        val = x2nmodp((int)last, 6);
         crc = multmodp(val, crc) ^ crc1;
         crc = multmodp(val, crc) ^ crc2;
     }
@@ -715,13 +647,12 @@ local z_word_t crc_word_big(z_word_t data) {
 #endif
 
 /* ========================================================================= */
-unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
-                              z_size_t len) {
+uLong ZEXPORT crc32_z(uLong crc, const unsigned char FAR *buf, z_size_t len) {
     /* Return initial CRC, if requested. */
     if (buf == Z_NULL) return 0;
 
 #ifdef DYNAMIC_CRC_TABLE
-    once(&made, make_crc_table);
+    z_once(&made, make_crc_table);
 #endif /* DYNAMIC_CRC_TABLE */
 
     /* Pre-condition the CRC */
@@ -1036,28 +967,19 @@ unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
 #endif
 
 /* ========================================================================= */
-unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf,
-                            uInt len) {
+uLong ZEXPORT crc32(uLong crc, const unsigned char FAR *buf, uInt len) {
+    #ifdef HAVE_S390X_VX
+    return crc32_z_hook(crc, buf, len);
+    #endif
     return crc32_z(crc, buf, len);
 }
 
-/* ========================================================================= */
-uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) {
-#ifdef DYNAMIC_CRC_TABLE
-    once(&made, make_crc_table);
-#endif /* DYNAMIC_CRC_TABLE */
-    return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
-}
-
-/* ========================================================================= */
-uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) {
-    return crc32_combine64(crc1, crc2, (z_off64_t)len2);
-}
-
 /* ========================================================================= */
 uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) {
+    if (len2 < 0)
+        return 0;
 #ifdef DYNAMIC_CRC_TABLE
-    once(&made, make_crc_table);
+    z_once(&made, make_crc_table);
 #endif /* DYNAMIC_CRC_TABLE */
     return x2nmodp(len2, 3);
 }
@@ -1069,5 +991,17 @@ uLong ZEXPORT crc32_combine_gen(z_off_t len2) {
 
 /* ========================================================================= */
 uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) {
-    return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
+    if (op == 0)
+        return 0;
+    return multmodp(op, crc1 & 0xffffffff) ^ (crc2 & 0xffffffff);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) {
+    return crc32_combine_op(crc1, crc2, crc32_combine_gen64(len2));
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) {
+    return crc32_combine64(crc1, crc2, (z_off64_t)len2);
 }
diff --git a/src/java.base/share/native/libzip/zlib/zlib.h b/src/java.base/share/native/libzip/zlib/zlib.h
index 07496b5f981..90230f4f23f 100644
--- a/src/java.base/share/native/libzip/zlib/zlib.h
+++ b/src/java.base/share/native/libzip/zlib/zlib.h
@@ -23,9 +23,9 @@
  */
 
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.3.1, January 22nd, 2024
+  version 1.3.2, February 17th, 2026
 
-  Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
+  Copyright (C) 1995-2026 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -48,24 +48,28 @@
 
 
   The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+  Comments) 1950 to 1952 at https://datatracker.ietf.org/doc/html/rfc1950
   (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
 */
 
 #ifndef ZLIB_H
 #define ZLIB_H
 
-#include "zconf.h"
+#ifdef ZLIB_BUILD
+#  include 
+#else
+# include "zconf.h"
+#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.3.1"
-#define ZLIB_VERNUM 0x1310
+#define ZLIB_VERSION "1.3.2"
+#define ZLIB_VERNUM 0x1320
 #define ZLIB_VER_MAJOR 1
 #define ZLIB_VER_MINOR 3
-#define ZLIB_VER_REVISION 1
+#define ZLIB_VER_REVISION 2
 #define ZLIB_VER_SUBREVISION 0
 
 /*
@@ -465,7 +469,7 @@ ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush);
 
     The Z_BLOCK option assists in appending to or combining deflate streams.
   To assist in this, on return inflate() always sets strm->data_type to the
-  number of unused bits in the last byte taken from strm->next_in, plus 64 if
+  number of unused bits in the input taken from strm->next_in, plus 64 if
   inflate() is currently decoding the last block in the deflate stream, plus
   128 if inflate() returned immediately after decoding an end-of-block code or
   decoding the complete header up to just before the first byte of the deflate
@@ -611,18 +615,21 @@ ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
 
      The strategy parameter is used to tune the compression algorithm.  Use the
    value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
-   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
-   string match), or Z_RLE to limit match distances to one (run-length
-   encoding).  Filtered data consists mostly of small values with a somewhat
-   random distribution.  In this case, the compression algorithm is tuned to
-   compress them better.  The effect of Z_FILTERED is to force more Huffman
-   coding and less string matching; it is somewhat intermediate between
-   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
-   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
-   strategy parameter only affects the compression ratio but not the
-   correctness of the compressed output even if it is not set appropriately.
-   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
-   decoder for special applications.
+   filter (or predictor), Z_RLE to limit match distances to one (run-length
+   encoding), or Z_HUFFMAN_ONLY to force Huffman encoding only (no string
+   matching).  Filtered data consists mostly of small values with a somewhat
+   random distribution, as produced by the PNG filters.  In this case, the
+   compression algorithm is tuned to compress them better.  The effect of
+   Z_FILTERED is to force more Huffman coding and less string matching than the
+   default; it is intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.
+   Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better
+   compression for PNG image data than Huffman only.  The degree of string
+   matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then
+   Z_HUFFMAN_ONLY. The strategy parameter affects the compression ratio but
+   never the correctness of the compressed output, even if it is not set
+   optimally for the given data.  Z_FIXED uses the default string matching, but
+   prevents the use of dynamic Huffman codes, allowing for a simpler decoder
+   for special applications.
 
      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
    memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
@@ -782,8 +789,8 @@ ZEXTERN int ZEXPORT deflateTune(z_streamp strm,
    returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
  */
 
-ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm,
-                                   uLong sourceLen);
+ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen);
+ZEXTERN z_size_t ZEXPORT deflateBound_z(z_streamp strm, z_size_t sourceLen);
 /*
      deflateBound() returns an upper bound on the compressed size after
    deflation of sourceLen bytes.  It must be called after deflateInit() or
@@ -795,6 +802,9 @@ ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm,
    to return Z_STREAM_END.  Note that it is possible for the compressed size to
    be larger than the value returned by deflateBound() if flush options other
    than Z_FINISH or Z_NO_FLUSH are used.
+
+     delfateBound_z() is the same, but takes and returns a size_t length.  Note
+   that a long is 32 bits on Windows.
 */
 
 ZEXTERN int ZEXPORT deflatePending(z_streamp strm,
@@ -809,6 +819,21 @@ ZEXTERN int ZEXPORT deflatePending(z_streamp strm,
    or bits are Z_NULL, then those values are not set.
 
      deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.  If an int is 16 bits and memLevel is 9, then
+   it is possible for the number of pending bytes to not fit in an unsigned. In
+   that case Z_BUF_ERROR is returned and *pending is set to the maximum value
+   of an unsigned.
+ */
+
+ZEXTERN int ZEXPORT deflateUsed(z_streamp strm,
+                                int *bits);
+/*
+     deflateUsed() returns in *bits the most recent number of deflate bits used
+   in the last byte when flushing to a byte boundary. The result is in 1..8, or
+   0 if there has not yet been a flush. This helps determine the location of
+   the last bit of a deflate stream.
+
+     deflateUsed returns Z_OK if success, or Z_STREAM_ERROR if the source
    stream state was inconsistent.
  */
 
@@ -1011,13 +1036,15 @@ ZEXTERN int ZEXPORT inflatePrime(z_streamp strm,
                                  int bits,
                                  int value);
 /*
-     This function inserts bits in the inflate input stream.  The intent is
-   that this function is used to start inflating at a bit position in the
-   middle of a byte.  The provided bits will be used before any bytes are used
-   from next_in.  This function should only be used with raw inflate, and
-   should be used before the first inflate() call after inflateInit2() or
-   inflateReset().  bits must be less than or equal to 16, and that many of the
-   least significant bits of value will be inserted in the input.
+     This function inserts bits in the inflate input stream.  The intent is to
+   use inflatePrime() to start inflating at a bit position in the middle of a
+   byte.  The provided bits will be used before any bytes are used from
+   next_in.  This function should be used with raw inflate, before the first
+   inflate() call, after inflateInit2() or inflateReset().  It can also be used
+   after an inflate() return indicates the end of a deflate block or header
+   when using Z_BLOCK.  bits must be less than or equal to 16, and that many of
+   the least significant bits of value will be inserted in the input.  The
+   other bits in value can be non-zero, and will be ignored.
 
      If bits is negative, then the input stream bit buffer is emptied.  Then
    inflatePrime() can be called again to put bits in the buffer.  This is used
@@ -1025,7 +1052,15 @@ ZEXTERN int ZEXPORT inflatePrime(z_streamp strm,
    to feeding inflate codes.
 
      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
+   stream state was inconsistent, or if bits is out of range.  If inflate was
+   in the middle of processing a header, trailer, or stored block lengths, then
+   it is possible for there to be only eight bits available in the bit buffer.
+   In that case, bits > 8 is considered out of range.  However, when used as
+   outlined above, there will always be 16 bits available in the buffer for
+   insertion.  As noted in its documentation above, inflate records the number
+   of bits in the bit buffer on return in data_type. 32 minus that is the
+   number of bits available for insertion.  inflatePrime does not update
+   data_type with the new number of bits in buffer.
 */
 
 ZEXTERN long ZEXPORT inflateMark(z_streamp strm);
@@ -1071,20 +1106,22 @@ ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm,
 
      The text, time, xflags, and os fields are filled in with the gzip header
    contents.  hcrc is set to true if there is a header CRC.  (The header CRC
-   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
-   contains the maximum number of bytes to write to extra.  Once done is true,
-   extra_len contains the actual extra field length, and extra contains the
-   extra field, or that field truncated if extra_max is less than extra_len.
-   If name is not Z_NULL, then up to name_max characters are written there,
-   terminated with a zero unless the length is greater than name_max.  If
-   comment is not Z_NULL, then up to comm_max characters are written there,
-   terminated with a zero unless the length is greater than comm_max.  When any
-   of extra, name, or comment are not Z_NULL and the respective field is not
-   present in the header, then that field is set to Z_NULL to signal its
-   absence.  This allows the use of deflateSetHeader() with the returned
-   structure to duplicate the header.  However if those fields are set to
-   allocated memory, then the application will need to save those pointers
-   elsewhere so that they can be eventually freed.
+   was valid if done is set to one.)  The extra, name, and comment pointers
+   much each be either Z_NULL or point to space to store that information from
+   the header.  If extra is not Z_NULL, then extra_max contains the maximum
+   number of bytes that can be written to extra.  Once done is true, extra_len
+   contains the actual extra field length, and extra contains the extra field,
+   or that field truncated if extra_max is less than extra_len.  If name is not
+   Z_NULL, then up to name_max characters, including the terminating zero, are
+   written there.  If comment is not Z_NULL, then up to comm_max characters,
+   including the terminating zero, are written there.  The application can tell
+   that the name or comment did not fit in the provided space by the absence of
+   a terminating zero.  If any of extra, name, or comment are not present in
+   the header, then that field's pointer is set to Z_NULL.  This allows the use
+   of deflateSetHeader() with the returned structure to duplicate the header.
+   Note that if those fields initially pointed to allocated memory, then the
+   application will need to save them elsewhere so that they can be eventually
+   freed.
 
      If inflateGetHeader is not used, then the header information is simply
    discarded.  The header is always checked for validity, including the header
@@ -1232,13 +1269,14 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags(void);
      21: FASTEST -- deflate algorithm with only one, lowest compression level
      22,23: 0 (reserved)
 
-    The sprintf variant used by gzprintf (zero is best):
+    The sprintf variant used by gzprintf (all zeros is best):
      24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
-     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() is not secure!
      26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+     27: 0 = gzprintf() present, 1 = not -- 1 means gzprintf() returns an error
 
     Remainder:
-     27-31: 0 (reserved)
+     28-31: 0 (reserved)
  */
 
 #ifndef Z_SOLO
@@ -1250,11 +1288,14 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags(void);
    stream-oriented functions.  To simplify the interface, some default options
    are assumed (compression level and memory usage, standard memory allocation
    functions).  The source code of these utility functions can be modified if
-   you need special options.
+   you need special options.  The _z versions of the functions use the size_t
+   type for lengths.  Note that a long is 32 bits on Windows.
 */
 
-ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
+ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen,
                              const Bytef *source, uLong sourceLen);
+ZEXTERN int ZEXPORT compress_z(Bytef *dest, z_size_t *destLen,
+                               const Bytef *source, z_size_t sourceLen);
 /*
      Compresses the source buffer into the destination buffer.  sourceLen is
    the byte length of the source buffer.  Upon entry, destLen is the total size
@@ -1268,9 +1309,12 @@ ZEXTERN int ZEXPORT compress(Bytef *dest,   uLongf *destLen,
    buffer.
 */
 
-ZEXTERN int ZEXPORT compress2(Bytef *dest,   uLongf *destLen,
+ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen,
                               const Bytef *source, uLong sourceLen,
                               int level);
+ZEXTERN int ZEXPORT compress2_z(Bytef *dest, z_size_t *destLen,
+                                const Bytef *source, z_size_t sourceLen,
+                                int level);
 /*
      Compresses the source buffer into the destination buffer.  The level
    parameter has the same meaning as in deflateInit.  sourceLen is the byte
@@ -1285,21 +1329,24 @@ ZEXTERN int ZEXPORT compress2(Bytef *dest,   uLongf *destLen,
 */
 
 ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen);
+ZEXTERN z_size_t ZEXPORT compressBound_z(z_size_t sourceLen);
 /*
      compressBound() returns an upper bound on the compressed size after
    compress() or compress2() on sourceLen bytes.  It would be used before a
    compress() or compress2() call to allocate the destination buffer.
 */
 
-ZEXTERN int ZEXPORT uncompress(Bytef *dest,   uLongf *destLen,
+ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen,
                                const Bytef *source, uLong sourceLen);
+ZEXTERN int ZEXPORT uncompress_z(Bytef *dest, z_size_t *destLen,
+                                 const Bytef *source, z_size_t sourceLen);
 /*
      Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer.  Upon entry, destLen is the total size
+   the byte length of the source buffer.  On entry, *destLen is the total size
    of the destination buffer, which must be large enough to hold the entire
    uncompressed data.  (The size of the uncompressed data must have been saved
    previously by the compressor and transmitted to the decompressor by some
-   mechanism outside the scope of this compression library.) Upon exit, destLen
+   mechanism outside the scope of this compression library.)  On exit, *destLen
    is the actual size of the uncompressed data.
 
      uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
@@ -1309,8 +1356,10 @@ ZEXTERN int ZEXPORT uncompress(Bytef *dest,   uLongf *destLen,
    buffer with the uncompressed data up to that point.
 */
 
-ZEXTERN int ZEXPORT uncompress2(Bytef *dest,   uLongf *destLen,
+ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen,
                                 const Bytef *source, uLong *sourceLen);
+ZEXTERN int ZEXPORT uncompress2_z(Bytef *dest, z_size_t *destLen,
+                                  const Bytef *source, z_size_t *sourceLen);
 /*
      Same as uncompress, except that sourceLen is a pointer, where the
    length of the source is *sourceLen.  On return, *sourceLen is the number of
@@ -1338,13 +1387,17 @@ ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode);
    'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
    as in "wb9F".  (See the description of deflateInit2 for more information
    about the strategy parameter.)  'T' will request transparent writing or
-   appending with no compression and not using the gzip format.
+   appending with no compression and not using the gzip format. 'T' cannot be
+   used to force transparent reading. Transparent reading is automatically
+   performed if there is no gzip header at the start. Transparent reading can
+   be disabled with the 'G' option, which will instead return an error if there
+   is no gzip header. 'N' will open the file in non-blocking mode.
 
-     "a" can be used instead of "w" to request that the gzip stream that will
-   be written be appended to the file.  "+" will result in an error, since
+     'a' can be used instead of 'w' to request that the gzip stream that will
+   be written be appended to the file.  '+' will result in an error, since
    reading and writing to the same gzip file is not supported.  The addition of
-   "x" when writing will create the file exclusively, which fails if the file
-   already exists.  On systems that support it, the addition of "e" when
+   'x' when writing will create the file exclusively, which fails if the file
+   already exists.  On systems that support it, the addition of 'e' when
    reading or writing will set the flag to close the file on an execve() call.
 
      These functions, as well as gzip, will read and decode a sequence of gzip
@@ -1363,14 +1416,22 @@ ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode);
    insufficient memory to allocate the gzFile state, or if an invalid mode was
    specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
    errno can be checked to determine if the reason gzopen failed was that the
-   file could not be opened.
+   file could not be opened. Note that if 'N' is in mode for non-blocking, the
+   open() itself can fail in order to not block. In that case gzopen() will
+   return NULL and errno will be EAGAIN or ENONBLOCK. The call to gzopen() can
+   then be re-tried. If the application would like to block on opening the
+   file, then it can use open() without O_NONBLOCK, and then gzdopen() with the
+   resulting file descriptor and 'N' in the mode, which will set it to non-
+   blocking.
 */
 
 ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
 /*
      Associate a gzFile with the file descriptor fd.  File descriptors are
    obtained from calls like open, dup, creat, pipe or fileno (if the file has
-   been previously opened with fopen).  The mode parameter is as in gzopen.
+   been previously opened with fopen).  The mode parameter is as in gzopen. An
+   'e' in mode will set fd's flag to close the file on an execve() call. An 'N'
+   in mode will set fd's non-blocking flag.
 
      The next call of gzclose on the returned gzFile will also close the file
    descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
@@ -1440,10 +1501,16 @@ ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len);
    stream.  Alternatively, gzerror can be used before gzclose to detect this
    case.
 
+     gzread can be used to read a gzip file on a non-blocking device. If the
+   input stalls and there is no uncompressed data to return, then gzread() will
+   return -1, and errno will be EAGAIN or EWOULDBLOCK. gzread() can then be
+   called again.
+
      gzread returns the number of uncompressed bytes actually read, less than
    len for end of file, or -1 for error.  If len is too large to fit in an int,
    then nothing is read, -1 is returned, and the error state is set to
-   Z_STREAM_ERROR.
+   Z_STREAM_ERROR. If some data was read before an error, then that data is
+   returned until exhausted, after which the next call will signal the error.
 */
 
 ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
@@ -1467,15 +1534,20 @@ ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
    multiple of size, then the final partial item is nevertheless read into buf
    and the end-of-file flag is set.  The length of the partial item read is not
    provided, but could be inferred from the result of gztell().  This behavior
-   is the same as the behavior of fread() implementations in common libraries,
-   but it prevents the direct use of gzfread() to read a concurrently written
-   file, resetting and retrying on end-of-file, when size is not 1.
+   is the same as that of fread() implementations in common libraries. This
+   could result in data loss if used with size != 1 when reading a concurrently
+   written file or a non-blocking file. In that case, use size == 1 or gzread()
+   instead.
 */
 
 ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len);
 /*
      Compress and write the len uncompressed bytes at buf to file. gzwrite
-   returns the number of uncompressed bytes written or 0 in case of error.
+   returns the number of uncompressed bytes written, or 0 in case of error or
+   if len is 0.  If the write destination is non-blocking, then gzwrite() may
+   return a number of bytes written that is not 0 and less than len.
+
+     If len does not fit in an int, then 0 is returned and nothing is written.
 */
 
 ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,
@@ -1490,9 +1562,18 @@ ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,
    if there was an error.  If the multiplication of size and nitems overflows,
    i.e. the product does not fit in a z_size_t, then nothing is written, zero
    is returned, and the error state is set to Z_STREAM_ERROR.
+
+     If writing a concurrently read file or a non-blocking file with size != 1,
+   a partial item could be written, with no way of knowing how much of it was
+   not written, resulting in data loss.  In that case, use size == 1 or
+   gzwrite() instead.
 */
 
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
 ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);
+#else
+ZEXTERN int ZEXPORTVA gzprintf();
+#endif
 /*
      Convert, format, compress, and write the arguments (...) to file under
    control of the string format, as in fprintf.  gzprintf returns the number of
@@ -1500,11 +1581,19 @@ ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);
    of error.  The number of uncompressed bytes written is limited to 8191, or
    one less than the buffer size given to gzbuffer().  The caller should assure
    that this limit is not exceeded.  If it is exceeded, then gzprintf() will
-   return an error (0) with nothing written.  In this case, there may also be a
-   buffer overflow with unpredictable consequences, which is possible only if
-   zlib was compiled with the insecure functions sprintf() or vsprintf(),
-   because the secure snprintf() or vsnprintf() functions were not available.
-   This can be determined using zlibCompileFlags().
+   return an error (0) with nothing written.
+
+     In that last case, there may also be a buffer overflow with unpredictable
+   consequences, which is possible only if zlib was compiled with the insecure
+   functions sprintf() or vsprintf(), because the secure snprintf() and
+   vsnprintf() functions were not available. That would only be the case for
+   a non-ANSI C compiler. zlib may have been built without gzprintf() because
+   secure functions were not available and having gzprintf() be insecure was
+   not an option, in which case, gzprintf() returns Z_STREAM_ERROR. All of
+   these possibilities can be determined using zlibCompileFlags().
+
+     If a Z_BUF_ERROR is returned, then nothing was written due to a stall on
+   the non-blocking write destination.
 */
 
 ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s);
@@ -1513,6 +1602,11 @@ ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s);
    the terminating null character.
 
      gzputs returns the number of characters written, or -1 in case of error.
+   The number of characters written may be less than the length of the string
+   if the write destination is non-blocking.
+
+     If the length of the string does not fit in an int, then -1 is returned
+   and nothing is written.
 */
 
 ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
@@ -1525,8 +1619,13 @@ ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
    left untouched.
 
      gzgets returns buf which is a null-terminated string, or it returns NULL
-   for end-of-file or in case of error.  If there was an error, the contents at
-   buf are indeterminate.
+   for end-of-file or in case of error. If some data was read before an error,
+   then that data is returned until exhausted, after which the next call will
+   return NULL to signal the error.
+
+     gzgets can be used on a file being concurrently written, and on a non-
+   blocking device, both as for gzread(). However lines may be broken in the
+   middle, leaving it up to the application to reassemble them as needed.
 */
 
 ZEXTERN int ZEXPORT gzputc(gzFile file, int c);
@@ -1537,11 +1636,19 @@ ZEXTERN int ZEXPORT gzputc(gzFile file, int c);
 
 ZEXTERN int ZEXPORT gzgetc(gzFile file);
 /*
-     Read and decompress one byte from file.  gzgetc returns this byte or -1
-   in case of end of file or error.  This is implemented as a macro for speed.
-   As such, it does not do all of the checking the other functions do.  I.e.
-   it does not check to see if file is NULL, nor whether the structure file
-   points to has been clobbered or not.
+     Read and decompress one byte from file. gzgetc returns this byte or -1 in
+   case of end of file or error. If some data was read before an error, then
+   that data is returned until exhausted, after which the next call will return
+   -1 to signal the error.
+
+     This is implemented as a macro for speed. As such, it does not do all of
+   the checking the other functions do. I.e. it does not check to see if file
+   is NULL, nor whether the structure file points to has been clobbered or not.
+
+     gzgetc can be used to read a gzip file on a non-blocking device. If the
+   input stalls and there is no uncompressed data to return, then gzgetc() will
+   return -1, and errno will be EAGAIN or EWOULDBLOCK. gzread() can then be
+   called again.
 */
 
 ZEXTERN int ZEXPORT gzungetc(int c, gzFile file);
@@ -1554,6 +1661,11 @@ ZEXTERN int ZEXPORT gzungetc(int c, gzFile file);
    output buffer size of pushed characters is allowed.  (See gzbuffer above.)
    The pushed character will be discarded if the stream is repositioned with
    gzseek() or gzrewind().
+
+     gzungetc(-1, file) will force any pending seek to execute. Then gztell()
+   will report the position, even if the requested seek reached end of file.
+   This can be used to determine the number of uncompressed bytes in a gzip
+   file without having to read it into a buffer.
 */
 
 ZEXTERN int ZEXPORT gzflush(gzFile file, int flush);
@@ -1583,7 +1695,8 @@ ZEXTERN z_off_t ZEXPORT gzseek(gzFile file,
      If the file is opened for reading, this function is emulated but can be
    extremely slow.  If the file is opened for writing, only forward seeks are
    supported; gzseek then compresses a sequence of zeroes up to the new
-   starting position.
+   starting position. For reading or writing, any actual seeking is deferred
+   until the next read or write operation, or close operation when writing.
 
      gzseek returns the resulting offset location as measured in bytes from
    the beginning of the uncompressed stream, or -1 in case of error, in
@@ -1591,7 +1704,7 @@ ZEXTERN z_off_t ZEXPORT gzseek(gzFile file,
    would be before the current position.
 */
 
-ZEXTERN int ZEXPORT    gzrewind(gzFile file);
+ZEXTERN int ZEXPORT gzrewind(gzFile file);
 /*
      Rewind file. This function is supported only for reading.
 
@@ -1599,7 +1712,7 @@ ZEXTERN int ZEXPORT    gzrewind(gzFile file);
 */
 
 /*
-ZEXTERN z_off_t ZEXPORT    gztell(gzFile file);
+ZEXTERN z_off_t ZEXPORT gztell(gzFile file);
 
      Return the starting position for the next gzread or gzwrite on file.
    This position represents a number of bytes in the uncompressed data stream,
@@ -1644,8 +1757,11 @@ ZEXTERN int ZEXPORT gzdirect(gzFile file);
 
      If gzdirect() is used immediately after gzopen() or gzdopen() it will
    cause buffers to be allocated to allow reading the file to determine if it
-   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
-   gzdirect().
+   is a gzip file. Therefore if gzbuffer() is used, it should be called before
+   gzdirect(). If the input is being written concurrently or the device is non-
+   blocking, then gzdirect() may give a different answer once four bytes of
+   input have been accumulated, which is what is needed to confirm or deny a
+   gzip header. Before this, gzdirect() will return true (1).
 
      When writing, gzdirect() returns true (1) if transparent writing was
    requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
@@ -1655,7 +1771,7 @@ ZEXTERN int ZEXPORT gzdirect(gzFile file);
    gzip file reading and decompression, which may not be desired.)
 */
 
-ZEXTERN int ZEXPORT    gzclose(gzFile file);
+ZEXTERN int ZEXPORT gzclose(gzFile file);
 /*
      Flush all pending output for file, if necessary, close file and
    deallocate the (de)compression state.  Note that once file is closed, you
@@ -1683,9 +1799,10 @@ ZEXTERN int ZEXPORT gzclose_w(gzFile file);
 ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
 /*
      Return the error message for the last error which occurred on file.
-   errnum is set to zlib error number.  If an error occurred in the file system
-   and not in the compression library, errnum is set to Z_ERRNO and the
-   application may consult errno to get the exact error code.
+   If errnum is not NULL, *errnum is set to zlib error number.  If an error
+   occurred in the file system and not in the compression library, *errnum is
+   set to Z_ERRNO and the application may consult errno to get the exact error
+   code.
 
      The application must not modify the returned string.  Future calls to
    this function may invalidate the previously returned string.  If file is
@@ -1736,7 +1853,8 @@ ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
 ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,
                                 z_size_t len);
 /*
-     Same as adler32(), but with a size_t length.
+     Same as adler32(), but with a size_t length.  Note that a long is 32 bits
+   on Windows.
 */
 
 /*
@@ -1772,7 +1890,8 @@ ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
 ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,
                               z_size_t len);
 /*
-     Same as crc32(), but with a size_t length.
+     Same as crc32(), but with a size_t length.  Note that a long is 32 bits on
+   Windows.
 */
 
 /*
@@ -1782,14 +1901,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
    seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
    calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
    check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
-   len2. len2 must be non-negative.
+   len2. len2 must be non-negative, otherwise zero is returned.
 */
 
 /*
 ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
 
      Return the operator corresponding to length len2, to be used with
-   crc32_combine_op(). len2 must be non-negative.
+   crc32_combine_op(). len2 must be non-negative, otherwise zero is returned.
 */
 
 ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
@@ -1912,9 +2031,9 @@ ZEXTERN int ZEXPORT gzgetc_(gzFile file);       /* backward compatibility */
      ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int);
      ZEXTERN z_off_t ZEXPORT gztell64(gzFile);
      ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile);
-     ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
-     ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
-     ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
+     ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
+     ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
+     ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
 #  endif
 #else
    ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *);
diff --git a/src/java.base/share/native/libzip/zlib/zutil.c b/src/java.base/share/native/libzip/zlib/zutil.c
index 92dda78497b..c57c162ffde 100644
--- a/src/java.base/share/native/libzip/zlib/zutil.c
+++ b/src/java.base/share/native/libzip/zlib/zutil.c
@@ -23,7 +23,7 @@
  */
 
 /* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2017 Jean-loup Gailly
+ * Copyright (C) 1995-2026 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -110,28 +110,36 @@ uLong ZEXPORT zlibCompileFlags(void) {
     flags += 1L << 21;
 #endif
 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
-#  ifdef NO_vsnprintf
-    flags += 1L << 25;
-#    ifdef HAS_vsprintf_void
-    flags += 1L << 26;
-#    endif
-#  else
-#    ifdef HAS_vsnprintf_void
-    flags += 1L << 26;
-#    endif
-#  endif
+#   ifdef NO_vsnprintf
+#       ifdef ZLIB_INSECURE
+            flags += 1L << 25;
+#       else
+            flags += 1L << 27;
+#       endif
+#       ifdef HAS_vsprintf_void
+            flags += 1L << 26;
+#       endif
+#   else
+#       ifdef HAS_vsnprintf_void
+            flags += 1L << 26;
+#       endif
+#   endif
 #else
     flags += 1L << 24;
-#  ifdef NO_snprintf
-    flags += 1L << 25;
-#    ifdef HAS_sprintf_void
-    flags += 1L << 26;
-#    endif
-#  else
-#    ifdef HAS_snprintf_void
-    flags += 1L << 26;
-#    endif
-#  endif
+#   ifdef NO_snprintf
+#       ifdef ZLIB_INSECURE
+            flags += 1L << 25;
+#       else
+            flags += 1L << 27;
+#       endif
+#       ifdef HAS_sprintf_void
+            flags += 1L << 26;
+#       endif
+#   else
+#       ifdef HAS_snprintf_void
+            flags += 1L << 26;
+#       endif
+#   endif
 #endif
     return flags;
 }
@@ -166,28 +174,34 @@ const char * ZEXPORT zError(int err) {
 
 #ifndef HAVE_MEMCPY
 
-void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) {
-    if (len == 0) return;
-    do {
-        *dest++ = *source++; /* ??? to be unrolled */
-    } while (--len != 0);
+void ZLIB_INTERNAL zmemcpy(void FAR *dst, const void FAR *src, z_size_t n) {
+    uchf *p = dst;
+    const uchf *q = src;
+    while (n) {
+        *p++ = *q++;
+        n--;
+    }
 }
 
-int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) {
-    uInt j;
-
-    for (j = 0; j < len; j++) {
-        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+int ZLIB_INTERNAL zmemcmp(const void FAR *s1, const void FAR *s2, z_size_t n) {
+    const uchf *p = s1, *q = s2;
+    while (n) {
+        if (*p++ != *q++)
+            return (int)p[-1] - (int)q[-1];
+        n--;
     }
     return 0;
 }
 
-void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) {
+void ZLIB_INTERNAL zmemzero(void FAR *b, z_size_t len) {
+    uchf *p = b;
     if (len == 0) return;
-    do {
-        *dest++ = 0;  /* ??? to be unrolled */
-    } while (--len != 0);
+    while (len) {
+        *p++ = 0;
+        len--;
+    }
 }
+
 #endif
 
 #ifndef Z_SOLO
diff --git a/src/java.base/share/native/libzip/zlib/zutil.h b/src/java.base/share/native/libzip/zlib/zutil.h
index 2b7e697bef9..b337065875d 100644
--- a/src/java.base/share/native/libzip/zlib/zutil.h
+++ b/src/java.base/share/native/libzip/zlib/zutil.h
@@ -23,7 +23,7 @@
  */
 
 /* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
+ * Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -60,6 +60,10 @@
    define "local" for the non-static meaning of "static", for readability
    (compile with -Dlocal if your debugger can't find static symbols) */
 
+extern const char deflate_copyright[];
+extern const char inflate_copyright[];
+extern const char inflate9_copyright[];
+
 typedef unsigned char  uch;
 typedef uch FAR uchf;
 typedef unsigned short ush;
@@ -72,6 +76,8 @@ typedef unsigned long  ulg;
 #    define Z_U8 unsigned long
 #  elif (ULLONG_MAX == 0xffffffffffffffff)
 #    define Z_U8 unsigned long long
+#  elif (ULONG_LONG_MAX == 0xffffffffffffffff)
+#    define Z_U8 unsigned long long
 #  elif (UINT_MAX == 0xffffffffffffffff)
 #    define Z_U8 unsigned
 #  endif
@@ -87,7 +93,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 /* To be used only when the state is known to be valid */
 
         /* common constants */
-
+#if MAX_WBITS < 9 || MAX_WBITS > 15
+#  error MAX_WBITS must be in 9..15
+#endif
 #ifndef DEF_WBITS
 #  define DEF_WBITS MAX_WBITS
 #endif
@@ -165,7 +173,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #  define OS_CODE  7
 #endif
 
-#ifdef __acorn
+#if defined(__acorn) || defined(__riscos)
 #  define OS_CODE 13
 #endif
 
@@ -192,11 +200,10 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #endif
 
 /* provide prototypes for these when building zlib without LFS */
-#if !defined(_WIN32) && \
-    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
-    ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
-    ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
-    ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
+#ifndef Z_LARGE64
+   ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
+   ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
+   ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
 #endif
 
         /* common defaults */
@@ -235,9 +242,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #    define zmemzero(dest, len) memset(dest, 0, len)
 #  endif
 #else
-   void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len);
-   int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len);
-   void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len);
+   void ZLIB_INTERNAL zmemcpy(void FAR *, const void FAR *, z_size_t);
+   int ZLIB_INTERNAL zmemcmp(const void FAR *, const void FAR *, z_size_t);
+   void ZLIB_INTERNAL zmemzero(void FAR *, z_size_t);
 #endif
 
 /* Diagnostic functions */
@@ -275,4 +282,74 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
                     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
 
+#ifdef Z_ONCE
+/*
+  Create a local z_once() function depending on the availability of atomics.
+ */
+
+/* Check for the availability of atomics. */
+#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \
+    !defined(__STDC_NO_ATOMICS__)
+
+#include 
+typedef struct {
+    atomic_flag begun;
+    atomic_int done;
+} z_once_t;
+#define Z_ONCE_INIT {ATOMIC_FLAG_INIT, 0}
+
+/*
+  Run the provided init() function exactly once, even if multiple threads
+  invoke once() at the same time. The state must be a once_t initialized with
+  Z_ONCE_INIT.
+ */
+local void z_once(z_once_t *state, void (*init)(void)) {
+    if (!atomic_load(&state->done)) {
+        if (atomic_flag_test_and_set(&state->begun))
+            while (!atomic_load(&state->done))
+                ;
+        else {
+            init();
+            atomic_store(&state->done, 1);
+        }
+    }
+}
+
+#else   /* no atomics */
+
+#warning zlib not thread-safe
+
+typedef struct z_once_s {
+    volatile int begun;
+    volatile int done;
+} z_once_t;
+#define Z_ONCE_INIT {0, 0}
+
+/* Test and set. Alas, not atomic, but tries to limit the period of
+   vulnerability. */
+local int test_and_set(int volatile *flag) {
+    int was;
+
+    was = *flag;
+    *flag = 1;
+    return was;
+}
+
+/* Run the provided init() function once. This is not thread-safe. */
+local void z_once(z_once_t *state, void (*init)(void)) {
+    if (!state->done) {
+        if (test_and_set(&state->begun))
+            while (!state->done)
+                ;
+        else {
+            init();
+            state->done = 1;
+        }
+    }
+}
+
+#endif /* ?atomics */
+
+#endif /* Z_ONCE */
+
 #endif /* ZUTIL_H */
diff --git a/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java b/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java
index 77dc1851478..2d72aeb2ee9 100644
--- a/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java
+++ b/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2026, 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,7 +47,8 @@ class UnixNativeDispatcher {
                 return buffer;
         }
         NativeBuffers.copyCStringToNativeBuffer(cstr, buffer);
-        buffer.setOwner(path);
+        if (!Thread.currentThread().isVirtual())
+            buffer.setOwner(path);
         return buffer;
     }
 
diff --git a/src/java.base/windows/classes/java/lang/ProcessImpl.java b/src/java.base/windows/classes/java/lang/ProcessImpl.java
index 1a08aca52e9..26d7afc5363 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, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2026, 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
@@ -119,6 +119,12 @@ final class ProcessImpl extends Process {
                     stdHandles[1] = -1L;
                 } else if (redirects[1] == Redirect.INHERIT) {
                     stdHandles[1] = fdAccess.getHandle(FileDescriptor.out);
+                    if (stdHandles[1] == -1L) {
+                        // FileDescriptor.out has been closed.
+                        f1 = newFileOutputStream(Redirect.DISCARD.file(),
+                                                 Redirect.DISCARD.append());
+                        stdHandles[1] = fdAccess.getHandle(f1.getFD());
+                    }
                 } else if (redirects[1] instanceof ProcessBuilder.RedirectPipeImpl) {
                     stdHandles[1] = fdAccess.getHandle(((ProcessBuilder.RedirectPipeImpl) redirects[1]).getFd());
                     // Force getInputStream to return a null stream,
@@ -134,6 +140,12 @@ final class ProcessImpl extends Process {
                     stdHandles[2] = -1L;
                 } else if (redirects[2] == Redirect.INHERIT) {
                     stdHandles[2] = fdAccess.getHandle(FileDescriptor.err);
+                    if (stdHandles[2] == -1L) {
+                        // FileDescriptor.err has been closed.
+                        f2 = newFileOutputStream(Redirect.DISCARD.file(),
+                                                 Redirect.DISCARD.append());
+                        stdHandles[2] = fdAccess.getHandle(f2.getFD());
+                    }
                 } else if (redirects[2] instanceof ProcessBuilder.RedirectPipeImpl) {
                     stdHandles[2] = fdAccess.getHandle(((ProcessBuilder.RedirectPipeImpl) redirects[2]).getFd());
                 } else {
diff --git a/src/java.base/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java b/src/java.base/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java
index 8e351b7e0ef..ba1b7b1aa9f 100644
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsNativeDispatcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2026, 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
@@ -1085,7 +1085,8 @@ class WindowsNativeDispatcher {
         unsafe.copyMemory(chars, Unsafe.ARRAY_CHAR_BASE_OFFSET, null,
             buffer.address(), (long)stringLengthInBytes);
         unsafe.putChar(buffer.address() + stringLengthInBytes, (char)0);
-        buffer.setOwner(s);
+        if (!Thread.currentThread().isVirtual())
+            buffer.setOwner(s);
         return buffer;
     }
 
diff --git a/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java b/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java
index d1b747a8f30..418cace016e 100644
--- a/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java
+++ b/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2026, 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,11 +59,10 @@ import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
-import java.util.IdentityHashMap;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
-import sun.awt.AppContext;
+import java.util.Set;
 import sun.awt.SunToolkit;
 
 final class _AppEventHandler {
@@ -480,26 +479,22 @@ final class _AppEventHandler {
     }
 
     abstract static class _AppEventMultiplexor {
-        private final Map listenerToAppContext =
-                new IdentityHashMap();
+        private final Set listeners = new HashSet();
         boolean nativeListenerRegistered;
 
         // called from AppKit Thread-0
         void dispatch(final _NativeEvent event, final Object... args) {
-            // grab a local ref to the listeners and its contexts as an array of the map's entries
-            final ArrayList> localEntries;
+            // grab a local ref to the listeners as an array
+            final ArrayList localList;
             synchronized (this) {
-                if (listenerToAppContext.size() == 0) {
+                if (listeners.size() == 0) {
                     return;
                 }
-                localEntries = new ArrayList>(listenerToAppContext.size());
-                localEntries.addAll(listenerToAppContext.entrySet());
+                localList = new ArrayList(listeners.size());
+                localList.addAll(listeners);
             }
-
-            for (final Map.Entry e : localEntries) {
-                final L listener = e.getKey();
-                final AppContext listenerContext = e.getValue();
-                SunToolkit.invokeLaterOnAppContext(listenerContext, new Runnable() {
+            for (final L listener : localList) {
+                SunToolkit.invokeLater(new Runnable() {
                     public void run() {
                         performOnListener(listener, event);
                     }
@@ -508,7 +503,7 @@ final class _AppEventHandler {
         }
 
         synchronized void addListener(final L listener) {
-            setListenerContext(listener, AppContext.getAppContext());
+            listeners.add(listener);
 
             if (!nativeListenerRegistered) {
                 registerNativeListener();
@@ -517,19 +512,11 @@ final class _AppEventHandler {
         }
 
         synchronized void removeListener(final L listener) {
-            listenerToAppContext.remove(listener);
+            listeners.remove(listener);
         }
 
         abstract void performOnListener(L listener, final _NativeEvent event);
         void registerNativeListener() { }
-
-        private void setListenerContext(L listener, AppContext listenerContext) {
-            if (listenerContext == null) {
-                throw new RuntimeException(
-                        "Attempting to add a listener from a thread group without AppContext");
-            }
-            listenerToAppContext.put(listener, AppContext.getAppContext());
-        }
     }
 
     abstract static class _BooleanAppEventMultiplexor extends _AppEventMultiplexor {
@@ -561,22 +548,19 @@ final class _AppEventHandler {
      */
     abstract static class _AppEventDispatcher {
         H _handler;
-        AppContext handlerContext;
 
         // called from AppKit Thread-0
         void dispatch(final _NativeEvent event) {
             // grab a local ref to the handler
             final H localHandler;
-            final AppContext localHandlerContext;
             synchronized (_AppEventDispatcher.this) {
                 localHandler = _handler;
-                localHandlerContext = handlerContext;
             }
 
             if (localHandler == null) {
                 performDefaultAction(event);
             } else {
-                SunToolkit.invokeLaterOnAppContext(localHandlerContext, new Runnable() {
+                SunToolkit.invokeLater(new Runnable() {
                     public void run() {
                         performUsing(localHandler, event);
                     }
@@ -586,22 +570,10 @@ final class _AppEventHandler {
 
         synchronized void setHandler(final H handler) {
             this._handler = handler;
-
-            setHandlerContext(AppContext.getAppContext());
-
         }
 
         void performDefaultAction(final _NativeEvent event) { } // by default, do nothing
         abstract void performUsing(final H handler, final _NativeEvent event);
-
-        protected void setHandlerContext(AppContext ctx) {
-            if (ctx == null) {
-                throw new RuntimeException(
-                        "Attempting to set a handler from a thread group without AppContext");
-            }
-
-            handlerContext = ctx;
-        }
     }
 
     abstract static class _QueuingAppEventDispatcher extends _AppEventDispatcher {
@@ -624,8 +596,6 @@ final class _AppEventHandler {
         synchronized void setHandler(final H handler) {
             this._handler = handler;
 
-            setHandlerContext(AppContext.getAppContext());
-
             // dispatch any events in the queue
             if (queuedEvents != null) {
                 // grab a local ref to the queue, so the real one can be nulled out
diff --git a/src/java.desktop/macosx/classes/sun/font/CStrike.java b/src/java.desktop/macosx/classes/sun/font/CStrike.java
index bffb76fb1ad..f7fa00070ff 100644
--- a/src/java.desktop/macosx/classes/sun/font/CStrike.java
+++ b/src/java.desktop/macosx/classes/sun/font/CStrike.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2026, 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
@@ -174,7 +174,19 @@ public final class CStrike extends PhysicalStrike {
 
     @Override
     Point2D.Float getGlyphMetrics(final int glyphCode) {
-        return new Point2D.Float(getGlyphAdvance(glyphCode), 0.0f);
+        Point2D.Float metrics = new Point2D.Float();
+        long glyphPtr = getGlyphImagePtr(glyphCode);
+        if (glyphPtr != 0L) {
+            metrics.x = StrikeCache.getGlyphXAdvance(glyphPtr);
+            metrics.y = StrikeCache.getGlyphYAdvance(glyphPtr);
+            /* advance is currently in device space, need to convert back
+             * into user space.
+             * This must not include the translation component. */
+            if (invDevTx != null) {
+                invDevTx.deltaTransform(metrics, metrics);
+            }
+        }
+        return metrics;
     }
 
     @Override
diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java b/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java
index 287de9e1801..0b5e37c5ce5 100644
--- a/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java
+++ b/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2026, 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
@@ -157,11 +157,6 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
         while (getRunState() < STATE_SHUTDOWN) {
             try {
                 platformRunMessage();
-                if (Thread.currentThread().isInterrupted()) {
-                    if (AppContext.getAppContext().isDisposed()) {
-                        break;
-                    }
-                }
             } catch (Throwable t) {
                 // TODO: log
                 System.err.println("Exception on the toolkit thread");
@@ -456,7 +451,7 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
     public abstract LWCursorManager getCursorManager();
 
     public static void postEvent(AWTEvent event) {
-        postEvent(targetToAppContext(event.getSource()), event);
+        SunToolkit.postEvent(event);
     }
 
     @Override
diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java
index 11099f6a8e6..634f578df02 100644
--- a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java
+++ b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2026, 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,6 @@ import javax.swing.JComponent;
 
 import sun.awt.AWTAccessor;
 import sun.awt.AWTAccessor.ComponentAccessor;
-import sun.awt.AppContext;
 import sun.awt.CGraphicsDevice;
 import sun.awt.DisplayChangedListener;
 import sun.awt.ExtendedKeyCodes;
@@ -1236,9 +1235,7 @@ public class LWWindowPeer
             return false;
         }
 
-        AppContext targetAppContext = AWTAccessor.getComponentAccessor().getAppContext(getTarget());
-        KeyboardFocusManager kfm = AWTAccessor.getKeyboardFocusManagerAccessor()
-                .getCurrentKeyboardFocusManager(targetAppContext);
+        KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
         Window currentActive = kfm.getActiveWindow();
 
 
diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java
index 4947d1a109e..494995735e6 100644
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2026, 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
@@ -1030,13 +1030,19 @@ final class CAccessibility implements PropertyChangeListener {
             }
 
             if (!allowIgnored) {
-                final AccessibleRole role = context.getAccessibleRole();
-                if (role != null && ignoredRoles != null && ignoredRoles.contains(roleKey(role))) {
-                    // Get the child's unignored children.
-                    _addChildren(child, whichChildren, false, childrenAndRoles, ChildrenOperations.COMMON);
-                } else {
-                    childrenAndRoles.add(child);
-                    childrenAndRoles.add(getAccessibleRole(child));
+                // If a Component isn't showing then it should be classified as
+                // "ignored", and we should skip it and its descendants
+                if (isShowing(context)) {
+                    final AccessibleRole role = context.getAccessibleRole();
+                    if (role != null && ignoredRoles != null &&
+                            ignoredRoles.contains(roleKey(role))) {
+                        // Get the child's unignored children.
+                        _addChildren(child, whichChildren, false,
+                                childrenAndRoles, ChildrenOperations.COMMON);
+                    } else {
+                        childrenAndRoles.add(child);
+                        childrenAndRoles.add(getAccessibleRole(child));
+                    }
                 }
             } else {
                 childrenAndRoles.add(child);
@@ -1050,6 +1056,46 @@ final class CAccessibility implements PropertyChangeListener {
         }
     }
 
+    /**
+     * Return false if an AccessibleContext is not showing
+     * 

+ * This first checks {@link AccessibleComponent#isShowing()}, if possible. + * If there is no AccessibleComponent then this checks the + * AccessibleStateSet for {@link AccessibleState#SHOWING}. If there is no + * AccessibleStateSet then we assume (given the lack of information) the + * AccessibleContext may be visible, and we recursive check its parent if + * possible. + * + * Return false if an AccessibleContext is not showing + */ + private static boolean isShowing(final AccessibleContext context) { + AccessibleComponent c = context.getAccessibleComponent(); + if (c != null) { + return c.isShowing(); + } + + AccessibleStateSet ass = context.getAccessibleStateSet(); + if (ass != null && ass.contains((AccessibleState.SHOWING))) { + return true; + } else { + // We don't have an AccessibleComponent. And either we don't + // have an AccessibleStateSet OR it doesn't include useful + // info to determine visibility/showing. So our status is + // unknown. When in doubt: assume we're showing and ask our + // parent if it is visible/showing. + } + + Accessible parent = context.getAccessibleParent(); + if (parent == null) { + return true; + } + AccessibleContext parentContext = parent.getAccessibleContext(); + if (parentContext == null) { + return true; + } + return isShowing(parentContext); + } + private static native String roleKey(AccessibleRole aRole); public static Object[] getChildren(final Accessible a, final Component c) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java index 30ed1d1bba0..492c32b9703 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ public final class CCheckboxMenuItem extends CMenuItem implements CheckboxMenuIt } }); ItemEvent event = new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED, target.getLabel(), state ? ItemEvent.SELECTED : ItemEvent.DESELECTED); - SunToolkit.postEvent(SunToolkit.targetToAppContext(getTarget()), event); + SunToolkit.postEvent(event); } public void setIsIndeterminate(final boolean indeterminate) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CClipboard.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CClipboard.java index c934ec3e234..c81d9f4fd3d 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CClipboard.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CClipboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -136,7 +136,7 @@ final class CClipboard extends SunClipboard { void checkPasteboardAndNotify() { if (checkPasteboardWithoutNotification()) { notifyChanged(); - lostOwnershipNow(null); + lostOwnershipNow(); } } diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java index 1eb896bf291..dd0ac6e64f7 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -450,7 +450,7 @@ public final class CInputMethod extends InputMethodAdapter { aString.length(), theCaret, theCaret); - LWCToolkit.postEvent(LWCToolkit.targetToAppContext(fAwtFocussedComponent), event); + LWCToolkit.postEvent(event); fCurrentText = null; fCurrentTextAsString = null; fCurrentTextLength = 0; @@ -563,7 +563,7 @@ public final class CInputMethod extends InputMethodAdapter { 0, theCaret, visiblePosition); - LWCToolkit.postEvent(LWCToolkit.targetToAppContext(fAwtFocussedComponent), event); + LWCToolkit.postEvent(event); if (pressAndHold) selectNextGlyph(); } @@ -583,7 +583,7 @@ public final class CInputMethod extends InputMethodAdapter { fCurrentTextLength, theCaret, visiblePosition); - LWCToolkit.postEvent(LWCToolkit.targetToAppContext(fAwtFocussedComponent), event); + LWCToolkit.postEvent(event); fCurrentText = null; fCurrentTextAsString = null; fCurrentTextLength = 0; diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java index c4b2640efb8..9e3fcdb0600 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -157,7 +157,7 @@ public class CMenuItem extends CMenuComponent implements MenuItemPeer { public void run() { final String cmd = ((MenuItem)getTarget()).getActionCommand(); final ActionEvent event = new ActionEvent(getTarget(), ActionEvent.ACTION_PERFORMED, cmd, when, modifiers); - SunToolkit.postEvent(SunToolkit.targetToAppContext(getTarget()), event); + SunToolkit.postEvent(event); } }); } diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java index 77639a262d5..a25b3177063 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -224,7 +224,7 @@ public final class CTrayIcon extends CFRetainedResource implements TrayIconPeer private void postEvent(final AWTEvent event) { SunToolkit.executeOnEventHandlerThread(target, new Runnable() { public void run() { - SunToolkit.postEvent(SunToolkit.targetToAppContext(target), event); + SunToolkit.postEvent(event); } }); } diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 0e5bfc44bc5..8dad6335548 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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,6 @@ import javax.swing.UIManager; import com.apple.laf.AquaMenuBarUI; import sun.awt.AWTAccessor; -import sun.awt.AppContext; import sun.awt.CGraphicsDevice; import sun.awt.LightweightFrame; import sun.awt.PlatformGraphicsInfo; @@ -700,10 +699,9 @@ public final class LWCToolkit extends LWToolkit { }, true); - AppContext appContext = SunToolkit.targetToAppContext(component); - SunToolkit.postEvent(appContext, invocationEvent); + SunToolkit.postEvent(invocationEvent); // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock - SunToolkit.flushPendingEvents(appContext); + SunToolkit.flushPendingEvents(); doAWTRunLoop(mediator, false); checkException(invocationEvent); @@ -715,10 +713,9 @@ public final class LWCToolkit extends LWToolkit { InvocationEvent invocationEvent = new InvocationEvent(component, event); - AppContext appContext = SunToolkit.targetToAppContext(component); - SunToolkit.postEvent(SunToolkit.targetToAppContext(component), invocationEvent); + SunToolkit.postEvent(invocationEvent); // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock - SunToolkit.flushPendingEvents(appContext); + SunToolkit.flushPendingEvents(); checkException(invocationEvent); } @@ -930,7 +927,6 @@ public final class LWCToolkit extends LWToolkit { @Override public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) { //TODO: FileDialog blocks excluded windows... - //TODO: Test: 2 file dialogs, separate AppContexts: a) Dialog 1 blocked, shouldn't be. Frame 4 blocked (shouldn't be). return (modalityType == null) || (modalityType == Dialog.ModalityType.MODELESS) || (modalityType == Dialog.ModalityType.DOCUMENT_MODAL) || diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m index e1841c9398c..460749c363d 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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,6 +120,7 @@ JNI_COCOA_ENTER(env); if (appURI == nil || [[urlToOpen absoluteString] containsString:[appURI absoluteString]] || [[defaultTerminalApp absoluteString] containsString:[appURI absoluteString]]) { + [urlToOpen release]; return -1; } // Additionally set forPrinting=TRUE for print @@ -129,6 +130,7 @@ JNI_COCOA_ENTER(env); } else if (action == sun_lwawt_macosx_CDesktopPeer_EDIT) { if (appURI == nil || [[urlToOpen absoluteString] containsString:[appURI absoluteString]]) { + [urlToOpen release]; return -1; } // for EDIT: if (defaultApp = TerminalApp) then set appURI = DefaultTextEditor @@ -156,6 +158,7 @@ JNI_COCOA_ENTER(env); dispatch_semaphore_wait(semaphore, timeout); + [urlToOpen release]; JNI_COCOA_EXIT(env); return status; } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m index 051588f95bf..fa534fff275 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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 @@ -270,7 +270,7 @@ JNI_COCOA_ENTER(env); NSRect fromRect = NSMakeRect(0, 0, sw, sh); NSRect toRect = NSMakeRect(0, 0, dw, dh); CImage_CopyNSImageIntoArray(img, dst, fromRect, toRect); - (*env)->ReleasePrimitiveArrayCritical(env, buffer, dst, JNI_ABORT); + (*env)->ReleasePrimitiveArrayCritical(env, buffer, dst, 0); } JNI_COCOA_EXIT(env); diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m index 4e2c1ace969..0f0a395c597 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 @@ -132,7 +132,7 @@ static jobject sAccessibilityClass = NULL; [rolesMap setObject:@"ImageAccessibility" forKey:@"icon"]; [rolesMap setObject:@"ImageAccessibility" forKey:@"desktopicon"]; [rolesMap setObject:@"SpinboxAccessibility" forKey:@"spinbox"]; - [rolesMap setObject:@"StaticTextAccessibility" forKey:@"hyperlink"]; + [rolesMap setObject:@"LinkAccessibility" forKey:@"hyperlink"]; [rolesMap setObject:@"StaticTextAccessibility" forKey:@"label"]; [rolesMap setObject:@"RadiobuttonAccessibility" forKey:@"radiobutton"]; [rolesMap setObject:@"CheckboxAccessibility" forKey:@"checkbox"]; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/LinkAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/LinkAccessibility.h new file mode 100644 index 00000000000..968e96cbb2d --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/LinkAccessibility.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2026, 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. + */ + +#ifndef LINK_ACCESSIBILITY +#define LINK_ACCESSIBILITY + +#import "CommonTextAccessibility.h" + +#import + + +@interface LinkAccessibility : CommonTextAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityAttributedStringForRange:(NSRange)range; +- (NSString * _Nullable)accessibilityValue; +- (NSRange)accessibilityVisibleCharacterRange; +@end +#endif diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/LinkAccessibility.m similarity index 50% rename from src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java rename to src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/LinkAccessibility.m index 667e4cd4a94..0de0237d03e 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/LinkAccessibility.m @@ -1,10 +1,12 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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. + * 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 @@ -19,42 +21,40 @@ * 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 sun.jvm.hotspot.oops; +#import "LinkAccessibility.h" -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; +@implementation LinkAccessibility -// Type entry used for return from a call. A single cell to record the -// type. -public class ReturnTypeEntry extends TypeEntries { - static final int cellCount = 1; - - ReturnTypeEntry(MethodDataInterface methodData, ProfileData pd, int baseOff) { - super(methodData, pd, baseOff); - } - - K type() { - return validKlass(baseOff); - } - - static int staticCellCount() { - return cellCount; - } - - int typeIndex() { - return baseOff; - } - - void printDataOn(PrintStream st) { - pd.tab(st); - printKlass(st, baseOff); - st.println(); - } +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityLinkRole; } + +- (NSString * _Nullable)accessibilityAttributedStringForRange:(NSRange)range +{ + return [self accessibilityStringForRangeAttribute:range]; +} + +- (NSString * _Nullable)accessibilityValue +{ + return [self accessibilityValueAttribute]; +} + +- (NSRange)accessibilityVisibleCharacterRange +{ + return [self accessibilityVisibleCharacterRangeAttribute]; +} + +- (NSRect)accessibilityFrame +{ + return [super accessibilityFrame]; +} + +- (id)accessibilityParent +{ + return [super accessibilityParent]; +} + +@end diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java index f9a1dd7bb50..d78bcb13577 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java @@ -36,8 +36,6 @@ import javax.swing.UIManager; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicRadioButtonUI; -import sun.awt.AppContext; - /** * RadioButtonUI implementation for MotifRadioButtonUI * @@ -45,7 +43,7 @@ import sun.awt.AppContext; */ public class MotifRadioButtonUI extends BasicRadioButtonUI { - private static final Object MOTIF_RADIO_BUTTON_UI_KEY = new Object(); + private static final ComponentUI UI = new MotifRadioButtonUI(); protected Color focusColor; @@ -55,14 +53,7 @@ public class MotifRadioButtonUI extends BasicRadioButtonUI { // Create PLAF // ******************************** public static ComponentUI createUI(JComponent c) { - AppContext appContext = AppContext.getAppContext(); - MotifRadioButtonUI motifRadioButtonUI = - (MotifRadioButtonUI) appContext.get(MOTIF_RADIO_BUTTON_UI_KEY); - if (motifRadioButtonUI == null) { - motifRadioButtonUI = new MotifRadioButtonUI(); - appContext.put(MOTIF_RADIO_BUTTON_UI_KEY, motifRadioButtonUI); - } - return motifRadioButtonUI; + return UI; } // ******************************** diff --git a/src/java.desktop/share/classes/java/awt/Color.java b/src/java.desktop/share/classes/java/awt/Color.java index 923afb91866..e129cbae23a 100644 --- a/src/java.desktop/share/classes/java/awt/Color.java +++ b/src/java.desktop/share/classes/java/awt/Color.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2026, 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 @@ -334,7 +334,7 @@ public class Color implements Paint, java.io.Serializable { * The actual color used in rendering depends * on finding the best match given the color space * available for a given output device. - * Alpha is defaulted to 255. + * Alpha defaults to 255. * * @throws IllegalArgumentException if {@code r}, {@code g} * or {@code b} are outside of the range @@ -378,12 +378,15 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates an opaque sRGB color with the specified combined RGB value - * consisting of the red component in bits 16-23, the green component - * in bits 8-15, and the blue component in bits 0-7. The actual color - * used in rendering depends on finding the best match given the - * color space available for a particular output device. Alpha is - * defaulted to 255. + * Creates an opaque sRGB color with the specified RGB value consisting of + *

    + *
  • the red component in bits 16-23, + *
  • the green component in bits 8-15, and + *
  • the blue component in bits 0-7. + *
+ * The actual color used in rendering depends on finding the best match + * given the color space available for a particular output device. Alpha + * defaults to 255. * * @param rgb the combined RGB components * @see java.awt.image.ColorModel#getRGBdefault @@ -397,14 +400,17 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates an sRGB color with the specified combined RGBA value consisting - * of the alpha component in bits 24-31, the red component in bits 16-23, - * the green component in bits 8-15, and the blue component in bits 0-7. - * If the {@code hasalpha} argument is {@code false}, alpha - * is defaulted to 255. + * Creates an sRGB color with the specified ARGB value consisting of + *
    + *
  • the alpha component in bits 24-31, + *
  • the red component in bits 16-23, + *
  • the green component in bits 8-15, and + *
  • the blue component in bits 0-7. + *
+ * If the {@code hasAlpha} argument is {@code false}, alpha defaults to 255. * - * @param rgba the combined RGBA components - * @param hasalpha {@code true} if the alpha bits are valid; + * @param argb the combined ARGB components + * @param hasAlpha {@code true} if the alpha bits are valid; * {@code false} otherwise * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed @@ -413,17 +419,17 @@ public class Color implements Paint, java.io.Serializable { * @see #getAlpha * @see #getRGB */ - public Color(int rgba, boolean hasalpha) { - if (hasalpha) { - value = rgba; + public Color(int argb, boolean hasAlpha) { + if (hasAlpha) { + value = argb; } else { - value = 0xff000000 | rgba; + value = 0xff000000 | argb; } } /** * Creates an opaque sRGB color with the specified red, green, and blue - * values in the range (0.0 - 1.0). Alpha is defaulted to 1.0. The + * values in the range (0.0 - 1.0). Alpha defaults to 1.0. The * actual color used in rendering depends on finding the best * match given the color space available for a particular output * device. @@ -570,9 +576,14 @@ public class Color implements Paint, java.io.Serializable { /** * Returns the RGB value representing the color in the default sRGB - * {@link ColorModel}. - * (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are - * blue). + * {@link ColorModel}, consisting of + *
    + *
  • the alpha component in bits 24-31, + *
  • the red component in bits 16-23, + *
  • the green component in bits 8-15, and + *
  • the blue component in bits 0-7. + *
+ * * @return the RGB value of the color in the default sRGB * {@code ColorModel}. * @see java.awt.image.ColorModel#getRGBdefault diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index e48255aaf00..7f021dcdb85 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2026, 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 @@ -7938,7 +7938,7 @@ public abstract class Component implements ImageObserver, MenuContainer, (this, temporary, focusedWindowChangeAllowed, time, cause); if (!success) { KeyboardFocusManager.getCurrentKeyboardFocusManager - (appContext).dequeueKeyEvents(time, this); + ().dequeueKeyEvents(time, this); if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Peer request failed"); } diff --git a/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java b/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java index 8ee336548d2..cf3c849829f 100644 --- a/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 +38,6 @@ import java.util.ListIterator; import java.util.Set; import sun.awt.AWTAccessor; -import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.TimedWindowEvent; import sun.util.logging.PlatformLogger; @@ -231,9 +230,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { @Serial private static final long serialVersionUID = -2924743257508701758L; - public DefaultKeyboardFocusManagerSentEvent(AWTEvent nested, - AppContext toNotify) { - super(nested, toNotify); + public DefaultKeyboardFocusManagerSentEvent(AWTEvent nested) { + super(nested); } public final void dispatch() { KeyboardFocusManager manager = @@ -260,76 +258,12 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * Sends a synthetic AWTEvent to a Component. If the Component is in - * the current AppContext, then the event is immediately dispatched. - * If the Component is in a different AppContext, then the event is - * posted to the other AppContext's EventQueue, and this method blocks - * until the event is handled or target AppContext is disposed. - * Returns true if successfully dispatched event, false if failed - * to dispatch. + * Sends a synthetic AWTEvent to a Component. */ static boolean sendMessage(Component target, AWTEvent e) { e.isPosted = true; - AppContext myAppContext = AppContext.getAppContext(); - final AppContext targetAppContext = target.appContext; - final SentEvent se = - new DefaultKeyboardFocusManagerSentEvent(e, myAppContext); - - if (myAppContext == targetAppContext) { - se.dispatch(); - } else { - if (targetAppContext.isDisposed()) { - return false; - } - SunToolkit.postEvent(targetAppContext, se); - if (EventQueue.isDispatchThread()) { - if (Thread.currentThread() instanceof EventDispatchThread) { - EventDispatchThread edt = (EventDispatchThread) - Thread.currentThread(); - edt.pumpEvents(SentEvent.ID, new Conditional() { - public boolean evaluate() { - return !se.dispatched && !targetAppContext.isDisposed(); - } - }); - } else { - if (fxAppThreadIsDispatchThread) { - Thread fxCheckDispatchThread = new Thread() { - @Override - public void run() { - while (!se.dispatched && !targetAppContext.isDisposed()) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - break; - } - } - } - }; - fxCheckDispatchThread.start(); - try { - // check if event is dispatched or disposed - // but since this user app thread is same as - // dispatch thread in fx when run with - // javafx.embed.singleThread=true - // we do not wait infinitely to avoid deadlock - // as dispatch will ultimately be done by this thread - fxCheckDispatchThread.join(500); - } catch (InterruptedException ex) { - } - } - } - } else { - synchronized (se) { - while (!se.dispatched && !targetAppContext.isDisposed()) { - try { - se.wait(1000); - } catch (InterruptedException ie) { - break; - } - } - } - } - } + final SentEvent se = new DefaultKeyboardFocusManagerSentEvent(e); + se.dispatch(); return se.dispatched; } @@ -356,7 +290,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { // Check that the component awaiting focus belongs to // the current focused window. See 8015454. if (toplevel != null && toplevel.isFocused()) { - SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e)); + SunToolkit.postEvent(new SequencedEvent(e)); return true; } } diff --git a/src/java.desktop/share/classes/java/awt/Font.java b/src/java.desktop/share/classes/java/awt/Font.java index 0614163fb7f..cb811d5d533 100644 --- a/src/java.desktop/share/classes/java/awt/Font.java +++ b/src/java.desktop/share/classes/java/awt/Font.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2026, 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 @@ -2709,7 +2709,7 @@ public class Font implements java.io.Serializable int limit, int flags) { - GlyphLayout gl = GlyphLayout.get(null); // !!! no custom layout engines + GlyphLayout gl = GlyphLayout.get(); StandardGlyphVector gv = gl.layout(this, frc, text, start, limit-start, flags, null); GlyphLayout.done(gl); diff --git a/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java b/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java index 348d0772cf4..06932d33f8a 100644 --- a/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java +++ b/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 +50,6 @@ import java.util.WeakHashMap; import sun.util.logging.PlatformLogger; -import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.KeyboardFocusManagerPeerProvider; import sun.awt.AWTAccessor; @@ -127,9 +126,6 @@ public abstract class KeyboardFocusManager public void setMostRecentFocusOwner(Window window, Component component) { KeyboardFocusManager.setMostRecentFocusOwner(window, component); } - public KeyboardFocusManager getCurrentKeyboardFocusManager(AppContext ctx) { - return KeyboardFocusManager.getCurrentKeyboardFocusManager(ctx); - } public Container getCurrentFocusCycleRoot() { return KeyboardFocusManager.currentFocusCycleRoot; } @@ -183,53 +179,40 @@ public abstract class KeyboardFocusManager static final int TRAVERSAL_KEY_LENGTH = DOWN_CYCLE_TRAVERSAL_KEYS + 1; + private static KeyboardFocusManager manager; + /** - * Returns the current KeyboardFocusManager instance for the calling - * thread's context. + * Returns the current KeyboardFocusManager instance * - * @return this thread's context's KeyboardFocusManager + * @return the current KeyboardFocusManager * @see #setCurrentKeyboardFocusManager */ - public static KeyboardFocusManager getCurrentKeyboardFocusManager() { - return getCurrentKeyboardFocusManager(AppContext.getAppContext()); - } - - static synchronized KeyboardFocusManager - getCurrentKeyboardFocusManager(AppContext appcontext) - { - KeyboardFocusManager manager = (KeyboardFocusManager) - appcontext.get(KeyboardFocusManager.class); + public static synchronized KeyboardFocusManager getCurrentKeyboardFocusManager() { if (manager == null) { manager = new DefaultKeyboardFocusManager(); - appcontext.put(KeyboardFocusManager.class, manager); } return manager; } /** - * Sets the current KeyboardFocusManager instance for the calling thread's - * context. If null is specified, then the current KeyboardFocusManager + * Sets the current KeyboardFocusManager instance. + * If null is specified, then the current KeyboardFocusManager * is replaced with a new instance of DefaultKeyboardFocusManager. * - * @param newManager the new KeyboardFocusManager for this thread's context + * @param newManager the new KeyboardFocusManager * @see #getCurrentKeyboardFocusManager * @see DefaultKeyboardFocusManager */ public static void setCurrentKeyboardFocusManager(KeyboardFocusManager newManager) { - KeyboardFocusManager oldManager = null; + KeyboardFocusManager oldManager = manager; + + if (newManager == null) { + newManager = new DefaultKeyboardFocusManager(); + } synchronized (KeyboardFocusManager.class) { - AppContext appcontext = AppContext.getAppContext(); - - if (newManager != null) { - oldManager = getCurrentKeyboardFocusManager(appcontext); - - appcontext.put(KeyboardFocusManager.class, newManager); - } else { - oldManager = getCurrentKeyboardFocusManager(appcontext); - appcontext.remove(KeyboardFocusManager.class); - } + manager = newManager; } if (oldManager != null) { @@ -344,7 +327,7 @@ public abstract class KeyboardFocusManager private static java.util.Map> mostRecentFocusOwners = new WeakHashMap<>(); /* - * SequencedEvent which is currently dispatched in AppContext. + * SequencedEvent which is currently dispatched. */ transient SequencedEvent currentSequencedEvent = null; @@ -431,13 +414,7 @@ public abstract class KeyboardFocusManager */ public Component getFocusOwner() { synchronized (KeyboardFocusManager.class) { - if (focusOwner == null) { - return null; - } - - return (focusOwner.appContext == AppContext.getAppContext()) - ? focusOwner - : null; + return focusOwner; } } @@ -599,42 +576,32 @@ public abstract class KeyboardFocusManager } /** - * Returns the permanent focus owner, if the permanent focus owner is in - * the same context as the calling thread. The permanent focus owner is + * Returns the permanent focus owner. The permanent focus owner is * defined as the last Component in an application to receive a permanent * FOCUS_GAINED event. The focus owner and permanent focus owner are * equivalent unless a temporary focus change is currently in effect. In * such a situation, the permanent focus owner will again be the focus * owner when the temporary focus change ends. * - * @return the permanent focus owner, or null if the permanent focus owner - * is not a member of the calling thread's context + * @return the permanent focus owner, or null if there is none * @see #getGlobalPermanentFocusOwner * @see #setGlobalPermanentFocusOwner */ public Component getPermanentFocusOwner() { synchronized (KeyboardFocusManager.class) { - if (permanentFocusOwner == null) { - return null; - } - - return (permanentFocusOwner.appContext == - AppContext.getAppContext()) - ? permanentFocusOwner - : null; + return permanentFocusOwner; } } /** - * Returns the permanent focus owner, even if the calling thread is in a - * different context than the permanent focus owner. The permanent focus + * Returns the permanent focus owner. The permanent focus * owner is defined as the last Component in an application to receive a * permanent FOCUS_GAINED event. The focus owner and permanent focus owner * are equivalent unless a temporary focus change is currently in effect. * In such a situation, the permanent focus owner will again be the focus * owner when the temporary focus change ends. * - * @return the permanent focus owner + * @return the permanent focus owner, or null if there is none * @see #getPermanentFocusOwner * @see #setGlobalPermanentFocusOwner */ @@ -701,24 +668,16 @@ public abstract class KeyboardFocusManager } /** - * Returns the focused Window, if the focused Window is in the same context - * as the calling thread. The focused Window is the Window that is or - * contains the focus owner. + * Returns the focused Window. + * The focused Window is the Window that is or contains the focus owner. * - * @return the focused Window, or null if the focused Window is not a - * member of the calling thread's context + * @return the focused Window, or null if there is none * @see #getGlobalFocusedWindow * @see #setGlobalFocusedWindow */ public Window getFocusedWindow() { synchronized (KeyboardFocusManager.class) { - if (focusedWindow == null) { - return null; - } - - return (focusedWindow.appContext == AppContext.getAppContext()) - ? focusedWindow - : null; + return focusedWindow; } } @@ -785,27 +744,19 @@ public abstract class KeyboardFocusManager } /** - * Returns the active Window, if the active Window is in the same context - * as the calling thread. Only a Frame or a Dialog can be the active + * Returns the active Window. Only a Frame or a Dialog can be the active * Window. The native windowing system may denote the active Window or its * children with special decorations, such as a highlighted title bar. * The active Window is always either the focused Window, or the first * Frame or Dialog that is an owner of the focused Window. * - * @return the active Window, or null if the active Window is not a member - * of the calling thread's context + * @return the active Window, or null if there is none * @see #getGlobalActiveWindow * @see #setGlobalActiveWindow */ public Window getActiveWindow() { synchronized (KeyboardFocusManager.class) { - if (activeWindow == null) { - return null; - } - - return (activeWindow.appContext == AppContext.getAppContext()) - ? activeWindow - : null; + return activeWindow; } } @@ -1100,14 +1051,7 @@ public abstract class KeyboardFocusManager */ public Container getCurrentFocusCycleRoot() { synchronized (KeyboardFocusManager.class) { - if (currentFocusCycleRoot == null) { - return null; - } - - return (currentFocusCycleRoot.appContext == - AppContext.getAppContext()) - ? currentFocusCycleRoot - : null; + return currentFocusCycleRoot; } } @@ -2159,7 +2103,7 @@ public abstract class KeyboardFocusManager descendant = heavyweight; } - KeyboardFocusManager manager = getCurrentKeyboardFocusManager(SunToolkit.targetToAppContext(descendant)); + KeyboardFocusManager manager = getCurrentKeyboardFocusManager(); FocusEvent currentFocusOwnerEvent = null; FocusEvent newFocusOwnerEvent = null; @@ -2268,8 +2212,7 @@ public abstract class KeyboardFocusManager descendant = heavyweight; } - KeyboardFocusManager manager = - getCurrentKeyboardFocusManager(SunToolkit.targetToAppContext(descendant)); + KeyboardFocusManager manager = getCurrentKeyboardFocusManager(); KeyboardFocusManager thisManager = getCurrentKeyboardFocusManager(); Component currentFocusOwner = thisManager.getGlobalFocusOwner(); Component nativeFocusOwner = thisManager.getNativeFocusOwner(); @@ -2484,16 +2427,6 @@ public abstract class KeyboardFocusManager KeyboardFocusManager manager = getCurrentKeyboardFocusManager(); LinkedList localLightweightRequests = null; - Component globalFocusOwner = manager.getGlobalFocusOwner(); - if ((globalFocusOwner != null) && - (globalFocusOwner.appContext != AppContext.getAppContext())) - { - // The current app context differs from the app context of a focus - // owner (and all pending lightweight requests), so we do nothing - // now and wait for a next event. - return; - } - synchronized(heavyweightRequests) { if (currentLightweightRequests != null) { clearingCurrentLightweightRequests = true; diff --git a/src/java.desktop/share/classes/java/awt/MediaTracker.java b/src/java.desktop/share/classes/java/awt/MediaTracker.java index f77816dc2e7..02310586c97 100644 --- a/src/java.desktop/share/classes/java/awt/MediaTracker.java +++ b/src/java.desktop/share/classes/java/awt/MediaTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2026, 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 @@ -184,7 +184,7 @@ public class MediaTracker implements java.io.Serializable { * @serial * @see #MediaTracker(Component) */ - Component target; + final Component target; /** * The head of the list of {@code Images} that is being * tracked by the {@code MediaTracker}. @@ -194,7 +194,7 @@ public class MediaTracker implements java.io.Serializable { * @see #removeImage(Image) */ @SuppressWarnings("serial") // Not statically typed as Serializable - MediaEntry head; + private MediaEntry head; /** * Use serialVersionUID from JDK 1.1 for interoperability. @@ -864,8 +864,8 @@ public class MediaTracker implements java.io.Serializable { } abstract class MediaEntry { - MediaTracker tracker; - int ID; + final MediaTracker tracker; + final int ID; MediaEntry next; int status; @@ -897,7 +897,7 @@ abstract class MediaEntry { return head; } - int getID() { + final int getID() { return ID; } @@ -935,12 +935,12 @@ abstract class MediaEntry { * The entry of the list of {@code Images} that is being tracked by the * {@code MediaTracker}. */ -class ImageMediaEntry extends MediaEntry implements ImageObserver, +final class ImageMediaEntry extends MediaEntry implements ImageObserver, java.io.Serializable { @SuppressWarnings("serial") // Not statically typed as Serializable - Image image; - int width; - int height; + final Image image; + final int width; + final int height; /** * Use serialVersionUID from JDK 1.1 for interoperability. @@ -959,10 +959,12 @@ java.io.Serializable { return (image == img && width == w && height == h); } + @Override Object getMedia() { return image; } + @Override synchronized int getStatus(boolean doLoad, boolean doVerify) { if (doVerify) { int flags = tracker.target.checkImage(image, width, height, null); @@ -978,6 +980,7 @@ java.io.Serializable { return super.getStatus(doLoad, doVerify); } + @Override void startLoad() { if (tracker.target.prepareImage(image, width, height, this)) { setStatus(COMPLETE); @@ -995,6 +998,7 @@ java.io.Serializable { return 0; } + @Override public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { if (cancelled) { diff --git a/src/java.desktop/share/classes/java/awt/MenuComponent.java b/src/java.desktop/share/classes/java/awt/MenuComponent.java index 1391a397f82..88ebbed96da 100644 --- a/src/java.desktop/share/classes/java/awt/MenuComponent.java +++ b/src/java.desktop/share/classes/java/awt/MenuComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2026, 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,7 +40,6 @@ import javax.accessibility.AccessibleState; import javax.accessibility.AccessibleStateSet; import sun.awt.AWTAccessor; -import sun.awt.AppContext; import sun.awt.ComponentFactory; /** @@ -60,12 +59,6 @@ public abstract class MenuComponent implements java.io.Serializable { transient volatile MenuComponentPeer peer; transient volatile MenuContainer parent; - /** - * The {@code AppContext} of the {@code MenuComponent}. - * This is set in the constructor and never changes. - */ - private transient volatile AppContext appContext; - /** * The menu component's font. This value can be * {@code null} at which point a default will be used. @@ -116,15 +109,6 @@ public abstract class MenuComponent implements java.io.Serializable { static { AWTAccessor.setMenuComponentAccessor( new AWTAccessor.MenuComponentAccessor() { - @Override - public AppContext getAppContext(MenuComponent menuComp) { - return menuComp.appContext; - } - @Override - public void setAppContext(MenuComponent menuComp, - AppContext appContext) { - menuComp.appContext = appContext; - } @Override @SuppressWarnings("unchecked") public T getPeer(MenuComponent menuComp) { @@ -154,7 +138,6 @@ public abstract class MenuComponent implements java.io.Serializable { */ public MenuComponent() throws HeadlessException { GraphicsEnvironment.checkHeadless(); - appContext = AppContext.getAppContext(); } /** @@ -428,8 +411,6 @@ public abstract class MenuComponent implements java.io.Serializable { GraphicsEnvironment.checkHeadless(); s.defaultReadObject(); - - appContext = AppContext.getAppContext(); } /* diff --git a/src/java.desktop/share/classes/java/awt/ModalEventFilter.java b/src/java.desktop/share/classes/java/awt/ModalEventFilter.java index 7941be89743..93956c34fc5 100644 --- a/src/java.desktop/share/classes/java/awt/ModalEventFilter.java +++ b/src/java.desktop/share/classes/java/awt/ModalEventFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,8 +26,6 @@ package java.awt; import java.awt.event.*; -import sun.awt.AppContext; - abstract class ModalEventFilter implements EventFilter { protected Dialog modalDialog; @@ -129,20 +127,14 @@ abstract class ModalEventFilter implements EventFilter { private static class ToolkitModalEventFilter extends ModalEventFilter { - private AppContext appContext; - ToolkitModalEventFilter(Dialog modalDialog) { super(modalDialog); - appContext = modalDialog.appContext; } protected FilterAction acceptWindow(Window w) { if (w.isModalExcluded(Dialog.ModalExclusionType.TOOLKIT_EXCLUDE)) { return FilterAction.ACCEPT; } - if (w.appContext != appContext) { - return FilterAction.REJECT; - } while (w != null) { if (w == modalDialog) { return FilterAction.ACCEPT_IMMEDIATELY; @@ -155,27 +147,21 @@ abstract class ModalEventFilter implements EventFilter { private static class ApplicationModalEventFilter extends ModalEventFilter { - private AppContext appContext; - ApplicationModalEventFilter(Dialog modalDialog) { super(modalDialog); - appContext = modalDialog.appContext; } protected FilterAction acceptWindow(Window w) { if (w.isModalExcluded(Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { return FilterAction.ACCEPT; } - if (w.appContext == appContext) { - while (w != null) { - if (w == modalDialog) { - return FilterAction.ACCEPT_IMMEDIATELY; - } - w = w.getOwner(); + while (w != null) { + if (w == modalDialog) { + return FilterAction.ACCEPT_IMMEDIATELY; } - return FilterAction.REJECT; + w = w.getOwner(); } - return FilterAction.ACCEPT; + return FilterAction.REJECT; } } diff --git a/src/java.desktop/share/classes/java/awt/Robot.java b/src/java.desktop/share/classes/java/awt/Robot.java index d887cad4f77..2a489a4cbf5 100644 --- a/src/java.desktop/share/classes/java/awt/Robot.java +++ b/src/java.desktop/share/classes/java/awt/Robot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -459,6 +459,9 @@ public class Robot { * @return Color of the pixel */ public synchronized Color getPixelColor(int x, int y) { + // need to sync the toolkit prior to grabbing the pixels since in some + // cases rendering to the screen may be delayed + Toolkit.getDefaultToolkit().sync(); Point point = peer.useAbsoluteCoordinates() ? toDeviceSpaceAbs(x, y) : toDeviceSpace(x, y); return new Color(peer.getRGBPixel(point.x, point.y)); diff --git a/src/java.desktop/share/classes/java/awt/SystemTray.java b/src/java.desktop/share/classes/java/awt/SystemTray.java index bf1871765eb..c873d849213 100644 --- a/src/java.desktop/share/classes/java/awt/SystemTray.java +++ b/src/java.desktop/share/classes/java/awt/SystemTray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,7 +32,6 @@ import java.beans.PropertyChangeSupport; import java.util.Vector; import sun.awt.AWTAccessor; -import sun.awt.AppContext; import sun.awt.HeadlessToolkit; import sun.awt.SunToolkit; @@ -213,6 +212,8 @@ public class SystemTray { } } + private Vector icons; + /** * Adds a {@code TrayIcon} to the {@code SystemTray}. * The tray icon becomes visible in the system tray once it is @@ -240,15 +241,10 @@ public class SystemTray { } TrayIcon[] oldArray; TrayIcon[] newArray; - Vector icons; synchronized (this) { oldArray = systemTray.getTrayIcons(); - @SuppressWarnings("unchecked") - Vector tmp = (Vector)AppContext.getAppContext().get(TrayIcon.class); - icons = tmp; if (icons == null) { icons = new Vector<>(3); - AppContext.getAppContext().put(TrayIcon.class, icons); } else if (icons.contains(trayIcon)) { throw new IllegalArgumentException("adding TrayIcon that is already added"); @@ -291,8 +287,6 @@ public class SystemTray { TrayIcon[] newArray; synchronized (this) { oldArray = systemTray.getTrayIcons(); - @SuppressWarnings("unchecked") - Vector icons = (Vector)AppContext.getAppContext().get(TrayIcon.class); // TrayIcon with no peer is not contained in the array. if (icons == null || !icons.remove(trayIcon)) { return; @@ -320,12 +314,12 @@ public class SystemTray { * @see TrayIcon */ public TrayIcon[] getTrayIcons() { - @SuppressWarnings("unchecked") - Vector icons = (Vector)AppContext.getAppContext().get(TrayIcon.class); - if (icons != null) { - return icons.toArray(EMPTY_TRAY_ARRAY); + synchronized (this) { + if (icons != null) { + return icons.toArray(EMPTY_TRAY_ARRAY); + } + return EMPTY_TRAY_ARRAY; } - return EMPTY_TRAY_ARRAY; } /** @@ -374,8 +368,6 @@ public class SystemTray { * * *

- * The {@code listener} listens to property changes only in this context. - *

* If {@code listener} is {@code null}, no exception is thrown * and no action is performed. * @@ -398,8 +390,6 @@ public class SystemTray { * Removes a {@code PropertyChangeListener} from the listener list * for a specific property. *

- * The {@code PropertyChangeListener} must be from this context. - *

* If {@code propertyName} or {@code listener} is {@code null} or invalid, * no exception is thrown and no action is taken. * @@ -421,8 +411,6 @@ public class SystemTray { /** * Returns an array of all the listeners that have been associated * with the named property. - *

- * Only the listeners in this context are returned. * * @param propertyName the specified property * @return all of the {@code PropertyChangeListener}s associated with @@ -461,19 +449,16 @@ public class SystemTray { getCurrentChangeSupport().firePropertyChange(propertyName, oldValue, newValue); } + private PropertyChangeSupport changeSupport; + /** - * Returns the current PropertyChangeSupport instance for the - * calling thread's context. + * Returns the current PropertyChangeSupport instance * - * @return this thread's context's PropertyChangeSupport + * @return the current PropertyChangeSupport for this {@code SystemTray} */ private synchronized PropertyChangeSupport getCurrentChangeSupport() { - PropertyChangeSupport changeSupport = - (PropertyChangeSupport)AppContext.getAppContext().get(SystemTray.class); - if (changeSupport == null) { changeSupport = new PropertyChangeSupport(this); - AppContext.getAppContext().put(SystemTray.class, changeSupport); } return changeSupport; } diff --git a/src/java.desktop/share/classes/java/awt/TrayIcon.java b/src/java.desktop/share/classes/java/awt/TrayIcon.java index b53174ef05e..c72c018867c 100644 --- a/src/java.desktop/share/classes/java/awt/TrayIcon.java +++ b/src/java.desktop/share/classes/java/awt/TrayIcon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,7 +27,6 @@ package java.awt; import java.awt.event.*; import java.awt.peer.TrayIconPeer; -import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.AWTAccessor; import sun.awt.HeadlessToolkit; @@ -126,7 +125,7 @@ public class TrayIcon { if (!SystemTray.isSupported()) { throw new UnsupportedOperationException(); } - SunToolkit.insertTargetMapping(this, AppContext.getAppContext()); + SunToolkit.insertTargetMapping(this); } /** 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 f4a39c43e04..89cde4b0ef0 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -200,6 +200,7 @@ public class ICC_ColorSpace extends ColorSpace { * the number of components in this {@code ColorSpace} * @throws NullPointerException if {@code colorvalue} is {@code null} */ + @Override public float[] toRGB(float[] colorvalue) { if (this2srgb == null) { synchronized (this) { @@ -249,6 +250,7 @@ public class ICC_ColorSpace extends ColorSpace { * @throws ArrayIndexOutOfBoundsException if array length is not at least 3 * @throws NullPointerException if {@code rgbvalue} is {@code null} */ + @Override public float[] fromRGB(float[] rgbvalue) { if (srgb2this == null) { synchronized (this) { @@ -378,6 +380,7 @@ public class ICC_ColorSpace extends ColorSpace { * the number of components in this {@code ColorSpace} * @throws NullPointerException if {@code colorvalue} is {@code null} */ + @Override public float[] toCIEXYZ(float[] colorvalue) { if (this2xyz == null) { synchronized (this) { @@ -510,6 +513,7 @@ public class ICC_ColorSpace extends ColorSpace { * @throws ArrayIndexOutOfBoundsException if array length is not at least 3 * @throws NullPointerException if {@code colorvalue} is {@code null} */ + @Override public float[] fromCIEXYZ(float[] colorvalue) { if (xyz2this == null) { synchronized (this) { @@ -560,6 +564,7 @@ public class ICC_ColorSpace extends ColorSpace { * than {@code numComponents - 1} * @since 1.4 */ + @Override public float getMinValue(int component) { rangeCheck(component); return minVal[component]; @@ -583,6 +588,7 @@ public class ICC_ColorSpace extends ColorSpace { * than {@code numComponents - 1} * @since 1.4 */ + @Override public float getMaxValue(int component) { rangeCheck(component); return maxVal[component]; diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_ProfileGray.java b/src/java.desktop/share/classes/java/awt/color/ICC_ProfileGray.java index f8de7d1581d..85b4b28b487 100644 --- a/src/java.desktop/share/classes/java/awt/color/ICC_ProfileGray.java +++ b/src/java.desktop/share/classes/java/awt/color/ICC_ProfileGray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -100,6 +100,7 @@ public final class ICC_ProfileGray extends ICC_Profile { * @return an array containing the components of the mediaWhitePointTag in * the ICC profile */ + @Override public float[] getMediaWhitePoint() { return super.getMediaWhitePoint(); } diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java b/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java index 1c7fab265ac..9069c898261 100644 --- a/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java +++ b/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -135,6 +135,7 @@ public final class ICC_ProfileRGB extends ICC_Profile { * @return a 3-element {@code float} array containing the x, y, and z * components of the profile's {@code mediaWhitePointTag} */ + @Override public float[] getMediaWhitePoint() { return super.getMediaWhitePoint(); } @@ -186,6 +187,7 @@ public final class ICC_ProfileRGB extends ICC_Profile { * @throws ProfileDataException if the profile does not specify the * corresponding TRC as a single gamma value */ + @Override public float getGamma(int component) { return super.getGamma(toTag(component)); } @@ -218,6 +220,7 @@ public final class ICC_ProfileRGB extends ICC_Profile { * @throws ProfileDataException if the profile does not specify the * corresponding TRC as a table */ + @Override public short[] getTRC(int component) { return super.getTRC(toTag(component)); } diff --git a/src/java.desktop/share/classes/java/awt/event/FocusEvent.java b/src/java.desktop/share/classes/java/awt/event/FocusEvent.java index 27da2e8b4bb..e39e9c317b0 100644 --- a/src/java.desktop/share/classes/java/awt/event/FocusEvent.java +++ b/src/java.desktop/share/classes/java/awt/event/FocusEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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,7 +30,6 @@ import java.io.ObjectStreamException; import java.io.Serial; import sun.awt.AWTAccessor; -import sun.awt.AppContext; import sun.awt.SunToolkit; /** @@ -326,21 +325,14 @@ public class FocusEvent extends ComponentEvent { * FOCUS_GAINED event, this is the Component that lost focus. For a * FOCUS_LOST event, this is the Component that gained focus. If this * focus change occurs with a native application, with a Java application - * in a different VM or context, or with no other Component, then null is + * in a different VM, or with no other Component, then null is * returned. * * @return the other Component involved in the focus change, or null * @since 1.4 */ public Component getOppositeComponent() { - if (opposite == null) { - return null; - } - - return (SunToolkit.targetToAppContext(opposite) == - AppContext.getAppContext()) - ? opposite - : null; + return opposite; } /** @@ -407,4 +399,4 @@ public class FocusEvent extends ComponentEvent { } -} \ No newline at end of file +} diff --git a/src/java.desktop/share/classes/java/awt/geom/Arc2D.java b/src/java.desktop/share/classes/java/awt/geom/Arc2D.java index 6646a14537e..7402dc98691 100644 --- a/src/java.desktop/share/classes/java/awt/geom/Arc2D.java +++ b/src/java.desktop/share/classes/java/awt/geom/Arc2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ package java.awt.geom; +import java.awt.Rectangle; import java.io.IOException; import java.io.Serial; import java.io.Serializable; @@ -1052,19 +1053,7 @@ public abstract class Arc2D extends RectangularShape { } /** - * Returns the high-precision framing rectangle of the arc. The framing - * rectangle contains only the part of this {@code Arc2D} that is - * in between the starting and ending angles and contains the pie - * wedge, if this {@code Arc2D} has a {@code PIE} closure type. - *

- * This method differs from the - * {@link RectangularShape#getBounds() getBounds} in that the - * {@code getBounds} method only returns the bounds of the - * enclosing ellipse of this {@code Arc2D} without considering - * the starting and ending angles of this {@code Arc2D}. - * - * @return the {@code Rectangle2D} that represents the arc's - * framing rectangle. + * {@inheritDoc java.awt.Shape} * @since 1.2 */ public Rectangle2D getBounds2D() { @@ -1110,6 +1099,15 @@ public abstract class Arc2D extends RectangularShape { return makeBounds(x1, y1, x2, y2); } + /** + * {@inheritDoc java.awt.Shape} + * @since 1.2 + */ + @Override + public Rectangle getBounds() { + return getBounds2D().getBounds(); + } + /** * Constructs a {@code Rectangle2D} of the appropriate precision * to hold the parameters calculated to be the framing rectangle diff --git a/src/java.desktop/share/classes/java/beans/BeanDescriptor.java b/src/java.desktop/share/classes/java/beans/BeanDescriptor.java index e0428abb3b9..f276b6086af 100644 --- a/src/java.desktop/share/classes/java/beans/BeanDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/BeanDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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,6 +118,7 @@ public class BeanDescriptor extends FeatureDescriptor { customizerClassRef = old.customizerClassRef; } + @Override void appendTo(StringBuilder sb) { appendTo(sb, "beanClass", this.beanClassRef); appendTo(sb, "customizerClass", this.customizerClassRef); diff --git a/src/java.desktop/share/classes/java/beans/Beans.java b/src/java.desktop/share/classes/java/beans/Beans.java index db94f413ccc..de706fe4451 100644 --- a/src/java.desktop/share/classes/java/beans/Beans.java +++ b/src/java.desktop/share/classes/java/beans/Beans.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -340,6 +340,7 @@ class ObjectInputStreamWithLoader extends ObjectInputStream /** * Use the given ClassLoader rather than using the system class */ + @Override @SuppressWarnings("rawtypes") protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException { diff --git a/src/java.desktop/share/classes/java/beans/DefaultPersistenceDelegate.java b/src/java.desktop/share/classes/java/beans/DefaultPersistenceDelegate.java index 8e4d3f0577c..a305ce81b3c 100644 --- a/src/java.desktop/share/classes/java/beans/DefaultPersistenceDelegate.java +++ b/src/java.desktop/share/classes/java/beans/DefaultPersistenceDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -130,6 +130,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { * * @see #DefaultPersistenceDelegate(String[]) */ + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { // Assume the instance is either mutable or a singleton // if it has a nullary constructor. @@ -153,6 +154,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { * * @see #DefaultPersistenceDelegate(String[]) */ + @Override protected Expression instantiate(Object oldInstance, Encoder out) { int nArgs = constructor.length; Class type = oldInstance.getClass(); @@ -393,6 +395,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { * @see java.beans.Introspector#getBeanInfo * @see java.beans.PropertyDescriptor */ + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) diff --git a/src/java.desktop/share/classes/java/beans/EventHandler.java b/src/java.desktop/share/classes/java/beans/EventHandler.java index cdda3d940d5..60f4e7bafda 100644 --- a/src/java.desktop/share/classes/java/beans/EventHandler.java +++ b/src/java.desktop/share/classes/java/beans/EventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -415,6 +415,7 @@ public class EventHandler implements InvocationHandler { * * @see EventHandler */ + @Override public Object invoke(final Object proxy, final Method method, final Object[] arguments) { String methodName = method.getName(); if (method.getDeclaringClass() == Object.class) { diff --git a/src/java.desktop/share/classes/java/beans/EventSetDescriptor.java b/src/java.desktop/share/classes/java/beans/EventSetDescriptor.java index 8826ff27902..5855fabf2e5 100644 --- a/src/java.desktop/share/classes/java/beans/EventSetDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/EventSetDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -536,6 +536,7 @@ public class EventSetDescriptor extends FeatureDescriptor { inDefaultEventSet = old.inDefaultEventSet; } + @Override void appendTo(StringBuilder sb) { appendTo(sb, "unicast", this.unicast); appendTo(sb, "inDefaultEventSet", this.inDefaultEventSet); diff --git a/src/java.desktop/share/classes/java/beans/Expression.java b/src/java.desktop/share/classes/java/beans/Expression.java index 21e9e4a4dc0..94fbb76fda3 100644 --- a/src/java.desktop/share/classes/java/beans/Expression.java +++ b/src/java.desktop/share/classes/java/beans/Expression.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -169,6 +169,7 @@ public class Expression extends Statement { this.value = value; } + @Override /*pp*/ String instanceName(Object instance) { return instance == unbound ? "" : super.instanceName(instance); } @@ -176,6 +177,7 @@ public class Expression extends Statement { /** * Prints the value of this expression using a Java-style syntax. */ + @Override public String toString() { return instanceName(value) + "=" + super.toString(); } diff --git a/src/java.desktop/share/classes/java/beans/FeatureDescriptor.java b/src/java.desktop/share/classes/java/beans/FeatureDescriptor.java index 0756d39da7a..ea1bc64534e 100644 --- a/src/java.desktop/share/classes/java/beans/FeatureDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/FeatureDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -406,6 +406,7 @@ public class FeatureDescriptor { * * @since 1.7 */ + @Override public String toString() { StringBuilder sb = new StringBuilder(getClass().getName()); sb.append("[name=").append(this.name); diff --git a/src/java.desktop/share/classes/java/beans/IndexedPropertyChangeEvent.java b/src/java.desktop/share/classes/java/beans/IndexedPropertyChangeEvent.java index 90c0fb109d2..0886f1fc23d 100644 --- a/src/java.desktop/share/classes/java/beans/IndexedPropertyChangeEvent.java +++ b/src/java.desktop/share/classes/java/beans/IndexedPropertyChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,7 @@ public class IndexedPropertyChangeEvent extends PropertyChangeEvent { return index; } + @Override void appendTo(StringBuilder sb) { sb.append("; index=").append(getIndex()); } diff --git a/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java b/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java index a46c8ec9d6e..d0a9529e325 100644 --- a/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -400,6 +400,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { * * @since 1.4 */ + @Override public boolean equals(Object obj) { // Note: This would be identical to PropertyDescriptor but they don't // share the same fields. @@ -485,6 +486,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { indexedReadMethodName = old.indexedReadMethodName; } + @Override void updateGenericsFor(Class type) { super.updateGenericsFor(type); try { @@ -502,6 +504,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { * @return a hash code value for this object. * @since 1.5 */ + @Override public int hashCode() { int result = super.hashCode(); @@ -515,6 +518,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { return result; } + @Override void appendTo(StringBuilder sb) { super.appendTo(sb); appendTo(sb, "indexedPropertyType", this.indexedPropertyTypeRef); diff --git a/src/java.desktop/share/classes/java/beans/Introspector.java b/src/java.desktop/share/classes/java/beans/Introspector.java index 564021104a7..cce046b8ec0 100644 --- a/src/java.desktop/share/classes/java/beans/Introspector.java +++ b/src/java.desktop/share/classes/java/beans/Introspector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -1345,30 +1345,37 @@ class GenericBeanInfo extends SimpleBeanInfo { this.targetBeanInfoRef = old.targetBeanInfoRef; } + @Override public PropertyDescriptor[] getPropertyDescriptors() { return properties; } + @Override public int getDefaultPropertyIndex() { return defaultProperty; } + @Override public EventSetDescriptor[] getEventSetDescriptors() { return events; } + @Override public int getDefaultEventIndex() { return defaultEvent; } + @Override public MethodDescriptor[] getMethodDescriptors() { return methods; } + @Override public BeanDescriptor getBeanDescriptor() { return beanDescriptor; } + @Override public java.awt.Image getIcon(int iconKind) { BeanInfo targetBeanInfo = getTargetBeanInfo(); if (targetBeanInfo != null) { diff --git a/src/java.desktop/share/classes/java/beans/MetaData.java b/src/java.desktop/share/classes/java/beans/MetaData.java index 347ac8ad555..baed32af44d 100644 --- a/src/java.desktop/share/classes/java/beans/MetaData.java +++ b/src/java.desktop/share/classes/java/beans/MetaData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -66,10 +66,13 @@ class MetaData { static final class NullPersistenceDelegate extends PersistenceDelegate { // Note this will be called by all classes when they reach the // top of their superclass chain. + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return null; } + @Override public void writeObject(Object oldInstance, Encoder out) { // System.out.println("NullPersistenceDelegate:writeObject " + oldInstance); } @@ -81,10 +84,12 @@ static final class NullPersistenceDelegate extends PersistenceDelegate { * @author Sergey A. Malenkov */ static final class EnumPersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance == newInstance; } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Enum e = (Enum) oldInstance; return new Expression(e, Enum.class, "valueOf", new Object[]{e.getDeclaringClass(), e.name()}); @@ -92,10 +97,12 @@ static final class EnumPersistenceDelegate extends PersistenceDelegate { } static final class PrimitivePersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance, oldInstance.getClass(), "new", new Object[]{oldInstance.toString()}); @@ -103,12 +110,14 @@ static final class PrimitivePersistenceDelegate extends PersistenceDelegate { } static final class ArrayPersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return (newInstance != null && oldInstance.getClass() == newInstance.getClass() && // Also ensures the subtype is correct. Array.getLength(oldInstance) == Array.getLength(newInstance)); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { // System.out.println("instantiate: " + type + " " + oldInstance); Class oldClass = oldInstance.getClass(); @@ -117,6 +126,7 @@ static final class ArrayPersistenceDelegate extends PersistenceDelegate { Array.getLength(oldInstance)}); } + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { int n = Array.getLength(oldInstance); for (int i = 0; i < n; i++) { @@ -144,6 +154,7 @@ static final class ArrayPersistenceDelegate extends PersistenceDelegate { } static final class ProxyPersistenceDelegate extends PersistenceDelegate { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Class type = oldInstance.getClass(); java.lang.reflect.Proxy p = (java.lang.reflect.Proxy)oldInstance; @@ -180,8 +191,10 @@ static final class ProxyPersistenceDelegate extends PersistenceDelegate { // Strings static final class java_lang_String_PersistenceDelegate extends PersistenceDelegate { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return null; } + @Override public void writeObject(Object oldInstance, Encoder out) { // System.out.println("NullPersistenceDelegate:writeObject " + oldInstance); } @@ -189,10 +202,12 @@ static final class java_lang_String_PersistenceDelegate extends PersistenceDeleg // Classes static final class java_lang_Class_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Class c = (Class)oldInstance; // As of 1.3 it is not possible to call Class.forName("int"), @@ -223,10 +238,12 @@ static final class java_lang_Class_PersistenceDelegate extends PersistenceDelega // Fields static final class java_lang_reflect_Field_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Field f = (Field)oldInstance; return new Expression(oldInstance, @@ -238,10 +255,12 @@ static final class java_lang_reflect_Field_PersistenceDelegate extends Persisten // Methods static final class java_lang_reflect_Method_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Method m = (Method)oldInstance; return new Expression(oldInstance, @@ -262,6 +281,7 @@ static final class java_lang_reflect_Method_PersistenceDelegate extends Persiste * @author Sergey A. Malenkov */ static class java_util_Date_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { if (!super.mutatesTo(oldInstance, newInstance)) { return false; @@ -272,6 +292,7 @@ static class java_util_Date_PersistenceDelegate extends PersistenceDelegate { return oldDate.getTime() == newDate.getTime(); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Date date = (Date)oldInstance; return new Expression(date, date.getClass(), "new", new Object[] {date.getTime()}); @@ -318,6 +339,7 @@ static final class java_sql_Timestamp_PersistenceDelegate extends java_util_Date } } + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { // assumes oldInstance and newInstance are Timestamps int nanos = getNanos(oldInstance); @@ -349,6 +371,7 @@ delegates to be registered with concrete classes. * @author Sergey A. Malenkov */ private abstract static class java_util_Collections extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { if (!super.mutatesTo(oldInstance, newInstance)) { return false; @@ -361,29 +384,34 @@ private abstract static class java_util_Collections extends PersistenceDelegate return (oldC.size() == newC.size()) && oldC.containsAll(newC); } + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { // do not initialize these custom collections in default way } static final class EmptyList_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance, Collections.class, "emptyList", null); } } static final class EmptySet_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance, Collections.class, "emptySet", null); } } static final class EmptyMap_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance, Collections.class, "emptyMap", null); } } static final class SingletonList_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = (List) oldInstance; return new Expression(oldInstance, Collections.class, "singletonList", new Object[]{list.get(0)}); @@ -391,6 +419,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SingletonSet_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Set set = (Set) oldInstance; return new Expression(oldInstance, Collections.class, "singleton", new Object[]{set.iterator().next()}); @@ -398,6 +427,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SingletonMap_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Map map = (Map) oldInstance; Object key = map.keySet().iterator().next(); @@ -406,6 +436,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableCollection_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = new ArrayList<>((Collection) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableCollection", new Object[]{list}); @@ -413,6 +444,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableList_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = new LinkedList<>((Collection) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list}); @@ -420,6 +452,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableRandomAccessList_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = new ArrayList<>((Collection) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list}); @@ -427,6 +460,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableSet_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Set set = new HashSet<>((Set) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableSet", new Object[]{set}); @@ -434,6 +468,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableSortedSet_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { SortedSet set = new TreeSet<>((SortedSet) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableSortedSet", new Object[]{set}); @@ -441,6 +476,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableMap_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Map map = new HashMap<>((Map) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableMap", new Object[]{map}); @@ -448,6 +484,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class UnmodifiableSortedMap_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { SortedMap map = new TreeMap<>((SortedMap) oldInstance); return new Expression(oldInstance, Collections.class, "unmodifiableSortedMap", new Object[]{map}); @@ -455,6 +492,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedCollection_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = new ArrayList<>((Collection) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedCollection", new Object[]{list}); @@ -462,6 +500,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedList_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = new LinkedList<>((Collection) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list}); @@ -469,6 +508,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedRandomAccessList_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { List list = new ArrayList<>((Collection) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list}); @@ -476,6 +516,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedSet_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Set set = new HashSet<>((Set) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedSet", new Object[]{set}); @@ -483,6 +524,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedSortedSet_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { SortedSet set = new TreeSet<>((SortedSet) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedSortedSet", new Object[]{set}); @@ -490,6 +532,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedMap_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Map map = new HashMap<>((Map) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedMap", new Object[]{map}); @@ -497,6 +540,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate } static final class SynchronizedSortedMap_PersistenceDelegate extends java_util_Collections { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { SortedMap map = new TreeMap<>((SortedMap) oldInstance); return new Expression(oldInstance, Collections.class, "synchronizedSortedMap", new Object[]{map}); @@ -506,6 +550,7 @@ private abstract static class java_util_Collections extends PersistenceDelegate // Collection static class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { java.util.Collection oldO = (java.util.Collection)oldInstance; java.util.Collection newO = (java.util.Collection)newInstance; @@ -521,6 +566,7 @@ static class java_util_Collection_PersistenceDelegate extends DefaultPersistence // List static class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { java.util.List oldO = (java.util.List)oldInstance; java.util.List newO = (java.util.List)newInstance; @@ -556,6 +602,7 @@ static class java_util_List_PersistenceDelegate extends DefaultPersistenceDelega // Map static class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { // System.out.println("Initializing: " + newInstance); java.util.Map oldMap = (java.util.Map)oldInstance; @@ -612,10 +659,12 @@ static final class java_beans_beancontext_BeanContextSupport_PersistenceDelegate * @author Sergey A. Malenkov */ static final class java_awt_Insets_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Insets insets = (Insets) oldInstance; Object[] args = new Object[] { @@ -636,10 +685,12 @@ static final class java_awt_Insets_PersistenceDelegate extends PersistenceDelega * @author Sergey A. Malenkov */ static final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Font font = (Font) oldInstance; @@ -705,10 +756,12 @@ static final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate * @author Sergey A. Malenkov */ static final class java_awt_AWTKeyStroke_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { AWTKeyStroke key = (AWTKeyStroke) oldInstance; @@ -760,10 +813,12 @@ static class StaticFieldsPersistenceDelegate extends PersistenceDelegate { } } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { throw new RuntimeException("Unrecognized instance: " + oldInstance); } + @Override public void writeObject(Object oldInstance, Encoder out) { if (out.getAttribute(this) == null) { out.setAttribute(this, Boolean.TRUE); @@ -781,10 +836,12 @@ static final class java_awt_font_TextAttribute_PersistenceDelegate extends Stati // MenuShortcut static final class java_awt_MenuShortcut_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance; return new Expression(oldInstance, m.getClass(), "new", @@ -794,6 +851,7 @@ static final class java_awt_MenuShortcut_PersistenceDelegate extends Persistence // Component static final class java_awt_Component_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); java.awt.Component c = (java.awt.Component)oldInstance; @@ -841,6 +899,7 @@ static final class java_awt_Component_PersistenceDelegate extends DefaultPersist // Container static final class java_awt_Container_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); // Ignore the children of a JScrollPane. @@ -876,6 +935,7 @@ static final class java_awt_Container_PersistenceDelegate extends DefaultPersist // Choice static final class java_awt_Choice_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); java.awt.Choice m = (java.awt.Choice)oldInstance; @@ -888,6 +948,7 @@ static final class java_awt_Choice_PersistenceDelegate extends DefaultPersistenc // Menu static final class java_awt_Menu_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); java.awt.Menu m = (java.awt.Menu)oldInstance; @@ -900,6 +961,7 @@ static final class java_awt_Menu_PersistenceDelegate extends DefaultPersistenceD // MenuBar static final class java_awt_MenuBar_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); java.awt.MenuBar m = (java.awt.MenuBar)oldInstance; @@ -912,6 +974,7 @@ static final class java_awt_MenuBar_PersistenceDelegate extends DefaultPersisten // List static final class java_awt_List_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); java.awt.List m = (java.awt.List)oldInstance; @@ -958,6 +1021,7 @@ static final class java_awt_BorderLayout_PersistenceDelegate extends DefaultPers // CardLayout static final class java_awt_CardLayout_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); @@ -969,6 +1033,7 @@ static final class java_awt_CardLayout_PersistenceDelegate extends DefaultPersis } } } + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return super.mutatesTo(oldInstance, newInstance) && getVector(newInstance).isEmpty(); } @@ -979,6 +1044,7 @@ static final class java_awt_CardLayout_PersistenceDelegate extends DefaultPersis // GridBagLayout static final class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); @@ -989,6 +1055,7 @@ static final class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPer } } } + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return super.mutatesTo(oldInstance, newInstance) && getHashtable(newInstance).isEmpty(); } @@ -1003,6 +1070,7 @@ static final class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPer // will be issued before we have added all the children to the JFrame and // will appear blank). static final class javax_swing_JFrame_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); java.awt.Window oldC = (java.awt.Window)oldInstance; @@ -1023,6 +1091,7 @@ static final class javax_swing_JFrame_PersistenceDelegate extends DefaultPersist // DefaultListModel static final class javax_swing_DefaultListModel_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { // Note, the "size" property will be set here. super.initialize(type, oldInstance, newInstance, out); @@ -1037,6 +1106,7 @@ static final class javax_swing_DefaultListModel_PersistenceDelegate extends Defa // DefaultComboBoxModel static final class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); javax.swing.DefaultComboBoxModel m = (javax.swing.DefaultComboBoxModel)oldInstance; @@ -1049,6 +1119,7 @@ static final class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends // DefaultMutableTreeNode static final class javax_swing_tree_DefaultMutableTreeNode_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); @@ -1065,6 +1136,7 @@ static final class javax_swing_tree_DefaultMutableTreeNode_PersistenceDelegate e // ToolTipManager static final class javax_swing_ToolTipManager_PersistenceDelegate extends PersistenceDelegate { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance, javax.swing.ToolTipManager.class, "sharedInstance", new Object[]{}); @@ -1073,6 +1145,7 @@ static final class javax_swing_ToolTipManager_PersistenceDelegate extends Persis // JTabbedPane static final class javax_swing_JTabbedPane_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); javax.swing.JTabbedPane p = (javax.swing.JTabbedPane)oldInstance; @@ -1088,10 +1161,12 @@ static final class javax_swing_JTabbedPane_PersistenceDelegate extends DefaultPe // Box static final class javax_swing_Box_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return super.mutatesTo(oldInstance, newInstance) && getAxis(oldInstance).equals(getAxis(newInstance)); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance, oldInstance.getClass(), "new", new Object[] {getAxis(oldInstance)}); } @@ -1109,6 +1184,7 @@ static final class javax_swing_Box_PersistenceDelegate extends DefaultPersistenc // need to be added to the menu item. // Not so for JMenu apparently. static final class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate { + @Override protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); javax.swing.JMenu m = (javax.swing.JMenu)oldInstance; @@ -1127,6 +1203,7 @@ static final class javax_swing_JMenu_PersistenceDelegate extends DefaultPersiste * @author Sergey A. Malenkov */ static final class javax_swing_border_MatteBorder_PersistenceDelegate extends PersistenceDelegate { + @Override protected Expression instantiate(Object oldInstance, Encoder out) { MatteBorder border = (MatteBorder) oldInstance; Insets insets = border.getBorderInsets(); @@ -1169,10 +1246,12 @@ static final class javax_swing_JMenu_PersistenceDelegate extends DefaultPersiste * @author Sergey A. Malenkov */ static final class sun_swing_PrintColorUIResource_PersistenceDelegate extends PersistenceDelegate { + @Override protected boolean mutatesTo(Object oldInstance, Object newInstance) { return oldInstance.equals(newInstance); } + @Override protected Expression instantiate(Object oldInstance, Encoder out) { Color color = (Color) oldInstance; Object[] args = new Object[] {color.getRGB()}; diff --git a/src/java.desktop/share/classes/java/beans/MethodDescriptor.java b/src/java.desktop/share/classes/java/beans/MethodDescriptor.java index 00cd3f6db30..a0fef42ff5a 100644 --- a/src/java.desktop/share/classes/java/beans/MethodDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/MethodDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -221,6 +221,7 @@ public class MethodDescriptor extends FeatureDescriptor { } } + @Override void appendTo(StringBuilder sb) { appendTo(sb, "method", this.methodRef.get()); if (this.parameterDescriptors != null) { diff --git a/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java b/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java index 1badd4bc72a..0db50ff898a 100644 --- a/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java +++ b/src/java.desktop/share/classes/java/beans/PropertyChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -161,6 +161,7 @@ public class PropertyChangeEvent extends EventObject { * * @since 1.7 */ + @Override public String toString() { StringBuilder sb = new StringBuilder(getClass().getName()); sb.append("[propertyName=").append(getPropertyName()); diff --git a/src/java.desktop/share/classes/java/beans/PropertyChangeListenerProxy.java b/src/java.desktop/share/classes/java/beans/PropertyChangeListenerProxy.java index e8fe197cfd6..024ae551895 100644 --- a/src/java.desktop/share/classes/java/beans/PropertyChangeListenerProxy.java +++ b/src/java.desktop/share/classes/java/beans/PropertyChangeListenerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -66,6 +66,7 @@ public class PropertyChangeListenerProxy * * @param event the property change event */ + @Override public void propertyChange(PropertyChangeEvent event) { getListener().propertyChange(event); } diff --git a/src/java.desktop/share/classes/java/beans/PropertyChangeSupport.java b/src/java.desktop/share/classes/java/beans/PropertyChangeSupport.java index edad65444ee..1b28fd4e320 100644 --- a/src/java.desktop/share/classes/java/beans/PropertyChangeSupport.java +++ b/src/java.desktop/share/classes/java/beans/PropertyChangeSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -566,6 +566,7 @@ public class PropertyChangeSupport implements Serializable { /** * {@inheritDoc} */ + @Override public PropertyChangeListener extract(PropertyChangeListener listener) { while (listener instanceof PropertyChangeListenerProxy) { listener = ((PropertyChangeListenerProxy) listener).getListener(); diff --git a/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java b/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java index 6f5d5d82832..c678199afc1 100644 --- a/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -371,6 +371,7 @@ public class PropertyDescriptor extends FeatureDescriptor { /** * Overridden to ensure that a super class doesn't take precedent */ + @Override void setClass0(Class clz) { if (getClass0() != null && clz.isAssignableFrom(getClass0())) { // don't replace a subclass with a superclass @@ -497,6 +498,7 @@ public class PropertyDescriptor extends FeatureDescriptor { * * @since 1.4 */ + @Override public boolean equals(Object obj) { if (this == obj) { return true; @@ -712,6 +714,7 @@ public class PropertyDescriptor extends FeatureDescriptor { * @return a hash code value for this object. * @since 1.5 */ + @Override public int hashCode() { int result = 7; @@ -742,6 +745,7 @@ public class PropertyDescriptor extends FeatureDescriptor { return baseName; } + @Override void appendTo(StringBuilder sb) { appendTo(sb, "bound", this.bound); appendTo(sb, "constrained", this.constrained); diff --git a/src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java b/src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java index 6c7140769a3..601d4634e1f 100644 --- a/src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java +++ b/src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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,7 @@ public class PropertyEditorSupport implements PropertyEditor { * the PropertyEditor should create a new object to hold any * modified value. */ + @Override public void setValue(Object value) { this.value = value; firePropertyChange(); @@ -104,6 +105,7 @@ public class PropertyEditorSupport implements PropertyEditor { * * @return The value of the property. */ + @Override public Object getValue() { return value; } @@ -116,6 +118,7 @@ public class PropertyEditorSupport implements PropertyEditor { * @return True if the class will honor the paintValue method. */ + @Override public boolean isPaintable() { return false; } @@ -131,6 +134,7 @@ public class PropertyEditorSupport implements PropertyEditor { * @param gfx Graphics object to paint into. * @param box Rectangle within graphics object into which we should paint. */ + @Override public void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box) { } @@ -147,6 +151,7 @@ public class PropertyEditorSupport implements PropertyEditor { * @return A fragment of Java code representing an initializer for the * current value. */ + @Override public String getJavaInitializationString() { return "???"; } @@ -163,6 +168,7 @@ public class PropertyEditorSupport implements PropertyEditor { *

If a non-null value is returned, then the PropertyEditor should * be prepared to parse that string back in setAsText(). */ + @Override public String getAsText() { return (this.value != null) ? this.value.toString() @@ -177,6 +183,7 @@ public class PropertyEditorSupport implements PropertyEditor { * * @param text The string to be parsed. */ + @Override public void setAsText(String text) throws java.lang.IllegalArgumentException { if (value instanceof String) { setValue(text); @@ -198,6 +205,7 @@ public class PropertyEditorSupport implements PropertyEditor { * property cannot be represented as a tagged value. * */ + @Override public String[] getTags() { return null; } @@ -219,6 +227,7 @@ public class PropertyEditorSupport implements PropertyEditor { * not supported. */ + @Override public java.awt.Component getCustomEditor() { return null; } @@ -228,6 +237,7 @@ public class PropertyEditorSupport implements PropertyEditor { * * @return True if the propertyEditor can provide a custom editor. */ + @Override public boolean supportsCustomEditor() { return false; } @@ -250,6 +260,7 @@ public class PropertyEditorSupport implements PropertyEditor { * * @param listener the {@link PropertyChangeListener} to add */ + @Override public synchronized void addPropertyChangeListener( PropertyChangeListener listener) { if (listeners == null) { @@ -268,6 +279,7 @@ public class PropertyEditorSupport implements PropertyEditor { * * @param listener the {@link PropertyChangeListener} to remove */ + @Override public synchronized void removePropertyChangeListener( PropertyChangeListener listener) { if (listeners == null) { diff --git a/src/java.desktop/share/classes/java/beans/Statement.java b/src/java.desktop/share/classes/java/beans/Statement.java index 117aef7f22b..2602aed83d7 100644 --- a/src/java.desktop/share/classes/java/beans/Statement.java +++ b/src/java.desktop/share/classes/java/beans/Statement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,6 +56,7 @@ public class Statement { private static Object[] emptyArray = new Object[]{}; static ExceptionListener defaultExceptionListener = new ExceptionListener() { + @Override public void exceptionThrown(Exception e) { System.err.println(e); // e.printStackTrace(); @@ -310,6 +311,7 @@ public class Statement { /** * Prints the value of this statement using a Java-style syntax. */ + @Override public String toString() { // Respect a subclass's implementation here. Object target = getTarget(); diff --git a/src/java.desktop/share/classes/java/beans/ThreadGroupContext.java b/src/java.desktop/share/classes/java/beans/ThreadGroupContext.java index b77154c9a3b..dc42799c9f7 100644 --- a/src/java.desktop/share/classes/java/beans/ThreadGroupContext.java +++ b/src/java.desktop/share/classes/java/beans/ThreadGroupContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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,6 +42,7 @@ import java.util.WeakHashMap; final class ThreadGroupContext { private static final WeakIdentityMap contexts = new WeakIdentityMap() { + @Override protected ThreadGroupContext create(Object key) { return new ThreadGroupContext(); } diff --git a/src/java.desktop/share/classes/java/beans/VetoableChangeListenerProxy.java b/src/java.desktop/share/classes/java/beans/VetoableChangeListenerProxy.java index 4e4ad96ebd8..a09c3f09b3b 100644 --- a/src/java.desktop/share/classes/java/beans/VetoableChangeListenerProxy.java +++ b/src/java.desktop/share/classes/java/beans/VetoableChangeListenerProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,6 +69,7 @@ public class VetoableChangeListenerProxy * @throws PropertyVetoException if the recipient wishes the property * change to be rolled back */ + @Override public void vetoableChange(PropertyChangeEvent event) throws PropertyVetoException{ getListener().vetoableChange(event); } diff --git a/src/java.desktop/share/classes/java/beans/VetoableChangeSupport.java b/src/java.desktop/share/classes/java/beans/VetoableChangeSupport.java index cce44ad0355..3ce47142867 100644 --- a/src/java.desktop/share/classes/java/beans/VetoableChangeSupport.java +++ b/src/java.desktop/share/classes/java/beans/VetoableChangeSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -555,6 +555,7 @@ public class VetoableChangeSupport implements Serializable { /** * {@inheritDoc} */ + @Override public VetoableChangeListener extract(VetoableChangeListener listener) { while (listener instanceof VetoableChangeListenerProxy) { listener = ((VetoableChangeListenerProxy) listener).getListener(); diff --git a/src/java.desktop/share/classes/java/beans/XMLDecoder.java b/src/java.desktop/share/classes/java/beans/XMLDecoder.java index 3d5fbd3a8ce..32a9ee5953d 100644 --- a/src/java.desktop/share/classes/java/beans/XMLDecoder.java +++ b/src/java.desktop/share/classes/java/beans/XMLDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -166,6 +166,7 @@ public class XMLDecoder implements AutoCloseable { * This method closes the input stream associated * with this stream. */ + @Override public void close() { if (parsingComplete()) { close(this.input.getCharacterStream()); diff --git a/src/java.desktop/share/classes/java/beans/XMLEncoder.java b/src/java.desktop/share/classes/java/beans/XMLEncoder.java index 646b777e7f7..aec59dad0ad 100644 --- a/src/java.desktop/share/classes/java/beans/XMLEncoder.java +++ b/src/java.desktop/share/classes/java/beans/XMLEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -321,6 +321,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { * * @see XMLDecoder#readObject */ + @Override public void writeObject(Object o) { if (internal) { super.writeObject(o); @@ -391,6 +392,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { * to the stream. * @see java.beans.PersistenceDelegate#initialize */ + @Override public void writeStatement(Statement oldStm) { // System.out.println("XMLEncoder::writeStatement: " + oldStm); boolean internal = this.internal; @@ -445,6 +447,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { * to the stream. * @see java.beans.PersistenceDelegate#initialize */ + @Override public void writeExpression(Expression oldExp) { boolean internal = this.internal; this.internal = true; @@ -502,6 +505,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { clear(); } + @Override void clear() { super.clear(); nameGenerator.clear(); @@ -526,6 +530,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { * postamble and then closes the output stream associated * with this stream. */ + @Override public void close() { flush(); writeln(""); diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java index 527a8be9cc0..0f623648f7b 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextChildSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -101,6 +101,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * property * @throws PropertyVetoException if the change is rejected */ + @Override public synchronized void setBeanContext(BeanContext bc) throws PropertyVetoException { if (bc == beanContext) return; @@ -146,6 +147,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * @return the nesting {@code BeanContext} for * this {@code BeanContextChildSupport}. */ + @Override public synchronized BeanContext getBeanContext() { return beanContext; } /** @@ -159,6 +161,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * @param name The name of the property to listen on * @param pcl The {@code PropertyChangeListener} to be added */ + @Override public void addPropertyChangeListener(String name, PropertyChangeListener pcl) { pcSupport.addPropertyChangeListener(name, pcl); } @@ -176,6 +179,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * @param name The name of the property that was listened on * @param pcl The PropertyChangeListener to be removed */ + @Override public void removePropertyChangeListener(String name, PropertyChangeListener pcl) { pcSupport.removePropertyChangeListener(name, pcl); } @@ -191,6 +195,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * @param name The name of the property to listen on * @param vcl The {@code VetoableChangeListener} to be added */ + @Override public void addVetoableChangeListener(String name, VetoableChangeListener vcl) { vcSupport.addVetoableChangeListener(name, vcl); } @@ -208,6 +213,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * @param name The name of the property that was listened on * @param vcl The {@code VetoableChangeListener} to be removed */ + @Override public void removeVetoableChangeListener(String name, VetoableChangeListener vcl) { vcSupport.removeVetoableChangeListener(name, vcl); } @@ -220,6 +226,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * @param bcsre The {@code BeanContextServiceRevokedEvent} fired as a * result of a service being revoked */ + @Override public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) { } /** @@ -231,6 +238,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * result of a service becoming available * */ + @Override public void serviceAvailable(BeanContextServiceAvailableEvent bcsae) { } /** diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java index 0e2e4211a9c..17897f6865e 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,6 +131,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * call it directly. */ + @Override public void initialize() { super.initialize(); services = new HashMap<>(serializable + 1); @@ -592,6 +593,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * @param peer the peer if the targetChild and peer are related by BeanContextProxy */ + @Override protected BCSChild createBCSChild(Object targetChild, Object peer) { return new BCSSChild(targetChild, peer); } @@ -655,6 +657,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * @throws NullPointerException if the argument is null */ + @Override public void addBeanContextServicesListener(BeanContextServicesListener bcsl) { if (bcsl == null) throw new NullPointerException("bcsl"); @@ -670,6 +673,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * remove a BeanContextServicesListener */ + @Override public void removeBeanContextServicesListener(BeanContextServicesListener bcsl) { if (bcsl == null) throw new NullPointerException("bcsl"); @@ -687,6 +691,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * @param bcsp the service provider */ + @Override public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp) { return addService(serviceClass, bcsp, true); } @@ -739,6 +744,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * @param revokeCurrentServicesNow whether or not to revoke the service */ + @Override public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) { if (serviceClass == null) throw new NullPointerException("serviceClass"); @@ -770,6 +776,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * has a service, which may be delegated */ + @Override public synchronized boolean hasService(Class serviceClass) { if (serviceClass == null) throw new NullPointerException("serviceClass"); @@ -807,6 +814,7 @@ public class BeanContextServicesSupport extends BeanContextSupport nestingCtxt = bcs; } + @Override public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) { Object service = null; @@ -819,14 +827,17 @@ public class BeanContextServicesSupport extends BeanContextSupport return service; } + @Override public void releaseService(BeanContextServices bcs, Object requestor, Object service) { nestingCtxt.releaseService(bcs, requestor, service); } + @Override public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) { return nestingCtxt.getCurrentServiceSelectors(serviceClass); } + @Override public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) { Iterator i = bcsChildren(); // get the BCSChild values. @@ -848,6 +859,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * obtain a service which may be delegated */ + @Override public Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException { if (child == null) throw new NullPointerException("child"); if (serviceClass == null) throw new NullPointerException("serviceClass"); @@ -913,6 +925,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * release a service */ + @Override public void releaseService(BeanContextChild child, Object requestor, Object service) { if (child == null) throw new NullPointerException("child"); if (requestor == null) throw new NullPointerException("requestor"); @@ -934,6 +947,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * @return an iterator for all the currently registered service classes. */ + @Override public Iterator getCurrentServiceClasses() { return new BCSIterator(services.keySet().iterator()); } @@ -943,6 +957,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * (if any) available for the specified service. */ + @Override public Iterator getCurrentServiceSelectors(Class serviceClass) { BCSSServiceProvider bcsssp = services.get(serviceClass); @@ -960,6 +975,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * own propagation semantics. */ + @Override public void serviceAvailable(BeanContextServiceAvailableEvent bcssae) { synchronized(BeanContext.globalHierarchyLock) { if (services.containsKey(bcssae.getServiceClass())) return; @@ -992,6 +1008,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * own propagation semantics. */ + @Override public void serviceRevoked(BeanContextServiceRevokedEvent bcssre) { synchronized(BeanContext.globalHierarchyLock) { if (services.containsKey(bcssre.getServiceClass())) return; @@ -1040,6 +1057,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * own child removal side-effects. */ + @Override protected void childJustRemovedHook(Object child, BCSChild bcsc) { BCSSChild bcssc = (BCSSChild)bcsc; @@ -1055,6 +1073,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * subclasses may envelope this method to implement their own semantics. */ + @Override protected synchronized void releaseBeanContextResources() { Object[] bcssc; @@ -1081,6 +1100,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * subclasses may envelope this method to implement their own semantics. */ + @Override protected synchronized void initializeBeanContextResources() { super.initializeBeanContextResources(); @@ -1167,6 +1187,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * processing that has to occur prior to serialization of the children */ + @Override protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException { oos.writeInt(serializable); @@ -1210,6 +1231,7 @@ public class BeanContextServicesSupport extends BeanContextSupport * processing that has to occur prior to serialization of the children */ + @Override protected synchronized void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException { serializable = ois.readInt(); diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java index dbbecb87d7e..3aa77048f8f 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -186,6 +186,7 @@ public class BeanContextSupport extends BeanContextChildSupport * identified by the beanName parameter is not found * @return the new object */ + @Override public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException { BeanContext bc = getBeanContextPeer(); @@ -199,6 +200,7 @@ public class BeanContextSupport extends BeanContextChildSupport * * @return number of children */ + @Override public int size() { synchronized(children) { return children.size(); @@ -212,6 +214,7 @@ public class BeanContextSupport extends BeanContextChildSupport * * @return {@code true} if there are no children, otherwise {@code false} */ + @Override public boolean isEmpty() { synchronized(children) { return children.isEmpty(); @@ -225,6 +228,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @param o the Object in question * @return {@code true} if this object is a child, otherwise {@code false} */ + @Override public boolean contains(Object o) { synchronized(children) { return children.containsKey(o); @@ -249,6 +253,7 @@ public class BeanContextSupport extends BeanContextChildSupport * currently nested in this {@code BeanContext}. * @return an {@code Iterator} of the nested children */ + @Override public Iterator iterator() { synchronized(children) { return new BCSIterator(children.keySet().iterator()); @@ -259,6 +264,7 @@ public class BeanContextSupport extends BeanContextChildSupport * Gets all JavaBean or {@code BeanContext} * instances currently nested in this BeanContext. */ + @Override public Object[] toArray() { synchronized(children) { return children.keySet().toArray(); @@ -273,6 +279,7 @@ public class BeanContextSupport extends BeanContextChildSupport * types that are of interest. * @return an array of children */ + @Override public Object[] toArray(Object[] arry) { synchronized(children) { return children.keySet().toArray(arry); @@ -290,8 +297,11 @@ public class BeanContextSupport extends BeanContextChildSupport protected static final class BCSIterator implements Iterator { BCSIterator(Iterator i) { super(); src = i; } + @Override public boolean hasNext() { return src.hasNext(); } + @Override public Object next() { return src.next(); } + @Override public void remove() { /* do nothing */ } private Iterator src; @@ -388,6 +398,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @return true if the child was added successfully. * @see #validatePendingAdd */ + @Override public boolean add(Object targetChild) { if (targetChild == null) throw new IllegalArgumentException(); @@ -492,6 +503,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @param targetChild The child objects to remove * @see #validatePendingRemove */ + @Override public boolean remove(Object targetChild) { return remove(targetChild, true); } @@ -579,6 +591,7 @@ public class BeanContextSupport extends BeanContextChildSupport * in the collection are children of * this {@code BeanContext}, false if not. */ + @Override @SuppressWarnings("rawtypes") public boolean containsAll(Collection c) { synchronized(children) { @@ -596,6 +609,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @throws UnsupportedOperationException thrown unconditionally by this implementation * @return this implementation unconditionally throws {@code UnsupportedOperationException} */ + @Override @SuppressWarnings("rawtypes") public boolean addAll(Collection c) { throw new UnsupportedOperationException(); @@ -608,6 +622,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @return this implementation unconditionally throws {@code UnsupportedOperationException} */ + @Override @SuppressWarnings("rawtypes") public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); @@ -620,6 +635,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @throws UnsupportedOperationException thrown unconditionally by this implementation * @return this implementation unconditionally throws {@code UnsupportedOperationException} */ + @Override @SuppressWarnings("rawtypes") public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); @@ -630,6 +646,7 @@ public class BeanContextSupport extends BeanContextChildSupport * implementations must synchronized on the hierarchy lock and "children" protected field * @throws UnsupportedOperationException thrown unconditionally by this implementation */ + @Override public void clear() { throw new UnsupportedOperationException(); } @@ -641,6 +658,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @throws NullPointerException if the argument is null */ + @Override public void addBeanContextMembershipListener(BeanContextMembershipListener bcml) { if (bcml == null) throw new NullPointerException("listener"); @@ -659,6 +677,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @throws NullPointerException if the argument is null */ + @Override public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml) { if (bcml == null) throw new NullPointerException("listener"); @@ -678,6 +697,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @throws NullPointerException if the argument is null */ + @Override public InputStream getResourceAsStream(String name, BeanContextChild bcc) { if (name == null) throw new NullPointerException("name"); if (bcc == null) throw new NullPointerException("bcc"); @@ -697,6 +717,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @return the requested resource as an InputStream */ + @Override public URL getResource(String name, BeanContextChild bcc) { if (name == null) throw new NullPointerException("name"); if (bcc == null) throw new NullPointerException("bcc"); @@ -713,6 +734,7 @@ public class BeanContextSupport extends BeanContextChildSupport * Sets the new design time value for this {@code BeanContext}. * @param dTime the new designTime value */ + @Override public synchronized void setDesignTime(boolean dTime) { if (designTime != dTime) { designTime = dTime; @@ -728,6 +750,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @return {@code true} if in design time mode, * {@code false} if not */ + @Override public synchronized boolean isDesignTime() { return designTime; } /** @@ -768,6 +791,7 @@ public class BeanContextSupport extends BeanContextChildSupport *

* @return {@code true} if the implementor needs a GUI */ + @Override public synchronized boolean needsGui() { BeanContext bc = getBeanContextPeer(); @@ -798,6 +822,7 @@ public class BeanContextSupport extends BeanContextChildSupport * notify this instance that it may no longer render a GUI. */ + @Override public synchronized void dontUseGui() { if (okToUseGui) { okToUseGui = false; @@ -817,6 +842,7 @@ public class BeanContextSupport extends BeanContextChildSupport * Notify this instance that it may now render a GUI */ + @Override public synchronized void okToUseGui() { if (!okToUseGui) { okToUseGui = true; @@ -838,6 +864,7 @@ public class BeanContextSupport extends BeanContextChildSupport * @return is this instance avoiding using its GUI? * @see Visibility */ + @Override public boolean avoidingGui() { return !okToUseGui && needsGui(); } @@ -1101,6 +1128,7 @@ public class BeanContextSupport extends BeanContextChildSupport * subclasses may envelope to monitor veto child property changes. */ + @Override public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException { String propertyName = pce.getPropertyName(); Object source = pce.getSource(); @@ -1121,6 +1149,7 @@ public class BeanContextSupport extends BeanContextChildSupport * subclasses may envelope to monitor child property changes. */ + @Override public void propertyChange(PropertyChangeEvent pce) { String propertyName = pce.getPropertyName(); Object source = pce.getSource(); @@ -1341,6 +1370,7 @@ public class BeanContextSupport extends BeanContextChildSupport * behaved Serializable child. */ + @Override public void propertyChange(PropertyChangeEvent pce) { BeanContextSupport.this.propertyChange(pce); } @@ -1355,6 +1385,7 @@ public class BeanContextSupport extends BeanContextChildSupport * behaved Serializable child. */ + @Override public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException { BeanContextSupport.this.vetoableChange(pce); } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java index 0481060f73f..25dbb7ddaca 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,6 +114,7 @@ public final class Chromaticity extends EnumSyntax /** * Returns the string table for class {@code Chromaticity}. */ + @Override protected String[] getStringTable() { return myStringTable; } @@ -121,6 +122,7 @@ public final class Chromaticity extends EnumSyntax /** * Returns the enumeration value table for class {@code Chromaticity}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; } @@ -135,6 +137,7 @@ public final class Chromaticity extends EnumSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return Chromaticity.class; } @@ -148,6 +151,7 @@ public final class Chromaticity extends EnumSyntax * * @return attribute category name */ + @Override public final String getName() { return "chromaticity"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java b/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java index 6affb3e28dc..8ce2c5eef7c 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,6 +104,7 @@ public final class ColorSupported extends EnumSyntax /** * Returns the string table for class {@code ColorSupported}. */ + @Override protected String[] getStringTable() { return myStringTable; } @@ -111,6 +112,7 @@ public final class ColorSupported extends EnumSyntax /** * Returns the enumeration value table for class {@code ColorSupported}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; } @@ -125,6 +127,7 @@ public final class ColorSupported extends EnumSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return ColorSupported.class; } @@ -138,6 +141,7 @@ public final class ColorSupported extends EnumSyntax * * @return attribute category name */ + @Override public final String getName() { return "color-supported"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java index b1e7f1e89fc..9eeab5d9688 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -106,6 +106,7 @@ public class Compression extends EnumSyntax implements DocAttribute { /** * Returns the string table for class {@code Compression}. */ + @Override protected String[] getStringTable() { return myStringTable.clone(); } @@ -113,6 +114,7 @@ public class Compression extends EnumSyntax implements DocAttribute { /** * Returns the enumeration value table for class {@code Compression}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); } @@ -127,6 +129,7 @@ public class Compression extends EnumSyntax implements DocAttribute { * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return Compression.class; } @@ -140,6 +143,7 @@ public class Compression extends EnumSyntax implements DocAttribute { * * @return attribute category name */ + @Override public final String getName() { return "compression"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java index 33a98c035be..6292cc4c8c2 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -97,6 +97,7 @@ public final class Copies extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this copies * attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return super.equals (object) && object instanceof Copies; } @@ -110,6 +111,7 @@ public final class Copies extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return Copies.class; } @@ -122,6 +124,7 @@ public final class Copies extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "copies"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java b/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java index e7b411d8e55..3c2cf4bb550 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -105,6 +105,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * @return {@code true} if {@code object} is equivalent to this copies * supported attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return super.equals (object) && object instanceof CopiesSupported; } @@ -119,6 +120,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return CopiesSupported.class; } @@ -132,6 +134,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "copies-supported"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java index 4e0a3b27259..a7a31dacd8d 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -88,6 +88,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * @return {@code true} if {@code object} is equivalent to this date-time at * completed attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return(super.equals (object) && object instanceof DateTimeAtCompleted); @@ -105,6 +106,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return DateTimeAtCompleted.class; } @@ -118,6 +120,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * * @return attribute category name */ + @Override public final String getName() { return "date-time-at-completed"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java index fc09f0672c2..53b85b7cf5c 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -88,6 +88,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * @return {@code true} if {@code object} is equivalent to this date-time at * creation attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return(super.equals (object) && object instanceof DateTimeAtCreation); @@ -103,6 +104,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return DateTimeAtCreation.class; } @@ -116,6 +118,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * * @return attribute category name */ + @Override public final String getName() { return "date-time-at-creation"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java index 8b1f3efdc0f..310f3f756c7 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -89,6 +89,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * @return {@code true} if {@code object} is equivalent to this date-time at * processing attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return(super.equals (object) && object instanceof DateTimeAtProcessing); @@ -104,6 +105,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return DateTimeAtProcessing.class; } @@ -117,6 +119,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * * @return attribute category name */ + @Override public final String getName() { return "date-time-at-processing"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java index bc1d240c9c1..655a314b136 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -89,6 +89,7 @@ public final class Destination extends URISyntax * @return {@code true} if {@code object} is equivalent to this destination * attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals(object) && object instanceof Destination); @@ -104,6 +105,7 @@ public final class Destination extends URISyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return Destination.class; } @@ -117,6 +119,7 @@ public final class Destination extends URISyntax * * @return attribute category name */ + @Override public final String getName() { return "spool-data-destination"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java index 593e656cf6b..01a410d075b 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogOwner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,6 +50,7 @@ public final class DialogOwner implements PrintRequestAttribute { private static class Accessor extends DialogOwnerAccessor { + @Override public long getOwnerID(DialogOwner owner) { return owner.getID(); } @@ -133,6 +134,7 @@ public final class DialogOwner implements PrintRequestAttribute { * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return DialogOwner.class; } @@ -145,6 +147,7 @@ public final class DialogOwner implements PrintRequestAttribute { * {@code "dialog-owner"}. * */ + @Override public final String getName() { return "dialog-owner"; diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java index ae3195d0280..2cf003060b1 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -98,6 +98,7 @@ public final class DialogTypeSelection extends EnumSyntax /** * Returns the string table for class {@code DialogTypeSelection}. */ + @Override protected String[] getStringTable() { return myStringTable; } @@ -106,6 +107,7 @@ public final class DialogTypeSelection extends EnumSyntax * Returns the enumeration value table for class * {@code DialogTypeSelection}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; } @@ -120,6 +122,7 @@ public final class DialogTypeSelection extends EnumSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return DialogTypeSelection.class; } @@ -133,6 +136,7 @@ public final class DialogTypeSelection extends EnumSyntax * * @return attribute category name */ + @Override public final String getName() { return "dialog-type-selection"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java b/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java index eb2bd7a870d..bd1f574e4ba 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -86,6 +86,7 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * @return {@code true} if {@code object} is equivalent to this document * name attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof DocumentName); } @@ -100,6 +101,7 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return DocumentName.class; } @@ -113,6 +115,7 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * * @return attribute category name */ + @Override public final String getName() { return "document-name"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java index b0e4b70c87c..8c8941c76c4 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -101,6 +101,7 @@ public final class Fidelity extends EnumSyntax /** * Returns the string table for class {@code Fidelity}. */ + @Override protected String[] getStringTable() { return myStringTable; } @@ -108,6 +109,7 @@ public final class Fidelity extends EnumSyntax /** * Returns the enumeration value table for class {@code Fidelity}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; } @@ -122,6 +124,7 @@ public final class Fidelity extends EnumSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return Fidelity.class; } @@ -135,6 +138,7 @@ public final class Fidelity extends EnumSyntax * * @return attribute category name */ + @Override public final String getName() { return "ipp-attribute-fidelity"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java index 46d520ecb48..7d9d042b3e7 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -344,6 +344,7 @@ public class Finishings extends EnumSyntax /** * Returns the string table for class {@code Finishings}. */ + @Override protected String[] getStringTable() { return myStringTable.clone(); } @@ -351,6 +352,7 @@ public class Finishings extends EnumSyntax /** * Returns the enumeration value table for class {@code Finishings}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); } @@ -358,6 +360,7 @@ public class Finishings extends EnumSyntax /** * Returns the lowest integer value used by class {@code Finishings}. */ + @Override protected int getOffset() { return 3; } @@ -372,6 +375,7 @@ public class Finishings extends EnumSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return Finishings.class; } @@ -385,6 +389,7 @@ public class Finishings extends EnumSyntax * * @return attribute category name */ + @Override public final String getName() { return "finishings"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java index d4e2c2625df..2b9ede6940f 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -123,6 +123,7 @@ public final class JobHoldUntil extends DateTimeSyntax * @return {@code true} if {@code object} is equivalent to this job hold * until attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals(object) && object instanceof JobHoldUntil); } @@ -137,6 +138,7 @@ public final class JobHoldUntil extends DateTimeSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobHoldUntil.class; } @@ -150,6 +152,7 @@ public final class JobHoldUntil extends DateTimeSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-hold-until"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java index ed9600838be..70d7c7e5e46 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ public final class JobImpressions extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job * impressions attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return super.equals (object) && object instanceof JobImpressions; } @@ -124,6 +125,7 @@ public final class JobImpressions extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobImpressions.class; } @@ -137,6 +139,7 @@ public final class JobImpressions extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-impressions"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java index 4974f9e13c9..e6fdeb93d05 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job * impressions completed attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return(super.equals (object) && object instanceof JobImpressionsCompleted); @@ -109,6 +110,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobImpressionsCompleted.class; } @@ -122,6 +124,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-impressions-completed"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java index 131b19f5ad2..82b3049b8bd 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * @return {@code true} if {@code object} is equivalent to this job * impressions supported attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobImpressionsSupported); @@ -109,6 +110,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobImpressionsSupported.class; } @@ -122,6 +124,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-impressions-supported"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java index 454a30a3a28..acd04fab21d 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -159,6 +159,7 @@ public final class JobKOctets extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job K octets * attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return super.equals(object) && object instanceof JobKOctets; } @@ -173,6 +174,7 @@ public final class JobKOctets extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobKOctets.class; } @@ -186,6 +188,7 @@ public final class JobKOctets extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-k-octets"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java index 9acc44f5777..efd9cac2441 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,6 +104,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job K octets * processed attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return(super.equals (object) && object instanceof JobKOctetsProcessed); @@ -119,6 +120,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobKOctetsProcessed.class; } @@ -132,6 +134,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-k-octets-processed"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java index 032d172d6e2..221328caeb8 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -93,6 +93,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * @return {@code true} if {@code object} is equivalent to this job K octets * supported attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobKOctetsSupported); @@ -108,6 +109,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobKOctetsSupported.class; } @@ -121,6 +123,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-k-octets-supported"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java index a3720748f68..181bda79826 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -101,6 +101,7 @@ public class JobMediaSheets extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job media * sheets attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return super.equals(object) && object instanceof JobMediaSheets; } @@ -115,6 +116,7 @@ public class JobMediaSheets extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobMediaSheets.class; } @@ -128,6 +130,7 @@ public class JobMediaSheets extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-media-sheets"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java index e6f1eb9b4d8..fea87dc8ebd 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job media * sheets completed attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobMediaSheetsCompleted); @@ -109,6 +110,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobMediaSheetsCompleted.class; } @@ -122,6 +124,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-media-sheets-completed"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java index a942f277175..8feeafef18a 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * @return {@code true} if {@code object} is equivalent to this job media * sheets supported attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobMediaSheetsSupported); @@ -109,6 +110,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobMediaSheetsSupported.class; } @@ -122,6 +124,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-media-sheets-supported"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java index cd944103d23..796fe37774c 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 @@ public final class JobMessageFromOperator extends TextSyntax * @return {@code true} if {@code object} is equivalent to this job message * from operator attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobMessageFromOperator); @@ -109,6 +110,7 @@ public final class JobMessageFromOperator extends TextSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobMessageFromOperator.class; } @@ -122,6 +124,7 @@ public final class JobMessageFromOperator extends TextSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-message-from-operator"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java index cceabd8b8f0..4fa9eaee6fd 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -92,6 +92,7 @@ public final class JobName extends TextSyntax * @return {@code true} if {@code object} is equivalent to this job name * attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals(object) && object instanceof JobName); } @@ -105,6 +106,7 @@ public final class JobName extends TextSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobName.class; } @@ -117,6 +119,7 @@ public final class JobName extends TextSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-name"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java index d8dfd56a920..eda27d142f9 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -91,6 +91,7 @@ public final class JobOriginatingUserName extends TextSyntax * @return {@code true} if {@code object} is equivalent to this job * originating user name attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobOriginatingUserName); @@ -106,6 +107,7 @@ public final class JobOriginatingUserName extends TextSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobOriginatingUserName.class; } @@ -119,6 +121,7 @@ public final class JobOriginatingUserName extends TextSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-originating-user-name"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java index 7c77a504673..5ca9990ec13 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 @@ public final class JobPriority extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job priority * attribute, {@code false} otherwise */ + @Override public boolean equals(Object object) { return (super.equals (object) && object instanceof JobPriority); } @@ -108,6 +109,7 @@ public final class JobPriority extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobPriority.class; } @@ -121,6 +123,7 @@ public final class JobPriority extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-priority"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java index 6df729a9813..422d823bff7 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -86,6 +86,7 @@ public final class JobPrioritySupported extends IntegerSyntax * @return {@code true} if {@code object} is equivalent to this job priority * supported attribute, {@code false} otherwise */ + @Override public boolean equals (Object object) { return (super.equals(object) && @@ -102,6 +103,7 @@ public final class JobPrioritySupported extends IntegerSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobPrioritySupported.class; } @@ -115,6 +117,7 @@ public final class JobPrioritySupported extends IntegerSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-priority-supported"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java index 130b8eb27a3..59a31096d2a 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -101,6 +101,7 @@ public class JobSheets extends EnumSyntax /** * Returns the string table for class {@code JobSheets}. */ + @Override protected String[] getStringTable() { return myStringTable.clone(); } @@ -108,6 +109,7 @@ public class JobSheets extends EnumSyntax /** * Returns the enumeration value table for class {@code JobSheets}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); } @@ -122,6 +124,7 @@ public class JobSheets extends EnumSyntax * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobSheets.class; } @@ -135,6 +138,7 @@ public class JobSheets extends EnumSyntax * * @return attribute category name */ + @Override public final String getName() { return "job-sheets"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java index 13499a9b2a7..0b0ba9d3276 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -206,6 +206,7 @@ public class JobState extends EnumSyntax implements PrintJobAttribute { /** * Returns the string table for class {@code JobState}. */ + @Override protected String[] getStringTable() { return myStringTable; } @@ -213,6 +214,7 @@ public class JobState extends EnumSyntax implements PrintJobAttribute { /** * Returns the enumeration value table for class {@code JobState}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return myEnumValueTable; } @@ -227,6 +229,7 @@ public class JobState extends EnumSyntax implements PrintJobAttribute { * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobState.class; } @@ -240,6 +243,7 @@ public class JobState extends EnumSyntax implements PrintJobAttribute { * * @return attribute category name */ + @Override public final String getName() { return "job-state"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java index 2f8526cb7b1..aba72ec9c1a 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -436,6 +436,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { /** * Returns the string table for class {@code JobStateReason}. */ + @Override protected String[] getStringTable() { return myStringTable.clone(); } @@ -443,6 +444,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { /** * Returns the enumeration value table for class {@code JobStateReason}. */ + @Override protected EnumSyntax[] getEnumValueTable() { return (EnumSyntax[])myEnumValueTable.clone(); } @@ -457,6 +459,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobStateReason.class; } @@ -470,6 +473,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { * * @return attribute category name */ + @Override public final String getName() { return "job-state-reason"; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java b/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java index 22b438c02eb..4e3e66d0ea8 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReasons.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -140,6 +140,7 @@ public final class JobStateReasons * class {@link JobStateReason JobStateReason} * @since 1.5 */ + @Override public boolean add(JobStateReason o) { if (o == null) { throw new NullPointerException(); @@ -157,6 +158,7 @@ public final class JobStateReasons * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ + @Override public final Class getCategory() { return JobStateReasons.class; } @@ -170,6 +172,7 @@ public final class JobStateReasons * * @return attribute category name */ + @Override public final String getName() { return "job-state-reasons"; } diff --git a/src/java.desktop/share/classes/javax/swing/DebugGraphics.java b/src/java.desktop/share/classes/javax/swing/DebugGraphics.java index 83b44716c04..512b56ee28a 100644 --- a/src/java.desktop/share/classes/javax/swing/DebugGraphics.java +++ b/src/java.desktop/share/classes/javax/swing/DebugGraphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1492,14 +1492,12 @@ public class DebugGraphics extends Graphics { /** Returns DebugGraphicsInfo, or creates one if none exists. */ static DebugGraphicsInfo info() { - DebugGraphicsInfo debugGraphicsInfo = (DebugGraphicsInfo) - SwingUtilities.appContextGet(debugGraphicsInfoKey); - if (debugGraphicsInfo == null) { - debugGraphicsInfo = new DebugGraphicsInfo(); - SwingUtilities.appContextPut(debugGraphicsInfoKey, - debugGraphicsInfo); + synchronized (DebugGraphicsInfo.class) { + if (debugGraphicsInfo == null) { + debugGraphicsInfo = new DebugGraphicsInfo(); + } + return debugGraphicsInfo; } - return debugGraphicsInfo; } - private static final Class debugGraphicsInfoKey = DebugGraphicsInfo.class; + private static DebugGraphicsInfo debugGraphicsInfo; } diff --git a/src/java.desktop/share/classes/javax/swing/JComponent.java b/src/java.desktop/share/classes/javax/swing/JComponent.java index f515115bade..6351522ab49 100644 --- a/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -4885,8 +4885,7 @@ public abstract class JComponent extends Container implements Serializable, * @see RepaintManager#addDirtyRegion */ public void repaint(long tm, int x, int y, int width, int height) { - RepaintManager.currentManager(SunToolkit.targetToAppContext(this)) - .addDirtyRegion(this, x, y, width, height); + RepaintManager.currentManager(this).addDirtyRegion(this, x, y, width, height); } diff --git a/src/java.desktop/share/classes/javax/swing/JDialog.java b/src/java.desktop/share/classes/javax/swing/JDialog.java index 99d6385cd7c..a7d8791c72c 100644 --- a/src/java.desktop/share/classes/javax/swing/JDialog.java +++ b/src/java.desktop/share/classes/javax/swing/JDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -101,13 +101,6 @@ public class JDialog extends Dialog implements WindowConstants, RootPaneContainer, TransferHandler.HasGetTransferHandler { - /** - * Key into the AppContext, used to check if should provide decorations - * by default. - */ - private static final Object defaultLookAndFeelDecoratedKey = - new StringBuffer("JDialog.defaultLookAndFeelDecorated"); - private int defaultCloseOperation = HIDE_ON_CLOSE; /** @@ -1119,6 +1112,8 @@ public class JDialog extends Dialog implements WindowConstants, } } + private static boolean defaultLAFDecorated; + /** * Provides a hint as to whether or not newly created {@code JDialog}s * should have their Window decorations (such as borders, widgets to @@ -1144,11 +1139,7 @@ public class JDialog extends Dialog implements WindowConstants, * @since 1.4 */ public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated) { - if (defaultLookAndFeelDecorated) { - SwingUtilities.appContextPut(defaultLookAndFeelDecoratedKey, Boolean.TRUE); - } else { - SwingUtilities.appContextPut(defaultLookAndFeelDecoratedKey, Boolean.FALSE); - } + defaultLAFDecorated = defaultLookAndFeelDecorated; } /** @@ -1160,12 +1151,7 @@ public class JDialog extends Dialog implements WindowConstants, * @since 1.4 */ public static boolean isDefaultLookAndFeelDecorated() { - Boolean defaultLookAndFeelDecorated = - (Boolean) SwingUtilities.appContextGet(defaultLookAndFeelDecoratedKey); - if (defaultLookAndFeelDecorated == null) { - defaultLookAndFeelDecorated = Boolean.FALSE; - } - return defaultLookAndFeelDecorated.booleanValue(); + return defaultLAFDecorated; } /** diff --git a/src/java.desktop/share/classes/javax/swing/JEditorPane.java b/src/java.desktop/share/classes/javax/swing/JEditorPane.java index 2f8f0f30722..3134b8bace2 100644 --- a/src/java.desktop/share/classes/javax/swing/JEditorPane.java +++ b/src/java.desktop/share/classes/javax/swing/JEditorPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1227,12 +1227,11 @@ public class JEditorPane extends JTextComponent { */ @SuppressWarnings("deprecation") public static EditorKit createEditorKitForContentType(String type) { - Hashtable kitRegistry = getKitRegistry(); EditorKit k = kitRegistry.get(type); if (k == null) { // try to dynamically load the support - String classname = getKitTypeRegistry().get(type); - ClassLoader loader = getKitLoaderRegistry().get(type); + String classname = kitTypeRegistry.get(type); + ClassLoader loader = kitLoaderRegistry.get(type); try { Class c; if (loader != null) { @@ -1287,13 +1286,13 @@ public class JEditorPane extends JTextComponent { * @param loader the ClassLoader to use to load the name */ public static void registerEditorKitForContentType(String type, String classname, ClassLoader loader) { - getKitTypeRegistry().put(type, classname); + kitTypeRegistry.put(type, classname); if (loader != null) { - getKitLoaderRegistry().put(type, loader); + kitLoaderRegistry.put(type, loader); } else { - getKitLoaderRegistry().remove(type); + kitLoaderRegistry.remove(type); } - getKitRegistry().remove(type); + kitRegistry.remove(type); } /** @@ -1306,63 +1305,27 @@ public class JEditorPane extends JTextComponent { * @since 1.3 */ public static String getEditorKitClassNameForContentType(String type) { - return getKitTypeRegistry().get(type); + return kitTypeRegistry.get(type); } - private static Hashtable getKitTypeRegistry() { - loadDefaultKitsIfNecessary(); - @SuppressWarnings("unchecked") - Hashtable tmp = - (Hashtable)SwingUtilities.appContextGet(kitTypeRegistryKey); - return tmp; - } + private static final Hashtable kitTypeRegistry = new Hashtable<>(); + private static final Hashtable kitLoaderRegistry = new Hashtable<>(); - private static Hashtable getKitLoaderRegistry() { - loadDefaultKitsIfNecessary(); - @SuppressWarnings("unchecked") - Hashtable tmp = - (Hashtable)SwingUtilities.appContextGet(kitLoaderRegistryKey); - return tmp; - } + private static final Hashtable kitRegistry = new Hashtable<>(3); - private static Hashtable getKitRegistry() { - @SuppressWarnings("unchecked") - Hashtable ht = - (Hashtable)SwingUtilities.appContextGet(kitRegistryKey); - if (ht == null) { - ht = new Hashtable<>(3); - SwingUtilities.appContextPut(kitRegistryKey, ht); - } - return ht; - } - - /** - * This is invoked every time the registries are accessed. Loading - * is done this way instead of via a static as the static is only - * called once when running in an AppContext. - */ - private static void loadDefaultKitsIfNecessary() { - if (SwingUtilities.appContextGet(kitTypeRegistryKey) == null) { - synchronized(defaultEditorKitMap) { - if (defaultEditorKitMap.size() == 0) { - defaultEditorKitMap.put("text/plain", - "javax.swing.JEditorPane$PlainEditorKit"); - defaultEditorKitMap.put("text/html", - "javax.swing.text.html.HTMLEditorKit"); - defaultEditorKitMap.put("text/rtf", - "javax.swing.text.rtf.RTFEditorKit"); - defaultEditorKitMap.put("application/rtf", - "javax.swing.text.rtf.RTFEditorKit"); - } - } - Hashtable ht = new Hashtable<>(); - SwingUtilities.appContextPut(kitTypeRegistryKey, ht); - ht = new Hashtable<>(); - SwingUtilities.appContextPut(kitLoaderRegistryKey, ht); - for (String key : defaultEditorKitMap.keySet()) { - registerEditorKitForContentType(key,defaultEditorKitMap.get(key)); - } + static final Map defaultEditorKitMap = new HashMap(0); + static { + defaultEditorKitMap.put("text/plain", + "javax.swing.JEditorPane$PlainEditorKit"); + defaultEditorKitMap.put("text/html", + "javax.swing.text.html.HTMLEditorKit"); + defaultEditorKitMap.put("text/rtf", + "javax.swing.text.rtf.RTFEditorKit"); + defaultEditorKitMap.put("application/rtf", + "javax.swing.text.rtf.RTFEditorKit"); + for (String key : defaultEditorKitMap.keySet()) { + registerEditorKitForContentType(key,defaultEditorKitMap.get(key)); } } @@ -1587,16 +1550,6 @@ public class JEditorPane extends JTextComponent { */ private Hashtable typeHandlers; - /* - * Private AppContext keys for this class's static variables. - */ - private static final Object kitRegistryKey = - new StringBuffer("JEditorPane.kitRegistry"); - private static final Object kitTypeRegistryKey = - new StringBuffer("JEditorPane.kitTypeRegistry"); - private static final Object kitLoaderRegistryKey = - new StringBuffer("JEditorPane.kitLoaderRegistry"); - /** * @see #getUIClassID * @see #readObject @@ -1633,8 +1586,6 @@ public class JEditorPane extends JTextComponent { */ public static final String HONOR_DISPLAY_PROPERTIES = "JEditorPane.honorDisplayProperties"; - static final Map defaultEditorKitMap = new HashMap(0); - /** * Returns a string representation of this JEditorPane. * This method diff --git a/src/java.desktop/share/classes/javax/swing/JFrame.java b/src/java.desktop/share/classes/javax/swing/JFrame.java index 8bde7e18f03..bab215625b9 100644 --- a/src/java.desktop/share/classes/javax/swing/JFrame.java +++ b/src/java.desktop/share/classes/javax/swing/JFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -126,13 +126,6 @@ public class JFrame extends Frame implements WindowConstants, RootPaneContainer, TransferHandler.HasGetTransferHandler { - /** - * Key into the AppContext, used to check if should provide decorations - * by default. - */ - private static final Object defaultLookAndFeelDecoratedKey = - new StringBuffer("JFrame.defaultLookAndFeelDecorated"); - private int defaultCloseOperation = HIDE_ON_CLOSE; /** @@ -755,6 +748,8 @@ public class JFrame extends Frame implements WindowConstants, } } + private static boolean defaultLAFDecorated; + /** * Provides a hint as to whether or not newly created JFrames * should have their Window decorations (such as borders, widgets to @@ -780,11 +775,7 @@ public class JFrame extends Frame implements WindowConstants, * @since 1.4 */ public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated) { - if (defaultLookAndFeelDecorated) { - SwingUtilities.appContextPut(defaultLookAndFeelDecoratedKey, Boolean.TRUE); - } else { - SwingUtilities.appContextPut(defaultLookAndFeelDecoratedKey, Boolean.FALSE); - } + defaultLAFDecorated = defaultLookAndFeelDecorated; } @@ -797,12 +788,7 @@ public class JFrame extends Frame implements WindowConstants, * @since 1.4 */ public static boolean isDefaultLookAndFeelDecorated() { - Boolean defaultLookAndFeelDecorated = - (Boolean) SwingUtilities.appContextGet(defaultLookAndFeelDecoratedKey); - if (defaultLookAndFeelDecorated == null) { - defaultLookAndFeelDecorated = Boolean.FALSE; - } - return defaultLookAndFeelDecorated.booleanValue(); + return defaultLAFDecorated; } /** diff --git a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java index 9611f991025..f3295cd6ad8 100644 --- a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java +++ b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 @@ import javax.swing.event.InternalFrameListener; import javax.swing.plaf.DesktopIconUI; import javax.swing.plaf.InternalFrameUI; -import sun.awt.AppContext; import sun.swing.SwingUtilities2; /** @@ -237,17 +236,13 @@ public class JInternalFrame extends JComponent implements /** Constrained property name indicating that the internal frame is iconified. */ public static final String IS_ICON_PROPERTY = "icon"; - private static final Object PROPERTY_CHANGE_LISTENER_KEY = - new StringBuilder("InternalFramePropertyChangeListener"); + private static PropertyChangeListener focusListener; private static void addPropertyChangeListenerIfNecessary() { - if (AppContext.getAppContext().get(PROPERTY_CHANGE_LISTENER_KEY) == - null) { - PropertyChangeListener focusListener = - new FocusPropertyChangeListener(); - - AppContext.getAppContext().put(PROPERTY_CHANGE_LISTENER_KEY, - focusListener); + synchronized (JInternalFrame.class) { + if (focusListener == null) { + focusListener = new FocusPropertyChangeListener(); + } KeyboardFocusManager.getCurrentKeyboardFocusManager(). addPropertyChangeListener(focusListener); diff --git a/src/java.desktop/share/classes/javax/swing/JPopupMenu.java b/src/java.desktop/share/classes/javax/swing/JPopupMenu.java index 1b04e8c6169..2ecc7cf3b1e 100644 --- a/src/java.desktop/share/classes/javax/swing/JPopupMenu.java +++ b/src/java.desktop/share/classes/javax/swing/JPopupMenu.java @@ -112,12 +112,6 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { */ private static final String uiClassID = "PopupMenuUI"; - /** - * Key used in AppContext to determine if light way popups are the default. - */ - private static final Object defaultLWPopupEnabledKey = - new StringBuffer("JPopupMenu.defaultLWPopupEnabledKey"); - /** Bug#4425878-Property javax.swing.adjustPopupLocationToFit introduced */ static boolean popupPositionFixDisabled = System.getProperty("javax.swing.adjustPopupLocationToFit","").equals("false"); @@ -153,6 +147,8 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { private static final boolean VERBOSE = false; // show reuse hits/misses private static final boolean DEBUG = false; // show bad params, misc. + private static boolean defaultLWPopupEnabled = true; + /** * Sets the default value of the lightWeightPopupEnabled * property. @@ -163,8 +159,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { * @see #setLightWeightPopupEnabled */ public static void setDefaultLightWeightPopupEnabled(boolean aFlag) { - SwingUtilities.appContextPut(defaultLWPopupEnabledKey, - Boolean.valueOf(aFlag)); + defaultLWPopupEnabled = aFlag; } /** @@ -177,14 +172,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { * @see #setDefaultLightWeightPopupEnabled */ public static boolean getDefaultLightWeightPopupEnabled() { - Boolean b = (Boolean) - SwingUtilities.appContextGet(defaultLWPopupEnabledKey); - if (b == null) { - SwingUtilities.appContextPut(defaultLWPopupEnabledKey, - Boolean.TRUE); - return true; - } - return b.booleanValue(); + return defaultLWPopupEnabled; } /** diff --git a/src/java.desktop/share/classes/javax/swing/JTable.java b/src/java.desktop/share/classes/javax/swing/JTable.java index f5c914135d1..fa8110d1517 100644 --- a/src/java.desktop/share/classes/javax/swing/JTable.java +++ b/src/java.desktop/share/classes/javax/swing/JTable.java @@ -6021,6 +6021,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable surrendersFocusOnKeystroke = f.get("surrendersFocusOnKeystroke", false); editorRemover = (PropertyChangeListener) f.get("editorRemover", null); + editingColumn = -1; + editingRow = -1; columnSelectionAdjusting = f.get("columnSelectionAdjusting", false); rowSelectionAdjusting = f.get("rowSelectionAdjusting", false); printError = (Throwable) f.get("printError", null); @@ -6053,6 +6055,9 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * do any Swing-specific pre-serialization configuration. */ void compWriteObjectNotify() { + if (isEditing() && !getCellEditor().stopCellEditing()) { + getCellEditor().cancelCellEditing(); + } super.compWriteObjectNotify(); // If ToolTipText != null, then the tooltip has already been // unregistered by JComponent.compWriteObjectNotify() diff --git a/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java b/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java index c84a218b877..ba80fc3bc95 100644 --- a/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java +++ b/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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,6 @@ import java.util.*; import java.awt.event.*; import javax.swing.event.*; -import sun.awt.AppContext; import sun.awt.AWTAccessor; import sun.awt.AWTAccessor.MouseEventAccessor; import sun.swing.SwingUtilities2; @@ -48,8 +47,7 @@ public class MenuSelectionManager { private static final boolean VERBOSE = false; // show reuse hits/misses private static final boolean DEBUG = false; // show bad params, misc. - private static final StringBuilder MENU_SELECTION_MANAGER_KEY = - new StringBuilder("javax.swing.MenuSelectionManager"); + private static final MenuSelectionManager DEFAULT_MSM = new MenuSelectionManager(); /** * Constructs a {@code MenuSelectionManager}. @@ -62,23 +60,7 @@ public class MenuSelectionManager { * @return a MenuSelectionManager object */ public static MenuSelectionManager defaultManager() { - synchronized (MENU_SELECTION_MANAGER_KEY) { - AppContext context = AppContext.getAppContext(); - MenuSelectionManager msm = (MenuSelectionManager)context.get( - MENU_SELECTION_MANAGER_KEY); - if (msm == null) { - msm = new MenuSelectionManager(); - context.put(MENU_SELECTION_MANAGER_KEY, msm); - - // installing additional listener if found in the AppContext - Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY); - if (o instanceof ChangeListener listener) { - msm.addChangeListener(listener); - } - } - - return msm; - } + return DEFAULT_MSM; } /** diff --git a/src/java.desktop/share/classes/javax/swing/PopupFactory.java b/src/java.desktop/share/classes/javax/swing/PopupFactory.java index 2b274c816b1..208177fc55e 100644 --- a/src/java.desktop/share/classes/javax/swing/PopupFactory.java +++ b/src/java.desktop/share/classes/javax/swing/PopupFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -80,13 +80,6 @@ public class PopupFactory { } }); } - /** - * The shared instanceof PopupFactory is per - * AppContext. This is the key used in the - * AppContext to locate the PopupFactory. - */ - private static final Object SharedInstanceKey = - new StringBuffer("PopupFactory.SharedInstanceKey"); /** * Max number of items to store in any one particular cache. @@ -118,6 +111,7 @@ public class PopupFactory { */ public PopupFactory() {} + static PopupFactory sharedFactory; /** * Sets the PopupFactory that will be used to obtain * Popups. @@ -132,7 +126,9 @@ public class PopupFactory { if (factory == null) { throw new IllegalArgumentException("PopupFactory can not be null"); } - SwingUtilities.appContextPut(SharedInstanceKey, factory); + synchronized (PopupFactory.class) { + sharedFactory = factory; + } } /** @@ -142,14 +138,12 @@ public class PopupFactory { * @return Shared PopupFactory */ public static PopupFactory getSharedInstance() { - PopupFactory factory = (PopupFactory)SwingUtilities.appContextGet( - SharedInstanceKey); - - if (factory == null) { - factory = new PopupFactory(); - setSharedInstance(factory); + synchronized (PopupFactory.class) { + if (sharedFactory == null) { + sharedFactory = new PopupFactory(); + } + return sharedFactory; } - return factory; } @@ -351,8 +345,6 @@ public class PopupFactory { * Popup implementation that uses a Window as the popup. */ private static class HeavyWeightPopup extends Popup { - private static final Object heavyWeightPopupCacheKey = - new StringBuffer("PopupFactory.heavyWeightPopupCache"); private volatile boolean isCacheEnabled = true; @@ -434,21 +426,16 @@ public class PopupFactory { } } + private static Map> cache; /** * Returns the cache to use for heavy weight popups. Maps from * Window to a List of * HeavyWeightPopups. */ - @SuppressWarnings("unchecked") private static Map> getHeavyWeightPopupCache() { synchronized (HeavyWeightPopup.class) { - Map> cache = (Map>)SwingUtilities.appContextGet( - heavyWeightPopupCacheKey); - if (cache == null) { cache = new HashMap<>(2); - SwingUtilities.appContextPut(heavyWeightPopupCacheKey, - cache); } return cache; } @@ -728,18 +715,17 @@ public class PopupFactory { return popup; } + private static List cache; /** * Returns the cache to use for heavy weight popups. */ - @SuppressWarnings("unchecked") private static List getLightWeightPopupCache() { - List cache = (List)SwingUtilities.appContextGet( - lightWeightPopupCacheKey); - if (cache == null) { - cache = new ArrayList<>(); - SwingUtilities.appContextPut(lightWeightPopupCacheKey, cache); + synchronized (LightWeightPopup.class) { + if (cache == null) { + cache = new ArrayList<>(); + } + return cache; } - return cache; } /** @@ -849,8 +835,6 @@ public class PopupFactory { * Popup implementation that uses a Panel as the popup. */ private static class MediumWeightPopup extends ContainerPopup { - private static final Object mediumWeightPopupCacheKey = - new StringBuffer("PopupFactory.mediumPopupCache"); /** Child of the panel. The contents are added to this. */ private JRootPane rootPane; @@ -877,19 +861,18 @@ public class PopupFactory { return popup; } + private static List cache; /** * Returns the cache to use for medium weight popups. */ @SuppressWarnings("unchecked") private static List getMediumWeightPopupCache() { - List cache = (List)SwingUtilities.appContextGet( - mediumWeightPopupCacheKey); - - if (cache == null) { - cache = new ArrayList<>(); - SwingUtilities.appContextPut(mediumWeightPopupCacheKey, cache); + synchronized (MediumWeightPopup.class) { + if (cache == null) { + cache = new ArrayList<>(); + } + return cache; } - return cache; } /** diff --git a/src/java.desktop/share/classes/javax/swing/RepaintManager.java b/src/java.desktop/share/classes/javax/swing/RepaintManager.java index dcc755cb4bc..db8b13afa22 100644 --- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java +++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -119,8 +119,6 @@ public class RepaintManager */ private PaintManager paintManager; - private static final Object repaintManagerKey = RepaintManager.class; - // Whether or not a VolatileImage should be used for double-buffered painting static boolean volatileImageBufferEnabled = true; /** @@ -236,8 +234,10 @@ public class RepaintManager } } + private static RepaintManager repaintManager; + /** - * Return the RepaintManager for the calling thread given a Component. + * Return the RepaintManager given a Component. * * @param c a Component -- unused in the default implementation, but could * be used by an overridden version to return a different RepaintManager @@ -249,21 +249,15 @@ public class RepaintManager // component is ever used to determine the current // RepaintManager, DisplayChangedRunnable will need to be modified // accordingly. - return currentManager(AppContext.getAppContext()); - } - /** - * Returns the RepaintManager for the specified AppContext. If - * a RepaintManager has not been created for the specified - * AppContext this will return null. - */ - static RepaintManager currentManager(AppContext appContext) { - RepaintManager rm = (RepaintManager)appContext.get(repaintManagerKey); - if (rm == null) { - rm = new RepaintManager(BUFFER_STRATEGY_TYPE); - appContext.put(repaintManagerKey, rm); + synchronized (RepaintManager.class) { + RepaintManager rm = repaintManager; + if (rm == null) { + rm = new RepaintManager(BUFFER_STRATEGY_TYPE); + repaintManager = rm; + } + return rm; } - return rm; } /** @@ -282,16 +276,12 @@ public class RepaintManager /** - * Set the RepaintManager that should be used for the calling - * thread. aRepaintManager will become the current RepaintManager - * for the calling thread's thread group. + * Set the RepaintManager. * @param aRepaintManager the RepaintManager object to use */ public static void setCurrentManager(RepaintManager aRepaintManager) { - if (aRepaintManager != null) { - SwingUtilities.appContextPut(repaintManagerKey, aRepaintManager); - } else { - SwingUtilities.appContextRemove(repaintManagerKey); + synchronized (RepaintManager.class) { + repaintManager = aRepaintManager; } } @@ -373,7 +363,7 @@ public class RepaintManager // Queue a Runnable to invoke paintDirtyRegions and // validateInvalidComponents. - scheduleProcessingRunnable(SunToolkit.targetToAppContext(invalidComponent)); + scheduleProcessingRunnable(); } @@ -460,7 +450,7 @@ public class RepaintManager // Queue a Runnable to invoke paintDirtyRegions and // validateInvalidComponents. - scheduleProcessingRunnable(SunToolkit.targetToAppContext(c)); + scheduleProcessingRunnable(); } /** @@ -530,8 +520,7 @@ public class RepaintManager // This is called from the toolkit thread when a native expose is // received. // - void nativeAddDirtyRegion(AppContext appContext, Container c, - int x, int y, int w, int h) { + void nativeAddDirtyRegion(Container c, int x, int y, int w, int h) { if (w > 0 && h > 0) { synchronized(this) { Rectangle dirty = hwDirtyComponents.get(c); @@ -543,7 +532,7 @@ public class RepaintManager x, y, w, h, dirty)); } } - scheduleProcessingRunnable(appContext); + scheduleProcessingRunnable(); } } @@ -551,8 +540,7 @@ public class RepaintManager // This is called from the toolkit thread when awt needs to run a // Runnable before we paint. // - void nativeQueueSurfaceDataRunnable(AppContext appContext, - final Component c, final Runnable r) + void nativeQueueSurfaceDataRunnable(final Component c, final Runnable r) { synchronized(this) { if (runnableList == null) { @@ -560,7 +548,7 @@ public class RepaintManager } runnableList.add(r); } - scheduleProcessingRunnable(appContext); + scheduleProcessingRunnable(); } /** @@ -1411,11 +1399,11 @@ public class RepaintManager return paintManager; } - private void scheduleProcessingRunnable(AppContext context) { + private void scheduleProcessingRunnable() { if (processingRunnable.markPending()) { Toolkit tk = Toolkit.getDefaultToolkit(); if (tk instanceof SunToolkit) { - SunToolkit.getSystemEventQueueImplPP(context). + SunToolkit.getSystemEventQueueImplPP(). postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), processingRunnable)); } else { @@ -1733,8 +1721,7 @@ public class RepaintManager /** * Listener installed to detect display changes. When display changes, * schedules a callback to notify all RepaintManagers of the display - * changes. Only one DisplayChangedHandler is ever installed. The - * singleton instance will schedule notification for all AppContexts. + * changes. Only one DisplayChangedHandler is ever installed. */ private static final class DisplayChangedHandler implements DisplayChangedListener { diff --git a/src/java.desktop/share/classes/javax/swing/SwingPaintEventDispatcher.java b/src/java.desktop/share/classes/javax/swing/SwingPaintEventDispatcher.java index 4a7b0821a3d..8c904f7d00c 100644 --- a/src/java.desktop/share/classes/javax/swing/SwingPaintEventDispatcher.java +++ b/src/java.desktop/share/classes/javax/swing/SwingPaintEventDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,7 +28,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.Rectangle; import java.awt.event.PaintEvent; -import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.event.IgnorePaintEvent; @@ -52,12 +51,10 @@ class SwingPaintEventDispatcher extends sun.awt.PaintEventDispatcher { public PaintEvent createPaintEvent(Component component, int x, int y, int w, int h) { if (component instanceof RootPaneContainer) { - AppContext appContext = SunToolkit.targetToAppContext(component); - RepaintManager rm = RepaintManager.currentManager(appContext); + RepaintManager rm = RepaintManager.currentManager(component); if (!SHOW_FROM_DOUBLE_BUFFER || !rm.show((Container)component, x, y, w, h)) { - rm.nativeAddDirtyRegion(appContext, (Container)component, - x, y, w, h); + rm.nativeAddDirtyRegion((Container)component, x, y, w, h); } // For backward compatibility generate an empty paint // event. Not doing this broke parts of Netbeans. @@ -65,10 +62,8 @@ class SwingPaintEventDispatcher extends sun.awt.PaintEventDispatcher { new Rectangle(x, y, w, h)); } else if (component instanceof SwingHeavyWeight) { - AppContext appContext = SunToolkit.targetToAppContext(component); - RepaintManager rm = RepaintManager.currentManager(appContext); - rm.nativeAddDirtyRegion(appContext, (Container)component, - x, y, w, h); + RepaintManager rm = RepaintManager.currentManager(component); + rm.nativeAddDirtyRegion((Container)component, x, y, w, h); return new IgnorePaintEvent(component, PaintEvent.PAINT, new Rectangle(x, y, w, h)); } @@ -81,9 +76,7 @@ class SwingPaintEventDispatcher extends sun.awt.PaintEventDispatcher { public boolean queueSurfaceDataReplacing(Component c, Runnable r) { if (c instanceof RootPaneContainer) { - AppContext appContext = SunToolkit.targetToAppContext(c); - RepaintManager.currentManager(appContext). - nativeQueueSurfaceDataRunnable(appContext, c, r); + RepaintManager.currentManager(c).nativeQueueSurfaceDataRunnable(c, r); return true; } return super.queueSurfaceDataReplacing(c, r); diff --git a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java index bc6441212de..afe1c444c31 100644 --- a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java +++ b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1899,11 +1899,6 @@ public class SwingUtilities implements SwingConstants return null; } - - // Don't use String, as it's not guaranteed to be unique in a Hashtable. - private static final Object sharedOwnerFrameKey = - new StringBuffer("SwingUtilities.sharedOwnerFrame"); - @SuppressWarnings("serial") // JDK-implementation class static class SharedOwnerFrame extends Frame implements WindowListener { public void addNotify() { @@ -1961,6 +1956,7 @@ public class SwingUtilities implements SwingConstants } } + private static Frame sharedOwnerFrame; /** * Returns a toolkit-private, shared, invisible Frame * to be the owner for JDialogs and JWindows created with @@ -1970,14 +1966,12 @@ public class SwingUtilities implements SwingConstants * @see java.awt.GraphicsEnvironment#isHeadless */ static Frame getSharedOwnerFrame() throws HeadlessException { - Frame sharedOwnerFrame = - (Frame)SwingUtilities.appContextGet(sharedOwnerFrameKey); - if (sharedOwnerFrame == null) { - sharedOwnerFrame = new SharedOwnerFrame(); - SwingUtilities.appContextPut(sharedOwnerFrameKey, - sharedOwnerFrame); + synchronized (SharedOwnerFrame.class) { + if (sharedOwnerFrame == null) { + sharedOwnerFrame = new SharedOwnerFrame(); + } + return sharedOwnerFrame; } - return sharedOwnerFrame; } /** diff --git a/src/java.desktop/share/classes/javax/swing/ToolTipManager.java b/src/java.desktop/share/classes/javax/swing/ToolTipManager.java index a9e2c6e69bb..4c3d0209823 100644 --- a/src/java.desktop/share/classes/javax/swing/ToolTipManager.java +++ b/src/java.desktop/share/classes/javax/swing/ToolTipManager.java @@ -61,7 +61,6 @@ public final class ToolTipManager extends MouseAdapter implements MouseMotionLis JComponent insideComponent; MouseEvent mouseEvent; boolean showImmediately; - private static final Object TOOL_TIP_MANAGER_KEY = new Object(); transient Popup tipWindow; /** The Window tip is being displayed in. This will be non-null if * the Window tip is in differs from that of insideComponent's Window. @@ -394,19 +393,19 @@ public final class ToolTipManager extends MouseAdapter implements MouseMotionLis } } + private static ToolTipManager manager; /** * Returns a shared ToolTipManager instance. * * @return a shared ToolTipManager object */ public static ToolTipManager sharedInstance() { - Object value = SwingUtilities.appContextGet(TOOL_TIP_MANAGER_KEY); - if (value instanceof ToolTipManager) { - return (ToolTipManager) value; + synchronized(ToolTipManager.class) { + if (manager == null) { + manager = new ToolTipManager(); + } + return manager; } - ToolTipManager manager = new ToolTipManager(); - SwingUtilities.appContextPut(TOOL_TIP_MANAGER_KEY, manager); - return manager; } // add keylistener here to trigger tip for access diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBumps.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBumps.java index dddcde10636..65030716d49 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBumps.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBumps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,7 +30,6 @@ import java.awt.image.*; import javax.swing.*; import java.util.ArrayList; import java.util.List; -import sun.awt.AppContext; /** * Implements the bumps used throughout the Metal Look and Feel. @@ -50,7 +49,7 @@ class MetalBumps implements Icon { protected Color shadowColor; protected Color backColor; - private static final Object METAL_BUMPS = new Object(); + private static final List bumpsList = new ArrayList(); protected BumpBuffer buffer; /** @@ -66,20 +65,14 @@ class MetalBumps implements Icon { private static BumpBuffer createBuffer(GraphicsConfiguration gc, Color topColor, Color shadowColor, Color backColor) { - AppContext context = AppContext.getAppContext(); - @SuppressWarnings("unchecked") - List buffers = (List) context.get(METAL_BUMPS); - if (buffers == null) { - buffers = new ArrayList(); - context.put(METAL_BUMPS, buffers); - } - for (BumpBuffer buffer : buffers) { + + for (BumpBuffer buffer : bumpsList) { if (buffer.hasSameConfiguration(gc, topColor, shadowColor, backColor)) { return buffer; } } BumpBuffer buffer = new BumpBuffer(gc, topColor, shadowColor, backColor); - buffers.add(buffer); + bumpsList.add(buffer); return buffer; } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java index c940b4dcead..92b7c3b58f9 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,7 +26,6 @@ package javax.swing.plaf.metal; import sun.swing.SwingUtilities2; -import sun.awt.AppContext; import javax.swing.*; import javax.swing.border.*; @@ -69,7 +68,7 @@ public class MetalButtonUI extends BasicButtonUI { */ protected Color disabledTextColor; - private static final Object METAL_BUTTON_UI_KEY = new Object(); + private static final ComponentUI UI = new MetalButtonUI(); // ******************************** // Create PLAF @@ -87,14 +86,7 @@ public class MetalButtonUI extends BasicButtonUI { * @return an instance of {@code MetalButtonUI} */ public static ComponentUI createUI(JComponent c) { - AppContext appContext = AppContext.getAppContext(); - MetalButtonUI metalButtonUI = - (MetalButtonUI) appContext.get(METAL_BUTTON_UI_KEY); - if (metalButtonUI == null) { - metalButtonUI = new MetalButtonUI(); - appContext.put(METAL_BUTTON_UI_KEY, metalButtonUI); - } - return metalButtonUI; + return UI; } // ******************************** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java index 558f1987e4d..4809de43a8f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,8 +25,6 @@ package javax.swing.plaf.metal; -import sun.awt.AppContext; - import javax.swing.*; import javax.swing.plaf.basic.BasicCheckBoxUI; @@ -57,7 +55,7 @@ public class MetalCheckBoxUI extends MetalRadioButtonUI { // of BasicCheckBoxUI because we want to pick up all the // painting changes made in MetalRadioButtonUI. - private static final Object METAL_CHECK_BOX_UI_KEY = new Object(); + private static final ComponentUI UI = new MetalCheckBoxUI(); private static final String propertyPrefix = "CheckBox" + "."; @@ -79,14 +77,7 @@ public class MetalCheckBoxUI extends MetalRadioButtonUI { * @return a new instance of {@code MetalCheckBoxUI} */ public static ComponentUI createUI(JComponent b) { - AppContext appContext = AppContext.getAppContext(); - MetalCheckBoxUI checkboxUI = - (MetalCheckBoxUI) appContext.get(METAL_CHECK_BOX_UI_KEY); - if (checkboxUI == null) { - checkboxUI = new MetalCheckBoxUI(); - appContext.put(METAL_CHECK_BOX_UI_KEY, checkboxUI); - } - return checkboxUI; + return UI; } public String getPropertyPrefix() { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLabelUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLabelUI.java index 35fc07de056..1d131c9d294 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLabelUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLabelUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,7 +26,6 @@ package javax.swing.plaf.metal; import sun.swing.SwingUtilities2; -import sun.awt.AppContext; import javax.swing.*; import javax.swing.plaf.*; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index 7b9a23aec5d..7c56c681423 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,6 @@ import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicLookAndFeel; import javax.swing.text.DefaultEditorKit; -import sun.awt.AppContext; import sun.awt.OSInfo; import sun.awt.SunToolkit; import sun.swing.DefaultLayoutStyle; @@ -1600,6 +1599,8 @@ public class MetalLookAndFeel extends BasicLookAndFeel super.provideErrorFeedback(component); } + private static MetalTheme currentMetalTheme; + /** * Set the theme used by MetalLookAndFeel. *

@@ -1629,7 +1630,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel if (theme == null) { throw new NullPointerException("Can't have null theme"); } - AppContext.getAppContext().put( "currentMetalTheme", theme ); + currentMetalTheme = theme; } /** @@ -1641,15 +1642,10 @@ public class MetalLookAndFeel extends BasicLookAndFeel * @since 1.5 */ public static MetalTheme getCurrentTheme() { - MetalTheme currentTheme; - AppContext context = AppContext.getAppContext(); - currentTheme = (MetalTheme) context.get( "currentMetalTheme" ); + MetalTheme currentTheme = currentMetalTheme; if (currentTheme == null) { - // This will happen in two cases: - // . When MetalLookAndFeel is first being initialized. - // . When a new AppContext has been created that hasn't - // triggered UIManager to load a LAF. Rather than invoke - // a method on the UIManager, which would trigger the loading + // This will happen when MetalLookAndFeel is first being initialized. + // Rather than invoke a method on the UIManager, which would trigger the loading // of a potentially different LAF, we directly set the // Theme here. if (useHighContrastTheme()) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java index 712046737eb..ddbd7bcc9cb 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,7 +26,6 @@ package javax.swing.plaf.metal; import sun.swing.SwingUtilities2; -import sun.awt.AppContext; import java.awt.*; import java.awt.event.*; @@ -55,7 +54,7 @@ import javax.swing.text.View; */ public class MetalRadioButtonUI extends BasicRadioButtonUI { - private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object(); + private static final ComponentUI UI = new MetalRadioButtonUI(); /** * The color of the focused radio button. @@ -90,14 +89,7 @@ public class MetalRadioButtonUI extends BasicRadioButtonUI { * @return an instance of {@code MetalRadioButtonUI} */ public static ComponentUI createUI(JComponent c) { - AppContext appContext = AppContext.getAppContext(); - MetalRadioButtonUI metalRadioButtonUI = - (MetalRadioButtonUI) appContext.get(METAL_RADIO_BUTTON_UI_KEY); - if (metalRadioButtonUI == null) { - metalRadioButtonUI = new MetalRadioButtonUI(); - appContext.put(METAL_RADIO_BUTTON_UI_KEY, metalRadioButtonUI); - } - return metalRadioButtonUI; + return UI; } // ******************************** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTitlePane.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTitlePane.java index ae8b379a579..4ed6734df1f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTitlePane.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTitlePane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -437,6 +437,7 @@ class MetalTitlePane extends JComponent { */ private JMenu createMenu() { JMenu menu = new JMenu(""); + menu.setPreferredSize(new Dimension(IMAGE_WIDTH, IMAGE_HEIGHT)); if (getWindowDecorationStyle() == JRootPane.FRAME) { addMenuItems(menu); } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java index 088a54ba6b2..9c944388c4a 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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,7 +26,6 @@ package javax.swing.plaf.metal; import sun.swing.SwingUtilities2; -import sun.awt.AppContext; import java.awt.*; import java.awt.event.*; @@ -57,7 +56,7 @@ import java.io.Serializable; */ public class MetalToggleButtonUI extends BasicToggleButtonUI { - private static final Object METAL_TOGGLE_BUTTON_UI_KEY = new Object(); + private static final ComponentUI UI = new MetalToggleButtonUI(); /** * The color of a focused toggle button. @@ -92,14 +91,7 @@ public class MetalToggleButtonUI extends BasicToggleButtonUI { * @return the {@code MetalToggleButtonUI}. */ public static ComponentUI createUI(JComponent b) { - AppContext appContext = AppContext.getAppContext(); - MetalToggleButtonUI metalToggleButtonUI = - (MetalToggleButtonUI) appContext.get(METAL_TOGGLE_BUTTON_UI_KEY); - if (metalToggleButtonUI == null) { - metalToggleButtonUI = new MetalToggleButtonUI(); - appContext.put(METAL_TOGGLE_BUTTON_UI_KEY, metalToggleButtonUI); - } - return metalToggleButtonUI; + return UI; } // ******************************** diff --git a/src/java.desktop/share/classes/sun/awt/AWTAccessor.java b/src/java.desktop/share/classes/sun/awt/AWTAccessor.java index 22df71f564d..c74219f7efa 100644 --- a/src/java.desktop/share/classes/sun/awt/AWTAccessor.java +++ b/src/java.desktop/share/classes/sun/awt/AWTAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2026, 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 @@ -441,11 +441,6 @@ public final class AWTAccessor { */ void setMostRecentFocusOwner(Window window, Component component); - /** - * Returns current KFM of the specified AppContext. - */ - KeyboardFocusManager getCurrentKeyboardFocusManager(AppContext ctx); - /** * Return the current focus cycle root */ @@ -456,16 +451,6 @@ public final class AWTAccessor { * An accessor for the MenuComponent class. */ public interface MenuComponentAccessor { - /** - * Returns the appContext of the menu component. - */ - AppContext getAppContext(MenuComponent menuComp); - - /** - * Sets the appContext of the menu component. - */ - void setAppContext(MenuComponent menuComp, AppContext appContext); - /** * Returns the peer of the menu component. */ diff --git a/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java b/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java index 8310b7cb604..ab2ad5dfbf0 100644 --- a/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java +++ b/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2026, 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 @@ -218,7 +218,7 @@ public abstract class EmbeddedFrame extends Frame */ public boolean dispatchKeyEvent(KeyEvent e) { - Container currentRoot = AWTAccessor.getKeyboardFocusManagerAccessor() + Container currentRoot = KeyboardFocusManager.getCurrentKeyboardFocusManager() .getCurrentFocusCycleRoot(); // if we are not in EmbeddedFrame's cycle, we should not try to leave. diff --git a/src/java.desktop/share/classes/sun/awt/SunToolkit.java b/src/java.desktop/share/classes/sun/awt/SunToolkit.java index 1f92189a62f..e97b654486f 100644 --- a/src/java.desktop/share/classes/sun/awt/SunToolkit.java +++ b/src/java.desktop/share/classes/sun/awt/SunToolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -333,9 +333,6 @@ public abstract class SunToolkit extends Toolkit if (target instanceof Component) { AWTAccessor.getComponentAccessor(). setAppContext((Component)target, context); - } else if (target instanceof MenuComponent) { - AWTAccessor.getMenuComponentAccessor(). - setAppContext((MenuComponent)target, context); } else { return false; } @@ -351,8 +348,7 @@ public abstract class SunToolkit extends Toolkit return AWTAccessor.getComponentAccessor(). getAppContext((Component)target); } else if (target instanceof MenuComponent) { - return AWTAccessor.getMenuComponentAccessor(). - getAppContext((MenuComponent)target); + return AppContext.getAppContext(); } else { return null; } @@ -414,6 +410,11 @@ public abstract class SunToolkit extends Toolkit cont.setFocusTraversalPolicy(defaultPolicy); } + /* This method should be removed at the same time as targetToAppContext() */ + public static void insertTargetMapping(Object target) { + insertTargetMapping(target, AppContext.getAppContext()); + } + /* * Insert a mapping from target to AppContext, for later retrieval * via targetToAppContext() above. @@ -426,6 +427,17 @@ public abstract class SunToolkit extends Toolkit } } + public static void postEvent(AWTEvent event) { + /* Adding AppContext is temporary to help migrate away from using app contexts + * It is used by code which has already been subject to that migration. + * However until that is complete, there is a single main app context we + * can retrieve to use which would be the same as if the code had + * not been migrated. + * The overload which accepts the AppContext will eventually be replaced by this. + */ + postEvent(AppContext.getAppContext(), event); + } + /* * Post an AWTEvent to the Java EventQueue, using the PostEventQueue * to avoid possibly calling client code (EventQueueSubclass.postEvent()) @@ -538,6 +550,10 @@ public abstract class SunToolkit extends Toolkit postEvent(targetToAppContext(peerEvent.getSource()), peerEvent); } + public static void invokeLater(Runnable dispatcher) { + invokeLaterOnAppContext(AppContext.getAppContext(), dispatcher); + } + /* * Execute a chunk of code on the Java event handler thread. The * method takes into account provided AppContext and sets @@ -1018,8 +1034,7 @@ public abstract class SunToolkit extends Toolkit return getSystemEventQueueImplPP(); } - // Package private implementation - static EventQueue getSystemEventQueueImplPP() { + public static EventQueue getSystemEventQueueImplPP() { return getSystemEventQueueImplPP(AppContext.getAppContext()); } diff --git a/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java b/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java index 6c03fa83369..9f247ed7fbd 100644 --- a/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -87,7 +87,6 @@ import javax.imageio.spi.ImageWriterSpi; import javax.imageio.stream.ImageInputStream; import javax.imageio.stream.ImageOutputStream; -import sun.awt.AppContext; import sun.awt.ComponentFactory; import sun.awt.SunToolkit; import sun.awt.image.ImageRepresentation; @@ -154,9 +153,9 @@ public abstract class DataTransferer { Collections.synchronizedMap(new HashMap<>()); /** - * The key used to store pending data conversion requests for an AppContext. + * The Runnable for pending data conversion requests. */ - private static final String DATA_CONVERTER_KEY = "DATA_CONVERTER_KEY"; + private static volatile Runnable dataConverterInstance; static { DataFlavor tJavaTextEncodingFlavor = null; @@ -1769,13 +1768,9 @@ search: } }; - final AppContext appContext = SunToolkit.targetToAppContext(source); - getToolkitThreadBlockedHandler().lock(); - if (appContext != null) { - appContext.put(DATA_CONVERTER_KEY, dataConverter); - } + dataConverterInstance = dataConverter; SunToolkit.executeOnEventHandlerThread(source, dataConverter); @@ -1783,9 +1778,7 @@ search: getToolkitThreadBlockedHandler().enter(); } - if (appContext != null) { - appContext.remove(DATA_CONVERTER_KEY); - } + dataConverterInstance = null; ret = stack.pop(); } finally { @@ -1802,14 +1795,12 @@ search: public void processDataConversionRequests() { if (EventQueue.isDispatchThread()) { - AppContext appContext = AppContext.getAppContext(); getToolkitThreadBlockedHandler().lock(); try { - Runnable dataConverter = - (Runnable)appContext.get(DATA_CONVERTER_KEY); + Runnable dataConverter = dataConverterInstance; if (dataConverter != null) { dataConverter.run(); - appContext.remove(DATA_CONVERTER_KEY); + dataConverterInstance = null; } } finally { getToolkitThreadBlockedHandler().unlock(); diff --git a/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java b/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java index edffbf59878..bc8071a798b 100644 --- a/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java +++ b/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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,6 @@ import java.util.HashSet; import java.io.IOException; -import sun.awt.AppContext; import sun.awt.PeerEvent; import sun.awt.SunToolkit; @@ -60,16 +59,11 @@ import sun.awt.SunToolkit; * * @since 1.3 */ -public abstract class SunClipboard extends Clipboard - implements PropertyChangeListener { - - private AppContext contentsContext = null; - - private final Object CLIPBOARD_FLAVOR_LISTENER_KEY; +public abstract class SunClipboard extends Clipboard { /** * A number of {@code FlavorListener}s currently registered - * on this clipboard across all {@code AppContext}s. + * on this clipboard */ private volatile int numberOfFlavorListeners; @@ -82,7 +76,6 @@ public abstract class SunClipboard extends Clipboard public SunClipboard(String name) { super(name); - CLIPBOARD_FLAVOR_LISTENER_KEY = new StringBuffer(name + "_CLIPBOARD_FLAVOR_LISTENER_KEY"); } public synchronized void setContents(Transferable contents, @@ -93,8 +86,6 @@ public abstract class SunClipboard extends Clipboard throw new NullPointerException("contents"); } - initContext(); - final ClipboardOwner oldOwner = this.owner; final Transferable oldContents = this.contents; @@ -110,27 +101,6 @@ public abstract class SunClipboard extends Clipboard } } - private synchronized void initContext() { - final AppContext context = AppContext.getAppContext(); - - if (contentsContext != context) { - // Need to synchronize on the AppContext to guarantee that it cannot - // be disposed after the check, but before the listener is added. - synchronized (context) { - if (context.isDisposed()) { - throw new IllegalStateException("Can't set contents from disposed AppContext"); - } - context.addPropertyChangeListener - (AppContext.DISPOSED_PROPERTY_NAME, this); - } - if (contentsContext != null) { - contentsContext.removePropertyChangeListener - (AppContext.DISPOSED_PROPERTY_NAME, this); - } - contentsContext = context; - } - } - public synchronized Transferable getContents(Object requestor) { if (contents != null) { return contents; @@ -140,13 +110,11 @@ public abstract class SunClipboard extends Clipboard /** - * @return the contents of this clipboard if it has been set from the same - * AppContext as it is currently retrieved or null otherwise + * @return the contents of this clipboard if it has been set or null otherwise * @since 1.5 */ protected synchronized Transferable getContextContents() { - AppContext context = AppContext.getAppContext(); - return (context == contentsContext) ? contents : null; + return contents; } @@ -248,16 +216,8 @@ public abstract class SunClipboard extends Clipboard public abstract long getID(); - public void propertyChange(PropertyChangeEvent evt) { - if (AppContext.DISPOSED_PROPERTY_NAME.equals(evt.getPropertyName()) && - Boolean.TRUE.equals(evt.getNewValue())) { - final AppContext disposedContext = (AppContext)evt.getSource(); - lostOwnershipLater(disposedContext); - } - } - protected void lostOwnershipImpl() { - lostOwnershipLater(null); + lostOwnershipLater(); } /** @@ -270,47 +230,30 @@ public abstract class SunClipboard extends Clipboard * {@code null} if the ownership is lost because another * application acquired ownership. */ - protected void lostOwnershipLater(final AppContext disposedContext) { - final AppContext context = this.contentsContext; - if (context == null) { - return; - } - - SunToolkit.postEvent(context, new PeerEvent(this, () -> lostOwnershipNow(disposedContext), - PeerEvent.PRIORITY_EVENT)); + protected void lostOwnershipLater() { + SunToolkit.postEvent(new PeerEvent(this, () -> lostOwnershipNow(), + PeerEvent.PRIORITY_EVENT)); } - protected void lostOwnershipNow(final AppContext disposedContext) { + + protected void lostOwnershipNow() { + final SunClipboard sunClipboard = SunClipboard.this; ClipboardOwner owner = null; Transferable contents = null; synchronized (sunClipboard) { - final AppContext context = sunClipboard.contentsContext; - - if (context == null) { - return; - } - - if (disposedContext == null || context == disposedContext) { - owner = sunClipboard.owner; - contents = sunClipboard.contents; - sunClipboard.contentsContext = null; - sunClipboard.owner = null; - sunClipboard.contents = null; - sunClipboard.clearNativeContext(); - context.removePropertyChangeListener - (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard); - } else { - return; - } + owner = sunClipboard.owner; + contents = sunClipboard.contents; + sunClipboard.owner = null; + sunClipboard.contents = null; + sunClipboard.clearNativeContext(); } if (owner != null) { owner.lostOwnership(sunClipboard, contents); } } - protected abstract void clearNativeContext(); protected abstract void setContentsNative(Transferable contents); @@ -343,11 +286,8 @@ public abstract class SunClipboard extends Clipboard if (listener == null) { return; } - AppContext appContext = AppContext.getAppContext(); - Set flavorListeners = getFlavorListeners(appContext); if (flavorListeners == null) { flavorListeners = new HashSet<>(); - appContext.put(CLIPBOARD_FLAVOR_LISTENER_KEY, flavorListeners); } flavorListeners.add(listener); @@ -362,7 +302,6 @@ public abstract class SunClipboard extends Clipboard if (listener == null) { return; } - Set flavorListeners = getFlavorListeners(AppContext.getAppContext()); if (flavorListeners == null){ //else we throw NullPointerException, but it is forbidden return; @@ -373,13 +312,8 @@ public abstract class SunClipboard extends Clipboard } } - @SuppressWarnings("unchecked") - private Set getFlavorListeners(AppContext appContext) { - return (Set)appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY); - } - + private static Set flavorListeners; public synchronized FlavorListener[] getFlavorListeners() { - Set flavorListeners = getFlavorListeners(AppContext.getAppContext()); return flavorListeners == null ? new FlavorListener[0] : flavorListeners.toArray(new FlavorListener[flavorListeners.size()]); } @@ -394,8 +328,7 @@ public abstract class SunClipboard extends Clipboard /** * Checks change of the {@code DataFlavor}s and, if necessary, - * posts notifications on {@code FlavorEvent}s to the - * AppContexts' EDTs. + * posts notifications on {@code FlavorEvent}s to the EDT's. * The parameter {@code formats} is null iff we have just * failed to get formats available on the clipboard. * @@ -411,19 +344,13 @@ public abstract class SunClipboard extends Clipboard } currentFormats = formats; - for (final AppContext appContext : AppContext.getAppContexts()) { - if (appContext == null || appContext.isDisposed()) { - continue; - } - Set flavorListeners = getFlavorListeners(appContext); - if (flavorListeners != null) { - for (FlavorListener listener : flavorListeners) { - if (listener != null) { - PeerEvent peerEvent = new PeerEvent(this, - () -> listener.flavorsChanged(new FlavorEvent(SunClipboard.this)), - PeerEvent.PRIORITY_EVENT); - SunToolkit.postEvent(appContext, peerEvent); - } + if (flavorListeners != null) { + for (FlavorListener listener : flavorListeners) { + if (listener != null) { + PeerEvent peerEvent = new PeerEvent(this, + () -> listener.flavorsChanged(new FlavorEvent(SunClipboard.this)), + PeerEvent.PRIORITY_EVENT); + SunToolkit.postEvent(peerEvent); } } } diff --git a/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java b/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java index 0da7dbed6ea..c3968f19b60 100644 --- a/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java +++ b/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java @@ -35,7 +35,6 @@ import java.awt.PopupMenu; import java.awt.Menu; import java.awt.MenuItem; import java.awt.Toolkit; -import sun.awt.AppContext; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.InvocationEvent; diff --git a/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java b/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java index bc025b87f3c..1b7cd41daa9 100644 --- a/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java +++ b/src/java.desktop/share/classes/sun/awt/image/XbmImageDecoder.java @@ -43,22 +43,25 @@ import static java.lang.Math.multiplyExact; /** * Parse files of the form: * + * {@snippet lang=c: * #define foo_width w * #define foo_height h * static char foo_bits[] = { * 0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn, * 0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn,0xnn, * 0xnn,0xnn,0xnn,0xnn}; + * } * * @author James Gosling */ public class XbmImageDecoder extends ImageDecoder { - private static byte[] XbmColormap = {(byte) 255, (byte) 255, (byte) 255, - 0, 0, 0}; - private static int XbmHints = (ImageConsumer.TOPDOWNLEFTRIGHT | - ImageConsumer.COMPLETESCANLINES | - ImageConsumer.SINGLEPASS | - ImageConsumer.SINGLEFRAME); + private static final byte[] XbmColormap = {(byte) 255, (byte) 255, (byte) 255, + 0, 0, 0}; + private static final int XbmHints = (ImageConsumer.TOPDOWNLEFTRIGHT | + ImageConsumer.COMPLETESCANLINES | + ImageConsumer.SINGLEPASS | + ImageConsumer.SINGLEFRAME); + private static final int MAX_XBM_SIZE = 16384; private static final int HEADER_SCAN_LIMIT = 100; @@ -110,20 +113,15 @@ public class XbmImageDecoder extends ImageDecoder { error("Error while parsing define statement"); } try { - if (!token[2].isBlank() && state == 0) { - if (token[1].endsWith("th")) { + if (state < 2) { + if (token[1].endsWith("h")) { W = Integer.parseInt(token[2]); - } else if (token[1].endsWith("t")) { + } else if (token[1].endsWith("ht")) { H = Integer.parseInt(token[2]); } - state = 1; // after first dimension is set - } else if (!token[2].isBlank() && state == 1) { - if (token[1].endsWith("th")) { - W = Integer.parseInt(token[2]); - } else if (token[1].endsWith("t")) { - H = Integer.parseInt(token[2]); - } - state = 2; // after second dimension is set + // After the 1st dimension is set, state becomes 1; + // after the 2nd dimension is set, state becomes 2 + ++state; } } catch (NumberFormatException nfe) { // parseInt() can throw NFE diff --git a/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java b/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java index 85c631d6e3e..f3569941321 100644 --- a/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java +++ b/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -399,7 +399,7 @@ class ExtendedTextSourceLabel implements TextLineComponent, Decoration.Label { int start = source.getStart(); int length = source.getLength(); - GlyphLayout gl = GlyphLayout.get(null); // !!! no custom layout engines + GlyphLayout gl = GlyphLayout.get(); gv = gl.layout(font, frc, context, start, length, flags, null); // ??? use textsource GlyphLayout.done(gl); diff --git a/src/java.desktop/share/classes/sun/font/GlyphLayout.java b/src/java.desktop/share/classes/sun/font/GlyphLayout.java index fe2a8bf2599..5bff127f143 100644 --- a/src/java.desktop/share/classes/sun/font/GlyphLayout.java +++ b/src/java.desktop/share/classes/sun/font/GlyphLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -76,7 +76,7 @@ import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; import java.awt.geom.Point2D; import java.util.ArrayList; -import java.util.concurrent.ConcurrentHashMap; +import java.util.WeakHashMap; import static java.lang.Character.*; @@ -87,7 +87,6 @@ public final class GlyphLayout { // cached glyph layout data for reuse private static volatile GlyphLayout cache; // reusable - private LayoutEngineFactory _lef; // set when get is called, unset when done is called private TextRecord _textRecord; // the text we're working on, used by iterators private ScriptRun _scriptRuns; // iterator over script runs private FontRunIterator _fontRuns; // iterator over physical fonts in a composite @@ -100,91 +99,10 @@ public final class GlyphLayout { private int _typo_flags; private int _offset; - public static final class LayoutEngineKey { - private Font2D font; - private int script; - private int lang; - - LayoutEngineKey() { - } - - LayoutEngineKey(Font2D font, int script, int lang) { - init(font, script, lang); - } - - void init(Font2D font, int script, int lang) { - this.font = font; - this.script = script; - this.lang = lang; - } - - LayoutEngineKey copy() { - return new LayoutEngineKey(font, script, lang); - } - - Font2D font() { - return font; - } - - int script() { - return script; - } - - int lang() { - return lang; - } - - public boolean equals(Object rhs) { - if (this == rhs) return true; - if (rhs == null) return false; - try { - LayoutEngineKey that = (LayoutEngineKey)rhs; - return this.script == that.script && - this.lang == that.lang && - this.font.equals(that.font); - } - catch (ClassCastException e) { - return false; - } - } - - public int hashCode() { - return script ^ lang ^ font.hashCode(); - } - } - - public static interface LayoutEngineFactory { - /** - * Given a font, script, and language, determine a layout engine to use. - */ - public LayoutEngine getEngine(Font2D font, int script, int lang); - - /** - * Given a key, determine a layout engine to use. - */ - public LayoutEngine getEngine(LayoutEngineKey key); - } - - public static interface LayoutEngine { - /** - * Given a strike descriptor, text, rtl flag, and starting point, append information about - * glyphs, positions, and character indices to the glyphvector data, and advance the point. - * - * If the GVData does not have room for the glyphs, throws an IndexOutOfBoundsException and - * leave pt and the gvdata unchanged. - */ - public void layout(FontStrikeDesc sd, float[] mat, float ptSize, int gmask, - int baseIndex, TextRecord text, int typo_flags, Point2D.Float pt, GVData data); - } - /** - * Return a new instance of GlyphLayout, using the provided layout engine factory. - * If null, the system layout engine factory will be used. + * Return a possibly recycled instance of GlyphLayout */ - public static GlyphLayout get(LayoutEngineFactory lef) { - if (lef == null) { - lef = SunLayoutEngine.instance(); - } + public static GlyphLayout get() { GlyphLayout result = null; synchronized(GlyphLayout.class) { if (cache != null) { @@ -195,7 +113,6 @@ public final class GlyphLayout { if (result == null) { result = new GlyphLayout(); } - result._lef = lef; return result; } @@ -204,23 +121,16 @@ public final class GlyphLayout { * of GlyphLayout objects. */ public static void done(GlyphLayout gl) { - gl._lef = null; cache = gl; // object reference assignment is thread safe, it says here... } private static final class SDCache { - public Font key_font; - public FontRenderContext key_frc; - public AffineTransform dtx; public AffineTransform gtx; public Point2D.Float delta; public FontStrikeDesc sd; private SDCache(Font font, FontRenderContext frc) { - key_font = font; - key_frc = frc; - // !!! add getVectorTransform and hasVectorTransform to frc? then // we could just skip this work... @@ -261,7 +171,7 @@ public final class GlyphLayout { private static final Point2D.Float ZERO_DELTA = new Point2D.Float(); private static - SoftReference> cacheRef; + SoftReference> cacheRef; private static final class SDKey { private final Font font; @@ -316,7 +226,7 @@ public final class GlyphLayout { } SDKey key = new SDKey(font, frc); // garbage, yuck... - ConcurrentHashMap cache = null; + WeakHashMap cache = null; SDCache res = null; if (cacheRef != null) { cache = cacheRef.get(); @@ -327,13 +237,17 @@ public final class GlyphLayout { if (res == null) { res = new SDCache(font, frc); if (cache == null) { - cache = new ConcurrentHashMap(10); + cache = new WeakHashMap(10); cacheRef = new - SoftReference>(cache); - } else if (cache.size() >= 512) { - cache.clear(); + SoftReference>(cache); + } else if (cache.size() >= 128) { + synchronized (SDCache.class) { + cache.clear(); + } + } + synchronized (SDCache.class) { + cache.put(key, res); } - cache.put(key, res); } return res; } @@ -398,8 +312,6 @@ public final class GlyphLayout { } } - int lang = -1; // default for now - Font2D font2D = FontUtilities.getFont2D(font); if (font2D instanceof FontSubstitution) { font2D = ((FontSubstitution)font2D).getCompositeFont2D(); @@ -426,7 +338,7 @@ public final class GlyphLayout { } int gmask = _fontRuns.getGlyphMask(); int pos = _fontRuns.getPos(); - nextEngineRecord(start, pos, script, lang, pfont, gmask); + nextEngineRecord(start, pos, script, pfont, gmask); start = pos; } } @@ -435,7 +347,7 @@ public final class GlyphLayout { while (_scriptRuns.next()) { int limit = _scriptRuns.getScriptLimit(); int script = _scriptRuns.getScriptCode(); - nextEngineRecord(start, limit, script, lang, font2D, 0); + nextEngineRecord(start, limit, script, font2D, 0); start = limit; } } @@ -508,7 +420,7 @@ public final class GlyphLayout { this._gvdata.init(capacity); } - private void nextEngineRecord(int start, int limit, int script, int lang, Font2D font, int gmask) { + private void nextEngineRecord(int start, int limit, int script, Font2D font, int gmask) { EngineRecord er = null; if (_ercount == _erecords.size()) { er = new EngineRecord(); @@ -516,7 +428,7 @@ public final class GlyphLayout { } else { er = _erecords.get(_ercount); } - er.init(start, limit, font, script, lang, gmask); + er.init(start, limit, font, script, gmask); ++_ercount; } @@ -627,18 +539,18 @@ public final class GlyphLayout { private int limit; private int gmask; private int eflags; - private LayoutEngineKey key; - private LayoutEngine engine; + private Font2D font; + private int script; EngineRecord() { - key = new LayoutEngineKey(); } - void init(int start, int limit, Font2D font, int script, int lang, int gmask) { + void init(int start, int limit, Font2D font, int script, int gmask) { this.start = start; this.limit = limit; + this.font = font; + this.script = script; this.gmask = gmask; - this.key.init(font, script, lang); this.eflags = 0; // only request canonical substitution if we have combining marks @@ -659,14 +571,12 @@ public final class GlyphLayout { break; } } - - this.engine = _lef.getEngine(key); // flags? } void layout() { _textRecord.start = start; _textRecord.limit = limit; - engine.layout(_sd, _mat, ptSize, gmask, start - _offset, _textRecord, + SunLayoutEngine.layout(font, script, _sd, _mat, ptSize, gmask, start - _offset, _textRecord, _typo_flags | eflags, _pt, _gvdata); } } diff --git a/src/java.desktop/share/classes/sun/font/SunLayoutEngine.java b/src/java.desktop/share/classes/sun/font/SunLayoutEngine.java index f1d6de7d4bc..99d3987e5fd 100644 --- a/src/java.desktop/share/classes/sun/font/SunLayoutEngine.java +++ b/src/java.desktop/share/classes/sun/font/SunLayoutEngine.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2003, 2026, 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 @@ -36,126 +37,22 @@ import sun.java2d.DisposerRecord; import java.awt.geom.Point2D; import java.lang.foreign.MemorySegment; -import java.lang.ref.SoftReference; import java.util.concurrent.ConcurrentHashMap; import java.util.WeakHashMap; -/* - * different ways to do this - * 1) each physical font2d keeps a hashtable mapping scripts to layout - * engines, we query and fill this cache. - * 2) we keep a mapping independent of font using the key Most likely - * few fonts will be used, so option 2 seems better - * - * Once we know which engine to use for a font, we always know, so we - * shouldn't have to recheck each time we do layout. So the cache is - * ok. - * - * Should we reuse engines? We could instantiate an engine for each - * font/script pair. The engine would hold onto the table(s) from the - * font that it needs. If we have multiple threads using the same - * engine, we still need to keep the state separate, so the native - * engines would still need to be allocated for each call, since they - * keep their state in themselves. If they used the passed-in GVData - * arrays directly (with some checks for space) then since each GVData - * is different per thread, we could reuse the layout engines. This - * still requires a separate layout engine per font, because of the - * table state in the engine. If we pushed that out too and passed it - * in with the native call as well, we'd be ok if the layout engines - * keep all their process state on the stack, but I don't know if this - * is true. Then we'd basically just be down to an engine index which - * we pass into native and then invoke the engine code (now a - * procedure call, not an object invocation) based on a switch on the - * index. There would be only half a dozen engine objects then, not - * potentially half a dozen per font. But we'd have to stack-allocate - * some state that included the pointer to the required font tables. - * - * Seems for now that the way to do things is to come in with a - * selector and the font. The selector indicates which engine to use, - * the engine is stack allocated and initialized with the required - * font tables (the selector indicates which). Then layout is called, - * the contents are copied (or not), and the stack is destroyed on - * exit. So the association is between the font/script (layout engine - * desc) and one of a few permanent engine objects, which are - * handed the key when they need to process something. In the native - * case, the engine holds an index, and just passes it together with - * the key info down to native. Some default cases are the 'default - * layout' case that just runs the c2gmapper, this stays in java and - * just uses the mapper from the font/strike. Another default case - * might be the unicode arabic shaper, since this doesn't care about - * the font (or script or lang?) it wouldn't need to extract this - * data. It could be (yikes) ported back to java even to avoid - * upcalls to check if the font supports a particular unicode - * character. - * - * I'd expect that the majority of scripts use the default mapper for - * a particular font. Loading the hashtable with 40 or so keys 30+ of - * which all map to the same object is unfortunate. It might be worth - * instead having a per-font list of 'scripts with non-default - * engines', e.g. the factory has a hashtable mapping fonts to 'script - * lists' (the factory has this since the design potentially has other - * factories, though I admit there's no client for this yet and no - * public api) and then the script list is queried for the script in - * question. it can be preloaded at creation time with all the - * scripts that don't have default engines-- either a list or a hash - * table, so a null return from the table means 'default' and not 'i - * don't know yet'. - * - * On the other hand, in most all cases the number of unique - * script/font combinations will be small, so a flat hashtable should - * suffice. - * */ -public final class SunLayoutEngine implements LayoutEngine, LayoutEngineFactory { +public final class SunLayoutEngine { + static { FontManagerNativeLibrary.load(); } - private LayoutEngineKey key; - - private static LayoutEngineFactory instance; - - public static LayoutEngineFactory instance() { - if (instance == null) { - instance = new SunLayoutEngine(); - } - return instance; - } - private SunLayoutEngine() { - // actually a factory, key is null so layout cannot be called on it - } - - public LayoutEngine getEngine(Font2D font, int script, int lang) { - return getEngine(new LayoutEngineKey(font, script, lang)); - } - - // !!! don't need this unless we have more than one sun layout engine... - public LayoutEngine getEngine(LayoutEngineKey key) { - ConcurrentHashMap cache = cacheref.get(); - if (cache == null) { - cache = new ConcurrentHashMap<>(); - cacheref = new SoftReference<>(cache); - } - - LayoutEngine e = cache.get(key); - if (e == null) { - LayoutEngineKey copy = key.copy(); - e = new SunLayoutEngine(copy); - cache.put(copy, e); - } - return e; - } - private SoftReference> cacheref = - new SoftReference<>(null); - - private SunLayoutEngine(LayoutEngineKey key) { - this.key = key; } private static final WeakHashMap facePtr = new WeakHashMap<>(); - private long getFacePtr(Font2D font2D) { + private static long getFacePtr(Font2D font2D) { FaceRef ref; synchronized (facePtr) { ref = facePtr.computeIfAbsent(font2D, FaceRef::new); @@ -170,17 +67,16 @@ public final class SunLayoutEngine implements LayoutEngine, LayoutEngineFactory } - public void layout(FontStrikeDesc desc, float[] mat, float ptSize, int gmask, + public static void layout(Font2D font, int script, FontStrikeDesc desc, float[] mat, float ptSize, int gmask, int baseIndex, TextRecord tr, int typo_flags, Point2D.Float pt, GVData data) { - Font2D font = key.font(); FontStrike strike = font.getStrike(desc); if (useFFM) { MemorySegment face = HBShaper.getFace(font); if (face != null) { HBShaper.shape(font, strike, ptSize, mat, face, - tr.text, data, key.script(), + tr.text, data, script, tr.start, tr.limit, baseIndex, pt, typo_flags, gmask); } @@ -188,7 +84,7 @@ public final class SunLayoutEngine implements LayoutEngine, LayoutEngineFactory long pFace = getFacePtr(font); if (pFace != 0) { shape(font, strike, ptSize, mat, pFace, - tr.text, data, key.script(), + tr.text, data, script, tr.start, tr.limit, baseIndex, pt, typo_flags, gmask); } diff --git a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java index 754af87b94e..32728efde6c 100644 --- a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java +++ b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -1610,6 +1610,11 @@ public abstract class RasterPrinterJob extends PrinterJob { cancelDoc(); } + } catch (PrinterException pe) { + throw pe; + } catch (Throwable printError) { + throw (PrinterException) + new PrinterException().initCause(printError.getCause()); } finally { // reset previousPaper in case this job is invoked again. previousPaper = null; diff --git a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java index faf31e0b426..d552bc5c9f2 100644 --- a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java +++ b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java @@ -92,7 +92,6 @@ import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; import sun.awt.AWTAccessor; -import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.font.FontDesignMetrics; import sun.font.FontUtilities; @@ -121,9 +120,6 @@ import static java.awt.geom.AffineTransform.TYPE_TRANSLATION; */ public class SwingUtilities2 { - public static final Object MENU_SELECTION_MANAGER_LISTENER_KEY = - new StringBuffer("MenuSelectionManager listener key"); - // Maintain a cache of CACHE_SIZE fonts and the left side bearing // of the characters falling into the range MIN_CHAR_INDEX to // MAX_CHAR_INDEX. The values in fontCache are created as needed. @@ -1244,7 +1240,7 @@ public class SwingUtilities2 { return null; } - private static final Object APP_CONTEXT_FRC_CACHE_KEY = new Object(); + private static final Map cache = new HashMap<>(); private static FontRenderContext getFRCFromCache(AffineTransform tx, Object aaHint) { @@ -1252,15 +1248,6 @@ public class SwingUtilities2 { return null; } - @SuppressWarnings("unchecked") - Map cache = (Map) - AppContext.getAppContext().get(APP_CONTEXT_FRC_CACHE_KEY); - - if (cache == null) { - cache = new HashMap<>(); - AppContext.getAppContext().put(APP_CONTEXT_FRC_CACHE_KEY, cache); - } - Object key = (tx == null) ? aaHint : (aaHint == null ? tx : new KeyPair(tx, aaHint)); diff --git a/src/java.desktop/share/classes/sun/swing/plaf/DesktopProperty.java b/src/java.desktop/share/classes/sun/swing/plaf/DesktopProperty.java index 8af75f98b83..6b33f0786a8 100644 --- a/src/java.desktop/share/classes/sun/swing/plaf/DesktopProperty.java +++ b/src/java.desktop/share/classes/sun/swing/plaf/DesktopProperty.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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,8 +42,6 @@ import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; -import sun.awt.AppContext; - /** * Wrapper for a value from the desktop. The value is lazily looked up, and * can be accessed using the UIManager.ActiveValue method @@ -52,8 +50,6 @@ import sun.awt.AppContext; * invalidate to force the value to be fetched again. */ public class DesktopProperty implements UIDefaults.ActiveValue { - private static final StringBuilder DESKTOP_PROPERTY_UPDATE_PENDING_KEY = - new StringBuilder("DesktopPropertyUpdatePending"); /** * ReferenceQueue of unreferenced WeakPCLs. @@ -90,23 +86,6 @@ public class DesktopProperty implements UIDefaults.ActiveValue { } } - - /** - * Sets whether or not an updateUI call is pending. - */ - private static synchronized void setUpdatePending(boolean update) { - AppContext.getAppContext() - .put(DESKTOP_PROPERTY_UPDATE_PENDING_KEY, update); - } - - /** - * Returns true if a UI update is pending. - */ - private static synchronized boolean isUpdatePending() { - return Boolean.TRUE.equals(AppContext.getAppContext() - .get(DESKTOP_PROPERTY_UPDATE_PENDING_KEY)); - } - /** * Updates the UIs of all the known Frames. */ @@ -202,6 +181,8 @@ public class DesktopProperty implements UIDefaults.ActiveValue { value = null; } + private static volatile boolean updatePending; + /** * Requests that all components in the GUI hierarchy be updated * to reflect dynamic changes in this {@literal look&feel}. This update occurs @@ -210,14 +191,14 @@ public class DesktopProperty implements UIDefaults.ActiveValue { * many desktop properties will change at once. */ protected void updateUI() { - if (!isUpdatePending()) { - setUpdatePending(true); + if (!updatePending) { + updatePending = true; Runnable uiUpdater = new Runnable() { public void run() { try { updateAllUIs(); } finally { - setUpdatePending(false); + updatePending = false; } } }; diff --git a/src/java.desktop/share/legal/lcms.md b/src/java.desktop/share/legal/lcms.md index d3bd7d84c8b..20a22ea4db5 100644 --- a/src/java.desktop/share/legal/lcms.md +++ b/src/java.desktop/share/legal/lcms.md @@ -1,11 +1,11 @@ -## Little Color Management System (LCMS) v2.17 +## Little Color Management System (LCMS) v2.18 ### LCMS License

 
 MIT License
 
-Copyright (C) 1998-2025 Marti Maria Saguer
+Copyright (C) 1998-2026 Marti Maria Saguer
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/legal/libpng.md b/src/java.desktop/share/legal/libpng.md
index 80d12248ec4..a2ffcca1974 100644
--- a/src/java.desktop/share/legal/libpng.md
+++ b/src/java.desktop/share/legal/libpng.md
@@ -1,4 +1,4 @@
-## libpng v1.6.54
+## libpng v1.6.55
 
 ### libpng License
 
@@ -170,6 +170,7 @@ Authors, for copyright and licensing purposes.
  * Guy Eric Schalnat
  * James Yu
  * John Bowler
+ * Joshua Inscoe
  * Kevin Bracey
  * Lucas Chollet
  * Magnus Holmgren
diff --git a/src/java.desktop/share/native/liblcms/cmsalpha.c b/src/java.desktop/share/native/liblcms/cmsalpha.c
index 2e50b65be24..bcedbde938e 100644
--- a/src/java.desktop/share/native/liblcms/cmsalpha.c
+++ b/src/java.desktop/share/native/liblcms/cmsalpha.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -406,7 +406,7 @@ int FormatterPos(cmsUInt32Number frm)
 static
 cmsFormatterAlphaFn _cmsGetFormatterAlpha(cmsContext id, cmsUInt32Number in, cmsUInt32Number out)
 {
-static cmsFormatterAlphaFn FormattersAlpha[6][6] = {
+static const cmsFormatterAlphaFn FormattersAlpha[6][6] = {
 
        /* from 8 */  { copy8,       from8to16,   from8to16SE,   from8toHLF,   from8toFLT,    from8toDBL    },
        /* from 16*/  { from16to8,   copy16,      from16to16,    from16toHLF,  from16toFLT,   from16toDBL   },
diff --git a/src/java.desktop/share/native/liblcms/cmscam02.c b/src/java.desktop/share/native/liblcms/cmscam02.c
index 45ef4eef970..168ef597032 100644
--- a/src/java.desktop/share/native/liblcms/cmscam02.c
+++ b/src/java.desktop/share/native/liblcms/cmscam02.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -285,27 +285,32 @@ CAM02COLOR InverseCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod)
            (clr.J / 100.0),
            (1.0 / (pMod->c * pMod->z)));
 
-    p1 = e / t;
     p2 = (clr.A / pMod->Nbb) + 0.305;
-    p3 = 21.0 / 20.0;
 
-    hr = clr.h * d2r;
-
-    if (fabs(sin(hr)) >= fabs(cos(hr))) {
-        p4 = p1 / sin(hr);
-        clr.b = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
-            (p4 + (2.0 + p3) * (220.0 / 1403.0) *
-            (cos(hr) / sin(hr)) - (27.0 / 1403.0) +
-            p3 * (6300.0 / 1403.0));
-        clr.a = clr.b * (cos(hr) / sin(hr));
+    if ( t <= 0.0 ) {     // special case from spec notes, avoid divide by zero
+        clr.a = clr.b = 0.0;
     }
     else {
-        p5 = p1 / cos(hr);
-        clr.a = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
-            (p5 + (2.0 + p3) * (220.0 / 1403.0) -
-            ((27.0 / 1403.0) - p3 * (6300.0 / 1403.0)) *
-            (sin(hr) / cos(hr)));
-        clr.b = clr.a * (sin(hr) / cos(hr));
+        hr = clr.h * d2r;
+        p1 = e / t;
+        p3 = 21.0 / 20.0;
+
+        if (fabs(sin(hr)) >= fabs(cos(hr))) {
+            p4 = p1 / sin(hr);
+            clr.b = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
+                (p4 + (2.0 + p3) * (220.0 / 1403.0) *
+                (cos(hr) / sin(hr)) - (27.0 / 1403.0) +
+                p3 * (6300.0 / 1403.0));
+            clr.a = clr.b * (cos(hr) / sin(hr));
+        }
+        else {
+            p5 = p1 / cos(hr);
+            clr.a = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
+                (p5 + (2.0 + p3) * (220.0 / 1403.0) -
+                ((27.0 / 1403.0) - p3 * (6300.0 / 1403.0)) *
+                (sin(hr) / cos(hr)));
+            clr.b = clr.a * (sin(hr) / cos(hr));
+        }
     }
 
     clr.RGBpa[0] = ((460.0 / 1403.0) * p2) +
diff --git a/src/java.desktop/share/native/liblcms/cmscgats.c b/src/java.desktop/share/native/liblcms/cmscgats.c
index 3e62d064c3f..e8a75c7355f 100644
--- a/src/java.desktop/share/native/liblcms/cmscgats.c
+++ b/src/java.desktop/share/native/liblcms/cmscgats.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -295,7 +295,7 @@ typedef struct {
         WRITEMODE as;      // How is supposed to be written
     } PROPERTY;
 
-static PROPERTY PredefinedProperties[] = {
+static const PROPERTY PredefinedProperties[] = {
 
         {"NUMBER_OF_FIELDS", WRITE_UNCOOKED},    // Required - NUMBER OF FIELDS
         {"NUMBER_OF_SETS",   WRITE_UNCOOKED},    // Required - NUMBER OF SETS
@@ -458,7 +458,7 @@ cmsBool StringAppend(string* s, char c)
         new_ptr = (char*) AllocChunk(s->it8, s->max);
         if (new_ptr == NULL) return FALSE;
 
-        if (new_ptr != NULL && s->begin != NULL)
+        if (s->begin != NULL)
             memcpy(new_ptr, s->begin, s->len);
 
         s->begin = new_ptr;
@@ -899,6 +899,11 @@ void InSymbol(cmsIT8* it8)
                     sign = -1;
                     NextCh(it8);
                 }
+                else
+                    if (it8->ch == '+') {
+                        sign = +1;
+                        NextCh(it8);
+                    }
 
                 it8->inum = 0;
                 it8->sy   = SINUM;
@@ -3206,7 +3211,7 @@ cmsBool ParseCube(cmsIT8* cube, cmsStage** Shaper, cmsStage** CLUT, char title[]
 
                 int nodes = lut_size * lut_size * lut_size;
 
-                cmsFloat32Number* lut_table = _cmsMalloc(cube->ContextID, nodes * 3 * sizeof(cmsFloat32Number));
+                cmsFloat32Number* lut_table = (cmsFloat32Number*) _cmsMalloc(cube->ContextID, nodes * 3 * sizeof(cmsFloat32Number));
                 if (lut_table == NULL) return FALSE;
 
                 for (i = 0; i < nodes; i++) {
diff --git a/src/java.desktop/share/native/liblcms/cmscnvrt.c b/src/java.desktop/share/native/liblcms/cmscnvrt.c
index 9f8619cb9da..c66dbcbebad 100644
--- a/src/java.desktop/share/native/liblcms/cmscnvrt.c
+++ b/src/java.desktop/share/native/liblcms/cmscnvrt.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmserr.c b/src/java.desktop/share/native/liblcms/cmserr.c
index d421c550d32..877beb9ca6a 100644
--- a/src/java.desktop/share/native/liblcms/cmserr.c
+++ b/src/java.desktop/share/native/liblcms/cmserr.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsgamma.c b/src/java.desktop/share/native/liblcms/cmsgamma.c
index 773858b0c1f..bace6ab02e2 100644
--- a/src/java.desktop/share/native/liblcms/cmsgamma.c
+++ b/src/java.desktop/share/native/liblcms/cmsgamma.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -1187,6 +1187,7 @@ cmsBool smooth2(cmsContext ContextID, cmsFloat32Number w[], cmsFloat32Number y[]
     cmsFloat32Number *c, *d, *e;
     cmsBool st;
 
+    if (m < 4 || lambda < MATRIX_DET_TOLERANCE) return FALSE;
 
     c = (cmsFloat32Number*) _cmsCalloc(ContextID, MAX_NODES_IN_CURVE, sizeof(cmsFloat32Number));
     d = (cmsFloat32Number*) _cmsCalloc(ContextID, MAX_NODES_IN_CURVE, sizeof(cmsFloat32Number));
diff --git a/src/java.desktop/share/native/liblcms/cmsgmt.c b/src/java.desktop/share/native/liblcms/cmsgmt.c
index 03ac70202a5..1b023dcc299 100644
--- a/src/java.desktop/share/native/liblcms/cmsgmt.c
+++ b/src/java.desktop/share/native/liblcms/cmsgmt.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmshalf.c b/src/java.desktop/share/native/liblcms/cmshalf.c
index 7e5f7a3c7e0..e1fb1d55488 100644
--- a/src/java.desktop/share/native/liblcms/cmshalf.c
+++ b/src/java.desktop/share/native/liblcms/cmshalf.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsintrp.c b/src/java.desktop/share/native/liblcms/cmsintrp.c
index 43c47429c3c..23e59a229a9 100644
--- a/src/java.desktop/share/native/liblcms/cmsintrp.c
+++ b/src/java.desktop/share/native/liblcms/cmsintrp.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -984,9 +984,9 @@ void Eval4Inputs(CMSREGISTER const cmsUInt16Number Input[],
                                 c1 = c2 = c3 = 0;
                             }
 
-        Rest = c1 * rx + c2 * ry + c3 * rz;
+        Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
 
-        Tmp1[OutChan] = (cmsUInt16Number)(c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest)));
+        Tmp1[OutChan] = (cmsUInt16Number)c0 + ((Rest + (Rest >> 16)) >> 16);
     }
 
 
@@ -1048,9 +1048,9 @@ void Eval4Inputs(CMSREGISTER const cmsUInt16Number Input[],
                                 c1 = c2 = c3 = 0;
                             }
 
-        Rest = c1 * rx + c2 * ry + c3 * rz;
+        Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
 
-        Tmp2[OutChan] = (cmsUInt16Number) (c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest)));
+        Tmp2[OutChan] = (cmsUInt16Number) c0 + ((Rest + (Rest >> 16)) >> 16);
     }
 
 
diff --git a/src/java.desktop/share/native/liblcms/cmsio0.c b/src/java.desktop/share/native/liblcms/cmsio0.c
index 5258b7939d2..5a4f09af5bc 100644
--- a/src/java.desktop/share/native/liblcms/cmsio0.c
+++ b/src/java.desktop/share/native/liblcms/cmsio0.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -685,6 +685,7 @@ void _cmsDeleteTagByPos(_cmsICCPROFILE* Icc, int i)
         // Free previous version
         if (Icc ->TagSaveAsRaw[i]) {
             _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]);
+            Icc->TagSaveAsRaw[i] = FALSE;
         }
         else {
             cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i];
@@ -1605,6 +1606,8 @@ void freeOneTag(_cmsICCPROFILE* Icc, cmsUInt32Number i)
         else
             _cmsFree(Icc->ContextID, Icc->TagPtrs[i]);
     }
+
+    Icc->TagPtrs[i] = NULL;
 }
 
 // Closes a profile freeing any involved resources
@@ -1847,8 +1850,11 @@ cmsBool CMSEXPORT cmsWriteTag(cmsHPROFILE hProfile, cmsTagSignature sig, const v
 
     if (!_cmsNewTag(Icc, sig, &i)) goto Error;
 
-    // This is not raw
-    Icc ->TagSaveAsRaw[i] = FALSE;
+    // This cannot be RAW
+    if (Icc->TagSaveAsRaw[i]) {
+        cmsSignalError(Icc->ContextID, cmsERROR_ALREADY_DEFINED, "Tag  '%x' was already saved as RAW", sig);
+        goto Error;
+    }
 
     // This is not a link
     Icc ->TagLinked[i] = (cmsTagSignature) 0;
diff --git a/src/java.desktop/share/native/liblcms/cmsio1.c b/src/java.desktop/share/native/liblcms/cmsio1.c
index 48772c7cbde..463f1192c2a 100644
--- a/src/java.desktop/share/native/liblcms/cmsio1.c
+++ b/src/java.desktop/share/native/liblcms/cmsio1.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -1012,7 +1012,13 @@ const cmsMLU* GetInfo(cmsHPROFILE hProfile, cmsInfoType Info)
     switch (Info) {
 
     case cmsInfoDescription:
-        sig = cmsSigProfileDescriptionTag;
+        /**
+        * Add for MacOS, which uses propiertary tags for description
+        */
+        if (cmsIsTag(hProfile, cmsSigProfileDescriptionMLTag))
+            sig = cmsSigProfileDescriptionMLTag;
+        else
+            sig = cmsSigProfileDescriptionTag;
         break;
 
     case cmsInfoManufacturer:
diff --git a/src/java.desktop/share/native/liblcms/cmslut.c b/src/java.desktop/share/native/liblcms/cmslut.c
index 3cf4e8cac5a..28220eae667 100644
--- a/src/java.desktop/share/native/liblcms/cmslut.c
+++ b/src/java.desktop/share/native/liblcms/cmslut.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsmd5.c b/src/java.desktop/share/native/liblcms/cmsmd5.c
index d9b9a4e5260..f18300ebace 100644
--- a/src/java.desktop/share/native/liblcms/cmsmd5.c
+++ b/src/java.desktop/share/native/liblcms/cmsmd5.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsmtrx.c b/src/java.desktop/share/native/liblcms/cmsmtrx.c
index 841da662a10..1db000752e3 100644
--- a/src/java.desktop/share/native/liblcms/cmsmtrx.c
+++ b/src/java.desktop/share/native/liblcms/cmsmtrx.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsnamed.c b/src/java.desktop/share/native/liblcms/cmsnamed.c
index 451bfe9f34d..acdaabc3ec2 100644
--- a/src/java.desktop/share/native/liblcms/cmsnamed.c
+++ b/src/java.desktop/share/native/liblcms/cmsnamed.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -303,7 +303,7 @@ cmsUInt32Number encodeUTF8(char* out, const wchar_t* in, cmsUInt32Number max_wch
     cmsUInt32Number size = 0;
     cmsUInt32Number len_w = 0;
 
-    while (*in && len_w < max_wchars)
+    while (len_w < max_wchars && *in)
     {
         if (*in >= 0xd800 && *in <= 0xdbff)
             codepoint = ((*in - 0xd800) << 10) + 0x10000;
@@ -1071,17 +1071,17 @@ cmsSEQ* CMSEXPORT cmsDupProfileSequenceDescription(const cmsSEQ* pseq)
     if (pseq == NULL)
         return NULL;
 
-    NewSeq = (cmsSEQ*) _cmsMalloc(pseq -> ContextID, sizeof(cmsSEQ));
+    NewSeq = (cmsSEQ*)_cmsMallocZero(pseq->ContextID, sizeof(cmsSEQ));
     if (NewSeq == NULL) return NULL;
 
+    NewSeq->ContextID = pseq->ContextID;
 
-    NewSeq -> seq      = (cmsPSEQDESC*) _cmsCalloc(pseq ->ContextID, pseq ->n, sizeof(cmsPSEQDESC));
-    if (NewSeq ->seq == NULL) goto Error;
+    NewSeq->seq = (cmsPSEQDESC*)_cmsCalloc(pseq->ContextID, pseq->n, sizeof(cmsPSEQDESC));
+    if (NewSeq->seq == NULL) goto Error;
 
-    NewSeq -> ContextID = pseq ->ContextID;
-    NewSeq -> n        = pseq ->n;
+    NewSeq->n = pseq->n;
 
-    for (i=0; i < pseq->n; i++) {
+    for (i = 0; i < pseq->n; i++) {
 
         memmove(&NewSeq ->seq[i].attributes, &pseq ->seq[i].attributes, sizeof(cmsUInt64Number));
 
diff --git a/src/java.desktop/share/native/liblcms/cmsopt.c b/src/java.desktop/share/native/liblcms/cmsopt.c
index 767008e68c5..9e71426a332 100644
--- a/src/java.desktop/share/native/liblcms/cmsopt.c
+++ b/src/java.desktop/share/native/liblcms/cmsopt.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -698,11 +698,16 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
     if (ColorSpace == (cmsColorSpaceSignature)0 ||
         OutputColorSpace == (cmsColorSpaceSignature)0) return FALSE;
 
-    nGridPoints = _cmsReasonableGridpointsByColorspace(ColorSpace, *dwFlags);
-
     // For empty LUTs, 2 points are enough
     if (cmsPipelineStageCount(*Lut) == 0)
         nGridPoints = 2;
+    else
+    {
+        nGridPoints = _cmsReasonableGridpointsByColorspace(ColorSpace, *dwFlags);
+
+        // Lab16 as input cannot be optimized by a CLUT due to centering issues, thanks to Mike Chaney for discovering this.
+        if (!(*dwFlags & cmsFLAGS_FORCE_CLUT) && (ColorSpace == cmsSigLabData) && (T_BYTES(*InputFormat) == 2)) return FALSE;
+    }
 
     Src = *Lut;
 
@@ -813,6 +818,11 @@ Error:
             Dest ->OutputChannels,
             DataSetOut);
 
+        if (p16 == NULL) {
+            cmsPipelineFree(Dest);
+            return FALSE;
+        }
+
         _cmsPipelineSetOptimizationParameters(Dest, PrelinEval16, (void*) p16, PrelinOpt16free, Prelin16dup);
     }
 
diff --git a/src/java.desktop/share/native/liblcms/cmspack.c b/src/java.desktop/share/native/liblcms/cmspack.c
index d430e73051d..b740567af3b 100644
--- a/src/java.desktop/share/native/liblcms/cmspack.c
+++ b/src/java.desktop/share/native/liblcms/cmspack.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmspcs.c b/src/java.desktop/share/native/liblcms/cmspcs.c
index 5f1b1f0d8e6..8c33057721e 100644
--- a/src/java.desktop/share/native/liblcms/cmspcs.c
+++ b/src/java.desktop/share/native/liblcms/cmspcs.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsplugin.c b/src/java.desktop/share/native/liblcms/cmsplugin.c
index aaad39f52b0..a943c9f4dd9 100644
--- a/src/java.desktop/share/native/liblcms/cmsplugin.c
+++ b/src/java.desktop/share/native/liblcms/cmsplugin.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -522,7 +522,7 @@ cmsBool CMSEXPORT _cmsIOPrintf(cmsIOHANDLER* io, const char* frm, ...)
     va_start(args, frm);
 
     len = vsnprintf((char*) Buffer, 2047, frm, args);
-    if (len < 0) {
+    if (len < 0 || len >= 2047) {
         va_end(args);
         return FALSE;   // Truncated, which is a fatal error for us
     }
diff --git a/src/java.desktop/share/native/liblcms/cmsps2.c b/src/java.desktop/share/native/liblcms/cmsps2.c
index 476817e9c1a..80f7c8084ae 100644
--- a/src/java.desktop/share/native/liblcms/cmsps2.c
+++ b/src/java.desktop/share/native/liblcms/cmsps2.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmssamp.c b/src/java.desktop/share/native/liblcms/cmssamp.c
index ca5c4a9d693..c54a0d4ea72 100644
--- a/src/java.desktop/share/native/liblcms/cmssamp.c
+++ b/src/java.desktop/share/native/liblcms/cmssamp.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -152,9 +152,12 @@ cmsBool  BlackPointAsDarkerColorant(cmsHPROFILE    hInput,
     // Convert black to Lab
     cmsDoTransform(xform, Black, &Lab, 1);
 
-    // Force it to be neutral, check for inconsistencies
-    Lab.a = Lab.b = 0;
-    if (Lab.L > 50 || Lab.L < 0) Lab.L = 0;
+    if (Lab.L > 95)
+        Lab.L = 0;  // for synthetical negative profiles
+    else if (Lab.L < 0)
+        Lab.L = 0;
+    else if (Lab.L > 50)
+        Lab.L = 50;
 
     // Free the resources
     cmsDeleteTransform(xform);
@@ -352,7 +355,7 @@ cmsFloat64Number RootOfLeastSquaresFitQuadraticCurve(int n, cmsFloat64Number x[]
     if (fabs(a) < 1.0E-10) {
 
         if (fabs(b) < 1.0E-10) return 0;
-        return cmsmin(0, cmsmax(50, -c/b ));
+        return cmsmax(0, cmsmin(50, -c/b ));
     }
     else {
 
diff --git a/src/java.desktop/share/native/liblcms/cmssm.c b/src/java.desktop/share/native/liblcms/cmssm.c
index e2a810a2669..b79cd85488b 100644
--- a/src/java.desktop/share/native/liblcms/cmssm.c
+++ b/src/java.desktop/share/native/liblcms/cmssm.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmstypes.c b/src/java.desktop/share/native/liblcms/cmstypes.c
index 22514f88226..eab74940cd0 100644
--- a/src/java.desktop/share/native/liblcms/cmstypes.c
+++ b/src/java.desktop/share/native/liblcms/cmstypes.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -4786,7 +4786,6 @@ cmsBool ReadMPEElem(struct _cms_typehandler_struct* self,
 
     return TRUE;
 
-    cmsUNUSED_PARAMETER(SizeOfTag);
     cmsUNUSED_PARAMETER(n);
 }
 
@@ -4894,9 +4893,11 @@ cmsBool Type_MPE_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, v
                  goto Error;
         }
 
+         Before = io ->Tell(io);
+
         if (!_cmsWriteUInt32Number(io, ElementSig)) goto Error;
         if (!_cmsWriteUInt32Number(io, 0)) goto Error;
-        Before = io ->Tell(io);
+
         if (!TypeHandler ->WritePtr(self, io, Elem, 1)) goto Error;
         if (!_cmsWriteAlignment(io)) goto Error;
 
@@ -5645,9 +5646,7 @@ void* Type_VideoSignal_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER*
 {
     cmsVideoSignalType* cicp = NULL;
 
-    if (SizeOfTag != 8) return NULL;
-
-    if (!_cmsReadUInt32Number(io, NULL)) return NULL;
+    if (SizeOfTag != 4) return NULL;
 
     cicp = (cmsVideoSignalType*)_cmsCalloc(self->ContextID, 1, sizeof(cmsVideoSignalType));
     if (cicp == NULL) return NULL;
@@ -5671,7 +5670,6 @@ cmsBool Type_VideoSignal_Write(struct _cms_typehandler_struct* self, cmsIOHANDLE
 {
     cmsVideoSignalType* cicp = (cmsVideoSignalType*)Ptr;
 
-    if (!_cmsWriteUInt32Number(io, 0)) return FALSE;
     if (!_cmsWriteUInt8Number(io, cicp->ColourPrimaries)) return FALSE;
     if (!_cmsWriteUInt8Number(io, cicp->TransferCharacteristics)) return FALSE;
     if (!_cmsWriteUInt8Number(io, cicp->MatrixCoefficients)) return FALSE;
@@ -5744,11 +5742,11 @@ void Type_MHC2_Free(struct _cms_typehandler_struct* self, void* Ptr)
 
 void* Type_MHC2_Dup(struct _cms_typehandler_struct* self, const void* Ptr, cmsUInt32Number n)
 {
-    cmsMHC2Type* mhc2 = _cmsDupMem(self->ContextID, Ptr, sizeof(cmsMHC2Type));
+    cmsMHC2Type* mhc2 = (cmsMHC2Type*)_cmsDupMem(self->ContextID, Ptr, sizeof(cmsMHC2Type));
 
-    mhc2->RedCurve = _cmsDupMem(self->ContextID,   mhc2->RedCurve, mhc2->CurveEntries*sizeof(cmsFloat64Number));
-    mhc2->GreenCurve = _cmsDupMem(self->ContextID, mhc2->GreenCurve, mhc2->CurveEntries * sizeof(cmsFloat64Number));
-    mhc2->BlueCurve = _cmsDupMem(self->ContextID,  mhc2->BlueCurve, mhc2->CurveEntries * sizeof(cmsFloat64Number));
+    mhc2->RedCurve = (cmsFloat64Number*) _cmsDupMem(self->ContextID,   mhc2->RedCurve, mhc2->CurveEntries*sizeof(cmsFloat64Number));
+    mhc2->GreenCurve = (cmsFloat64Number*) _cmsDupMem(self->ContextID, mhc2->GreenCurve, mhc2->CurveEntries * sizeof(cmsFloat64Number));
+    mhc2->BlueCurve = (cmsFloat64Number*) _cmsDupMem(self->ContextID,  mhc2->BlueCurve, mhc2->CurveEntries * sizeof(cmsFloat64Number));
 
     if (mhc2->RedCurve == NULL ||
         mhc2->GreenCurve == NULL ||
@@ -5786,7 +5784,6 @@ cmsBool Type_MHC2_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io,
     cmsUInt32Number MatrixOffset;
     cmsUInt32Number OffsetRedTable, OffsetGreenTable, OffsetBlueTable;
 
-    if (!_cmsWriteUInt32Number(io, 0)) return FALSE;
     if (!_cmsWriteUInt32Number(io, mhc2->CurveEntries)) return FALSE;
 
     if (!_cmsWrite15Fixed16Number(io, mhc2->MinLuminance)) return FALSE;
@@ -5811,10 +5808,20 @@ cmsBool Type_MHC2_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io,
     }
 
     OffsetRedTable = io->Tell(io) - BaseOffset;
+
+    if(!_cmsWriteUInt32Number(io, cmsSigS15Fixed16ArrayType)) return FALSE;
+    if(!_cmsWriteUInt32Number(io, 0)) return FALSE;
+
     if (!WriteDoubles(io, mhc2->CurveEntries, mhc2->RedCurve)) return FALSE;
+
     OffsetGreenTable = io->Tell(io) - BaseOffset;
+    if (!_cmsWriteUInt32Number(io, cmsSigS15Fixed16ArrayType)) return FALSE;
+    if (!_cmsWriteUInt32Number(io, 0)) return FALSE;
     if (!WriteDoubles(io, mhc2->CurveEntries, mhc2->GreenCurve)) return FALSE;
+
     OffsetBlueTable = io->Tell(io) - BaseOffset;
+    if (!_cmsWriteUInt32Number(io, cmsSigS15Fixed16ArrayType)) return FALSE;
+    if (!_cmsWriteUInt32Number(io, 0)) return FALSE;
     if (!WriteDoubles(io, mhc2->CurveEntries, mhc2->BlueCurve)) return FALSE;
 
     if (!io->Seek(io, TablesOffsetPos)) return FALSE;
@@ -5858,8 +5865,6 @@ void* Type_MHC2_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cms
     cmsUInt32Number MatrixOffset;
     cmsUInt32Number OffsetRedTable, OffsetGreenTable, OffsetBlueTable;
 
-    if (!_cmsReadUInt32Number(io, NULL)) return NULL;
-
     mhc2 = (cmsMHC2Type*)_cmsCalloc(self->ContextID, 1, sizeof(cmsMHC2Type));
     if (mhc2 == NULL) return NULL;
 
@@ -5890,9 +5895,10 @@ void* Type_MHC2_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cms
         if (!ReadDoublesAt(io, BaseOffset + MatrixOffset, 3*4, &mhc2->XYZ2XYZmatrix[0][0])) goto Error;
     }
 
-    if (!ReadDoublesAt(io, BaseOffset + OffsetRedTable, mhc2->CurveEntries, mhc2->RedCurve)) goto Error;
-    if (!ReadDoublesAt(io, BaseOffset + OffsetGreenTable, mhc2->CurveEntries, mhc2->GreenCurve)) goto Error;
-    if (!ReadDoublesAt(io, BaseOffset + OffsetBlueTable, mhc2->CurveEntries, mhc2->BlueCurve)) goto Error;
+    // Skip sf32 tag and filler (8bytes)
+    if (!ReadDoublesAt(io, BaseOffset + OffsetRedTable + 8, mhc2->CurveEntries, mhc2->RedCurve)) goto Error;
+    if (!ReadDoublesAt(io, BaseOffset + OffsetGreenTable + 8, mhc2->CurveEntries, mhc2->GreenCurve)) goto Error;
+    if (!ReadDoublesAt(io, BaseOffset + OffsetBlueTable + 8, mhc2->CurveEntries, mhc2->BlueCurve)) goto Error;
 
     // Success
     *nItems = 1;
diff --git a/src/java.desktop/share/native/liblcms/cmsvirt.c b/src/java.desktop/share/native/liblcms/cmsvirt.c
index 1ef86dae054..0dfc6e947a5 100644
--- a/src/java.desktop/share/native/liblcms/cmsvirt.c
+++ b/src/java.desktop/share/native/liblcms/cmsvirt.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -400,7 +400,7 @@ int InkLimitingSampler(CMSREGISTER const cmsUInt16Number In[], CMSREGISTER cmsUI
     SumCMY   = (cmsFloat64Number) In[0]  + In[1] + In[2];
     SumCMYK  = SumCMY + In[3];
 
-    if (SumCMYK > InkLimit) {
+    if (SumCMYK > InkLimit && SumCMY > 0) {
 
         Ratio = 1 - ((SumCMYK - InkLimit) / SumCMY);
         if (Ratio < 0)
@@ -513,16 +513,20 @@ cmsHPROFILE CMSEXPORT cmsCreateLab2ProfileTHR(cmsContext ContextID, const cmsCIE
     cmsSetColorSpace(hProfile,  cmsSigLabData);
     cmsSetPCS(hProfile,         cmsSigLabData);
 
-    if (!SetTextTags(hProfile, L"Lab identity built-in")) return NULL;
+    if (!SetTextTags(hProfile, L"Lab identity built-in"))
+        goto Error;
 
     // An identity LUT is all we need
     LUT = cmsPipelineAlloc(ContextID, 3, 3);
-    if (LUT == NULL) goto Error;
+    if (LUT == NULL)
+        goto Error;
 
     if (!cmsPipelineInsertStage(LUT, cmsAT_BEGIN, _cmsStageAllocIdentityCLut(ContextID, 3)))
         goto Error;
 
-    if (!cmsWriteTag(hProfile, cmsSigAToB0Tag, LUT)) goto Error;
+    if (!cmsWriteTag(hProfile, cmsSigAToB0Tag, LUT))
+        goto Error;
+
     cmsPipelineFree(LUT);
 
     return hProfile;
@@ -550,8 +554,14 @@ cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIE
 {
     cmsHPROFILE hProfile;
     cmsPipeline* LUT = NULL;
+    cmsCIEXYZ xyz;
 
-    hProfile = cmsCreateRGBProfileTHR(ContextID, WhitePoint == NULL ? cmsD50_xyY() : WhitePoint, NULL, NULL);
+    if (WhitePoint == NULL)
+        xyz = *cmsD50_XYZ();
+    else
+        cmsxyY2XYZ(&xyz, WhitePoint);
+
+    hProfile = cmsCreateRGBProfileTHR(ContextID, NULL, NULL, NULL);
     if (hProfile == NULL) return NULL;
 
     cmsSetProfileVersion(hProfile, 4.4);
@@ -560,6 +570,7 @@ cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIE
     cmsSetColorSpace(hProfile,  cmsSigLabData);
     cmsSetPCS(hProfile,         cmsSigLabData);
 
+    if (!cmsWriteTag(hProfile, cmsSigMediaWhitePointTag, &xyz)) goto Error;
     if (!SetTextTags(hProfile, L"Lab identity built-in")) goto Error;
 
     // An empty LUTs is all we need
@@ -929,25 +940,24 @@ cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID,
 
     for (i=0; i < MAX_INPUT_DIMENSIONS; i++) Dimensions[i] = nLUTPoints;
     CLUT = cmsStageAllocCLut16bitGranular(ContextID, Dimensions, 3, 3, NULL);
-    if (CLUT == NULL) goto Error;
-
-
-    if (!cmsStageSampleCLut16bit(CLUT, bchswSampler, (void*) &bchsw, 0)) {
-
-        // Shouldn't reach here
+    if (CLUT == NULL)
         goto Error;
-    }
 
-    if (!cmsPipelineInsertStage(Pipeline, cmsAT_END, CLUT)) {
+    if (!cmsStageSampleCLut16bit(CLUT, bchswSampler, (void*) &bchsw, 0))
+        goto Error;
+
+    if (!cmsPipelineInsertStage(Pipeline, cmsAT_END, CLUT))
         goto Error;
-    }
 
     // Create tags
-    if (!SetTextTags(hICC, L"BCHS built-in")) return NULL;
+    if (!SetTextTags(hICC, L"BCHS built-in"))
+        goto Error;
 
-    cmsWriteTag(hICC, cmsSigMediaWhitePointTag, (void*) cmsD50_XYZ());
+    if (!cmsWriteTag(hICC, cmsSigMediaWhitePointTag, (void*)cmsD50_XYZ()))
+        goto Error;
 
-    cmsWriteTag(hICC, cmsSigAToB0Tag, (void*) Pipeline);
+    if (!cmsWriteTag(hICC, cmsSigAToB0Tag, (void*)Pipeline))
+        goto Error;
 
     // Pipeline is already on virtual profile
     cmsPipelineFree(Pipeline);
diff --git a/src/java.desktop/share/native/liblcms/cmswtpnt.c b/src/java.desktop/share/native/liblcms/cmswtpnt.c
index ebba2cd6a97..f6337765c0c 100644
--- a/src/java.desktop/share/native/liblcms/cmswtpnt.c
+++ b/src/java.desktop/share/native/liblcms/cmswtpnt.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/cmsxform.c b/src/java.desktop/share/native/liblcms/cmsxform.c
index 1eb3eecbf18..b5dd302b973 100644
--- a/src/java.desktop/share/native/liblcms/cmsxform.c
+++ b/src/java.desktop/share/native/liblcms/cmsxform.c
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -1101,6 +1101,8 @@ cmsBool  IsProperColorSpace(cmsColorSpaceSignature Check, cmsUInt32Number dwForm
     int Space1 = (int) T_COLORSPACE(dwFormat);
     int Space2 = _cmsLCMScolorSpace(Check);
 
+    if (dwFormat == 0) return TRUE; // Bypass used by linkicc
+
     if (Space1 == PT_ANY) return (T_CHANNELS(dwFormat) == cmsChannelsOf(Check));
     if (Space1 == Space2) return TRUE;
 
@@ -1183,6 +1185,11 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID,
         if (hGamutProfile == NULL) dwFlags &= ~cmsFLAGS_GAMUTCHECK;
     }
 
+    if ((dwFlags & cmsFLAGS_GAMUTCHECK) && (nGamutPCSposition <= 0 || nGamutPCSposition >= nProfiles - 1)) {
+        cmsSignalError(ContextID, cmsERROR_RANGE, "Wrong gamut PCS position '%d'", nGamutPCSposition);
+        return NULL;
+    }
+
     // On floating point transforms, inhibit cache
     if (_cmsFormatterIsFloat(InputFormat) || _cmsFormatterIsFloat(OutputFormat))
         dwFlags |= cmsFLAGS_NOCACHE;
diff --git a/src/java.desktop/share/native/liblcms/lcms2.h b/src/java.desktop/share/native/liblcms/lcms2.h
index 5ba09661308..17a52384721 100644
--- a/src/java.desktop/share/native/liblcms/lcms2.h
+++ b/src/java.desktop/share/native/liblcms/lcms2.h
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2025 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
@@ -52,7 +52,7 @@
 //
 //---------------------------------------------------------------------------------
 //
-// Version 2.17
+// Version 2.18
 //
 
 #ifndef _lcms2_H
@@ -116,7 +116,7 @@ extern "C" {
 #endif
 
 // Version/release
-#define LCMS_VERSION        2170
+#define LCMS_VERSION        2180
 
 // I will give the chance of redefining basic types for compilers that are not fully C99 compliant
 #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
diff --git a/src/java.desktop/share/native/liblcms/lcms2_internal.h b/src/java.desktop/share/native/liblcms/lcms2_internal.h
index d14c0dd823e..6bfe67e5350 100644
--- a/src/java.desktop/share/native/liblcms/lcms2_internal.h
+++ b/src/java.desktop/share/native/liblcms/lcms2_internal.h
@@ -30,7 +30,7 @@
 
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/liblcms/lcms2_plugin.h b/src/java.desktop/share/native/liblcms/lcms2_plugin.h
index bdfc76f6bf5..85de9bc56d5 100644
--- a/src/java.desktop/share/native/liblcms/lcms2_plugin.h
+++ b/src/java.desktop/share/native/liblcms/lcms2_plugin.h
@@ -30,7 +30,7 @@
 //---------------------------------------------------------------------------------
 //
 //  Little Color Management System
-//  Copyright (c) 1998-2024 Marti Maria Saguer
+//  Copyright (c) 1998-2026 Marti Maria Saguer
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the "Software"),
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES b/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES
index 3bb1baecd23..af9fcff6eb3 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/CHANGES
@@ -5988,7 +5988,7 @@ Version 1.6.32rc01 [August 18, 2017]
 
 Version 1.6.32rc02 [August 22, 2017]
   Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
-    project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
+    project .
 
 Version 1.6.32 [August 24, 2017]
   No changes.
@@ -6323,15 +6323,21 @@ Version 1.6.53 [December 5, 2025]
 
 Version 1.6.54 [January 12, 2026]
   Fixed CVE-2026-22695 (medium severity):
-    Heap buffer over-read in `png_image_read_direct_scaled.
+    Heap buffer over-read in `png_image_read_direct_scaled`.
     (Reported and fixed by Petr Simecek.)
   Fixed CVE-2026-22801 (medium severity):
     Integer truncation causing heap buffer over-read in `png_image_write_*`.
   Implemented various improvements in oss-fuzz.
     (Contributed by Philippe Antoine.)
 
+Version 1.6.55 [February 9, 2026]
+  Fixed CVE-2026-25646 (high severity):
+    Heap buffer overflow in `png_set_quantize`.
+    (Reported and fixed by Joshua Inscoe.)
+  Resolved an oss-fuzz build issue involving nalloc.
+    (Contributed by Philippe Antoine.)
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
 Subscription is required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-implement
+
 to subscribe.
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/README b/src/java.desktop/share/native/libsplashscreen/libpng/README
index 63d1376edf7..6e0d1e33137 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/README
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.54
+README for libpng version 1.6.55
 ================================
 
 See the note about version numbers near the top of `png.h`.
@@ -24,14 +24,14 @@ for more things than just PNG files.  You can use zlib as a drop-in
 replacement for `fread()` and `fwrite()`, if you are so inclined.
 
 zlib should be available at the same place that libpng is, or at
-https://zlib.net .
+.
 
 You may also want a copy of the PNG specification.  It is available
 as an RFC, a W3C Recommendation, and an ISO/IEC Standard.  You can find
-these at http://www.libpng.org/pub/png/pngdocs.html .
+these at .
 
-This code is currently being archived at https://libpng.sourceforge.io
-in the download area, and at http://libpng.download/src .
+This code is currently being archived at 
+in the download area, and at .
 
 This release, based in a large way on Glenn's, Guy's and Andreas'
 earlier work, was created and will be supported by myself and the PNG
@@ -39,12 +39,12 @@ development group.
 
 Send comments, corrections and commendations to `png-mng-implement`
 at `lists.sourceforge.net`.  (Subscription is required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-implement
+
 to subscribe.)
 
 Send general questions about the PNG specification to `png-mng-misc`
 at `lists.sourceforge.net`.  (Subscription is required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-misc
+
 to subscribe.)
 
 Historical notes
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/png.c b/src/java.desktop/share/native/libsplashscreen/libpng/png.c
index 5636b4a754e..955fda8dd7e 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/png.c
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/png.c
@@ -42,7 +42,7 @@
 #include "pngpriv.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_54 Your_png_h_is_not_version_1_6_54;
+typedef png_libpng_version_1_6_55 Your_png_h_is_not_version_1_6_55;
 
 /* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
  * corresponding macro definitions.  This causes a compile time failure if
@@ -849,7 +849,7 @@ png_get_copyright(png_const_structrp png_ptr)
    return PNG_STRING_COPYRIGHT
 #else
    return PNG_STRING_NEWLINE \
-      "libpng version 1.6.54" PNG_STRING_NEWLINE \
+      "libpng version 1.6.55" PNG_STRING_NEWLINE \
       "Copyright (c) 2018-2026 Cosmin Truta" PNG_STRING_NEWLINE \
       "Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
       PNG_STRING_NEWLINE \
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/png.h b/src/java.desktop/share/native/libsplashscreen/libpng/png.h
index ab8876a9626..e95c0444399 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/png.h
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/png.h
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * libpng version 1.6.54
+ * libpng version 1.6.55
  *
  * Copyright (c) 2018-2026 Cosmin Truta
  * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -43,7 +43,7 @@
  *   libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
  *   libpng versions 0.97, January 1998, through 1.6.35, July 2018:
  *     Glenn Randers-Pehrson
- *   libpng versions 1.6.36, December 2018, through 1.6.54, January 2026:
+ *   libpng versions 1.6.36, December 2018, through 1.6.55, February 2026:
  *     Cosmin Truta
  *   See also "Contributing Authors", below.
  */
@@ -267,7 +267,7 @@
  *    ...
  *    1.5.30                  15    10530  15.so.15.30[.0]
  *    ...
- *    1.6.54                  16    10654  16.so.16.54[.0]
+ *    1.6.55                  16    10655  16.so.16.55[.0]
  *
  *    Henceforth the source version will match the shared-library major and
  *    minor numbers; the shared-library major version number will be used for
@@ -303,7 +303,7 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.54"
+#define PNG_LIBPNG_VER_STRING "1.6.55"
 #define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
 
 /* The versions of shared library builds should stay in sync, going forward */
@@ -314,7 +314,7 @@
 /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
 #define PNG_LIBPNG_VER_MAJOR   1
 #define PNG_LIBPNG_VER_MINOR   6
-#define PNG_LIBPNG_VER_RELEASE 54
+#define PNG_LIBPNG_VER_RELEASE 55
 
 /* This should be zero for a public release, or non-zero for a
  * development version.
@@ -345,7 +345,7 @@
  * From version 1.0.1 it is:
  * XXYYZZ, where XX=major, YY=minor, ZZ=release
  */
-#define PNG_LIBPNG_VER 10654 /* 1.6.54 */
+#define PNG_LIBPNG_VER 10655 /* 1.6.55 */
 
 /* Library configuration: these options cannot be changed after
  * the library has been built.
@@ -455,7 +455,7 @@ extern "C" {
 /* This triggers a compiler error in png.c, if png.c and png.h
  * do not agree upon the version number.
  */
-typedef char *png_libpng_version_1_6_54;
+typedef char *png_libpng_version_1_6_55;
 
 /* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.
  *
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h b/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h
index 959c604edbc..b957f8b5061 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * libpng version 1.6.54
+ * libpng version 1.6.55
  *
  * Copyright (c) 2018-2026 Cosmin Truta
  * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h b/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h
index b413b510acf..ae1ab462072 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h
@@ -31,7 +31,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  */
-/* libpng version 1.6.54 */
+/* libpng version 1.6.55 */
 
 /* Copyright (c) 2018-2026 Cosmin Truta */
 /* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
diff --git a/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c b/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c
index 7680fe64828..fcce80da1cb 100644
--- a/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c
+++ b/src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c
@@ -29,7 +29,7 @@
  * However, the following notice accompanied the original version of this
  * file and, per its terms, should not be removed:
  *
- * Copyright (c) 2018-2025 Cosmin Truta
+ * Copyright (c) 2018-2026 Cosmin Truta
  * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
  * Copyright (c) 1996-1997 Andreas Dilger
  * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -737,8 +737,8 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
                          break;
 
                      t->next = hash[d];
-                     t->left = (png_byte)i;
-                     t->right = (png_byte)j;
+                     t->left = png_ptr->palette_to_index[i];
+                     t->right = png_ptr->palette_to_index[j];
                      hash[d] = t;
                   }
                }
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java
index a7130fa7fe9..560e114982f 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XDropTargetContextPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2026, 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,7 +35,6 @@ import java.util.Iterator;
 import sun.awt.AWTAccessor;
 import sun.util.logging.PlatformLogger;
 
-import sun.awt.AppContext;
 import sun.awt.SunToolkit;
 
 import sun.awt.dnd.SunDropTargetContextPeer;
@@ -55,20 +54,14 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
 
     private static final Unsafe unsafe = XlibWrapper.unsafe;
 
-    /*
-     * A key to store a peer instance for an AppContext.
-     */
-    private static final Object DTCP_KEY = "DropTargetContextPeer";
-
     private XDropTargetContextPeer() {}
 
-    static XDropTargetContextPeer getPeer(AppContext appContext) {
+    private static XDropTargetContextPeer peer;
+
+    static XDropTargetContextPeer getPeer() {
         synchronized (_globalLock) {
-            XDropTargetContextPeer peer =
-                (XDropTargetContextPeer)appContext.get(DTCP_KEY);
             if (peer == null) {
                 peer = new XDropTargetContextPeer();
-                appContext.put(DTCP_KEY, peer);
             }
 
             return peer;
@@ -261,17 +254,11 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
                                                  int eventID) {
             Object target = xwindow.getTarget();
 
-            // The Every component is associated with some AppContext.
             assert target instanceof Component;
 
             Component component = (Component)target;
 
-            AppContext appContext = SunToolkit.targetToAppContext(target);
-
-            // Every component is associated with some AppContext.
-            assert appContext != null;
-
-            XDropTargetContextPeer peer = XDropTargetContextPeer.getPeer(appContext);
+            XDropTargetContextPeer peer = XDropTargetContextPeer.getPeer();
 
             peer.postDropTargetEvent(component, x, y, dropAction, actions, formats,
                                      nativeCtxt, eventID,
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java
index bc1b3ac9f4b..f5bb47db50c 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2026, 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
@@ -338,7 +338,7 @@ public final class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusLi
 //             Rectangle my_bounds = getBounds();
 //             setBounds(my_bounds.x, my_bounds.y, bounds.width, bounds.height, SET_BOUNDS);
         }
-        XToolkit.postEvent(XToolkit.targetToAppContext(target), new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
+        XToolkit.postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
     }
 
     void focusNext() {
@@ -735,9 +735,7 @@ public final class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusLi
             xembedLog.finest("     Drop target=" + target.getDropTarget());
         }
         if (target.getDropTarget() instanceof XEmbedDropTarget) {
-            AppContext appContext = XToolkit.targetToAppContext(getTarget());
-            XDropTargetContextPeer peer =
-                XDropTargetContextPeer.getPeer(appContext);
+            XDropTargetContextPeer peer = XDropTargetContextPeer.getPeer();
             peer.forwardEventToEmbedded(xembed.handle, ctxt, eventID);
             return true;
         } else {
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java b/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java
index f7a40312fe7..e93b311633d 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2026, 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,7 +34,6 @@ import java.io.IOException;
 import java.util.Hashtable;
 import java.util.Map;
 
-import sun.awt.AppContext;
 import sun.awt.SunToolkit;
 import sun.awt.UNIXToolkit;
 
@@ -91,8 +90,6 @@ final class XSelection {
     private Map formatMap = null;
     /* The formats supported by the current owner was set. */
     private long[] formats = null;
-    /* The AppContext in which the current owner was set. */
-    private AppContext appContext = null;
     // The X server time of the last XConvertSelection() call;
     // protected with 'lock' and awtLock.
     private static long lastRequestServerTime;
@@ -148,7 +145,6 @@ final class XSelection {
         this.contents = contents;
         this.formatMap = formatMap;
         this.formats = formats;
-        this.appContext = AppContext.getAppContext();
         this.ownershipTime = time;
 
         XToolkit.awtLock();
@@ -469,7 +465,6 @@ final class XSelection {
         contents = null;
         formatMap = null;
         formats = null;
-        appContext = null;
         ownershipTime = 0;
     }
 
@@ -483,7 +478,7 @@ final class XSelection {
         int count = 0;
 
         try {
-            SunToolkit.insertTargetMapping(this, appContext);
+            SunToolkit.insertTargetMapping(this);
 
             byteData = DataTransferer.getInstance().convertData(this,
                                                                 contents,
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java
index 473b638cb74..82423a75d0c 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XSystemTrayPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2026, 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,7 +28,6 @@ package sun.awt.X11;
 import java.awt.*;
 import java.awt.peer.SystemTrayPeer;
 import sun.awt.SunToolkit;
-import sun.awt.AppContext;
 import sun.awt.AWTAccessor;
 import sun.awt.UNIXToolkit;
 import sun.util.logging.PlatformLogger;
@@ -183,7 +182,7 @@ public final class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListene
                         .firePropertyChange(target, propertyName, oldValue, newValue);
                 }
             };
-        invokeOnEachAppContext(runnable);
+        SunToolkit.invokeLater(runnable);
     }
 
     private void createTrayPeers() {
@@ -198,7 +197,7 @@ public final class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListene
                     }
                 }
             };
-        invokeOnEachAppContext(runnable);
+        SunToolkit.invokeLater(runnable);
     }
 
     private void removeTrayPeers() {
@@ -210,13 +209,6 @@ public final class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListene
                     }
                 }
             };
-        invokeOnEachAppContext(runnable);
+        SunToolkit.invokeLater(runnable);
     }
-
-    private void invokeOnEachAppContext(Runnable runnable) {
-        for (AppContext appContext : AppContext.getAppContexts()) {
-            SunToolkit.invokeLaterOnAppContext(appContext, runnable);
-        }
-    }
-
 }
diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java b/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java
index 1b3fb9a85e9..00ad60c8bb3 100644
--- a/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2026, 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
@@ -902,7 +902,7 @@ public abstract class WComponentPeer extends WObjectPeer
      */
     void postEvent(AWTEvent event) {
         preprocessPostEvent(event);
-        WToolkit.postEvent(WToolkit.targetToAppContext(target), event);
+        WToolkit.postEvent(event);
     }
 
     void preprocessPostEvent(AWTEvent event) {}
diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java b/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java
index 9a74a1c25f7..0bd44d8ca85 100644
--- a/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2026, 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
@@ -238,8 +238,7 @@ public final class WEmbeddedFrame extends EmbeddedFrame {
                     peer.emulateActivation(true);
                 }
             };
-            WToolkit.postEvent(WToolkit.targetToAppContext(this),
-                               new InvocationEvent(this, r));
+            WToolkit.postEvent(new InvocationEvent(this, r));
         }
     }
 
diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java b/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
index a9237e21ff6..50ad23fabcd 100644
--- a/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2026, 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
@@ -602,7 +602,7 @@ final class WInputMethod extends InputMethodAdapter
                                                       commitedTextLength,
                                                       TextHitInfo.leading(caretPos),
                                                       TextHitInfo.leading(visiblePos));
-        WToolkit.postEvent(WToolkit.targetToAppContext(source), event);
+        WToolkit.postEvent(event);
     }
 
     public void inquireCandidatePosition()
@@ -641,8 +641,7 @@ final class WInputMethod extends InputMethodAdapter
                 openCandidateWindow(awtFocussedComponentPeer, x, y);
             }
         };
-        WToolkit.postEvent(WToolkit.targetToAppContext(source),
-                           new InvocationEvent(source, r));
+        WToolkit.postEvent(new InvocationEvent(source, r));
     }
 
     // java.awt.Toolkit#getNativeContainer() is not available
diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WMenuItemPeer.java b/src/java.desktop/windows/classes/sun/awt/windows/WMenuItemPeer.java
index 4abb9fa84ae..2594bd38a7d 100644
--- a/src/java.desktop/windows/classes/sun/awt/windows/WMenuItemPeer.java
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WMenuItemPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2026, 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
@@ -123,7 +123,7 @@ class WMenuItemPeer extends WObjectPeer implements MenuItemPeer {
      * Post an event. Queue it for execution by the callback thread.
      */
     void postEvent(AWTEvent event) {
-        WToolkit.postEvent(WToolkit.targetToAppContext(target), event);
+        WToolkit.postEvent(event);
     }
 
     native void create(WMenuPeer parent);
diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
index 0fdc4c6005b..4ed3e6b7e68 100644
--- a/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2026, 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
@@ -123,7 +123,6 @@ import javax.swing.text.JTextComponent;
 
 import sun.awt.AWTAccessor;
 import sun.awt.AWTAutoShutdown;
-import sun.awt.AppContext;
 import sun.awt.DisplayChangedListener;
 import sun.awt.LightweightFrame;
 import sun.awt.SunToolkit;
@@ -777,20 +776,7 @@ public final class WToolkit extends SunToolkit implements Runnable {
                 ((DisplayChangedListener) lge).displayChanged();
             }
         };
-        if (AppContext.getAppContext() != null) {
-            // Common case, standalone application
-            EventQueue.invokeLater(runnable);
-        } else {
-            if (displayChangeExecutor == null) {
-                // No synchronization, called on the Toolkit thread only
-                displayChangeExecutor = Executors.newFixedThreadPool(1, r -> {
-                    Thread t = Executors.defaultThreadFactory().newThread(r);
-                    t.setDaemon(true);
-                    return t;
-                });
-            }
-            displayChangeExecutor.submit(runnable);
-        }
+        EventQueue.invokeLater(runnable);
     }
 
     /**
@@ -910,17 +896,7 @@ public final class WToolkit extends SunToolkit implements Runnable {
         }
 
         updateXPStyleEnabled(props.get(XPSTYLE_THEME_ACTIVE));
-
-        if (AppContext.getAppContext() == null) {
-            // We cannot post the update to any EventQueue. Listeners will
-            // be called on EDTs by DesktopPropertyChangeSupport
-            updateProperties(props);
-        } else {
-            // Cannot update on Toolkit thread.
-            // DesktopPropertyChangeSupport will call listeners on Toolkit
-            // thread if it has AppContext (standalone mode)
-            EventQueue.invokeLater(() -> updateProperties(props));
-        }
+        EventQueue.invokeLater(() -> updateProperties(props));
     }
 
     private synchronized void updateProperties(final Map props) {
diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java b/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java
index 7cf92292a32..5c04803669d 100644
--- a/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2026, 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 @@ final class WTrayIconPeer extends WObjectPeer implements TrayIconPeer {
     }
 
     void postEvent(AWTEvent event) {
-        WToolkit.postEvent(WToolkit.targetToAppContext(target), event);
+        WToolkit.postEvent(event);
     }
 
     native void create();
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
index ebb43b2f078..ba69fa75f73 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2026, 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
@@ -92,6 +92,8 @@ JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute
     if (wcscmp(verb_c, L"open") == 0) {
         BOOL isExecutable = SaferiIsExecutableFileType(fileOrUri_c, FALSE);
         if (isExecutable) {
+            JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
+            JNU_ReleaseStringPlatformChars(env, verb_j, verb_c);
             return env->NewStringUTF("Unsupported URI content");
         }
     }
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp
index e679eb88dd2..19a38bcaa2d 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2026, 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
@@ -1632,7 +1632,7 @@ void AwtFrame::_NotifyModalBlocked(void *param)
         }
     }
 
-    if ((f != NULL) && ::IsWindow(f->GetHWnd()))
+    if (::IsWindow(f->GetHWnd()))
     {
         // get an HWND of the toplevel window this embedded frame is within
         HWND fHWnd = f->GetHWnd();
diff --git a/src/java.logging/share/classes/java/util/logging/Logger.java b/src/java.logging/share/classes/java/util/logging/Logger.java
index f40e419c2ca..dce0f69fa96 100644
--- a/src/java.logging/share/classes/java/util/logging/Logger.java
+++ b/src/java.logging/share/classes/java/util/logging/Logger.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2026, 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
@@ -2358,8 +2358,9 @@ public class Logger {
 
         synchronized (treeLock) {
 
-            // Remove ourself from any previous parent.
+            // Remove ourselves from any previous parent.
             LogManager.LoggerWeakRef ref = null;
+            Logger parent = this.parent;
             if (parent != null) {
                 // assert parent.kids != null;
                 for (Iterator iter = parent.kids.iterator(); iter.hasNext(); ) {
@@ -2372,11 +2373,11 @@ public class Logger {
                         ref = null;
                     }
                 }
-                // We have now removed ourself from our parents' kids.
+                // We have now removed ourselves from our parents' kids.
             }
 
             // Set our new parent.
-            parent = newParent;
+            this.parent = parent = newParent;
             if (parent.kids == null) {
                 parent.kids = new ArrayList<>(2);
             }
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 6eebaf4d6eb..dcb739a8697 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, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2026, 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
@@ -523,7 +523,15 @@ public final class Connection implements Runnable {
     void abandonRequest(LdapRequest ldr, Control[] reqCtls) {
         // Remove from queue
         removeRequest(ldr);
-
+        // an optimistic check to avoid having to construct the BER
+        // messages for the "abandon request". we repeat
+        // this check later when holding the lock, before actually
+        // writing out the "abandon request", and that check actually
+        // determines whether or not the "abandon request" is actually
+        // sent
+        if (!ldr.shouldAbandonRequest()) {
+            return;
+        }
         BerEncoder ber = new BerEncoder(256);
         int abandonMsgId = getMsgId();
 
@@ -547,6 +555,9 @@ public final class Connection implements Runnable {
 
             lock.lock();
             try {
+                if (!ldr.shouldAbandonRequest()) {
+                    return;
+                }
                 outStream.write(ber.getBuf(), 0, ber.getDataLen());
                 outStream.flush();
             } finally {
@@ -680,7 +691,7 @@ public final class Connection implements Runnable {
             if (nparent) {
                 LdapRequest ldr = pendingRequests;
                 while (ldr != null) {
-                    ldr.close();
+                    ldr.connectionClosed();
                     ldr = ldr.next;
                 }
             }
diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapRequest.java b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapRequest.java
index 2fdd685376c..a8694ed3c7a 100644
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapRequest.java
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapRequest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2026, 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,7 +33,7 @@ import java.util.concurrent.TimeUnit;
 
 final class LdapRequest {
 
-    private static final BerDecoder CLOSED_MARKER = new BerDecoder(new byte[]{}, -1, 0);
+    private static final BerDecoder CONN_CLOSED_MARKER = new BerDecoder(new byte[]{}, -1, 0);
     private static final BerDecoder CANCELLED_MARKER = new BerDecoder(new byte[]{}, -1, 0);
     private static final String CLOSE_MSG = "LDAP connection has been closed";
 
@@ -44,7 +44,7 @@ final class LdapRequest {
     private final boolean pauseAfterReceipt;
 
     private volatile boolean cancelled;
-    private volatile boolean closed;
+    private volatile boolean connectionClosed;
     private volatile boolean completed;
 
     LdapRequest(int msgId, boolean pause, int replyQueueCapacity) {
@@ -62,9 +62,22 @@ final class LdapRequest {
         replies.offer(CANCELLED_MARKER);
     }
 
-    void close() {
-        closed = true;
-        replies.offer(CLOSED_MARKER);
+    /*
+     * Invoked when the connection on which this (pending) request was made
+     * is closed.
+     */
+    void connectionClosed() {
+        connectionClosed = true;
+        replies.offer(CONN_CLOSED_MARKER);
+    }
+
+    /**
+     * {@return true if an "abandon request" may be sent for this request, false otherwise}
+     */
+    boolean shouldAbandonRequest() {
+        // if the connection to which this request belonged was closed, then
+        // don't send any further "abandon request" message
+        return !connectionClosed;
     }
 
     boolean addReplyBer(BerDecoder ber) {
@@ -73,7 +86,7 @@ final class LdapRequest {
         // this is merely a best effort basis check and if we do add the reply
         // due to a race, that's OK since the replies queue would have necessary
         // markers for cancelled/closed state and those will be detected by getReplyBer().
-        if (cancelled || closed) {
+        if (cancelled || connectionClosed) {
             return false;
         }
         // if the request is not already completed, check if the reply being added
@@ -127,7 +140,7 @@ final class LdapRequest {
                 throw new CommunicationException("Request: " + msgId +
                         " cancelled");
             }
-            if (closed) {
+            if (connectionClosed) {
                 throw new IOException(CLOSE_MSG);
             }
         }
@@ -146,7 +159,7 @@ final class LdapRequest {
             throw new CommunicationException("Request: " + msgId +
                 " cancelled");
         }
-        if (result == CLOSED_MARKER) {
+        if (result == CONN_CLOSED_MARKER) {
             throw new IOException(CLOSE_MSG);
         }
         return result;
diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java
index 30d64fc8611..8787df8c498 100644
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2026, 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,9 +35,10 @@ import java.io.OutputStream;
 class SaslOutputStream extends FilterOutputStream {
     private static final boolean debug = false;
 
-    private byte[] lenBuf = new byte[4];  // buffer for storing length
+    private final byte[] lenBuf = new byte[4];  // buffer for storing length
     private int rawSendSize = 65536;
-    private SaslClient sc;
+    private final SaslClient sc;
+    private boolean closed;
 
     SaslOutputStream(SaslClient sc, OutputStream out) throws SaslException {
         super(out);
@@ -60,8 +61,9 @@ class SaslOutputStream extends FilterOutputStream {
 
     // Override this method to call write(byte[], int, int) counterpart
     // super.write(int) simply calls out.write(int)
-
+    @Override
     public void write(int b) throws IOException {
+        ensureOpen();
         byte[] buffer = new byte[1];
         buffer[0] = (byte)b;
         write(buffer, 0, 1);
@@ -71,7 +73,9 @@ class SaslOutputStream extends FilterOutputStream {
      * Override this method to "wrap" the outgoing buffer before
      * writing it to the underlying output stream.
      */
+    @Override
     public void write(byte[] buffer, int offset, int total) throws IOException {
+        ensureOpen();
         int count;
         byte[] wrappedToken;
 
@@ -101,7 +105,12 @@ class SaslOutputStream extends FilterOutputStream {
         }
     }
 
+    @Override
     public void close() throws IOException {
+        if (closed) {
+            return;
+        }
+        closed = true;
         SaslException save = null;
         try {
             sc.dispose();  // Dispose of SaslClient's state
@@ -121,8 +130,7 @@ class SaslOutputStream extends FilterOutputStream {
      * Encodes an integer into 4 bytes in network byte order in the buffer
      * supplied.
      */
-    private static void intToNetworkByteOrder(int num, byte[] buf, int start,
-        int count) {
+    private static void intToNetworkByteOrder(int num, byte[] buf, int start, int count) {
         if (count > 4) {
             throw new IllegalArgumentException("Cannot handle more than 4 bytes");
         }
@@ -132,4 +140,10 @@ class SaslOutputStream extends FilterOutputStream {
             num >>>= 8;
         }
     }
+
+    private void ensureOpen() throws IOException {
+        if (closed) {
+            throw new IOException("stream closed");
+        }
+    }
 }
diff --git a/src/java.naming/share/classes/javax/naming/InitialContext.java b/src/java.naming/share/classes/javax/naming/InitialContext.java
index f2ab1676f4e..a66e843e641 100644
--- a/src/java.naming/share/classes/javax/naming/InitialContext.java
+++ b/src/java.naming/share/classes/javax/naming/InitialContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2026, 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
@@ -117,7 +117,7 @@ import com.sun.naming.internal.ResourceManager;
  * @see Context
  * @see NamingManager#setInitialContextFactoryBuilder
  *      NamingManager.setInitialContextFactoryBuilder
- * @since 1.3, JNDI 1.1
+ * @since 1.3
  */
 
 public class InitialContext implements Context {
diff --git a/src/java.net.http/share/classes/java/net/http/package-info.java b/src/java.net.http/share/classes/java/net/http/package-info.java
index 1b8395c2706..ce954404c81 100644
--- a/src/java.net.http/share/classes/java/net/http/package-info.java
+++ b/src/java.net.http/share/classes/java/net/http/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2026, 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
@@ -68,6 +68,8 @@
  * 

Unless otherwise stated, {@code null} parameter values will cause methods * of all classes in this package to throw {@code NullPointerException}. * + * @see java.net.http/ + * * @spec https://www.rfc-editor.org/info/rfc9114 * RFC 9114: HTTP/3 * @spec https://www.rfc-editor.org/info/rfc7540 diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java index 72a47eca42c..006c4b30bea 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -473,11 +473,10 @@ class Http1Exchange extends ExchangeImpl { @Override Http1ResponseBodySubscriber createResponseSubscriber(BodyHandler handler, ResponseInfo response) { - BodySubscriber subscriber = handler.apply(response); var cancelTimerOnTermination = cancelTimerOnResponseBodySubscriberTermination( exchange.request().isWebSocket(), response.statusCode()); - return new Http1ResponseBodySubscriber<>(subscriber, cancelTimerOnTermination, this); + return new Http1ResponseBodySubscriber<>(handler.apply(response), cancelTimerOnTermination, this); } @Override diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java b/src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java index 671874b8fb5..670b8cf3c25 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -384,6 +384,7 @@ class MultiExchange implements Cancelable { private CompletableFuture> handleNoBody(Response r, Exchange exch) { BodySubscriber bs = responseHandler.apply(new ResponseInfoImpl(r.statusCode(), r.headers(), r.version())); + Objects.requireNonNull(bs, "BodyHandler returned a null BodySubscriber"); bs.onSubscribe(new NullSubscription()); bs.onComplete(); CompletionStage cs = ResponseSubscribers.getBodyAsync(executor, bs); diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java index f1c1f6f2d2a..86a93f67dcd 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,6 +70,7 @@ public class HttpBodySubscriberWrapper implements TrustedSubscriber { volatile SubscriptionWrapper subscription; volatile Throwable withError; public HttpBodySubscriberWrapper(BodySubscriber userSubscriber) { + Objects.requireNonNull(userSubscriber, "BodySubscriber"); this.userSubscriber = userSubscriber; } diff --git a/src/java.net.http/share/classes/module-info.java b/src/java.net.http/share/classes/module-info.java index 48f23953ad0..fdfd1bf7e0d 100644 --- a/src/java.net.http/share/classes/module-info.java +++ b/src/java.net.http/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 @@ */ /** - * Defines the HTTP Client and WebSocket APIs. + * Defines the {@linkplain java.net.http HTTP Client and WebSocket APIs}. *

* System properties used by the java.net.http API *

@@ -144,15 +144,21 @@ * The value for HTTP/2 and HTTP/3 can be overridden with the * {@code jdk.httpclient.keepalive.timeout.h2} and {@code jdk.httpclient.keepalive.timeout.h3} * properties respectively. The value specified for HTTP/2 acts as default value for HTTP/3. + * If the provided value is negative, the default value is used. + * A value of 0 is valid and has no special meaning other than the connection is closed + * when it becomes idle. * *

  • {@systemProperty jdk.httpclient.keepalive.timeout.h2} (default: see - * below)
    The number of seconds to keep idle HTTP/2 connections alive. If not set, then the - * {@code jdk.httpclient.keepalive.timeout} setting is used. + * below)
    The number of seconds to keep idle HTTP/2 connections alive. If not set, or negative, + * then the {@code jdk.httpclient.keepalive.timeout} setting is used. + * A value of 0 is valid and has no special meaning other than the connection is closed + * when it becomes idle. *

  • *
  • {@systemProperty jdk.httpclient.keepalive.timeout.h3} (default: see - * below)
    The number of seconds to keep idle HTTP/3 connections alive. If not set, then the - * {@code jdk.httpclient.keepalive.timeout.h2} setting is used. - *

  • + * below)
    The number of seconds to keep idle HTTP/3 connections alive. If not set, + * or negative, then the {@code jdk.httpclient.keepalive.timeout.h2} setting is used. + * A value of 0 is valid and has no special meaning other than the connection is closed + * when it becomes idle. *
  • {@systemProperty jdk.httpclient.maxframesize} (default: 16384 or 16kB)
    * The HTTP/2 client maximum frame size in bytes. The server is not permitted to send a frame * larger than this. diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java index 845203c8735..152883b4930 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java @@ -266,6 +266,13 @@ public interface Tree { */ PRIMITIVE_TYPE(PrimitiveTypeTree.class), + /** + * Used for instances of {@link VarTypeTree}. + * + * @since 27 + */ + VAR_TYPE(VarTypeTree.class), + /** * Used for instances of {@link ReturnTree}. */ diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java index a2a33ccf8eb..f2a067971d1 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java @@ -498,6 +498,15 @@ public interface TreeVisitor { */ R visitPrimitiveType(PrimitiveTypeTree node, P p); + /** + * Visits a {@code VarTypeTree} node. + * @param node the node being visited + * @param p a parameter value + * @return a result value + * @since 27 + */ + R visitVarType(VarTypeTree node, P p); + /** * Visits a {@code TypeParameterTree} node. * @param node the node being visited diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/VarTypeTree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/VarTypeTree.java new file mode 100644 index 00000000000..bfe13ebdce1 --- /dev/null +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/VarTypeTree.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2026, 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. + */ + +package com.sun.source.tree; + +import javax.lang.model.type.TypeKind; + +/** + * A tree node for a {@code var} contextual keyword used as a type. + * + * @since 27 + */ +public interface VarTypeTree extends Tree { +} diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java index a1191b2f8e6..11dc41577be 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java @@ -65,10 +65,13 @@ public interface VariableTree extends StatementTree { */ ExpressionTree getNameExpression(); - /** - * Returns the type of the variable being declared. - * @return the type - */ + /// {@return the type of the variable being declared.} + /// + /// @apiNote + /// The type of the variable can be one of the following: + /// - if the variable is declared using {@code var}, then the returned value is a {@link VarTypeTree}, + /// - if the variable is a lambda parameter declared without a type (i.e. relying on type inferrence), then the returned value is {@code null}, + /// - otherwise, the variable is declared with an explicit type, and the returned value is that type. Tree getType(); /** diff --git a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java index 77305d56b1e..917df861b70 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java +++ b/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java @@ -803,6 +803,21 @@ public class SimpleTreeVisitor implements TreeVisitor { return defaultAction(node, p); } + /** + * {@inheritDoc} + * + * @implSpec This implementation calls {@code defaultAction}. + * + * @param node {@inheritDoc} + * @param p {@inheritDoc} + * @return the result of {@code defaultAction} + * @since 27 + */ + @Override + public R visitVarType(VarTypeTree node, P p) { + return defaultAction(node, p); + } + /** * {@inheritDoc} * diff --git a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java index 29e81c206e0..ca8b785d8cb 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java +++ b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java @@ -939,6 +939,21 @@ public class TreeScanner implements TreeVisitor { return null; } + /** + * {@inheritDoc} + * + * @implSpec This implementation returns {@code null}. + * + * @param node {@inheritDoc} + * @param p {@inheritDoc} + * @return the result of scanning + * @since 27 + */ + @Override + public R visitVarType(VarTypeTree node, P p) { + return null; + } + /** * {@inheritDoc} * diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java index 5b59e47027e..ac1bcc84194 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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,12 +156,22 @@ public class Flags { @Use({FlagTarget.CLASS}) public static final int IMPLICIT_CLASS = 1<<19; + /** Variable with implicit/inferred type. + */ + @Use(FlagTarget.VARIABLE) + public static final int VAR_VARIABLE = 1<<19; + /** Flag is set for compiler-generated anonymous method symbols * that `own' an initializer block. */ @Use({FlagTarget.METHOD}) public static final int BLOCK = 1<<20; + /** A parameter of a lambda function. + */ + @Use(FlagTarget.VARIABLE) + public static final int LAMBDA_PARAMETER = 1<<20; + /** Flag is set for ClassSymbols that are being compiled from source. */ @Use({FlagTarget.CLASS}) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java index 84a823f785f..cf5e5ca83f5 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -272,6 +272,7 @@ public enum Source { CASE_NULL(JDK21, Fragments.FeatureCaseNull, DiagKind.NORMAL), PATTERN_SWITCH(JDK21, Fragments.FeaturePatternSwitch, DiagKind.PLURAL), REDUNDANT_STRICTFP(JDK17), + TYPE_ANNOTATIONS_ON_VAR_LAMBDA_PARAMETER(MIN, JDK19), UNCONDITIONAL_PATTERN_IN_INSTANCEOF(JDK21, Fragments.FeatureUnconditionalPatternsInInstanceof, DiagKind.PLURAL), RECORD_PATTERNS(JDK21, Fragments.FeatureDeconstructionPatterns, DiagKind.PLURAL), IMPLICIT_CLASSES(JDK25, Fragments.FeatureImplicitClasses, DiagKind.PLURAL), diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java index 3f3eb1f9623..9ffab9fd961 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java @@ -1436,7 +1436,7 @@ public class Types { return visit(s, t); return s.hasTag(ARRAY) - && containsTypeEquivalent(t.elemtype, elemtype(s)); + && visit(t.elemtype, elemtype(s)); } @Override @@ -2858,13 +2858,17 @@ public class Types { hasSameArgs(t, erasure(s)) || hasSameArgs(erasure(t), s); } - public boolean overridesObjectMethod(TypeSymbol origin, Symbol msym) { + public Symbol overriddenObjectMethod(TypeSymbol origin, Symbol msym) { for (Symbol sym : syms.objectType.tsym.members().getSymbolsByName(msym.name)) { if (msym.overrides(sym, origin, Types.this, true)) { - return true; + return sym; } } - return false; + return null; + } + + public boolean overridesObjectMethod(TypeSymbol origin, Symbol msym) { + return overriddenObjectMethod(origin, msym) != null; } /** diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java index f45e8500000..fb5576a82e1 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java @@ -370,7 +370,6 @@ public class Analyzer { */ JCVariableDecl rewriteVarType(JCVariableDecl oldTree) { JCVariableDecl newTree = copier.copy(oldTree); - newTree.vartype = null; return newTree; } @@ -751,7 +750,6 @@ public class Analyzer { if (oldLambda.paramKind == ParameterKind.IMPLICIT) { //reset implicit lambda parameters (whose type might have been set during attr) newLambda.paramKind = ParameterKind.IMPLICIT; - newLambda.params.forEach(p -> p.vartype = null); } return newLambda; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index cdd88b22510..83b684e1225 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -680,10 +680,7 @@ public class Attr extends JCTree.Visitor { } matchBindings = matchBindingsComputer.finishBindings(tree, matchBindings); - if (tree == breakTree && - resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { - breakTreeFound(copyEnv(env)); - } + checkBreakTree(tree, env); return result; } catch (CompletionFailure ex) { tree.type = syms.errType; @@ -694,6 +691,13 @@ public class Attr extends JCTree.Visitor { } } + private void checkBreakTree(JCTree tree, Env env) { + if (tree == breakTree && + resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { + breakTreeFound(copyEnv(env)); + } + } + protected void breakTreeFound(Env env) { throw new BreakAttr(env); } @@ -1259,18 +1263,18 @@ public class Attr extends JCTree.Visitor { // parameters have already been entered env.info.scope.enter(tree.sym); } else { - if (tree.isImplicitlyTyped() && (tree.getModifiers().flags & PARAMETER) == 0) { + if (tree.isImplicitlyTyped() && (tree.getModifiers().flags & PARAMETER) == 0 && tree.type == null) { if (tree.init == null) { //cannot use 'var' without initializer log.error(tree, Errors.CantInferLocalVarType(tree.name, Fragments.LocalMissingInit)); - tree.vartype = make.at(tree.pos()).Erroneous(); + tree.type = syms.errType; } else { Fragment msg = canInferLocalVarType(tree); if (msg != null) { //cannot use 'var' with initializer which require an explicit target //(e.g. lambda, method reference, array initializer). log.error(tree, Errors.CantInferLocalVarType(tree.name, msg)); - tree.vartype = make.at(tree.pos()).Erroneous(); + tree.type = syms.errType; } } } @@ -1319,7 +1323,7 @@ public class Attr extends JCTree.Visitor { } } if (tree.isImplicitlyTyped()) { - setSyntheticVariableType(tree, v.type); + setupImplicitlyTypedVariable(tree, v.type); } } result = tree.type = v.type; @@ -1593,7 +1597,8 @@ public class Attr extends JCTree.Visitor { } if (tree.var.isImplicitlyTyped()) { Type inferredType = chk.checkLocalVarType(tree.var, elemtype, tree.var.name); - setSyntheticVariableType(tree.var, inferredType); + tree.var.type = inferredType; + setupImplicitlyTypedVariable(tree.var, inferredType); } attribStat(tree.var, loopEnv); chk.checkType(tree.expr.pos(), elemtype, tree.var.sym.type); @@ -2813,6 +2818,8 @@ public class Attr extends JCTree.Visitor { checkNewInnerClass(tree.pos(), env, clazztype, false); } + checkBreakTree(tree.clazz, localEnv); + // Attribute constructor arguments. ListBuffer argtypesBuf = new ListBuffer<>(); final KindSelector pkind = @@ -3217,8 +3224,10 @@ public class Attr extends JCTree.Visitor { Type argType = arityMismatch ? syms.errType : actuals.head; - if (params.head.isImplicitlyTyped()) { - setSyntheticVariableType(params.head, argType); + if (params.head.type == null && + params.head.isImplicitlyTyped()) { //error recovery + params.head.type = argType; + setupImplicitlyTypedVariable(params.head, argType); } params.head.sym = null; actuals = actuals.isEmpty() ? @@ -3250,10 +3259,8 @@ public class Attr extends JCTree.Visitor { attribTree(that.getBody(), localEnv, bodyResultInfo); } else { JCBlock body = (JCBlock)that.body; - if (body == breakTree && - resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) { - breakTreeFound(copyEnv(localEnv)); - } + + checkBreakTree(body, localEnv); attribStats(body.stats, localEnv); } @@ -3438,7 +3445,7 @@ public class Attr extends JCTree.Visitor { JCLambda lambda = (JCLambda)tree; List argtypes = List.nil(); for (JCVariableDecl param : lambda.params) { - argtypes = param.vartype != null && param.vartype.type != null ? + argtypes = !param.isImplicitlyTyped() && param.vartype.type != null ? argtypes.append(param.vartype.type) : argtypes.append(syms.errType); } @@ -4214,23 +4221,24 @@ public class Attr extends JCTree.Visitor { public void visitBindingPattern(JCBindingPattern tree) { Type type; - if (tree.var.vartype != null) { + if (!tree.var.isImplicitlyTyped()) { type = attribType(tree.var.vartype, env); } else { type = resultInfo.pt; } tree.type = tree.var.type = type; - BindingSymbol v = new BindingSymbol(tree.var.mods.flags, tree.var.name, type, env.info.scope.owner); + BindingSymbol v = new BindingSymbol(tree.var.mods.flags | tree.var.declKind.additionalSymbolFlags, + tree.var.name, type, env.info.scope.owner); v.pos = tree.pos; tree.var.sym = v; if (chk.checkUnique(tree.var.pos(), v, env.info.scope)) { chk.checkTransparentVar(tree.var.pos(), v, env.info.scope); } - chk.validate(tree.var.vartype, env, true); if (tree.var.isImplicitlyTyped()) { - setSyntheticVariableType(tree.var, type == Type.noType ? syms.errType - : type); + setupImplicitlyTypedVariable(tree.var, type == Type.noType ? syms.errType + : type); } + chk.validate(tree.var.vartype, env, true); annotate.annotateLater(tree.var.mods.annotations, env, v); if (!tree.var.isImplicitlyTyped()) { annotate.queueScanTreeAndTypeAnnotate(tree.var.vartype, env, v); @@ -4249,7 +4257,7 @@ public class Attr extends JCTree.Visitor { public void visitRecordPattern(JCRecordPattern tree) { Type site; - if (tree.deconstructor == null) { + if (tree.deconstructor.hasTag(VARTYPE)) { log.error(tree.pos(), Errors.DeconstructionPatternVarNotAllowed); tree.record = syms.errSymbol; site = tree.type = types.createErrorType(tree.record.type); @@ -4265,6 +4273,7 @@ public class Attr extends JCTree.Visitor { } tree.type = tree.deconstructor.type = type; site = types.capture(tree.type); + chk.validate(tree.deconstructor, env, true); } List expectedRecordTypes; @@ -4310,7 +4319,6 @@ public class Attr extends JCTree.Visitor { } finally { localEnv.info.scope.leave(); } - chk.validate(tree.deconstructor, env, true); result = tree.type; matchBindings = new MatchBindings(outBindings.toList(), List.nil()); } @@ -5390,7 +5398,8 @@ public class Attr extends JCTree.Visitor { Type st = types.supertype(c.type); if ((c.flags_field & Flags.COMPOUND) == 0 && - (c.flags_field & Flags.SUPER_OWNER_ATTRIBUTED) == 0) { + (c.flags_field & Flags.SUPER_OWNER_ATTRIBUTED) == 0 && + breakTree == null) { // First, attribute superclass. if (st.hasTag(CLASS)) attribClass((ClassSymbol)st.tsym); @@ -5725,15 +5734,20 @@ public class Attr extends JCTree.Visitor { return types.capture(type); } - private void setSyntheticVariableType(JCVariableDecl tree, Type type) { - if (type.isErroneous()) { - tree.vartype = make.at(tree.pos()).Erroneous(); - } else if (tree.declaredUsingVar()) { - Assert.check(tree.typePos != Position.NOPOS); - tree.vartype = make.at(tree.typePos).Type(type); - } else { - tree.vartype = make.at(tree.pos()).Type(type); + private void setupImplicitlyTypedVariable(JCVariableDecl tree, Type type) { + Assert.check(tree.isImplicitlyTyped()); + + type.complete(); + + if (tree.vartype == null) { + return ; } + + Assert.check(tree.vartype.hasTag(VARTYPE)); + + JCVarType vartype = (JCVarType) tree.vartype; + + vartype.type = type; } public void validateTypeAnnotations(JCTree tree, boolean sigOnly) { @@ -6062,9 +6076,6 @@ public class Attr extends JCTree.Visitor { that.sym = new VarSymbol(0, that.name, that.type, syms.noSymbol); that.sym.adr = 0; } - if (that.vartype == null) { - that.vartype = make.at(Position.NOPOS).Erroneous(); - } super.visitVarDef(that); } @@ -6139,6 +6150,11 @@ public class Attr extends JCTree.Visitor { syms.noSymbol); } } + + @Override + public void visitVarType(JCVarType that) { + initTypeIfNeeded(that); + } } // diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrRecover.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrRecover.java index 716345fa077..092035c84dd 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrRecover.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrRecover.java @@ -117,11 +117,6 @@ public class AttrRecover { ? formals.head : ((ArrayType) formals.head).elemtype; if (arg.hasTag(JCTree.Tag.LAMBDA)) { final JCTree.JCLambda lambda = (JCLambda) arg; - if (lambda.paramKind == JCLambda.ParameterKind.IMPLICIT) { - for (JCVariableDecl var : lambda.params) { - var.vartype = null; //reset type - } - } if (types.isFunctionalInterface(formal)) { Type functionalType = types.findDescriptorType(formal); boolean voidCompatible = functionalType.getReturnType().hasTag(TypeTag.VOID); 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 94b14f3122f..0af30be4671 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -3544,7 +3544,10 @@ public class Check { if (s.kind == PCK) applicableTargets.add(names.PACKAGE); } else if (target == names.TYPE_USE) { - if (s.kind == VAR && s.owner.kind == MTH && s.type.hasTag(NONE)) { + if (s.kind == VAR && + (s.flags() & Flags.VAR_VARIABLE) != 0 && + (!Feature.TYPE_ANNOTATIONS_ON_VAR_LAMBDA_PARAMETER.allowedInSource(source) || + ((s.flags() & Flags.LAMBDA_PARAMETER) == 0))) { //cannot type annotate implicitly typed locals continue; } else if (s.kind == TYP || s.kind == VAR || @@ -5632,8 +5635,8 @@ public class Check { } case JCVariableDecl variableDecl -> { if (variableDecl.vartype != null && - (variableDecl.sym.flags_field & RECORD) == 0 || - (variableDecl.sym.flags_field & ~(Flags.PARAMETER | RECORD | GENERATED_MEMBER)) != 0) { + ((variableDecl.sym.flags_field & RECORD) == 0 || + (variableDecl.sym.flags_field & ~(Flags.PARAMETER | RECORD | GENERATED_MEMBER)) != 0)) { /* we don't want to warn twice so if this variable is a compiler generated parameter of * a canonical record constructor, we don't want to issue a warning as we will warn the * corresponding compiler generated private record field anyways diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java index 7d0c5192039..40628709dfe 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java @@ -701,22 +701,24 @@ public class LambdaToMethod extends TreeTranslator { rs.resolveConstructor(null, attrEnv, ctype, TreeInfo.types(args), List.nil())); } - private void addDeserializationCase(MethodHandleSymbol refSym, Type targetType, MethodSymbol samSym, + private void addDeserializationCase(MethodHandleSymbol refSym, Type targetType, MethodSymbol samSym, Type samType, DiagnosticPosition pos, List staticArgs, MethodType indyType) { String functionalInterfaceClass = classSig(targetType); String functionalInterfaceMethodName = samSym.getSimpleName().toString(); String functionalInterfaceMethodSignature = typeSig(types.erasure(samSym.type)); - Symbol baseMethod = refSym.baseSymbol(); - Symbol origMethod = baseMethod.baseSymbol(); - if (baseMethod != origMethod && origMethod.owner == syms.objectType.tsym) { - //the implementation method is a java.lang.Object method transferred to an - //interface that does not declare it. Runtime will refer to this method as to - //a java.lang.Object method, so do the same: - refSym = ((MethodSymbol) origMethod).asHandle(); + if (refSym.enclClass().isInterface()) { + Symbol baseMethod = types.overriddenObjectMethod(refSym.enclClass(), refSym); + if (baseMethod != null) { + // The implementation method is a java.lang.Object method, runtime will resolve this method to + // a java.lang.Object method, so do the same. + // This case can be removed if JDK-8172817 is fixed. + refSym = ((MethodSymbol) baseMethod).asHandle(); + } } String implClass = classSig(types.erasure(refSym.owner.type)); String implMethodName = refSym.getQualifiedName().toString(); String implMethodSignature = typeSig(types.erasure(refSym.type)); + String instantiatedMethodType = typeSig(types.erasure(samType)); int implMethodKind = refSym.referenceKind(); JCExpression kindTest = eqTest(syms.intType, deserGetter("getImplMethodKind", syms.intType), @@ -730,13 +732,14 @@ public class LambdaToMethod extends TreeTranslator { ++i; } JCStatement stmt = make.If( - deserTest(deserTest(deserTest(deserTest(deserTest( - kindTest, - "getFunctionalInterfaceClass", functionalInterfaceClass), - "getFunctionalInterfaceMethodName", functionalInterfaceMethodName), - "getFunctionalInterfaceMethodSignature", functionalInterfaceMethodSignature), - "getImplClass", implClass), - "getImplMethodSignature", implMethodSignature), + deserTest(deserTest(deserTest(deserTest(deserTest(deserTest( + kindTest, + "getFunctionalInterfaceClass", functionalInterfaceClass), + "getFunctionalInterfaceMethodName", functionalInterfaceMethodName), + "getFunctionalInterfaceMethodSignature", functionalInterfaceMethodSignature), + "getImplClass", implClass), + "getImplMethodSignature", implMethodSignature), + "getInstantiatedMethodType", instantiatedMethodType), make.Return(makeIndyCall( pos, syms.lambdaMetafactory, @@ -756,7 +759,8 @@ public class LambdaToMethod extends TreeTranslator { implMethodKind, implClass, implMethodName, - implMethodSignature)); + implMethodSignature, + instantiatedMethodType)); } stmts.append(stmt); } @@ -818,10 +822,11 @@ public class LambdaToMethod extends TreeTranslator { List indy_args) { //determine the static bsm args MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.target.tsym); + MethodType samType = typeToMethodType(tree.getDescriptorType(types)); List staticArgs = List.of( typeToMethodType(samSym.type), refSym.asHandle(), - typeToMethodType(tree.getDescriptorType(types))); + samType); //computed indy arg types ListBuffer indy_args_types = new ListBuffer<>(); @@ -885,7 +890,7 @@ public class LambdaToMethod extends TreeTranslator { int prevPos = make.pos; try { make.at(kInfo.clazz); - addDeserializationCase(refSym, tree.type, samSym, + addDeserializationCase(refSym, tree.type, samSym, samType, tree, staticArgs, indyType); } finally { make.at(prevPos); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java index 69161fd682c..be603ffc9ca 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java @@ -3692,11 +3692,12 @@ public class Lower extends TreeTranslator { if (tree.var.type.isPrimitive()) vardefinit = make.TypeCast(types.cvarUpperBound(iteratorTarget), vardefinit); else - vardefinit = make.TypeCast(tree.var.type, vardefinit); + vardefinit = transTypes.coerce(attrEnv, vardefinit, tree.var.type); JCVariableDecl indexDef = (JCVariableDecl)make.VarDef(tree.var.mods, tree.var.name, tree.var.vartype, - vardefinit).setType(tree.var.type); + vardefinit, + tree.var.declKind).setType(tree.var.type); indexDef.sym = tree.var.sym; JCBlock body = make.Block(0, List.of(indexDef, tree.body)); body.bracePos = TreeInfo.endPos(tree.body); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java index d63ba1677d6..cb0e6d4676b 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,7 @@ public class MemberEnter extends JCTree.Visitor { ListBuffer argbuf = new ListBuffer<>(); for (List l = params; l.nonEmpty(); l = l.tail) { memberEnter(l.head, env); - argbuf.append(l.head.vartype.type); + argbuf.append(l.head.sym.type); } // Attribute result type, if one is given. @@ -276,12 +276,16 @@ public class MemberEnter extends JCTree.Visitor { tree.vartype.type = atype.makeVarargs(); } WriteableScope enclScope = enter.enterScope(env); - Type vartype = tree.isImplicitlyTyped() - ? env.info.scope.owner.kind == MTH ? Type.noType : syms.errType - : tree.vartype.type; + Type vartype = switch (tree.declKind) { + case IMPLICIT -> tree.type; + case EXPLICIT -> tree.vartype.type; + case VAR -> tree.type != null ? tree.type + : env.info.scope.owner.kind == MTH ? Type.noType + : syms.errType; + }; Name name = tree.name; VarSymbol v = new VarSymbol(0, name, vartype, enclScope.owner); - v.flags_field = chk.checkFlags(tree.mods.flags, v, tree); + v.flags_field = chk.checkFlags(tree.mods.flags | tree.declKind.additionalSymbolFlags, v, tree); tree.sym = v; if (tree.init != null) { v.flags_field |= HASINIT; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java index bbc12f1fe80..4890b749a90 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java @@ -93,6 +93,7 @@ import com.sun.tools.javac.tree.JCTree.JCTypeParameter; import com.sun.tools.javac.tree.JCTree.JCTypeUnion; import com.sun.tools.javac.tree.JCTree.JCUnary; import com.sun.tools.javac.tree.JCTree.JCUses; +import com.sun.tools.javac.tree.JCTree.JCVarType; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.tree.JCTree.JCWhileLoop; import com.sun.tools.javac.tree.JCTree.JCWildcard; @@ -631,6 +632,11 @@ public class TreeDiffer extends TreeScanner { result = tree.typetag == that.typetag; } + @Override + public void visitVarType(JCVarType tree) { + result = true; + } + @Override public void visitTypeIntersection(JCTypeIntersection tree) { JCTypeIntersection that = (JCTypeIntersection) parameter; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java index af7d79d4195..e8ab1b9349c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,17 +181,17 @@ public final class SourceLauncher { ProgramDescriptor program = context.getProgramDescriptor(); // 1. Find a main method in the first class and if there is one - invoke it - Class firstClass; + Class mainClass; String firstClassName = program.qualifiedTypeNames().getFirst(); ClassLoader loader = context.newClassLoaderFor(parentLoader, firstClassName); Thread.currentThread().setContextClassLoader(loader); try { - firstClass = Class.forName(firstClassName, false, loader); + mainClass = Class.forName(firstClassName, false, loader); } catch (ClassNotFoundException e) { throw new Fault(Errors.CantFindClass(firstClassName)); } - Method mainMethod = MethodFinder.findMainMethod(firstClass); + Method mainMethod = MethodFinder.findMainMethod(mainClass); if (mainMethod == null) { // 2. If the first class doesn't have a main method, look for a class with a matching name var compilationUnitName = program.fileObject().getFile().getFileName().toString(); @@ -206,22 +206,18 @@ public final class SourceLauncher { .findFirst() .orElseThrow(() -> new Fault(Errors.CantFindClass(expectedName))); - Class actualClass; try { - actualClass = Class.forName(actualName, false, firstClass.getClassLoader()); + mainClass = Class.forName(actualName, false, mainClass.getClassLoader()); } catch (ClassNotFoundException ignore) { throw new Fault(Errors.CantFindClass(actualName)); } - mainMethod = MethodFinder.findMainMethod(actualClass); + mainMethod = MethodFinder.findMainMethod(mainClass); if (mainMethod == null) { throw new Fault(Errors.CantFindMainMethod(actualName)); } } - // selected main method instance points back to its declaring class - Class mainClass = mainMethod.getDeclaringClass(); String mainClassName = mainClass.getName(); - var isStatic = Modifier.isStatic(mainMethod.getModifiers()); Object instance = null; 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 e78537c10f5..df5da5cb954 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -977,13 +977,11 @@ public class JavacParser implements Parser { pattern = toP(F.at(token.pos).AnyPattern()); } else { - int varTypePos = Position.NOPOS; if (parsedType == null) { boolean var = token.kind == IDENTIFIER && token.name() == names.var; e = unannotatedType(allowVar, TYPE | NOLAMBDA); if (var) { - varTypePos = e.pos; - e = null; + e = replaceTypeWithVar(e); } } else { e = parsedType; @@ -1021,12 +1019,9 @@ public class JavacParser implements Parser { name = names.empty; } JCVariableDecl var = toP(F.at(varPos).VarDef(mods, name, e, null, - varTypePos != Position.NOPOS ? JCVariableDecl.DeclKind.VAR : JCVariableDecl.DeclKind.EXPLICIT, - varTypePos)); - if (e == null) { - if (var.name == names.underscore && !allowVar) { - log.error(DiagnosticFlag.SYNTAX, varPos, Errors.UseOfUnderscoreNotAllowed); - } + e.hasTag(VARTYPE) ? JCVariableDecl.DeclKind.VAR : JCVariableDecl.DeclKind.EXPLICIT)); + if (var.name == names.underscore && !allowVar) { + log.error(DiagnosticFlag.SYNTAX, varPos, Errors.UseOfUnderscoreNotAllowed); } pattern = toP(F.at(pos).BindingPattern(var)); } @@ -2178,8 +2173,7 @@ public class JavacParser implements Parser { && restrictedTypeName(param.vartype, true) != null) { checkSourceLevel(param.pos, Feature.VAR_SYNTAX_IMPLICIT_LAMBDAS); param.declKind = JCVariableDecl.DeclKind.VAR; - param.typePos = TreeInfo.getStartPos(param.vartype); - param.vartype = null; + param.vartype = replaceTypeWithVar(param.vartype); } } } @@ -3792,7 +3786,6 @@ public class JavacParser implements Parser { */ JCVariableDecl variableDeclaratorRest(int pos, JCModifiers mods, JCExpression type, Name name, boolean reqInit, Comment dc, boolean localDecl, boolean compound) { - boolean declaredUsingVar = false; JCExpression init = null; type = bracketsOpt(type); @@ -3818,7 +3811,6 @@ public class JavacParser implements Parser { syntaxError(token.pos, Errors.Expected(EQ)); } - int varTypePos = Position.NOPOS; JCTree elemType = TreeInfo.innermostType(type, true); if (elemType.hasTag(IDENT)) { Name typeName = ((JCIdent) elemType).name; @@ -3829,21 +3821,27 @@ public class JavacParser implements Parser { //error - 'var' and arrays reportSyntaxError(elemType.pos, Errors.RestrictedTypeNotAllowedArray(typeName)); } else { - declaredUsingVar = true; - varTypePos = elemType.pos; + type = replaceTypeWithVar(type); + if (compound) //error - 'var' in compound local var decl reportSyntaxError(elemType.pos, Errors.RestrictedTypeNotAllowedCompound(typeName)); - //implicit type - type = null; } } } JCVariableDecl result = toP(F.at(pos).VarDef(mods, name, type, init, - declaredUsingVar ? JCVariableDecl.DeclKind.VAR : JCVariableDecl.DeclKind.EXPLICIT, varTypePos)); + type.hasTag(VARTYPE) ? JCVariableDecl.DeclKind.VAR : JCVariableDecl.DeclKind.EXPLICIT)); return attach(result, dc); } + JCExpression replaceTypeWithVar(JCExpression type) { + JCVarType varType = F.at(type).VarType(); + + varType.endpos = type.endpos; + + return varType; + } + Name restrictedTypeName(JCExpression e, boolean shouldWarn) { switch (e.getTag()) { case IDENT: @@ -3902,7 +3900,7 @@ public class JavacParser implements Parser { if (allowThisIdent || !lambdaParameter || LAX_IDENTIFIER.test(token.kind) || - mods.flags != Flags.PARAMETER || + (mods.flags & ~(Flags.PARAMETER | Flags.LAMBDA_PARAMETER)) != 0 || mods.annotations.nonEmpty()) { JCExpression pn; if (token.kind == UNDERSCORE && (catchParameter || lambdaParameter)) { @@ -3954,11 +3952,10 @@ public class JavacParser implements Parser { name = names.empty; } - boolean declaredUsingVar = type != null && type.hasTag(IDENT) && ((JCIdent)type).name == names.var; + boolean declaredUsingVar = type != null && type.hasTag(VARTYPE); JCVariableDecl.DeclKind declKind = declaredUsingVar ? JCVariableDecl.DeclKind.VAR : type != null ? JCVariableDecl.DeclKind.EXPLICIT : JCVariableDecl.DeclKind.IMPLICIT; - int typePos = type != null ? type.pos : pos; - return toP(F.at(pos).VarDef(mods, name, type, null, declKind, typePos)); + return toP(F.at(pos).VarDef(mods, name, type, null, declKind)); } /** Resources = Resource { ";" Resources } @@ -4424,12 +4421,13 @@ public class JavacParser implements Parser { JCMethodDecl methDef = (JCMethodDecl) def; if (methDef.name == names.init && methDef.params.isEmpty() && (methDef.mods.flags & Flags.COMPACT_RECORD_CONSTRUCTOR) != 0) { ListBuffer tmpParams = new ListBuffer<>(); + TreeCopier copier = new TreeCopier<>(F); for (JCVariableDecl param : headerFields) { tmpParams.add(F.at(param) // we will get flags plus annotations from the record component .VarDef(F.Modifiers(Flags.PARAMETER | Flags.GENERATED_MEMBER | Flags.MANDATED | param.mods.flags & Flags.VARARGS, - param.mods.annotations), - param.name, param.vartype, null)); + copier.copy(param.mods.annotations)), + param.name, copier.copy(param.vartype), null)); } methDef.params = tmpParams.toList(); } @@ -5405,7 +5403,19 @@ public class JavacParser implements Parser { * LastFormalParameter = { FINAL | '@' Annotation } Type '...' Ident | FormalParameter */ protected JCVariableDecl formalParameter(boolean lambdaParameter, boolean recordComponent) { - JCModifiers mods = !recordComponent ? optFinal(Flags.PARAMETER) : modifiersOpt(); + JCModifiers mods; + + if (recordComponent) { + mods = modifiersOpt(); + /* it could be that the user added a javadoc with the @deprecated tag, when analyzing this + * javadoc, javac will set the DEPRECATED flag. This is correct in most cases but not for + * record components and thus should be removed in that case. Any javadoc applied to + * record components is ignored + */ + mods.flags &= ~Flags.DEPRECATED; + } else { + mods = optFinal(Flags.PARAMETER | (lambdaParameter ? Flags.LAMBDA_PARAMETER : 0)); + } if (recordComponent && mods.flags != 0) { log.error(mods.pos, Errors.RecordCantDeclareFieldModifiers); } @@ -5436,7 +5446,7 @@ public class JavacParser implements Parser { } protected JCVariableDecl implicitParameter() { - JCModifiers mods = F.at(token.pos).Modifiers(Flags.PARAMETER); + JCModifiers mods = F.at(token.pos).Modifiers(Flags.PARAMETER | Flags.LAMBDA_PARAMETER); return variableDeclaratorId(mods, null, false, true, false); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index bb81916becb..915d7f8a8d8 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -1721,7 +1721,7 @@ compiler.note.mref.stat.1=\ alternate metafactory = {0}\n\ bridge method = {1} -# 0: string, 1: string, 2: string, 3: number, 4: string, 5: string, 6: string +# 0: string, 1: string, 2: string, 3: number, 4: string, 5: string, 6: string, 7: string compiler.note.lambda.deserialization.stat=\ Generating lambda deserialization\n\ functionalInterfaceClass: {0}\n\ @@ -1730,7 +1730,8 @@ compiler.note.lambda.deserialization.stat=\ implMethodKind: {3}\n\ implClass: {4}\n\ implMethodName: {5}\n\ - implMethodSignature: {6} + implMethodSignature: {6}\n\ + instantiatedMethodType: {7} compiler.note.note=\ Note:\u0020 diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java index e0a99a6f103..f0a8b6034df 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2026, 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 @@ -277,6 +277,10 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { */ TYPEIDENT, + /** 'var' type. + */ + VARTYPE, + /** Array types, of type TypeArray. */ TYPEARRAY, @@ -1012,9 +1016,16 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { public static class JCVariableDecl extends JCStatement implements VariableTree { public enum DeclKind { - EXPLICIT, // "SomeType name" - IMPLICIT, // "name" - VAR, // "var name" + EXPLICIT(0), // "SomeType name" + IMPLICIT(Flags.VAR_VARIABLE), // "name" + VAR(Flags.VAR_VARIABLE), // "var name" + ; + + public final long additionalSymbolFlags; + + private DeclKind(long additionalSymbolFlags) { + this.additionalSymbolFlags = additionalSymbolFlags; + } } /** variable modifiers */ @@ -1031,15 +1042,13 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { public VarSymbol sym; /** how the variable's type was declared */ public DeclKind declKind; - /** a source code position to use for "vartype" when null (can happen if declKind != EXPLICIT) */ - public int typePos; protected JCVariableDecl(JCModifiers mods, Name name, JCExpression vartype, JCExpression init, VarSymbol sym) { - this(mods, name, vartype, init, sym, DeclKind.EXPLICIT, Position.NOPOS); + this(mods, name, vartype, init, sym, DeclKind.EXPLICIT); } protected JCVariableDecl(JCModifiers mods, @@ -1047,21 +1056,19 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { JCExpression vartype, JCExpression init, VarSymbol sym, - DeclKind declKind, - int typePos) { + DeclKind declKind) { this.mods = mods; this.name = name; this.vartype = vartype; this.init = init; this.sym = sym; this.declKind = declKind; - this.typePos = typePos; } protected JCVariableDecl(JCModifiers mods, JCExpression nameexpr, JCExpression vartype) { - this(mods, null, vartype, null, null, DeclKind.EXPLICIT, Position.NOPOS); + this(mods, null, vartype, null, null, DeclKind.EXPLICIT); this.nameexpr = nameexpr; if (nameexpr.hasTag(Tag.IDENT)) { this.name = ((JCIdent)nameexpr).name; @@ -1071,8 +1078,9 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { } } + @DefinedBy(Api.COMPILER_TREE) public boolean isImplicitlyTyped() { - return vartype == null; + return declKind != DeclKind.EXPLICIT; } public boolean declaredUsingVar() { @@ -2040,7 +2048,7 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { this.params = params; this.body = body; if (params.isEmpty() || - params.head.vartype != null) { + !params.head.isImplicitlyTyped()) { paramKind = ParameterKind.EXPLICIT; } else { paramKind = ParameterKind.IMPLICIT; @@ -2820,6 +2828,24 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { } } + public static class JCVarType extends JCExpression implements VarTypeTree { + public JCVarType() {} + @Override + public void accept(Visitor v) { v.visitVarType(this); } + + @DefinedBy(Api.COMPILER_TREE) + public Kind getKind() { return Kind.VAR_TYPE; } + + @Override @DefinedBy(Api.COMPILER_TREE) + public R accept(TreeVisitor v, D d) { + return v.visitVarType(this, d); + } + @Override + public Tag getTag() { + return VARTYPE; + } + } + /** * An array type, A[] */ @@ -3597,6 +3623,7 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition { public void visitIdent(JCIdent that) { visitTree(that); } public void visitLiteral(JCLiteral that) { visitTree(that); } public void visitTypeIdent(JCPrimitiveTypeTree that) { visitTree(that); } + public void visitVarType(JCVarType that) { visitTree(that); } public void visitTypeArray(JCArrayTypeTree that) { visitTree(that); } public void visitTypeApply(JCTypeApply that) { visitTree(that); } public void visitTypeUnion(JCTypeUnion that) { visitTree(that); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java index d953663a6d7..c22dfd61637 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java @@ -1529,6 +1529,15 @@ public class Pretty extends JCTree.Visitor { } } + @Override + public void visitVarType(JCVarType that) { + try { + print("var"); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + public void visitTypeArray(JCArrayTypeTree tree) { try { printBaseElementType(tree); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java index 9efc6a9d895..95e2976f14e 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java @@ -480,6 +480,12 @@ public class TreeCopier

    implements TreeVisitor { return M.at(t.pos).TypeIdent(t.typetag); } + @DefinedBy(Api.COMPILER_TREE) + public JCTree visitVarType(VarTypeTree node, P p) { + JCVarType t = (JCVarType) node; + return M.at(t.pos).VarType(); + } + @DefinedBy(Api.COMPILER_TREE) public JCTree visitTypeParameter(TypeParameterTree node, P p) { JCTypeParameter t = (JCTypeParameter) node; @@ -551,7 +557,7 @@ public class TreeCopier

    implements TreeVisitor { JCExpression vartype = copy(t.vartype, p); if (t.nameexpr == null) { JCExpression init = copy(t.init, p); - return M.at(t.pos).VarDef(mods, t.name, vartype, init, t.declKind, t.typePos); + return M.at(t.pos).VarDef(mods, t.name, vartype, init, t.declKind); } else { JCExpression nameexpr = copy(t.nameexpr, p); return M.at(t.pos).ReceiverVarDef(mods, nameexpr, vartype); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java index aa616f3f580..ffb259c6a8b 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java @@ -621,8 +621,6 @@ public class TreeInfo { return node.mods.pos; } else if (node.vartype != null) { return getStartPos(node.vartype); - } else if (node.typePos != Position.NOPOS) { - return node.typePos; } break; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java index 0e71df99bdc..77391493ad2 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java @@ -238,8 +238,8 @@ public class TreeMaker implements JCTree.Factory { } public JCVariableDecl VarDef(JCModifiers mods, Name name, JCExpression vartype, JCExpression init, - JCVariableDecl.DeclKind declKind, int typePos) { - JCVariableDecl tree = new JCVariableDecl(mods, name, vartype, init, null, declKind, typePos); + JCVariableDecl.DeclKind declKind) { + JCVariableDecl tree = new JCVariableDecl(mods, name, vartype, init, null, declKind); tree.pos = pos; return tree; } @@ -566,6 +566,12 @@ public class TreeMaker implements JCTree.Factory { return tree; } + public JCVarType VarType() { + JCVarType tree = new JCVarType(); + tree.pos = pos; + return tree; + } + public JCArrayTypeTree TypeArray(JCExpression elemtype) { JCArrayTypeTree tree = new JCArrayTypeTree(elemtype); tree.pos = pos; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java index b9ae35da9df..0d1216217c8 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java @@ -361,6 +361,9 @@ public class TreeScanner extends Visitor { public void visitTypeIdent(JCPrimitiveTypeTree tree) { } + public void visitVarType(JCVarType tree) { + } + public void visitTypeArray(JCArrayTypeTree tree) { scan(tree.elemtype); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java index 63778fb42ff..5b06e76bf33 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java @@ -418,6 +418,10 @@ public class TreeTranslator extends JCTree.Visitor { result = tree; } + public void visitVarType(JCVarType tree) { + result = tree; + } + public void visitTypeArray(JCArrayTypeTree tree) { tree.elemtype = translate(tree.elemtype); result = tree; diff --git a/src/jdk.hotspot.agent/doc/clhsdb.html b/src/jdk.hotspot.agent/doc/clhsdb.html index bd436f1dfef..cfe6453b736 100644 --- a/src/jdk.hotspot.agent/doc/clhsdb.html +++ b/src/jdk.hotspot.agent/doc/clhsdb.html @@ -57,7 +57,6 @@ Available commands: pmap show Solaris pmap-like output print expression print given Klass*, Method* or arbitrary address printas type expression print given address as given HotSpot type. eg. print JavaThread <address> - printmdo -a | expression print method data oop printstatics [ type ] print static fields of given HotSpot type (or all types if none specified) pstack [-v] [-l] show mixed mode stack trace for all Java, non-Java threads. -v is verbose mode. -l includes info on owned java.util.concurrent locks. quit quit CLHSDB tool diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp b/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp index 6c94992e1e2..62dbc84f88c 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/DwarfParser.cpp @@ -205,7 +205,7 @@ extern "C" JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_getReturnAddressOffsetFromCFA (JNIEnv *env, jobject this_obj) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); - return parser->get_ra_cfa_offset(); + return parser->get_offset_from_cfa(RA); } /* @@ -217,5 +217,5 @@ extern "C" JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_getBasePointerOffsetFromCFA (JNIEnv *env, jobject this_obj) { DwarfParser *parser = reinterpret_cast(get_dwarf_context(env, this_obj)); - return parser->get_bp_cfa_offset(); + return parser->get_offset_from_cfa(RBP); } diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp index 2636bdf691a..459e3cc57e9 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.cpp @@ -24,10 +24,32 @@ */ #include +#include #include "dwarf.hpp" #include "libproc_impl.h" +DwarfParser::DwarfParser(lib_info *lib) : _lib(lib), + _buf(NULL), + _encoding(0), + _code_factor(0), + _data_factor(0), + _current_pc(0L) { + init_state(_initial_state); + init_state(_state); +} + +void DwarfParser::init_state(struct DwarfState& st) { + st.cfa_reg = MAX_VALUE; + st.return_address_reg = MAX_VALUE; + st.cfa_offset = 0; + + st.offset_from_cfa.clear(); + for (int reg = 0; reg < MAX_VALUE; reg++) { + st.offset_from_cfa[static_cast(reg)] = INT_MAX; + } +} + /* from read_leb128() in dwarf.c in binutils */ uintptr_t DwarfParser::read_leb(bool sign) { uintptr_t result = 0L; @@ -82,7 +104,7 @@ bool DwarfParser::process_cie(unsigned char *start_of_entry, uint32_t id) { _code_factor = read_leb(false); _data_factor = static_cast(read_leb(true)); - _return_address_reg = static_cast(*_buf++); + enum DWARF_Register initial_ra = static_cast(*_buf++); if (strpbrk(augmentation_string, "LP") != NULL) { // Language personality routine (P) and Language Specific Data Area (LSDA:L) @@ -99,14 +121,12 @@ bool DwarfParser::process_cie(unsigned char *start_of_entry, uint32_t id) { // Clear state _current_pc = 0L; - _cfa_reg = MAX_VALUE; - _return_address_reg = RA; - _cfa_offset = 0; - _ra_cfa_offset = 8; - _bp_cfa_offset = INT_MAX; + init_state(_state); + _state.return_address_reg = initial_ra; parse_dwarf_instructions(0L, static_cast(-1L), end); + _initial_state = _state; _buf = orig_pos; return true; } @@ -114,12 +134,7 @@ bool DwarfParser::process_cie(unsigned char *start_of_entry, uint32_t id) { void DwarfParser::parse_dwarf_instructions(uintptr_t begin, uintptr_t pc, const unsigned char *end) { uintptr_t operand1; _current_pc = begin; - - /* for remember state */ - enum DWARF_Register rem_cfa_reg = MAX_VALUE; - int rem_cfa_offset = 0; - int rem_ra_cfa_offset = 8; - int rem_bp_cfa_offset = INT_MAX; + std::stack remember_state; while ((_buf < end) && (_current_pc < pc)) { unsigned char op = *_buf++; @@ -138,21 +153,17 @@ void DwarfParser::parse_dwarf_instructions(uintptr_t begin, uintptr_t pc, const } break; case 0x0c: // DW_CFA_def_cfa - _cfa_reg = static_cast(read_leb(false)); - _cfa_offset = read_leb(false); + _state.cfa_reg = static_cast(read_leb(false)); + _state.cfa_offset = read_leb(false); break; case 0x80: {// DW_CFA_offset operand1 = read_leb(false); enum DWARF_Register reg = static_cast(opa); - if (reg == RBP) { - _bp_cfa_offset = operand1 * _data_factor; - } else if (reg == RA) { - _ra_cfa_offset = operand1 * _data_factor; - } + _state.offset_from_cfa[reg] = operand1 * _data_factor; break; } case 0xe: // DW_CFA_def_cfa_offset - _cfa_offset = read_leb(false); + _state.cfa_offset = read_leb(false); break; case 0x40: // DW_CFA_advance_loc if (_current_pc != 0L) { @@ -184,28 +195,28 @@ void DwarfParser::parse_dwarf_instructions(uintptr_t begin, uintptr_t pc, const } case 0x07: { // DW_CFA_undefined enum DWARF_Register reg = static_cast(read_leb(false)); - // We are only interested in BP here because CFA and RA should not be undefined. - if (reg == RBP) { - _bp_cfa_offset = INT_MAX; - } + _state.offset_from_cfa[reg] = INT_MAX; break; } - case 0x0d: {// DW_CFA_def_cfa_register - _cfa_reg = static_cast(read_leb(false)); + case 0x0d: // DW_CFA_def_cfa_register + _state.cfa_reg = static_cast(read_leb(false)); break; - } case 0x0a: // DW_CFA_remember_state - rem_cfa_reg = _cfa_reg; - rem_cfa_offset = _cfa_offset; - rem_ra_cfa_offset = _ra_cfa_offset; - rem_bp_cfa_offset = _bp_cfa_offset; + remember_state.push(_state); break; case 0x0b: // DW_CFA_restore_state - _cfa_reg = rem_cfa_reg; - _cfa_offset = rem_cfa_offset; - _ra_cfa_offset = rem_ra_cfa_offset; - _bp_cfa_offset = rem_bp_cfa_offset; + if (remember_state.empty()) { + print_debug("DWARF Error: DW_CFA_restore_state with empty stack.\n"); + return; + } + _state = remember_state.top(); + remember_state.pop(); break; + case 0xc0: {// DW_CFA_restore + enum DWARF_Register reg = static_cast(opa); + _state.offset_from_cfa[reg] = _initial_state.offset_from_cfa[reg]; + break; + } default: print_debug("DWARF: Unknown opcode: 0x%x\n", op); return; diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp index a2692738ce1..0a38c9a0f2e 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/dwarf.hpp @@ -26,6 +26,8 @@ #ifndef _DWARF_HPP_ #define _DWARF_HPP_ +#include + #include "libproc_impl.h" /* @@ -55,6 +57,13 @@ enum DWARF_Register { MAX_VALUE }; +struct DwarfState { + enum DWARF_Register cfa_reg; + enum DWARF_Register return_address_reg; + int cfa_offset; + std::map offset_from_cfa; +}; + /* * DwarfParser finds out CFA (Canonical Frame Address) from DWARF in ELF binary. * Also Return Address (RA) and Base Pointer (BP) are calculated from CFA. @@ -64,16 +73,14 @@ class DwarfParser { const lib_info *_lib; unsigned char *_buf; unsigned char _encoding; - enum DWARF_Register _cfa_reg; - enum DWARF_Register _return_address_reg; unsigned int _code_factor; int _data_factor; uintptr_t _current_pc; - int _cfa_offset; - int _ra_cfa_offset; - int _bp_cfa_offset; + struct DwarfState _initial_state; + struct DwarfState _state; + void init_state(struct DwarfState& st); uintptr_t read_leb(bool sign); uint64_t get_entry_length(); bool process_cie(unsigned char *start_of_entry, uint32_t id); @@ -82,24 +89,12 @@ class DwarfParser { unsigned int get_pc_range(); public: - DwarfParser(lib_info *lib) : _lib(lib), - _buf(NULL), - _encoding(0), - _cfa_reg(MAX_VALUE), - _return_address_reg(RA), - _code_factor(0), - _data_factor(0), - _current_pc(0L), - _cfa_offset(0), - _ra_cfa_offset(8), - _bp_cfa_offset(INT_MAX) {}; - + DwarfParser(lib_info *lib); ~DwarfParser() {} bool process_dwarf(const uintptr_t pc); - enum DWARF_Register get_cfa_register() { return _cfa_reg; } - int get_cfa_offset() { return _cfa_offset; } - int get_ra_cfa_offset() { return _ra_cfa_offset; } - int get_bp_cfa_offset() { return _bp_cfa_offset; } + enum DWARF_Register get_cfa_register() { return _state.cfa_reg; } + int get_cfa_offset() { return _state.cfa_offset; } + int get_offset_from_cfa(enum DWARF_Register reg) { return _state.offset_from_cfa[reg]; } bool is_in(long pc) { return (_lib->exec_start <= pc) && (pc < _lib->exec_end); diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c index 74563aa0d6c..e2681be73fe 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -187,9 +187,8 @@ static bool fill_addr_info(lib_info* lib) { lib->exec_end = (uintptr_t)-1L; for (ph = phbuf, cnt = 0; cnt < ehdr.e_phnum; cnt++, ph++) { if (ph->p_type == PT_LOAD) { - uintptr_t unaligned_start = lib->base + ph->p_vaddr; - uintptr_t aligned_start = align_down(unaligned_start, ph->p_align); - uintptr_t aligned_end = align_up(unaligned_start + ph->p_memsz, ph->p_align); + uintptr_t aligned_start = lib->base + align_down(ph->p_vaddr, ph->p_align); + uintptr_t aligned_end = aligned_start + align_up(ph->p_memsz, ph->p_align); if ((lib->end == (uintptr_t)-1L) || (lib->end < aligned_end)) { lib->end = aligned_end; } diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h index 42a6212510c..62b1b4d0d6b 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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 @@ -95,6 +95,9 @@ struct core_data { // part of the class sharing workaround int classes_jsa_fd; // file descriptor of class share archive uintptr_t dynamic_addr; // address of dynamic section of a.out + uintptr_t vdso_addr; // address of vDSO + off_t vdso_offset; // offset of vDSO in core + size_t vdso_size; // size of vDSO uintptr_t ld_base_addr; // base address of ld.so size_t num_maps; // number of maps. map_info* maps; // maps in a linked list diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c index 899d42152d1..6298f569aaf 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,11 +26,14 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include "libproc_impl.h" #include "ps_core_common.h" #include "proc_service.h" @@ -285,6 +288,8 @@ static bool core_handle_note(struct ps_prochandle* ph, ELF_PHDR* note_phdr) { // We will adjust it in read_exec_segments(). ph->core->dynamic_addr = auxv->a_un.a_val; break; + } else if (auxv->a_type == AT_SYSINFO_EHDR) { + ph->core->vdso_addr = auxv->a_un.a_val; } auxv++; } @@ -350,6 +355,10 @@ static bool read_core_segments(struct ps_prochandle* ph, ELF_EHDR* core_ehdr) { print_error("failed to add map info\n"); goto err; } + if (core_php->p_vaddr == ph->core->vdso_addr) { + ph->core->vdso_offset = core_php->p_offset; + ph->core->vdso_size = core_php->p_memsz; + } } break; } @@ -413,10 +422,18 @@ static bool read_lib_segments(struct ps_prochandle* ph, int lib_fd, ELF_EHDR* li if (target_vaddr > existing_map->vaddr) { lib_memsz += target_vaddr - existing_map->vaddr; } + uint64_t aligned_lib_memsz = ROUNDUP(lib_memsz, page_size); + size_t aligned_segment_sz = ROUNDUP(lib_php->p_memsz, page_size); + if (target_vaddr == ph->core->vdso_addr) { + // We can overwrite with entire vDSO because vDSO on memory is + // entire ELF binary. + aligned_lib_memsz = ROUNDUP(existing_map->memsz, page_size); + aligned_segment_sz = aligned_lib_memsz; + } if ((existing_map->memsz != page_size) && (existing_map->fd != lib_fd) && - (ROUNDUP(existing_map->memsz, page_size) != ROUNDUP(lib_memsz, page_size))) { + (ROUNDUP(existing_map->memsz, page_size) != aligned_lib_memsz)) { print_error("address conflict @ 0x%lx (existing map size = %ld, size = %ld, flags = %d)\n", target_vaddr, existing_map->memsz, lib_php->p_memsz, lib_php->p_flags); @@ -425,11 +442,11 @@ static bool read_lib_segments(struct ps_prochandle* ph, int lib_fd, ELF_EHDR* li /* replace PT_LOAD segment with library segment */ print_debug("overwrote with new address mapping (memsz %ld -> %ld)\n", - existing_map->memsz, ROUNDUP(lib_php->p_memsz, page_size)); + existing_map->memsz, aligned_segment_sz); existing_map->fd = lib_fd; existing_map->offset = lib_php->p_offset; - existing_map->memsz = ROUNDUP(lib_php->p_memsz, page_size); + existing_map->memsz = aligned_segment_sz; } } @@ -593,6 +610,44 @@ static uintptr_t calc_prelinked_load_address(struct ps_prochandle* ph, int lib_f return load_addr; } +// Check for vDSO binary in kernel directory (/lib/modules//vdso), +// rewrite the given lib_name string if found. +// Otherwise copy vDSO memory in coredump to temporal file generated by tmpfile(). +// Returns FD for vDSO (should be closed by caller), or -1 on error. +static int handle_vdso(struct ps_prochandle* ph, char* lib_name, size_t lib_name_len) { + int lib_fd; + struct utsname uts; + uname(&uts); + + // Check vDSO binary first (for referring debuginfo if possible). + char *vdso_path = (char*)malloc(lib_name_len); + snprintf(vdso_path, lib_name_len, "/lib/modules/%s/vdso/vdso64.so", uts.release); + lib_fd = pathmap_open(vdso_path); + if (lib_fd != -1) { + print_debug("replace vDSO: %s -> %s\n", lib_name, vdso_path); + strncpy(lib_name, vdso_path, lib_name_len); + } else { + // Copy vDSO memory segment from core to temporal memory + // if vDSO binary is not available. + FILE* tmpf = tmpfile(); + if (tmpf == NULL) { + print_debug("can't create tmpfile for vDSO (%d)\n", errno); + lib_fd = -1; + } else { + lib_fd = fileno(tmpf); + off_t ofs = ph->core->vdso_offset; + if (sendfile(lib_fd, ph->core->core_fd, &ofs, ph->core->vdso_size) == -1) { + print_debug("can't copy vDSO (%d)\n", errno); + fclose(tmpf); + lib_fd = -1; + } + } + } + + free(vdso_path); + return lib_fd; +} + // read shared library info from runtime linker's data structures. // This work is done by librtlb_db in Solaris static bool read_shared_lib_info(struct ps_prochandle* ph) { @@ -687,9 +742,14 @@ static bool read_shared_lib_info(struct ps_prochandle* ph) { // it will fail later. } - if (lib_name[0] != '\0') { - // ignore empty lib names - lib_fd = pathmap_open(lib_name); + if (lib_name[0] != '\0') { // ignore empty lib names + // We can use lib_base_diff to compare with vdso_addr + // because base address of vDSO should be 0. + if (lib_base_diff == ph->core->vdso_addr) { + lib_fd = handle_vdso(ph, lib_name, sizeof(lib_name)); + } else { + lib_fd = pathmap_open(lib_name); + } if (lib_fd < 0) { print_debug("can't open shared object %s\n", lib_name); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java index 01b9a4a447e..74335f78888 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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 @@ -60,7 +60,6 @@ import sun.jvm.hotspot.oops.InstanceKlass; import sun.jvm.hotspot.oops.Klass; import sun.jvm.hotspot.oops.Metadata; import sun.jvm.hotspot.oops.Method; -import sun.jvm.hotspot.oops.MethodData; import sun.jvm.hotspot.oops.Oop; import sun.jvm.hotspot.oops.RawHeapVisitor; import sun.jvm.hotspot.oops.Symbol; @@ -860,44 +859,8 @@ public class CommandProcessor { } } }, - new Command("printmdo", "printmdo [ -a | expression ]", false) { - // Print every MDO in the heap or the one referenced by expression. - public void doit(Tokens t) { - if (t.countTokens() != 1) { - usage(); - } else { - String s = t.nextToken(); - if (s.equals("-a")) { - ClassLoaderDataGraph cldg = VM.getVM().getClassLoaderDataGraph(); - cldg.classesDo(new ClassLoaderDataGraph.ClassVisitor() { - public void visit(Klass k) { - if (k instanceof InstanceKlass) { - MethodArray methods = ((InstanceKlass)k).getMethods(); - for (int i = 0; i < methods.length(); i++) { - Method m = methods.at(i); - MethodData mdo = m.getMethodData(); - if (mdo != null) { - out.println("MethodData " + mdo.getAddress() + " for " + - "method " + m.getMethodHolder().getName().asString() + "." + - m.getName().asString() + - m.getSignature().asString() + "@" + m.getAddress()); - mdo.printDataOn(out); - } - } - } - } - } - ); - } else { - Address a = VM.getVM().getDebugger().parseAddress(s); - MethodData mdo = (MethodData) Metadata.instantiateWrapperFor(a); - mdo.printDataOn(out); - } - } - } - }, new Command("printall", "printall", false) { - // Print every MDO in the heap or the one referenced by expression. + // Print every Method for every class loaded. public void doit(Tokens t) { if (t.countTokens() != 0) { usage(); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java index 44b407edaca..7ce46799495 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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,12 +44,14 @@ public class ClassLoaderData extends VMObject { private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { Type type = db.lookupType("ClassLoaderData"); classLoaderFieldOffset = type.getAddressField("_class_loader").getOffset(); + theNullClassLoaderDataField = type.getAddressField("_the_null_class_loader_data"); nextField = type.getAddressField("_next"); klassesField = new MetadataField(type.getAddressField("_klasses"), 0); hasClassMirrorHolderField = new CIntField(type.getCIntegerField("_has_class_mirror_holder"), 0); } private static long classLoaderFieldOffset; + private static AddressField theNullClassLoaderDataField; private static AddressField nextField; private static MetadataField klassesField; private static CIntField hasClassMirrorHolderField; @@ -75,6 +77,10 @@ public class ClassLoaderData extends VMObject { return hasClassMirrorHolderField.getValue(this) != 0; } + public static ClassLoaderData theNullClassLoaderData() { + return instantiateWrapperFor(theNullClassLoaderDataField.getValue()); + } + public ClassLoaderData next() { return instantiateWrapperFor(nextField.getValue(getAddress())); } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java index 64bdb8c1c72..04f374de80e 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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,6 +30,7 @@ import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.windows.amd64.*; +import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.utilities.AddressOps; class WindbgCDebugger implements CDebugger { @@ -66,14 +67,35 @@ class WindbgCDebugger implements CDebugger { return null; } + private JavaThread mapThreadProxyToJavaThread(ThreadProxy thread) { + var threads = VM.getVM().getThreads(); + for (int i = 0; i < threads.getNumberOfThreads(); i++) { + var jt = threads.getJavaThreadAt(i); + if (thread.equals(jt.getThreadProxy())) { + return jt; + } + } + + // not found + return null; + } + public CFrame topFrameForThread(ThreadProxy thread) throws DebuggerException { if (dbg.getCPU().equals("amd64")) { AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); + + // rbp is not needed null check because it could be used as GPR by compiler (cl.exe) option. Address rbp = context.getRegisterAsAddress(AMD64ThreadContext.RBP); - if (rbp == null) return null; + + Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); + if (rsp == null) return null; Address pc = context.getRegisterAsAddress(AMD64ThreadContext.RIP); if (pc == null) return null; - return new WindowsAMD64CFrame(dbg, rbp, pc); + + // get JavaThread as the owner from ThreadProxy + JavaThread ownerThread = mapThreadProxyToJavaThread(thread); + + return new WindowsAMD64CFrame(dbg, ownerThread, rsp, rbp, pc); } else { // unsupported CPU! return null; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java index 46edb2f55b2..82dc28515d3 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -85,4 +85,8 @@ public interface WindbgDebugger extends JVMDebugger { // public ThreadProxy getThreadForIdentifierAddress(Address addr); public int getAddressSize(); + + public static record SenderRegs(Address nextSP, Address nextFP, Address nextPC) {}; + + public SenderRegs getSenderRegs(Address sp, Address fp, Address pc); } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java index 9ed05b31319..4864b94fd86 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -229,6 +229,12 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger return lookupByAddress0(address); } + public synchronized SenderRegs getSenderRegs(Address sp, Address fp, Address pc) { + // sp and pc should not be null, but fp might be null because it could be used as GPR. + long[] rawSenderRegs = getSenderRegs0(sp.asLongValue(), fp == null ? 0L : fp.asLongValue(), pc.asLongValue()); + return rawSenderRegs == null ? null : new SenderRegs(newAddress(rawSenderRegs[0]), newAddress(rawSenderRegs[1]), newAddress(rawSenderRegs[2])); + } + /** From the Debugger interface */ public MachineDescription getMachineDescription() { return machDesc; @@ -644,6 +650,7 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger private native String consoleExecuteCommand0(String cmd); private native long lookupByName0(String objName, String symName); private native ClosestSymbol lookupByAddress0(long address); + private native long[] getSenderRegs0(long sp, long fp, long pc); // helper called lookupByAddress0 private ClosestSymbol createClosestSymbol(String symbol, long diff) { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java index 69ad04da51b..b004a84fff4 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,43 +29,74 @@ import sun.jvm.hotspot.debugger.amd64.*; import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.debugger.cdbg.basic.*; import sun.jvm.hotspot.debugger.windbg.*; +import sun.jvm.hotspot.runtime.*; +import sun.jvm.hotspot.runtime.amd64.*; public class WindowsAMD64CFrame extends BasicCFrame { + private JavaThread ownerThread; + private Address rsp; private Address rbp; private Address pc; - private static final int ADDRESS_SIZE = 8; - /** Constructor for topmost frame */ - public WindowsAMD64CFrame(WindbgDebugger dbg, Address rbp, Address pc) { + public WindowsAMD64CFrame(WindbgDebugger dbg, JavaThread ownerThread, Address rsp, Address rbp, Address pc) { super(dbg.getCDebugger()); + this.ownerThread = ownerThread; + this.rsp = rsp; this.rbp = rbp; this.pc = pc; this.dbg = dbg; } + @Override public CFrame sender(ThreadProxy thread) { - AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); - Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); + return sender(thread, null, null, null); + } - if ( (rbp == null) || rbp.lessThan(rsp) ) { - return null; - } + @Override + public CFrame sender(ThreadProxy th, Address nextSP, Address nextFP, Address nextPC) { + if (nextSP == null && nextPC == null) { + // GetStackTrace() by Windows Debug API would unwind frame with given SP, FP, and PC. + // However it would not work for dynamic generated code like CodeBlob because + // HotSpot would not register unwind info like RtlAddFunctionTable(). + // Thus SA should check whether current PC is in CodeCache at first when nextPC is null. + var cb = VM.getVM().getCodeCache().findBlob(pc); + if (cb != null) { + if (cb.getFrameSize() > 0) { + nextSP = rsp.addOffsetTo(cb.getFrameSize()); + nextPC = nextSP.getAddressAt(-1 * VM.getVM().getAddressSize()); - // Check alignment of rbp - if ( dbg.getAddressValue(rbp) % ADDRESS_SIZE != 0) { + // Set nextFP to null when PreserveFramePointer is disabled because We could not find out + // frame pointer of sender frame - it might be omitted. + nextFP = VM.getVM().getCommandLineBooleanFlag("PreserveFramePointer") ? rsp.getAddressAt(0) : null; + } else { + // Use Frame (AMD64Frame) to access slots on stack. + var frame = toFrame(); + nextSP = frame.getSenderSP(); + nextPC = frame.getSenderPC(); + nextFP = frame.getLink(); + } + return new WindowsAMD64CFrame(dbg, ownerThread, nextSP, nextFP, nextPC); + } + + WindbgDebugger.SenderRegs senderRegs = dbg.getSenderRegs(rsp, rbp, pc); + if (senderRegs == null) { return null; - } + } - Address nextRBP = rbp.getAddressAt( 0 * ADDRESS_SIZE); - if (nextRBP == null || nextRBP.lessThanOrEqual(rbp)) { - return null; + if (senderRegs.nextSP() == null || senderRegs.nextSP().lessThanOrEqual(rsp)) { + return null; + } + nextSP = senderRegs.nextSP(); + + if (senderRegs.nextPC() == null) { + return null; + } + nextPC = senderRegs.nextPC(); + + nextFP = senderRegs.nextFP(); } - Address nextPC = rbp.getAddressAt( 1 * ADDRESS_SIZE); - if (nextPC == null) { - return null; - } - return new WindowsAMD64CFrame(dbg, nextRBP, nextPC); + return new WindowsAMD64CFrame(dbg, ownerThread, nextSP, nextFP, nextPC); } public Address pc() { @@ -76,5 +107,21 @@ public class WindowsAMD64CFrame extends BasicCFrame { return rbp; } + @Override + public Frame toFrame() { + // Find the top of JavaVFrame related to this CFrame. The Windows GetStackTrace DbgHelp API + // cannot get FP for java frames. + for (JavaVFrame vf = ownerThread.getLastJavaVFrameDbg(); vf != null; vf = vf.javaSender()) { + Frame f = vf.getFrame(); + if (f.getSP().equals(rsp) && f.getPC().equals(pc)) { + return f; + } else if (f.getSP().greaterThanOrEqual(rsp)) { + return f; + } + } + + return new AMD64Frame(rsp, localVariableBase(), pc); + } + private WindbgDebugger dbg; } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java index 75d9589a74f..fda97b4f337 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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 @@ -96,7 +96,7 @@ public class OopMapCacheEntry { Method method() { return method; } int bci() { return bci; } - int numberOfEntries() { return maskSize; } + public int numberOfEntries() { return maskSize; } boolean entryAt(int offset) { return mask.at(offset); } 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 94200e31b7e..12b614e7fa8 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, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,6 +41,7 @@ public class FileMapInfo { private static Address rwRegionEndAddress; private static Address vtablesIndex; private static Address mapped_base_address; + private static long metadataOffsetShift; // HashMap created by mapping the vTable addresses in the rw region with // the corresponding metadata type. @@ -97,10 +98,15 @@ public class FileMapInfo { headerObj = VMObjectFactory.newObject(FileMapHeader.class, header); // char* mapped_base_address = header->_mapped_base_address - // size_t cloned_vtable_offset = header->_cloned_vtable_offset + // narrowPtr cloned_vtable_narrowPtr = header->_cloned_vtables + // size_t cloned_vtable_offset = AOTCompressedPointers::get_byte_offset(cloned_vtable_narrowPtr); // CppVtableInfo** vtablesIndex = mapped_base_address + cloned_vtable_offset; mapped_base_address = get_AddressField(FileMapHeader_type, header, "_mapped_base_address"); - long cloned_vtable_offset = get_CIntegerField(FileMapHeader_type, header, "_cloned_vtables_offset"); + long cloned_vtable_narrowPtr = get_CIntegerField(FileMapHeader_type, header, "_cloned_vtables"); + // narrowPtr stores scaled offset units (byte_offset >> MetadataOffsetShift). + // Apply the left shift to convert back to byte offset. + metadataOffsetShift = db.lookupIntConstant("AOTCompressedPointers::MetadataOffsetShift").longValue(); + long cloned_vtable_offset = cloned_vtable_narrowPtr << metadataOffsetShift; vtablesIndex = mapped_base_address.addOffsetTo(cloned_vtable_offset); // CDSFileMapRegion* rw_region = &header->_region[rw]; @@ -174,9 +180,9 @@ public class FileMapInfo { // vtablesIndex points to to an array like this: // long info[] = { - // offset of the CppVtableInfo for ConstantPool, - // offset of the CppVtableInfo for InstanceKlass, - // offset of the CppVtableInfo for InstanceClassLoaderKlass, + // narrowPtr of the CppVtableInfo for ConstantPool, + // narrowPtr of the CppVtableInfo for InstanceKlass, + // narrowPtr of the CppVtableInfo for InstanceClassLoaderKlass, // ... // }; // @@ -187,8 +193,8 @@ public class FileMapInfo { // }; // // The loop below computes the following - // CppVtableInfo* t_ConstantPool = mapped_base_address + info[0]; - // CppVtableInfo* t_InstanceKlass = mapped_base_address + info[1]; + // CppVtableInfo* t_ConstantPool = mapped_base_address + (info[0] << metadataOffsetShift); + // CppVtableInfo* t_InstanceKlass = mapped_base_address + (info[1] << metadataOffsetShift); // ... // // If we have the following objects @@ -201,21 +207,21 @@ public class FileMapInfo { // // To get an idea what these address look like, do this: // - // $ java -Xlog:cds+vtables=debug -XX:+UnlockDiagnosticVMOptions -XX:ArchiveRelocationMode=0 --version - // [0.002s][debug][cds,vtables] Copying 14 vtable entries for ConstantPool to 0x800000018 - // [0.002s][debug][cds,vtables] Copying 41 vtable entries for InstanceKlass to 0x800000090 - // [0.002s][debug][cds,vtables] Copying 41 vtable entries for InstanceClassLoaderKlass to 0x8000001e0 - // [0.002s][debug][cds,vtables] Copying 41 vtable entries for InstanceMirrorKlass to 0x800000330 - // [0.002s][debug][cds,vtables] Copying 41 vtable entries for InstanceRefKlass to 0x800000480 - // [0.002s][debug][cds,vtables] Copying 41 vtable entries for InstanceStackChunkKlass to 0x8000005d0 - // [0.002s][debug][cds,vtables] Copying 14 vtable entries for Method to 0x800000720 - // [0.002s][debug][cds,vtables] Copying 42 vtable entries for ObjArrayKlass to 0x800000798 - // [0.002s][debug][cds,vtables] Copying 42 vtable entries for TypeArrayKlass to 0x8000008f0 - // java 23-internal 2024-09-17 + // $ java -Xlog:aot+vtables=debug -XX:+UnlockDiagnosticVMOptions -XX:ArchiveRelocationMode=0 --version + // [0.002s][debug][aot,vtables] Copying 14 vtable entries for ConstantPool to 0x800000018 + // [0.002s][debug][aot,vtables] Copying 41 vtable entries for InstanceKlass to 0x800000090 + // [0.002s][debug][aot,vtables] Copying 41 vtable entries for InstanceClassLoaderKlass to 0x8000001e0 + // [0.002s][debug][aot,vtables] Copying 41 vtable entries for InstanceMirrorKlass to 0x800000330 + // [0.002s][debug][aot,vtables] Copying 41 vtable entries for InstanceRefKlass to 0x800000480 + // [0.002s][debug][aot,vtables] Copying 41 vtable entries for InstanceStackChunkKlass to 0x8000005d0 + // [0.002s][debug][aot,vtables] Copying 14 vtable entries for Method to 0x800000720 + // [0.002s][debug][aot,vtables] Copying 42 vtable entries for ObjArrayKlass to 0x800000798 + // [0.002s][debug][aot,vtables] Copying 42 vtable entries for TypeArrayKlass to 0x8000008f0 // ... for (int i=0; i < metadataTypeArray.length; i++) { - long vtable_offset = vtablesIndex.getJLongAt(i * addressSize); // long offset = _index[i] + long narrowPtr = vtablesIndex.getJLongAt(i * addressSize); + long vtable_offset = narrowPtr << metadataOffsetShift; // CppVtableInfo* t = the address of the CppVtableInfo for the i-th table Address vtableInfoAddress = mapped_base_address.addOffsetTo(vtable_offset); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java deleted file mode 100644 index 0eaa3faa74a..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2011, 2012, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// ArrayData -// -// A ArrayData is a base class for accessing profiling data which does -// not have a statically known size. It consists of an array length -// and an array start. -abstract class ArrayData extends ProfileData { - - static final int arrayLenOffSet = 0; - static final int arrayStartOffSet = 1; - - int arrayUintAt(int index) { - int aindex = index + arrayStartOffSet; - return uintAt(aindex); - } - int arrayIntAt(int index) { - int aindex = index + arrayStartOffSet; - return intAt(aindex); - } - - // Code generation support for subclasses. - static int arrayElementOffset(int index) { - return cellOffset(arrayStartOffSet + index); - } - - ArrayData(DataLayout layout) { - super(layout); - } - - static int staticCellCount() { - return -1; - } - - int arrayLen() { - return intAt(arrayLenOffSet); - } - - public int cellCount() { - return arrayLen() + 1; - } - - // Code generation support - static int arrayLenOffset() { - return cellOffset(arrayLenOffSet); - } - static int arrayStartOffset() { - return cellOffset(arrayStartOffSet); - } - -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java deleted file mode 100644 index fa48a7c9b16..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2011, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// BitData -// -// A BitData holds a flag or two in its header. -public class BitData extends ProfileData { - - // nullSeen: - // saw a null operand (cast/aastore/instanceof) - static final int nullSeenFlag = DataLayout.firstFlag + 0; - static final int bitCellCount = 0; - - public BitData(DataLayout layout) { - super(layout); - } - - static int staticCellCount() { - return bitCellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - // Accessor - - // The nullSeen flag bit is specially known to the interpreter. - // Consulting it allows the compiler to avoid setting up nullCheck traps. - boolean nullSeen() { return flagAt(nullSeenFlag); } - - // Code generation support - // static int nullSeenByteConstant() { - // return flagNumberToByteConstant(nullSeenFlag); - // } - - static int bitDataSize() { - return cellOffset(bitCellCount); - } - - public void printDataOn(PrintStream st) { - printShared(st, "BitData"); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java deleted file mode 100644 index 5f27437289c..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2011, 2012, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// BranchData -// -// A BranchData is used to access profiling data for a two-way branch. -// It consists of taken and notTaken counts as well as a data displacement -// for the taken case. -public class BranchData extends JumpData { - - static final int notTakenOffSet = jumpCellCount; - static final int branchCellCount = notTakenOffSet + 1; - - public BranchData(DataLayout layout) { - super(layout); - //assert(layout.tag() == DataLayout.branchDataTag, "wrong type"); - } - - static int staticCellCount() { - return branchCellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - // Direct accessor - int notTaken() { - return uintAt(notTakenOffSet); - } - - // Code generation support - static int notTakenOffset() { - return cellOffset(notTakenOffSet); - } - static int branchDataSize() { - return cellOffset(branchCellCount); - } - - public void printDataOn(PrintStream st) { - printShared(st, "BranchData"); - st.println("taken(" + taken() + ") displacement(" + displacement() + ")"); - tab(st); - st.println("not taken(" + notTaken() + ")"); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java deleted file mode 100644 index a0eb02946b3..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2014, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// CallTypeData -// -// A CallTypeData is used to access profiling information about a non -// virtual call for which we collect type information about arguments -// and return value. -public class CallTypeData extends CounterData implements CallTypeDataInterface { - final TypeStackSlotEntries args; - final ReturnTypeEntry ret; - - int cellCountGlobalOffset() { - return CounterData.staticCellCount() + TypeEntriesAtCall.cellCountLocalOffset(); - } - - int cellCountNoHeader() { - return uintAt(cellCountGlobalOffset()); - } - - public CallTypeData(MethodDataInterface methodData, DataLayout layout) { - super(layout); - args = new TypeStackSlotEntries(methodData, this, CounterData.staticCellCount()+TypeEntriesAtCall.headerCellCount(), numberOfArguments()); - ret = new ReturnTypeEntry(methodData, this, cellCount() - ReturnTypeEntry.staticCellCount()); - } - - static int staticCellCount() { - return -1; - } - - public int cellCount() { - return CounterData.staticCellCount() + - TypeEntriesAtCall.headerCellCount() + - intAt(cellCountGlobalOffset()); - } - - public int numberOfArguments() { - return cellCountNoHeader() / TypeStackSlotEntries.perArgCount(); - } - - public boolean hasArguments() { - return cellCountNoHeader() >= TypeStackSlotEntries.perArgCount(); - } - - public K argumentType(int i) { - return args.type(i); - } - - public boolean hasReturn() { - return (cellCountNoHeader() % TypeStackSlotEntries.perArgCount()) != 0; - } - - public K returnType() { - return ret.type(); - } - - public int argumentTypeIndex(int i) { - return args.typeIndex(i); - } - - public int returnTypeIndex() { - return ret.typeIndex(); - } - - public void printDataOn(PrintStream st) { - super.printDataOn(st); - if (hasArguments()) { - tab(st); - st.print("argument types"); - args.printDataOn(st); - } - if (hasReturn()) { - tab(st); - st.print("return type"); - ret.printDataOn(st); - } - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java index 3a4ea5546a1..9d19a1d7df1 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -253,13 +253,16 @@ public class ConstantPool extends Metadata implements ClassConstants { return res; } + private int invokedynamicBootstrapRefIndexAt(int indyIndex) { + return getCache().getIndyEntryAt(indyIndex).getConstantPoolIndex(); + } + // Translate index, which could be CPCache index or Indy index, to a constant pool index public int to_cp_index(int index, int code) { Assert.that(getCache() != null, "'index' is a rewritten index so this class must have been rewritten"); switch(code) { case Bytecodes._invokedynamic: - int poolIndex = getCache().getIndyEntryAt(index).getConstantPoolIndex(); - return invokeDynamicNameAndTypeRefIndexAt(poolIndex); + return invokedynamicBootstrapRefIndexAt(index); case Bytecodes._getfield: case Bytecodes._getstatic: case Bytecodes._putfield: diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java deleted file mode 100644 index f803c71e02b..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2011, 2012, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// CounterData -// -// A CounterData corresponds to a simple counter. -public class CounterData extends BitData { - - static final int countOff = 0; - static final int counterCellCount = 1; - - public CounterData(DataLayout layout) { - super(layout); - } - - static int staticCellCount() { - return counterCellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - // Direct accessor - int count() { - return uintAt(countOff); - } - - // Code generation support - static int countOffset() { - return cellOffset(countOff); - } - static int counterDataSize() { - return cellOffset(counterCellCount); - } - - public void printDataOn(PrintStream st) { - printShared(st, "CounterData"); - st.println("count(" + count() + ")"); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java deleted file mode 100644 index d627c66839b..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2011, 2021, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -public class DataLayout { - public static final int noTag = 0; - public static final int bitDataTag = 1; - public static final int counterDataTag = 2; - public static final int jumpDataTag= 3; - public static final int receiverTypeDataTag = 4; - public static final int virtualCallDataTag = 5; - public static final int retDataTag = 6; - public static final int branchDataTag = 7; - public static final int multiBranchDataTag = 8; - public static final int argInfoDataTag = 9; - public static final int callTypeDataTag = 10; - public static final int virtualCallTypeDataTag = 11; - public static final int parametersTypeDataTag = 12; - public static final int speculativeTrapDataTag = 13; - - // The trap state breaks down as [recompile:1 | reason:31]. - // This further breakdown is defined in deoptimization.cpp. - // See Deoptimization.trapStateReason for an assert that - // trapBits is big enough to hold reasons < reasonRecordedLimit. - // - // The trapState is collected only if ProfileTraps is true. - public static final int trapBits = 1+31; // 31: enough to distinguish [0..reasonRecordedLimit]. - public static final int trapMask = Bits.rightNBits(trapBits); - public static final int firstFlag = 0; - - private Address data; - - private int offset; - - public DataLayout(MethodData d, int o) { - data = d.getAddress(); - offset = o; - } - - public DataLayout(Address d, int o) { - data = d; - offset = o; - } - - public int dp() { return offset; } - - private int getU11(int at) { - return data.getJByteAt(offset + at) & 0xff; - } - - private int getU22(int at) { - return data.getJShortAt(offset + at) & 0xffff; - } - - long cellAt(int index) { - return data.getCIntegerAt(offset + cellOffset(index), MethodData.cellSize, false); - } - - public Address addressAt(int index) { - return data.getAddressAt(offset + cellOffset(index)); - } - - // Every data layout begins with a header. This header - // contains a tag, which is used to indicate the size/layout - // of the data, 8 bits of flags, which can be used in any way, - // 32 bits of trap history (none/one reason/many reasons), - // and a bci, which is used to tie this piece of data to a - // specific bci in the bytecodes. - // union { - // u8 _bits; - // struct { - // u1 _tag; - // u1 _flags; - // u2 _bci; - // u4 _traps; - // } _struct; - // } _header; - - // Some types of data layouts need a length field. - static boolean needsArrayLen(int tag) { - return (tag == multiBranchDataTag); - } - - public static final int counterIncrement = 1; - - // Size computation - static int headerSizeInBytes() { - return MethodData.cellSize * headerSizeInCells(); - } - static int headerSizeInCells() { - return VM.getVM().isLP64() ? 1 : 2; - } - - public static int computeSizeInBytes(int cellCount) { - return headerSizeInBytes() + cellCount * MethodData.cellSize; - } - - // Initialization - // void initialize(int tag, int bci, int cellCount); - - // Accessors - public int tag() { - return getU11(0); - } - - // Return a few bits of trap state. Range is [0..trapMask]. - // The state tells if traps with zero, one, or many reasons have occurred. - // It also tells whether zero or many recompilations have occurred. - // The associated trap histogram in the MDO itself tells whether - // traps are common or not. If a BCI shows that a trap X has - // occurred, and the MDO shows N occurrences of X, we make the - // simplifying assumption that all N occurrences can be blamed - // on that BCI. - int trapState() { - return data.getJIntAt(offset+4); - } - - int flags() { - return getU11(1); - } - - int bci() { - return getU22(2); - } - - boolean flagAt(int flagNumber) { - // assert(flagNumber < flagLimit, "oob"); - return (flags() & (0x1 << flagNumber)) != 0; - } - - // Low-level support for code generation. - static int headerOffset() { - return 0; - } - static int tagOffset() { - return 0; - } - static int flagsOffset() { - return 1; - } - static int bciOffset() { - return 2; - } - public static int cellOffset(int index) { - return (headerSizeInCells() + index) * MethodData.cellSize; - } - // // Return a value which, when or-ed as a byte into _flags, sets the flag. - // static int flagNumberToByteConstant(int flagNumber) { - // assert(0 <= flagNumber && flagNumber < flagLimit, "oob"); - // DataLayout temp; temp.setHeader(0); - // temp.setFlagAt(flagNumber); - // return temp._header._struct._flags; - // } - // // Return a value which, when or-ed as a word into _header, sets the flag. - // static intptrT flagMaskToHeaderMask(int byteConstant) { - // DataLayout temp; temp.setHeader(0); - // temp._header._struct._flags = byteConstant; - // return temp._header._bits; - // } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java deleted file mode 100644 index 008a6ee7164..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2011, 2012, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// JumpData -// -// A JumpData is used to access profiling information for a direct -// branch. It is a counter, used for counting the number of branches, -// plus a data displacement, used for realigning the data pointer to -// the corresponding target bci. -public class JumpData extends ProfileData { - static final int takenOffSet = 0; - static final int displacementOffSet = 1; - static final int jumpCellCount = 2; - - public JumpData(DataLayout layout) { - super(layout); - //assert(layout.tag() == DataLayout.jumpDataTag || - // layout.tag() == DataLayout.branchDataTag, "wrong type"); - } - - static int staticCellCount() { - return jumpCellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - // Direct accessor - int taken() { - return uintAt(takenOffSet); - } - - int displacement() { - return intAt(displacementOffSet); - } - - // Code generation support - static int takenOffset() { - return cellOffset(takenOffSet); - } - - static int displacementOffset() { - return cellOffset(displacementOffSet); - } - - public void printDataOn(PrintStream st) { - printShared(st, "JumpData"); - st.println("taken(" + taken() + ") displacement(" + displacement() + ")"); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java index dfbd67ae805..1ba1f817c5c 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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,7 +67,6 @@ public abstract class Metadata extends VMObject { metadataConstructor.addMapping("TypeArrayKlass", TypeArrayKlass.class); metadataConstructor.addMapping("ObjArrayKlass", ObjArrayKlass.class); metadataConstructor.addMapping("Method", Method.class); - metadataConstructor.addMapping("MethodData", MethodData.class); metadataConstructor.addMapping("ConstMethod", ConstMethod.class); metadataConstructor.addMapping("ConstantPool", ConstantPool.class); metadataConstructor.addMapping("ConstantPoolCache", ConstantPoolCache.class); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java index 75dec8edbd1..d16fa61a6b4 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,6 @@ public class Method extends Metadata { private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { type = db.lookupType("Method"); constMethod = type.getAddressField("_constMethod"); - methodData = type.getAddressField("_method_data"); methodCounters = type.getAddressField("_method_counters"); accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); code = type.getAddressField("_code"); @@ -82,7 +81,6 @@ public class Method extends Metadata { // Fields private static AddressField constMethod; - private static AddressField methodData; private static AddressField methodCounters; private static CIntField accessFlags; private static CIntField vtableIndex; @@ -126,10 +124,6 @@ public class Method extends Metadata { public U1Array getStackMapData() { return getConstMethod().getStackMapData(); } - public MethodData getMethodData() { - Address addr = methodData.getValue(getAddress()); - return VMObjectFactory.newObject(MethodData.class, addr); - } public MethodCounters getMethodCounters() { Address addr = methodCounters.getValue(getAddress()); return VMObjectFactory.newObject(MethodCounters.class, addr); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java index a7c2e2bccb7..fd804085c7b 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,92 +35,7 @@ import sun.jvm.hotspot.utilities.Observer; // A MethodData provides interpreter profiling information -public class MethodData extends Metadata implements MethodDataInterface { - static int TypeProfileWidth = 2; - static int BciProfileWidth = 2; - static int CompileThreshold; - - static int Reason_many; // indicates presence of several reasons - static int Reason_none; // indicates absence of a relevant deopt. - static int Reason_LIMIT; - static int Reason_RECORDED_LIMIT; // some are not recorded per bc - - private static String[] trapReasonName; - - static String trapReasonName(int reason) { - if (reason == Reason_many) return "many"; - if (reason < Reason_LIMIT) - return trapReasonName[reason]; - return "reason" + reason; - } - - - static int trapStateReason(int trapState) { - // This assert provides the link between the width of DataLayout.trapBits - // and the encoding of "recorded" reasons. It ensures there are enough - // bits to store all needed reasons in the per-BCI MDO profile. - // assert(dsReasonMask >= reasonRecordedLimit, "enough bits"); - int recompileBit = (trapState & dsRecompileBit); - trapState -= recompileBit; - if (trapState == dsReasonMask) { - return Reason_many; - } else { - // assert((int)reasonNone == 0, "state=0 => Reason_none"); - return trapState; - } - } - - - static final int dsReasonMask = DataLayout.trapMask >> 1; - static final int dsRecompileBit = DataLayout.trapMask - dsReasonMask; - - static boolean trapStateIsRecompiled(int trapState) { - return (trapState & dsRecompileBit) != 0; - } - - static boolean reasonIsRecordedPerBytecode(int reason) { - return reason > Reason_none && reason < Reason_RECORDED_LIMIT; - } - static int trapStateAddReason(int trapState, int reason) { - // assert(reasonIsRecordedPerBytecode((DeoptReason)reason) || reason == reasonMany, "valid reason"); - int recompileBit = (trapState & dsRecompileBit); - trapState -= recompileBit; - if (trapState == dsReasonMask) { - return trapState + recompileBit; // already at state lattice bottom - } else if (trapState == reason) { - return trapState + recompileBit; // the condition is already true - } else if (trapState == 0) { - return reason + recompileBit; // no condition has yet been true - } else { - return dsReasonMask + recompileBit; // fall to state lattice bottom - } - } - static int trapStateSetRecompiled(int trapState, boolean z) { - if (z) return trapState | dsRecompileBit; - else return trapState & ~dsRecompileBit; - } - - static String formatTrapState(int trapState) { - int reason = trapStateReason(trapState); - boolean recompFlag = trapStateIsRecompiled(trapState); - // Re-encode the state from its decoded components. - int decodedState = 0; - if (reasonIsRecordedPerBytecode(reason) || reason == Reason_many) - decodedState = trapStateAddReason(decodedState, reason); - if (recompFlag) - decodedState = trapStateSetRecompiled(decodedState, recompFlag); - // If the state re-encodes properly, format it symbolically. - // Because this routine is used for debugging and diagnostics, - // be robust even if the state is a strange value. - if (decodedState != trapState) { - // Random buggy state that doesn't decode?? - return "#" + trapState; - } else { - return trapReasonName(reason) + (recompFlag ? " recompiled" : ""); - } - } - - +public class MethodData extends Metadata { static { VM.registerVMInitializedObserver(new Observer() { @@ -132,96 +47,17 @@ public class MethodData extends Metadata implements MethodDataInterface parametersTypeData() { - int di = (int)parametersTypeDataDi.getValue(getAddress()); - if (di == -1 || di == -2) { - return null; - } - DataLayout dataLayout = new DataLayout(this, di + (int)data.getOffset()); - return new ParametersTypeData(this, dataLayout); - } - - boolean outOfBounds(int dataIndex) { - return dataIndex >= dataSize(); - } - - ProfileData dataAt(int dataIndex) { - if (outOfBounds(dataIndex)) { - return null; - } - DataLayout dataLayout = new DataLayout(this, dataIndex + (int)data.getOffset()); - - switch (dataLayout.tag()) { - case DataLayout.noTag: - default: - throw new InternalError(dataIndex + " " + dataSize() + " " + dataLayout.tag()); - case DataLayout.bitDataTag: - return new BitData(dataLayout); - case DataLayout.counterDataTag: - return new CounterData(dataLayout); - case DataLayout.jumpDataTag: - return new JumpData(dataLayout); - case DataLayout.receiverTypeDataTag: - return new ReceiverTypeData(this, dataLayout); - case DataLayout.virtualCallDataTag: - return new VirtualCallData(this, dataLayout); - case DataLayout.retDataTag: - return new RetData(dataLayout); - case DataLayout.branchDataTag: - return new BranchData(dataLayout); - case DataLayout.multiBranchDataTag: - return new MultiBranchData(dataLayout); - case DataLayout.callTypeDataTag: - return new CallTypeData(this, dataLayout); - case DataLayout.virtualCallTypeDataTag: - return new VirtualCallTypeData(this, dataLayout); - case DataLayout.parametersTypeDataTag: - return new ParametersTypeData(this, dataLayout); - } - } - - int dpToDi(int dp) { - // this in an offset from the base of the MDO, so convert to offset into _data - return dp - (int)data.getOffset(); - } - - int firstDi() { return 0; } - public ProfileData firstData() { return dataAt(firstDi()); } - public ProfileData nextData(ProfileData current) { - int currentIndex = dpToDi(current.dp()); - int nextIndex = currentIndex + current.sizeInBytes(); - return dataAt(nextIndex); - } - boolean isValid(ProfileData current) { return current != null; } - - DataLayout limitDataPosition() { - return new DataLayout(this, dataSize() + (int)data.getOffset()); - } - - DataLayout extraDataBase() { - return limitDataPosition(); - } - - DataLayout extraDataLimit() { - return new DataLayout(this, sizeInBytes()); - } - - public static int extraNbCells(DataLayout dataLayout) { - int nbCells = 0; - switch(dataLayout.tag()) { - case DataLayout.bitDataTag: - case DataLayout.noTag: - nbCells = BitData.staticCellCount(); - break; - case DataLayout.speculativeTrapDataTag: - nbCells = SpeculativeTrapData.staticCellCount(); - break; - default: - throw new InternalError("unexpected tag " + dataLayout.tag()); - } - return nbCells; - } - - DataLayout nextExtra(DataLayout dataLayout) { - return new DataLayout(this, dataLayout.dp() + DataLayout.computeSizeInBytes(extraNbCells(dataLayout))); - } - - public void printDataOn(PrintStream st) { - if (parametersTypeData() != null) { - parametersTypeData().printDataOn(st); - } - ProfileData data = firstData(); - for ( ; isValid(data); data = nextData(data)) { - st.print(dpToDi(data.dp())); - st.print(" "); - // st->fillTo(6); - data.printDataOn(st); - } - st.println("--- Extra data:"); - DataLayout dp = extraDataBase(); - DataLayout end = extraDataLimit(); - for (;; dp = nextExtra(dp)) { - switch(dp.tag()) { - case DataLayout.noTag: - continue; - case DataLayout.bitDataTag: - data = new BitData(dp); - break; - case DataLayout.speculativeTrapDataTag: - data = new SpeculativeTrapData(this, dp); - break; - case DataLayout.argInfoDataTag: - data = new ArgInfoData(dp); - dp = end; // ArgInfoData is at the end of extra data section. - break; - default: - throw new InternalError("unexpected tag " + dp.tag()); - } - st.print(dpToDi(data.dp())); - st.print(" "); - data.printDataOn(st); - if (dp == end) return; - } - } - - private byte[] fetchDataAt(Address base, long offset, long size) { - byte[] result = new byte[(int)size]; - for (int i = 0; i < size; i++) { - result[i] = base.getJByteAt(offset + i); - } - return result; - } - - public byte[] orig() { - // fetch the orig MethodData data between header and dataSize - return fetchDataAt(getAddress(), 0, sizeofMethodDataOopDesc); - } - - public long[] data() { - // Read the data as an array of intptr_t elements - Address base = getAddress(); - long offset = data.getOffset(); - int elements = dataSize() / cellSize; - long[] result = new long[elements]; - for (int i = 0; i < elements; i++) { - Address value = base.getAddressAt(offset + i * MethodData.cellSize); - if (value != null) { - result[i] = value.minus(null); - } - } - return result; - } - - // Get a measure of how much mileage the method has on it. - int mileageOf(Method method) { - long mileage = 0; - long iic = method.interpreterInvocationCount(); - if (mileage < iic) mileage = iic; - - long ic = method.getInvocationCount(); - long bc = method.getBackedgeCount(); - - long icval = ic >> 3; - if ((ic & 4) != 0) icval += CompileThreshold; - if (mileage < icval) mileage = icval; - long bcval = bc >> 3; - if ((bc & 4) != 0) bcval += CompileThreshold; - if (mileage < bcval) mileage = bcval; - return (int)mileage; - } - - public int currentMileage() { - return 20000; - } - } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java deleted file mode 100644 index 089de318adf..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2011, 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. - * - */ - -package sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// MultiBranchData -// -// A MultiBranchData is used to access profiling information for -// a multi-way branch (*switch bytecodes). It consists of a series -// of (count, displacement) pairs, which count the number of times each -// case was taken and specify the data displacement for each branch target. -public class MultiBranchData extends ArrayData { - static final int defaultCountOffSet = 0; - static final int defaultDisaplacementOffSet = 1; - static final int caseArrayStart = 2; - static final int relativeCountOffSet = 0; - static final int relativeDisplacementOffSet = 1; - static final int perCaseCellCount = 2; - - public MultiBranchData(DataLayout layout) { - super(layout); - //assert(layout.tag() == DataLayout.multiBranchDataTag, "wrong type"); - } - - // static int computeCellCount(BytecodeStream stream); - - int numberOfCases() { - int alen = arrayLen() - 2; // get rid of default case here. - //assert(alen % perCaseCellCount == 0, "must be even"); - return (alen / perCaseCellCount); - } - - int defaultCount() { - return arrayUintAt(defaultCountOffSet); - } - int defaultDisplacement() { - return arrayIntAt(defaultDisaplacementOffSet); - } - - int countAt(int index) { - return arrayUintAt(caseArrayStart + - index * perCaseCellCount + - relativeCountOffSet); - } - int displacementAt(int index) { - return arrayIntAt(caseArrayStart + - index * perCaseCellCount + - relativeDisplacementOffSet); - } - - // Code generation support - static int defaultCountOffset() { - return arrayElementOffset(defaultCountOffSet); - } - static int defaultDisplacementOffset() { - return arrayElementOffset(defaultDisaplacementOffSet); - } - static int caseCountOffset(int index) { - return caseArrayOffset() + - (perCaseSize() * index) + - relativeCountOffset(); - } - static int caseArrayOffset() { - return arrayElementOffset(caseArrayStart); - } - static int perCaseSize() { - return (perCaseCellCount) * MethodData.cellSize; - } - static int relativeCountOffset() { - return (relativeCountOffSet) * MethodData.cellSize; - } - static int relativeDisplacementOffset() { - return (relativeDisplacementOffSet) * MethodData.cellSize; - } - - public void printDataOn(PrintStream st) { - printShared(st, "MultiBranchData"); - st.println("default_count(" + defaultCount() + ") displacement(" + defaultDisplacement() + ")"); - int cases = numberOfCases(); - for (int i = 0; i < cases; i++) { - tab(st); - st.println("count(" + countAt(i) + ") displacement(" + displacementAt(i) + ")"); - } - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java deleted file mode 100644 index d6ea749576a..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2014, 2021, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// ParametersTypeData -// -// A ParametersTypeData is used to access profiling information about -// types of parameters to a method -public class ParametersTypeData extends ArrayData { - final TypeStackSlotEntries parameters; - - static int stackSlotLocalOffset(int i) { - return arrayStartOffSet + TypeStackSlotEntries.stackSlotLocalOffset(i); - } - - static int typeLocalOffset(int i) { - return arrayStartOffSet + TypeStackSlotEntries.typeLocalOffset(i); - } - - public ParametersTypeData(MethodDataInterface methodData, DataLayout layout) { - super(layout); - parameters = new TypeStackSlotEntries(methodData, this, 1, numberOfParameters()); - } - - public int numberOfParameters() { - return arrayLen() / TypeStackSlotEntries.perArgCount(); - } - - int stackSlot(int i) { - return parameters.stackSlot(i); - } - - public K type(int i) { - return parameters.type(i); - } - - public static int typeIndex(int i) { - return typeLocalOffset(i); - } - - public void printDataOn(PrintStream st) { - st.print("parameter types"); - parameters.printDataOn(st); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java deleted file mode 100644 index 29a127b6a49..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2011, 2021, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -public abstract class ProfileData { - // This is a pointer to a section of profiling data. - private DataLayout _data; - - public DataLayout data() { return _data; } - - // How many cells are in this? - public abstract int cellCount(); - - - // Return the size of this data. - public int sizeInBytes() { - return DataLayout.computeSizeInBytes(cellCount()); - } - - public int dp() { - return data().dp(); - } - - // Low-level accessors for underlying data - long intptrAt(int index) { - //assert(0 <= index && index < cellCount(), "oob"); - return data().cellAt(index); - } - int intAt(int index) { - return (int)intptrAt(index); - } - int uintAt(int index) { - return (int)intptrAt(index); - } - public Address addressAt(int index) { - return data().addressAt(index); - } - - boolean flagAt(int flagNumber) { - return data().flagAt(flagNumber); - } - - // two convenient imports for use by subclasses: - public static int cellOffset(int index) { - return DataLayout.cellOffset(index); - } - - public ProfileData(DataLayout data) { - _data = data; - } - - // Constructor for invalid ProfileData. - ProfileData() { - _data = null; - } - - int bci() { - return data().bci(); - } - - int trapState() { - return data().trapState(); - } - public abstract void printDataOn(PrintStream st); - - void tab(PrintStream st) { - st.print("\t"); - } - - void printShared(PrintStream st, String name) { - st.print("bci: " + bci()); - // st.fillTo(tabWidthOne); - st.print(" " + name + " "); - tab(st); - int trap = trapState(); - if (trap != 0) { - st.print("trap(" + MethodData.formatTrapState(trap) + ") "); - } - int flags = data().flags(); - if (flags != 0) - st.print("flags(" + flags + ") "); - } - - public String toString() { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos); - try { - printDataOn(ps); - } finally { - ps.close(); - } - return baos.toString(); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java deleted file mode 100644 index 758566c5611..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2011, 2016, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// ReceiverTypeData -// -// A ReceiverTypeData is used to access profiling information about a -// dynamic type check. It consists of a counter which counts the total times -// that the check is reached, and a series of (Klass, count) pairs -// which are used to store a type profile for the receiver of the check. -public class ReceiverTypeData extends CounterData { - static final int nonProfiledCountOffset = counterCellCount; - static final int receiver0Offset; - static final int count0Offset; - static final int receiverTypeRowCellCount; - static { - receiver0Offset = counterCellCount; - count0Offset = receiver0Offset + 1; - receiverTypeRowCellCount = (count0Offset + 1) - receiver0Offset; - } - final MethodDataInterface methodData; - - public ReceiverTypeData(MethodDataInterface methodData, DataLayout layout) { - super(layout); - this.methodData = methodData; - //assert(layout.tag() == DataLayout.receiverTypeDataTag || - // layout.tag() == DataLayout.virtualCallDataTag, "wrong type"); - } - - boolean isReceivertypedata() { return true; } - - static int staticCellCount() { - int cellCount = counterCellCount + MethodData.TypeProfileWidth * receiverTypeRowCellCount; - return cellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - // Direct accessors - public static int rowLimit() { - return MethodData.TypeProfileWidth; - } - public static int receiverCellIndex(int row) { - return receiver0Offset + row * receiverTypeRowCellCount; - } - public static int receiverCountCellIndex(int row) { - return count0Offset + row * receiverTypeRowCellCount; - } - - // Get the receiver at row. The 'unchecked' version is needed by parallel old - // gc; it does not assert the receiver is a klass. During compaction of the - // perm gen, the klass may already have moved, so the isKlass() predicate - // would fail. The 'normal' version should be used whenever possible. - K receiverUnchecked(int row) { - //assert(row < rowLimit(), "oob"); - Address recv = addressAt(receiverCellIndex(row)); - return methodData.getKlassAtAddress(recv); - } - - public K receiver(int row) { - K recv = receiverUnchecked(row); - //assert(recv == NULL || ((oop)recv).isKlass(), "wrong type"); - return recv; - } - - public int receiverCount(int row) { - //assert(row < rowLimit(), "oob"); - return uintAt(receiverCountCellIndex(row)); - } - - // Code generation support - static int receiverOffset(int row) { - return cellOffset(receiverCellIndex(row)); - } - static int receiverCountOffset(int row) { - return cellOffset(receiverCountCellIndex(row)); - } - static int receiverTypeDataSize() { - return cellOffset(staticCellCount()); - } - - void printReceiverDataOn(PrintStream st) { - int row; - int entries = 0; - for (row = 0; row < rowLimit(); row++) { - if (receiver(row) != null) entries++; - } - st.println("count(" + count() + ") entries(" + entries + ")"); - for (row = 0; row < rowLimit(); row++) { - if (receiver(row) != null) { - tab(st); - methodData.printKlassValueOn(receiver(row), st); - st.println("(" + receiverCount(row) + ")"); - } - } - } - public void printDataOn(PrintStream st) { - printShared(st, "ReceiverTypeData"); - printReceiverDataOn(st); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java deleted file mode 100644 index 5ecd60bcb8e..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2011, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// RetData -// -// A RetData is used to access profiling information for a ret bytecode. -// It is composed of a count of the number of times that the ret has -// been executed, followed by a series of triples of the form -// (bci, count, di) which count the number of times that some bci was the -// target of the ret and cache a corresponding data displacement. -public class RetData extends CounterData { - - static final int bci0Offset = counterCellCount; - static final int count0Offset = bci0Offset + 1; - static final int displacement0Offset = count0Offset + 1; - static final int retRowCellCount = (displacement0Offset + 1) - bci0Offset; - - public RetData(DataLayout layout) { - super(layout); - //assert(layout.tag() == DataLayout.retDataTag, "wrong type"); - } - - static final int noBci = -1; // value of bci when bci1/2 are not in use. - - static int staticCellCount() { - return counterCellCount + MethodData.BciProfileWidth * retRowCellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - static int rowLimit() { - return MethodData.BciProfileWidth; - } - static int bciCellIndex(int row) { - return bci0Offset + row * retRowCellCount; - } - static int bciCountCellIndex(int row) { - return count0Offset + row * retRowCellCount; - } - static int bciDisplacementCellIndex(int row) { - return displacement0Offset + row * retRowCellCount; - } - - // Direct accessors - int bci(int row) { - return intAt(bciCellIndex(row)); - } - int bciCount(int row) { - return uintAt(bciCountCellIndex(row)); - } - int bciDisplacement(int row) { - return intAt(bciDisplacementCellIndex(row)); - } - - // Code generation support - static int bciOffset(int row) { - return cellOffset(bciCellIndex(row)); - } - static int bciCountOffset(int row) { - return cellOffset(bciCountCellIndex(row)); - } - static int bciDisplacementOffset(int row) { - return cellOffset(bciDisplacementCellIndex(row)); - } - - public void printDataOn(PrintStream st) { - printShared(st, "RetData"); - int row; - int entries = 0; - for (row = 0; row < rowLimit(); row++) { - if (bci(row) != noBci) entries++; - } - st.println("count(" + count() + ") entries(" + entries + ")"); - for (row = 0; row < rowLimit(); row++) { - if (bci(row) != noBci) { - tab(st); - st.println(" bci(" + bci(row) + ": count(" + bciCount(row) + ") displacement(" + bciDisplacement(row) + "))"); - } - } - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java deleted file mode 100644 index 76e531d1dea..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2014, 2021, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// SpeculativeTrapData -// -// A SpeculativeTrapData is used to record traps due to type -// speculation. It records the root of the compilation. -public class SpeculativeTrapData extends ProfileData { - static final int speculativeTrapMethod = 0; - static final int speculativeTrapCellCount = 1; - final MethodDataInterface methodData; - - public SpeculativeTrapData(MethodDataInterface methodData, DataLayout layout) { - super(layout); - this.methodData = methodData; - } - - static int staticCellCount() { - return speculativeTrapCellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - public M method() { - return methodData.getMethodAtAddress(addressAt(speculativeTrapMethod)); - } - - public static int methodIndex() { - return speculativeTrapMethod; - } - - public void printDataOn(PrintStream st) { - printShared(st, "SpeculativeTrapData"); - tab(st); - methodData.printMethodValueOn(method(), st); - st.println(); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java deleted file mode 100644 index 16ba553a838..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2014, 2021, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// Entries in a ProfileData object to record types: it can either be -// none (no profile), unknown (conflicting profile data) or a klass if -// a single one is seen. Whether a null reference was seen is also -// recorded. No counter is associated with the type and a single type -// is tracked (unlike VirtualCallData). -public abstract class TypeEntries { - static final int nullSeen = 1; - static final int typeMask = ~nullSeen; - static final int typeUnknown = 2; - static final int statusBits = nullSeen | typeUnknown; - static final int typeKlassMask = ~statusBits; - - final ProfileData pd; - final int baseOff; - final MethodDataInterface methodData; - - boolean wasNullSeen(int index) { - long v = pd.intptrAt(index); - return (v & nullSeen) != 0; - } - - boolean isTypeUnknown(int index) { - long v = pd.intptrAt(index); - return (v & typeUnknown) != 0; - } - - boolean isTypeNone(int index) { - long v = pd.intptrAt(index); - return (v & typeMask) == 0; - } - - K validKlass(int index) { - if (!isTypeNone(index) && - !isTypeUnknown(index)) { - return methodData.getKlassAtAddress(pd.addressAt(index).andWithMask(typeKlassMask)); - } else { - return null; - } - } - - void printKlass(PrintStream st, int index) { - if (isTypeNone(index)) { - st.print("none"); - } else if (isTypeUnknown(index)) { - st.print("unknown"); - } else { - methodData.printKlassValueOn(validKlass(index), st); - } - if (wasNullSeen(index)) { - st.print(" (null seen)"); - } - } - - TypeEntries(MethodDataInterface methodData, ProfileData pd, int baseOff) { - this.pd = pd; - this.baseOff = baseOff; - this.methodData = methodData; - } - - long intptrAt(int index) { - return pd.intptrAt(index); - } - -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java deleted file mode 100644 index 2891f91c69e..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// Entries to collect type information at a call: contains arguments -// (TypeStackSlotEntries), a return type (ReturnTypeEntry) and a -// number of cells. -public abstract class TypeEntriesAtCall { - - static int stackSlotLocalOffset(int i) { - return headerCellCount() + TypeStackSlotEntries.stackSlotLocalOffset(i); - } - - static int argumentTypeLocalOffset(int i) { - return headerCellCount() + TypeStackSlotEntries.typeLocalOffset(i); - } - - static int headerCellCount() { - return 1; - } - - static int cellCountLocalOffset() { - return 0; - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java deleted file mode 100644 index 9efff34a4c3..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2014, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// Type entries used for arguments passed at a call and parameters on -// method entry. 2 cells per entry: one for the type encoded as in -// TypeEntries and one initialized with the stack slot where the -// profiled object is to be found so that the interpreter can locate -// it quickly. -public class TypeStackSlotEntries extends TypeEntries { - static final int stackSlotEntry = 0; - static final int typeEntry = 1; - static final int perArgCellCount = 2; - - int stackSlotOffset(int i) { - return baseOff + stackSlotLocalOffset(i); - } - - final int numberOfEntries; - - int typeOffsetInCells(int i) { - return baseOff + typeLocalOffset(i); - } - - TypeStackSlotEntries(MethodDataInterface methodData, ProfileData pd, int baseOff, int nbEntries) { - super(methodData, pd, baseOff); - numberOfEntries = nbEntries; - } - - static int stackSlotLocalOffset(int i) { - return i * perArgCellCount + stackSlotEntry; - } - - static int typeLocalOffset(int i) { - return i * perArgCellCount + typeEntry; - } - - int stackSlot(int i) { - return pd.uintAt(stackSlotOffset(i)); - } - - K type(int i) { - return validKlass(typeOffsetInCells(i)); - } - - static int perArgCount() { - return perArgCellCount; - } - - int typeIndex(int i) { - return typeOffsetInCells(i); - } - - void printDataOn(PrintStream st) { - for (int i = 0; i < numberOfEntries; i++) { - pd.tab(st); - st.print(i + ": stack(" + stackSlot(i)+ ") "); - printKlass(st, typeOffsetInCells(i)); - st.println(); - } - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java deleted file mode 100644 index 2d303d8606d..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2011, 2016, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// VirtualCallData -// -// A VirtualCallData is used to access profiling information about a -// call. For now, it has nothing more than a ReceiverTypeData. -public class VirtualCallData extends ReceiverTypeData { - public VirtualCallData(MethodDataInterface methodData, DataLayout layout) { - super(methodData, layout); - //assert(layout.tag() == DataLayout.virtualCallDataTag, "wrong type"); - } - - static int staticCellCount() { - // At this point we could add more profile state, e.g., for arguments. - // But for now it's the same size as the base record type. - int cellCount = ReceiverTypeData.staticCellCount(); - return cellCount; - } - - public int cellCount() { - return staticCellCount(); - } - - // Direct accessors - static int virtualCallDataSize() { - return cellOffset(staticCellCount()); - } - - public void printDataOn(PrintStream st) { - printShared(st, "VirtualCallData"); - printReceiverDataOn(st); - } -} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java deleted file mode 100644 index 483d0d54ee2..00000000000 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2014, 2020, 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 sun.jvm.hotspot.oops; - -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -// VirtualCallTypeData -// -// A VirtualCallTypeData is used to access profiling information about -// a virtual call for which we collect type information about -// arguments and return value. -public class VirtualCallTypeData extends VirtualCallData implements CallTypeDataInterface { - final TypeStackSlotEntries args; - final ReturnTypeEntry ret; - - int cellCountGlobalOffset() { - return VirtualCallData.staticCellCount() + TypeEntriesAtCall.cellCountLocalOffset(); - } - - int cellCountNoHeader() { - return uintAt(cellCountGlobalOffset()); - } - - public VirtualCallTypeData(MethodDataInterface methodData, DataLayout layout) { - super(methodData, layout); - args = new TypeStackSlotEntries(methodData, this, VirtualCallData.staticCellCount()+TypeEntriesAtCall.headerCellCount(), numberOfArguments()); - ret = new ReturnTypeEntry(methodData, this, cellCount() - ReturnTypeEntry.staticCellCount()); - } - - static int staticCellCount() { - return -1; - } - - public int cellCount() { - return VirtualCallData.staticCellCount() + - TypeEntriesAtCall.headerCellCount() + - intAt(cellCountGlobalOffset()); - } - - public int numberOfArguments() { - return cellCountNoHeader() / TypeStackSlotEntries.perArgCount(); - } - - public boolean hasArguments() { - return cellCountNoHeader() >= TypeStackSlotEntries.perArgCount(); - } - - public K argumentType(int i) { - return args.type(i); - } - - public boolean hasReturn() { - return (cellCountNoHeader() % TypeStackSlotEntries.perArgCount()) != 0; - } - - public K returnType() { - return ret.type(); - } - - public int argumentTypeIndex(int i) { - return args.typeIndex(i); - } - - public int returnTypeIndex() { - return ret.typeIndex(); - } - - public void printDataOn(PrintStream st) { - super.printDataOn(st); - if (hasArguments()) { - tab(st); - st.print("argument types"); - args.printDataOn(st); - } - if (hasReturn()) { - tab(st); - st.print("return type"); - ret.printDataOn(st); - } - } -}; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java index 75750548ef5..ae9c048f9d7 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -37,21 +37,18 @@ public class InterpretedVFrame extends JavaVFrame { } public StackValueCollection getLocals() { - Method m = getMethod(); - - int length = (int) m.getMaxLocals(); - - if (m.isNative()) { - // If the method is native, getMaxLocals is not telling the truth. - // maxlocals then equals the size of parameters - length = (int) m.getSizeOfParameters(); - } - - StackValueCollection result = new StackValueCollection(length); - // Get oopmap describing oops and int for current bci OopMapCacheEntry oopMask = getMethod().getMaskFor(getBCI()); + // If the method is native, method()->max_locals() is not telling the truth. + // For our purposes, max locals instead equals the size of parameters. + Method method = getMethod(); + int maxLocals = method.isNative() ? (int)method.getSizeOfParameters() : (int)method.getMaxLocals(); + + int length = maxLocals; + + StackValueCollection result = new StackValueCollection(length); + // handle locals for(int i = 0; i < length; i++) { // Find stack location @@ -74,26 +71,27 @@ public class InterpretedVFrame extends JavaVFrame { } public StackValueCollection getExpressions() { - int length = getFrame().getInterpreterFrameExpressionStackSize(); - - if (getMethod().isNative()) { - // If the method is native, there is no expression stack - length = 0; - } - - int nofLocals = (int) getMethod().getMaxLocals(); - StackValueCollection result = new StackValueCollection(length); - // Get oopmap describing oops and int for current bci OopMapCacheEntry oopMask = getMethod().getMaskFor(getBCI()); + int maskLen = oopMask.numberOfEntries(); + + // If the method is native, method()->max_locals() is not telling the truth. + // For our purposes, max locals instead equals the size of parameters. + Method method = getMethod(); + int maxLocals = method.isNative() ? (int)method.getSizeOfParameters() : (int)method.getMaxLocals(); + + int length = maskLen - maxLocals; + + StackValueCollection result = new StackValueCollection(length); + for(int i = 0; i < length; i++) { // Find stack location Address addr = addressOfExpressionStackAt(i); // Depending on oop/int put it in the right package StackValue sv; - if (oopMask.isOop(i + nofLocals)) { + if (oopMask.isOop(i + maxLocals)) { // oop value sv = new StackValue(addr.getOopHandleAt(0), 0); } else { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java index 22bc02a06d9..d2e05c6f84d 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java @@ -39,7 +39,7 @@ public class Thread extends VMObject { private static AddressField currentWaitingMonitorField; private static AddressField osThreadField; - private static JLongField allocatedBytesField; + private static CIntegerField allocatedBytesField; static { VM.registerVMInitializedObserver(new Observer() { @@ -60,7 +60,7 @@ public class Thread extends VMObject { tlabFieldOffset = typeThread.getField("_tlab").getOffset(); currentPendingMonitorField = typeJavaThread.getAddressField("_current_pending_monitor"); currentWaitingMonitorField = typeJavaThread.getAddressField("_current_waiting_monitor"); - allocatedBytesField = typeThread.getJLongField("_allocated_bytes"); + allocatedBytesField = typeThread.getCIntegerField("_allocated_bytes"); } public Thread(Address addr) { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java index 51f40fad12b..80ea272ea2c 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2026, 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 @@ -121,6 +121,9 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter { // write JNI global handles writeGlobalJNIHandles(); + // write classes in null class loader data + writeStickyClasses(); + } catch (RuntimeException re) { handleRuntimeException(re); } @@ -168,6 +171,9 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter { } } + protected void writeStickyClasses() throws IOException { + } + protected void writeGlobalJNIHandle(Address handleAddr) throws IOException { } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java index 72861d9c30d..2745e1f0783 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2026, 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 @@ -888,6 +888,16 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { out.writeInt(index); out.writeInt(DUMMY_STACK_TRACE_ID); writeLocalJNIHandles(jt, index); + + int depth = 0; + var jvf = jt.getLastJavaVFrameDbg(); + while (jvf != null) { + writeStackRefs(index, depth, jvf.getLocals()); + writeStackRefs(index, depth, jvf.getExpressions()); + + depth++; + jvf = jvf.javaSender(); + } } protected void writeLocalJNIHandles(JavaThread jt, int index) throws IOException { @@ -926,6 +936,23 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { } } + protected void writeStackRefs(int threadIndex, int frameIndex, StackValueCollection values) throws IOException { + for (int index = 0; index < values.size(); index++) { + if (values.get(index).getType() == BasicType.getTObject()) { + OopHandle oopHandle = values.oopHandleAt(index); + Oop oop = objectHeap.newOop(oopHandle); + if (oop != null) { + int size = BYTE_SIZE + OBJ_ID_SIZE + INT_SIZE * 2; + writeHeapRecordPrologue(size); + out.writeByte((byte) HPROF_GC_ROOT_JAVA_FRAME); + writeObjectID(oop); + out.writeInt(threadIndex); + out.writeInt(frameIndex); + } + } + } + } + protected void writeGlobalJNIHandle(Address handleAddr) throws IOException { OopHandle oopHandle = handleAddr.getOopHandleAt(0); Oop oop = objectHeap.newOop(oopHandle); @@ -940,6 +967,22 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { } } + @Override + protected void writeStickyClasses() throws IOException { + ClassLoaderData.theNullClassLoaderData().classesDo(k -> { + if (k instanceof InstanceKlass) { + try { + int size = 1 + (int)VM.getVM().getAddressSize(); + writeHeapRecordPrologue(size); + out.writeByte((byte)HPROF_GC_ROOT_STICKY_CLASS); + writeClassID(k); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + }); + } + protected void writeObjectArray(ObjArray array) throws IOException { int headerSize = getArrayHeaderSize(true); final int length = calculateArrayMaxLength(array.getLength(), @@ -1277,6 +1320,10 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { writeObjectID(address); } + private void writeClassID(Klass k) throws IOException { + writeObjectID(k.getJavaMirror()); + } + private void writeSymbolID(Symbol sym) throws IOException { assert names.contains(sym); long address = (sym != null) ? getAddressValue(sym.getAddress()) : getAddressValue(null); diff --git a/src/jdk.hotspot.agent/share/man/jhsdb.md b/src/jdk.hotspot.agent/share/man/jhsdb.md index 4c6be775ece..f329a2fea6f 100644 --- a/src/jdk.hotspot.agent/share/man/jhsdb.md +++ b/src/jdk.hotspot.agent/share/man/jhsdb.md @@ -119,20 +119,20 @@ The `jhsdb` tool can be launched in any one of the following modes: ## Options for the debugd Mode -`--serverid` *server-id* +[`--serverid`]{#debugd-option--serverid} *server-id* : An optional unique ID for this debug server. This is required if multiple debug servers are run on the same machine. -`--rmiport` *port* +[`--rmiport`]{#debugd-option--rmiport} *port* : Sets the port number to which the RMI connector is bound. If not specified a random available port is used. -`--registryport` *port* +[`--registryport`]{#debugd-option--registryport} *port* : Sets the RMI registry port. This option overrides the system property 'sun.jvm.hotspot.rmi.port'. If not specified, the system property is used. If the system property is not set, the default port 1099 is used. -`--hostname` *hostname* +[`--hostname`]{#debugd-option--hostname} *hostname* : Sets the hostname the RMI connector is bound. The value could be a hostname or an IPv4/IPv6 address. This option overrides the system property 'java.rmi.server.hostname'. If not specified, the system property is used. @@ -140,10 +140,10 @@ The `jhsdb` tool can be launched in any one of the following modes: ## Options for the jinfo Mode -`--flags` +[`--flags`]{#jinfo-option--flags} : Prints the VM flags. -`--sysprops` +[`--sysprops`]{#jinfo-option--sysprops} : Prints the Java system properties. no option @@ -154,33 +154,33 @@ no option no option : Prints the same information as Solaris `pmap`. -`--heap` +[`--heap`]{#jmap-option--heap} : Prints the `java` heap summary. -`--binaryheap` +[`--binaryheap`]{#jmap-option--binaryheap} : Dumps the `java` heap in `hprof` binary format. -`--dumpfile` *name* +[`--dumpfile`]{#jmap-option--dumpfile} *name* : The name of the dumpfile. -`--histo` +[`--histo`]{#jmap-option--histo} : Prints the histogram of `java` object heap. -`--clstats` +[`--clstats`]{#jmap-option--clstats} : Prints the class loader statistics. -`--finalizerinfo` +[`--finalizerinfo`]{#jmap-option--finalizerinfo} : Prints the information on objects awaiting finalization. ## Options for the jstack Mode -`--locks` +[`--locks`]{#jstack-option--locks} : Prints the `java.util.concurrent` locks information. -`--mixed` +[`--mixed`]{#jstack-option--mixed} : Attempts to print both `java` and native frames if the platform allows it. ## Options for the jsnap Mode -`--all` +[`--all`]{#jsnap-option--all} : Prints all performance counters. diff --git a/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp b/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp index f2994c0d827..0c16400bf3b 100644 --- a/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp +++ b/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -906,3 +906,40 @@ JNIEXPORT jobject JNICALL Java_sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLoc CHECK_EXCEPTION_(0); return res; } + +/* + * Class: sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal + * Method: getSenderRegs0 + * Signature: (JJJ)[J + */ +JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal_getSenderRegs0 + (JNIEnv *env, jobject obj, jlong sp, jlong fp, jlong pc) { + IDebugControl* ptrIDebugControl = (IDebugControl*)env->GetLongField(obj, ptrIDebugControl_ID); + CHECK_EXCEPTION_(nullptr); + + // GetStackTrace() returns call frames from specified fp, sp, and pc. + // The top of frame would point current frame, hence we refer 2nd frame + // as a sender and get registers from it. + DEBUG_STACK_FRAME frames[2]; + ULONG filled; + HRESULT dbg_result = ptrIDebugControl->GetStackTrace(fp, sp, pc, frames, 2, &filled); + if (dbg_result != S_OK || filled != 2) { + return nullptr; + } + + jlongArray result = env->NewLongArray(3); + CHECK_EXCEPTION_(nullptr); + if (result == nullptr) { + return nullptr; + } + + jlong regs[] = { + static_cast(frames[1].StackOffset), + static_cast(frames[1].FrameOffset), + static_cast(frames[1].InstructionOffset) + }; + env->SetLongArrayRegion(result, 0, 3, regs); + CHECK_EXCEPTION_(nullptr); + + return result; +} diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java index a0271fed146..fb10ecb0755 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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 @@ -75,7 +75,7 @@ import java.util.concurrent.Executor; * *

    The following table shows some request URIs and which, if any context they would * match with: - * + *
    description
    * * * @@ -278,10 +278,20 @@ public abstract class HttpServer { *

    The class overview describes how incoming request URIs are * mapped to HttpContext instances. * - * @apiNote The path should generally, but is not required to, end with '/'. - * If the path does not end with '/', eg such as with {@code "/foo"} then - * this would match requests with a path of {@code "/foobar"} or - * {@code "/foo/bar"}. + * @apiNote + * The path should generally, but is not required to, end with {@code /}. + * If the path does not end with {@code /}, e.g., such as with {@code /foo}, + * then some implementations may use string prefix matching where + * this context path matches request paths {@code /foo}, + * {@code /foo/bar}, or {@code /foobar}. Others may use path prefix + * matching where {@code /foo} matches request paths {@code /foo} and + * {@code /foo/bar}, but not {@code /foobar}. + * + * @implNote + * By default, the JDK built-in implementation uses path prefix matching. + * String prefix matching can be enabled using the + * {@link jdk.httpserver/##sun.net.httpserver.pathMatcher sun.net.httpserver.pathMatcher} + * system property. * * @param path the root URI path to associate the context with * @param handler the handler to invoke for incoming requests @@ -289,6 +299,8 @@ public abstract class HttpServer { * already exists for this path * @throws NullPointerException if either path, or handler are {@code null} * @return an instance of {@code HttpContext} + * + * @see jdk.httpserver/##sun.net.httpserver.pathMatcher sun.net.httpserver.pathMatcher */ public abstract HttpContext createContext(String path, HttpHandler handler); @@ -308,16 +320,28 @@ public abstract class HttpServer { *

    The class overview describes how incoming request URIs are * mapped to {@code HttpContext} instances. * - * @apiNote The path should generally, but is not required to, end with '/'. - * If the path does not end with '/', eg such as with {@code "/foo"} then - * this would match requests with a path of {@code "/foobar"} or - * {@code "/foo/bar"}. + * @apiNote + * The path should generally, but is not required to, end with {@code /}. + * If the path does not end with {@code /}, e.g., such as with {@code /foo}, + * then some implementations may use string prefix matching where + * this context path matches request paths {@code /foo}, + * {@code /foo/bar}, or {@code /foobar}. Others may use path prefix + * matching where {@code /foo} matches request paths + * {@code /foo} and {@code /foo/bar}, but not {@code /foobar}. + * + * @implNote + * By default, the JDK built-in implementation uses path prefix matching. + * String prefix matching can be enabled using the + * {@link jdk.httpserver/##sun.net.httpserver.pathMatcher sun.net.httpserver.pathMatcher} + * system property. * * @param path the root URI path to associate the context with * @throws IllegalArgumentException if path is invalid, or if a context * already exists for this path * @throws NullPointerException if path is {@code null} * @return an instance of {@code HttpContext} + * + * @see jdk.httpserver/##sun.net.httpserver.pathMatcher sun.net.httpserver.pathMatcher */ public abstract HttpContext createContext(String path); diff --git a/src/jdk.httpserver/share/classes/module-info.java b/src/jdk.httpserver/share/classes/module-info.java index ac147582b14..0a0e77c628f 100644 --- a/src/jdk.httpserver/share/classes/module-info.java +++ b/src/jdk.httpserver/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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 @@ -101,7 +101,35 @@ import com.sun.net.httpserver.*; *

  • {@systemProperty sun.net.httpserver.nodelay} (default: false)
    * Boolean value, which if true, sets the {@link java.net.StandardSocketOptions#TCP_NODELAY TCP_NODELAY} * socket option on all incoming connections. - *

  • + * + *
  • + *

    {@systemProperty sun.net.httpserver.pathMatcher} (default: + * {@code pathPrefix})
    + * + * The path matching scheme used to route requests to context handlers. + * The property can be configured with one of the following values:

    + * + *
    + *
    + *
    {@code pathPrefix} (default)
    + *
    The request path must begin with the context path and all matching path + * segments must be identical. For instance, the context path {@code /foo} + * would match request paths {@code /foo}, {@code /foo/}, and {@code /foo/bar}, + * but not {@code /foobar}.
    + *
    {@code stringPrefix}
    + *
    The request path string must begin with the context path string. For + * instance, the context path {@code /foo} would match request paths + * {@code /foo}, {@code /foo/}, {@code /foo/bar}, and {@code /foobar}. + *
    + *
    + *
    + * + *

    In case of a blank or invalid value, the default will be used.

    + * + *

    This property and the ability to restore the string prefix matching + * behavior may be removed in a future release.

    + *
  • + * * * @apiNote The API and SPI in this module are designed and implemented to support a minimal * HTTP server and simple HTTP semantics primarily. diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/ChunkedOutputStream.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/ChunkedOutputStream.java index fd1a940c0a5..0af59f1d1a7 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ChunkedOutputStream.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ChunkedOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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 @@ -154,9 +154,7 @@ class ChunkedOutputStream extends FilterOutputStream } finally { closed = true; } - - Event e = new Event.WriteFinished(t); - t.getHttpContext().getServerImpl().addEvent(e); + t.postExchangeFinished(true); } public void flush() throws IOException { diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/ContextList.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/ContextList.java index 96b55575928..6393ca34798 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ContextList.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ContextList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,13 +26,22 @@ package sun.net.httpserver; import java.util.*; +import java.util.function.BiPredicate; class ContextList { + private static final System.Logger LOGGER = System.getLogger(ContextList.class.getName()); + private final LinkedList list = new LinkedList<>(); public synchronized void add(HttpContextImpl ctx) { + assert ctx != null; + // `findContext(String protocol, String path, ContextPathMatcher matcher)` + // expects the protocol to be lower-cased using ROOT locale, hence: + assert ctx.getProtocol().equals(ctx.getProtocol().toLowerCase(Locale.ROOT)); assert ctx.getPath() != null; + // `ContextPathMatcher` expects context paths to be non-empty: + assert !ctx.getPath().isEmpty(); if (contains(ctx)) { throw new IllegalArgumentException("cannot add context to list"); } @@ -40,21 +49,25 @@ class ContextList { } boolean contains(HttpContextImpl ctx) { - return findContext(ctx.getProtocol(), ctx.getPath(), true) != null; + return findContext(ctx.getProtocol(), ctx.getPath(), ContextPathMatcher.EXACT) != null; } public synchronized int size() { return list.size(); } - /* initially contexts are located only by protocol:path. - * Context with longest prefix matches (currently case-sensitive) + /** + * {@return the context with the longest case-sensitive prefix match} + * + * @param protocol the request protocol + * @param path the request path */ - synchronized HttpContextImpl findContext(String protocol, String path) { - return findContext(protocol, path, false); + HttpContextImpl findContext(String protocol, String path) { + var matcher = ContextPathMatcher.ofConfiguredPrefixPathMatcher(); + return findContext(protocol, path, matcher); } - synchronized HttpContextImpl findContext(String protocol, String path, boolean exact) { + private synchronized HttpContextImpl findContext(String protocol, String path, ContextPathMatcher matcher) { protocol = protocol.toLowerCase(Locale.ROOT); String longest = ""; HttpContextImpl lc = null; @@ -63,9 +76,7 @@ class ContextList { continue; } String cpath = ctx.getPath(); - if (exact && !cpath.equals(path)) { - continue; - } else if (!exact && !path.startsWith(cpath)) { + if (!matcher.test(cpath, path)) { continue; } if (cpath.length() > longest.length()) { @@ -76,10 +87,174 @@ class ContextList { return lc; } + private enum ContextPathMatcher implements BiPredicate { + + /** + * Tests if both the request path and the context path are identical. + */ + EXACT(String::equals), + + /** + * Tests string prefix matches where the request path string + * starts with the context path string. + * + *

    Examples

    + * + *
    description
    Request URI
    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Context pathRequest path
    /foo/foo//foo/bar/foobar
    /YYYY
    /fooYYYY
    /foo/NYYN
    + */ + STRING_PREFIX((contextPath, requestPath) -> requestPath.startsWith(contextPath)), + + /** + * Tests path prefix matches where path segments must have an + * exact match. + * + *

    Examples

    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Context pathRequest path
    /foo/foo//foo/bar/foobar
    /YYYY
    /fooYYYN
    /foo/NYYN
    + */ + PATH_PREFIX((contextPath, requestPath) -> { + + // Fast-path for `/` + if ("/".equals(contextPath)) { + return true; + } + + // Does the request path prefix match? + if (requestPath.startsWith(contextPath)) { + + // Is it an exact match? + int contextPathLength = contextPath.length(); + if (requestPath.length() == contextPathLength) { + return true; + } + + // Is it a path-prefix match? + assert contextPathLength > 0; + return + // Case 1: The request path starts with the context + // path, but the context path has an extra path + // separator suffix. For instance, the context path is + // `/foo/` and the request path is `/foo/bar`. + contextPath.charAt(contextPathLength - 1) == '/' || + // Case 2: The request path starts with the + // context path, but the request path has an + // extra path separator suffix. For instance, + // context path is `/foo` and the request path + // is `/foo/` or `/foo/bar`. + requestPath.charAt(contextPathLength) == '/'; + + } + + return false; + + }); + + private final BiPredicate predicate; + + ContextPathMatcher(BiPredicate predicate) { + this.predicate = predicate; + } + + @Override + public boolean test(String contextPath, String requestPath) { + return predicate.test(contextPath, requestPath); + } + + private static ContextPathMatcher ofConfiguredPrefixPathMatcher() { + var propertyName = "sun.net.httpserver.pathMatcher"; + var propertyValueDefault = "pathPrefix"; + var propertyValue = System.getProperty(propertyName, propertyValueDefault); + return switch (propertyValue) { + case "pathPrefix" -> ContextPathMatcher.PATH_PREFIX; + case "stringPrefix" -> ContextPathMatcher.STRING_PREFIX; + default -> { + LOGGER.log( + System.Logger.Level.WARNING, + "System property \"{}\" contains an invalid value: \"{}\". Falling back to the default: \"{}\"", + propertyName, propertyValue, propertyValueDefault); + yield ContextPathMatcher.PATH_PREFIX; + } + }; + } + + } + public synchronized void remove(String protocol, String path) throws IllegalArgumentException { - HttpContextImpl ctx = findContext(protocol, path, true); + HttpContextImpl ctx = findContext(protocol, path, ContextPathMatcher.EXACT); if (ctx == null) { throw new IllegalArgumentException("cannot remove element from list"); } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/Event.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/Event.java index 18c2535492b..41ce83596b7 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/Event.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/Event.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,13 +47,15 @@ abstract sealed class Event { } /** - * Event indicating that writing is finished for a given exchange. + * Event indicating that the exchange is finished, + * without having necessarily read the complete + * request or sent the complete response. + * Typically, this event is posted when invoking + * the filter chain throws an exception. */ - static final class WriteFinished extends Event { - WriteFinished(ExchangeImpl t) { + static final class ExchangeFinished extends Event { + ExchangeFinished(ExchangeImpl t) { super(Objects.requireNonNull(t)); - assert !t.writefinished; - t.writefinished = true; } } } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java index ad6805938a2..57296842db2 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ExchangeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,10 +32,10 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.lang.System.Logger; import java.lang.System.Logger.Level; -import java.text.*; import java.time.Instant; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Stream; import com.sun.net.httpserver.*; import static com.sun.net.httpserver.HttpExchange.RSPBODY_EMPTY; @@ -46,7 +46,7 @@ class ExchangeImpl { Headers reqHdrs, rspHdrs; Request req; String method; - boolean writefinished; + private boolean writefinished; URI uri; HttpConnection connection; long reqContentLen; @@ -87,6 +87,19 @@ class ExchangeImpl { HttpPrincipal principal; ServerImpl server; + // Used to control that ServerImpl::endExchange is called + // exactly once for this exchange. ServerImpl::endExchange decrements + // the refcount that was incremented by calling ServerImpl::startExchange + // in this ExchangeImpl constructor. + private final AtomicBoolean ended = new AtomicBoolean(); + + // Used to ensure that the Event.ExchangeFinished is posted only + // once for this exchange. The Event.ExchangeFinished is what will + // eventually cause the ServerImpl::finishedLatch to be triggered, + // once the number of active exchanges reaches 0 and ServerImpl::stop + // has been requested. + private final AtomicBoolean finished = new AtomicBoolean(); + ExchangeImpl( String m, URI u, Request req, long len, HttpConnection connection ) throws IOException { @@ -107,6 +120,55 @@ class ExchangeImpl { server.startExchange(); } + /** + * When true, writefinished indicates that all bytes expected + * by the client have been written to the response body + * outputstream, and that the response body outputstream has + * been closed. When all bytes have also been pulled from + * the request body input stream, this makes it possible to + * reuse the connection for the next request. + */ + synchronized boolean writefinished() { + return writefinished; + } + + /** + * Calls ServerImpl::endExchange if not already called for this + * exchange. ServerImpl::endExchange must be called exactly once + * per exchange, and this method ensures that it is not called + * more than once for this exchange. + * @return the new (or current) value of the exchange count. + */ + int endExchange() { + // only call server.endExchange(); once per exchange + if (ended.compareAndSet(false, true)) { + return server.endExchange(); + } + return server.getExchangeCount(); + } + + /** + * Posts the ExchangeFinished event if not already posted. + * If `writefinished` is true, marks the exchange as {@link + * #writefinished()} so that the connection can be reused. + * @param writefinished whether all bytes expected by the + * client have been writen out to the + * response body output stream. + */ + void postExchangeFinished(boolean writefinished) { + // only post ExchangeFinished once per exchange + if (finished.compareAndSet(false, true)) { + if (writefinished) { + synchronized (this) { + assert this.writefinished == false; + this.writefinished = true; + } + } + Event e = new Event.ExchangeFinished(this); + getHttpContext().getServerImpl().addEvent(e); + } + } + public Headers getRequestHeaders() { return reqHdrs; } @@ -140,7 +202,7 @@ class ExchangeImpl { /* close the underlying connection if, * a) the streams not set up yet, no response can be sent, or * b) if the wrapper output stream is not set up, or - * c) if the close of the input/outpu stream fails + * c) if the close of the input/output stream fails */ try { if (uis_orig == null || uos == null) { @@ -157,6 +219,8 @@ class ExchangeImpl { uos.close(); } catch (IOException e) { connection.close(); + } finally { + postExchangeFinished(false); } } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthOutputStream.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthOutputStream.java index 95de03d27fa..e9dbd93bb12 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthOutputStream.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,8 +94,7 @@ class FixedLengthOutputStream extends FilterOutputStream is.close(); } catch (IOException e) {} } - Event e = new Event.WriteFinished(t); - t.getHttpContext().getServerImpl().addEvent(e); + t.postExchangeFinished(true); } // flush is a pass-through diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java index e8c8d336e03..94fe78b9c64 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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 @@ -419,7 +419,8 @@ class ServerImpl { // Stopping marking the state as finished if stop is requested, // termination is in progress and exchange count is 0 if (r instanceof Event.StopRequested) { - logger.log(Level.TRACE, "Handling Stop Requested Event"); + logger.log(Level.TRACE, "Handling {0} event", + r.getClass().getSimpleName()); // checking if terminating is set to true final boolean terminatingCopy = terminating; @@ -437,10 +438,11 @@ class ServerImpl { HttpConnection c = t.getConnection(); try { - if (r instanceof Event.WriteFinished) { + if (r instanceof Event.ExchangeFinished) { - logger.log(Level.TRACE, "Write Finished"); - int exchanges = endExchange(); + logger.log(Level.TRACE, "Handling {0} event", + r.getClass().getSimpleName()); + int exchanges = t.endExchange(); if (terminating && exchanges == 0 && reqConnections.isEmpty()) { finishedLatch.countDown(); } @@ -842,68 +844,77 @@ class ServerImpl { tx = new ExchangeImpl( method, uri, req, clen, connection ); - String chdr = headers.getFirst("Connection"); - Headers rheaders = tx.getResponseHeaders(); + try { - if (chdr != null && chdr.equalsIgnoreCase("close")) { - tx.close = true; - } - if (version.equalsIgnoreCase("http/1.0")) { - tx.http10 = true; - if (chdr == null) { + String chdr = headers.getFirst("Connection"); + Headers rheaders = tx.getResponseHeaders(); + + if (chdr != null && chdr.equalsIgnoreCase("close")) { tx.close = true; - rheaders.set("Connection", "close"); - } else if (chdr.equalsIgnoreCase("keep-alive")) { - rheaders.set("Connection", "keep-alive"); - int idleSeconds = (int) (ServerConfig.getIdleIntervalMillis() / 1000); - String val = "timeout=" + idleSeconds; - rheaders.set("Keep-Alive", val); } - } + if (version.equalsIgnoreCase("http/1.0")) { + tx.http10 = true; + if (chdr == null) { + tx.close = true; + rheaders.set("Connection", "close"); + } else if (chdr.equalsIgnoreCase("keep-alive")) { + rheaders.set("Connection", "keep-alive"); + int idleSeconds = (int) (ServerConfig.getIdleIntervalMillis() / 1000); + String val = "timeout=" + idleSeconds; + rheaders.set("Keep-Alive", val); + } + } - if (newconnection) { - connection.setParameters( - rawin, rawout, chan, engine, sslStreams, - sslContext, protocol, ctx, rawin - ); - } - /* check if client sent an Expect 100 Continue. - * In that case, need to send an interim response. - * In future API may be modified to allow app to - * be involved in this process. - */ - String exp = headers.getFirst("Expect"); - if (exp != null && exp.equalsIgnoreCase("100-continue")) { - logReply(100, requestLine, null); - sendReply( - Code.HTTP_CONTINUE, false, null - ); - } - /* uf is the list of filters seen/set by the user. - * sf is the list of filters established internally - * and which are not visible to the user. uc and sc - * are the corresponding Filter.Chains. - * They are linked together by a LinkHandler - * so that they can both be invoked in one call. - */ - final List sf = ctx.getSystemFilters(); - final List uf = ctx.getFilters(); + if (newconnection) { + connection.setParameters( + rawin, rawout, chan, engine, sslStreams, + sslContext, protocol, ctx, rawin + ); + } + /* check if client sent an Expect 100 Continue. + * In that case, need to send an interim response. + * In future API may be modified to allow app to + * be involved in this process. + */ + String exp = headers.getFirst("Expect"); + if (exp != null && exp.equalsIgnoreCase("100-continue")) { + logReply(100, requestLine, null); + sendReply( + Code.HTTP_CONTINUE, false, null + ); + } + /* uf is the list of filters seen/set by the user. + * sf is the list of filters established internally + * and which are not visible to the user. uc and sc + * are the corresponding Filter.Chains. + * They are linked together by a LinkHandler + * so that they can both be invoked in one call. + */ + final List sf = ctx.getSystemFilters(); + final List uf = ctx.getFilters(); - final Filter.Chain sc = new Filter.Chain(sf, ctx.getHandler()); - final Filter.Chain uc = new Filter.Chain(uf, new LinkHandler(sc)); + final Filter.Chain sc = new Filter.Chain(sf, ctx.getHandler()); + final Filter.Chain uc = new Filter.Chain(uf, new LinkHandler(sc)); - /* set up the two stream references */ - tx.getRequestBody(); - tx.getResponseBody(); - if (https) { - uc.doFilter(new HttpsExchangeImpl(tx)); - } else { - uc.doFilter(new HttpExchangeImpl(tx)); + /* set up the two stream references */ + tx.getRequestBody(); + tx.getResponseBody(); + if (https) { + uc.doFilter(new HttpsExchangeImpl(tx)); + } else { + uc.doFilter(new HttpExchangeImpl(tx)); + } + } catch (Throwable t) { + // release the exchange. + logger.log(Level.TRACE, "ServerImpl.Exchange", t); + if (!tx.writefinished()) { + closeConnection(connection); + } + tx.postExchangeFinished(false); } - } catch (Exception e) { logger.log(Level.TRACE, "ServerImpl.Exchange", e); - if (tx == null || !tx.writefinished) { + if (tx == null || !tx.writefinished()) { closeConnection(connection); } } catch (Throwable t) { diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/UndefLengthOutputStream.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/UndefLengthOutputStream.java index ecda32ecc31..9e1f949321a 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/UndefLengthOutputStream.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/UndefLengthOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2026, 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 @@ -75,8 +75,7 @@ class UndefLengthOutputStream extends FilterOutputStream is.close(); } catch (IOException e) {} } - Event e = new Event.WriteFinished(t); - t.getHttpContext().getServerImpl().addEvent(e); + t.postExchangeFinished(true); } // flush is a pass-through diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java index 0f9edbe450c..6c834077387 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java @@ -150,6 +150,14 @@ abstract class AbstractSpecies extends jdk.internal.vm.vector.VectorSupport.V int laneTypeOrdinal() { return laneType.ordinal(); } + + @ForceInline + @SuppressWarnings("unchecked") + //NOT FINAL: SPECIALIZED + Class carrierType() { + return (Class) laneType.carrierType; + } + // FIXME: appeal to general method (see https://bugs.openjdk.org/browse/JDK-6176992) // replace usages of this method and remove @ForceInline @@ -326,7 +334,7 @@ abstract class AbstractSpecies extends jdk.internal.vm.vector.VectorSupport.V return makeDummyVector(); } private AbstractVector makeDummyVector() { - Object za = Array.newInstance(elementType(), laneCount); + Object za = Array.newInstance(carrierType(), laneCount); return dummyVector = vectorFactory.apply(za); // This is the only use of vectorFactory. // All other factory requests are routed @@ -421,8 +429,7 @@ abstract class AbstractSpecies extends jdk.internal.vm.vector.VectorSupport.V Object iotaArray() { // Create an iota array. It's OK if this is really slow, // because it happens only once per species. - Object ia = Array.newInstance(laneType.elementType, - laneCount); + Object ia = Array.newInstance(carrierType(), laneCount); assert(ia.getClass() == laneType.arrayType); checkValue(laneCount-1); // worst case for (int i = 0; i < laneCount; i++) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java index 64d8e3a8252..846032cb5c6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java @@ -84,8 +84,8 @@ public abstract class ByteVector extends AbstractVector { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -4105,7 +4105,6 @@ public abstract class ByteVector extends AbstractVector { return this; } - /*package-private*/ @Override @ForceInline final @@ -4475,13 +4474,13 @@ public abstract class ByteVector extends AbstractVector { @Override @ForceInline public final ByteVector zero() { - if ((Class) vectorType() == ByteMaxVector.class) - return ByteMaxVector.ZERO; + if ((Class) vectorType() == ByteVectorMax.class) + return ByteVectorMax.ZERO; switch (vectorBitSize()) { - case 64: return Byte64Vector.ZERO; - case 128: return Byte128Vector.ZERO; - case 256: return Byte256Vector.ZERO; - case 512: return Byte512Vector.ZERO; + case 64: return ByteVector64.ZERO; + case 128: return ByteVector128.ZERO; + case 256: return ByteVector256.ZERO; + case 512: return ByteVector512.ZERO; } throw new AssertionError(); } @@ -4489,13 +4488,13 @@ public abstract class ByteVector extends AbstractVector { @Override @ForceInline public final ByteVector iota() { - if ((Class) vectorType() == ByteMaxVector.class) - return ByteMaxVector.IOTA; + if ((Class) vectorType() == ByteVectorMax.class) + return ByteVectorMax.IOTA; switch (vectorBitSize()) { - case 64: return Byte64Vector.IOTA; - case 128: return Byte128Vector.IOTA; - case 256: return Byte256Vector.IOTA; - case 512: return Byte512Vector.IOTA; + case 64: return ByteVector64.IOTA; + case 128: return ByteVector128.IOTA; + case 256: return ByteVector256.IOTA; + case 512: return ByteVector512.IOTA; } throw new AssertionError(); } @@ -4504,13 +4503,13 @@ public abstract class ByteVector extends AbstractVector { @Override @ForceInline public final VectorMask maskAll(boolean bit) { - if ((Class) vectorType() == ByteMaxVector.class) - return ByteMaxVector.ByteMaxMask.maskAll(bit); + if ((Class) vectorType() == ByteVectorMax.class) + return ByteVectorMax.ByteMaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return Byte64Vector.Byte64Mask.maskAll(bit); - case 128: return Byte128Vector.Byte128Mask.maskAll(bit); - case 256: return Byte256Vector.Byte256Mask.maskAll(bit); - case 512: return Byte512Vector.Byte512Mask.maskAll(bit); + case 64: return ByteVector64.ByteMask64.maskAll(bit); + case 128: return ByteVector128.ByteMask128.maskAll(bit); + case 256: return ByteVector256.ByteMask256.maskAll(bit); + case 512: return ByteVector512.ByteMask512.maskAll(bit); } throw new AssertionError(); } @@ -4538,42 +4537,42 @@ public abstract class ByteVector extends AbstractVector { /** Species representing {@link ByteVector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies SPECIES_64 = new ByteSpecies(VectorShape.S_64_BIT, - Byte64Vector.class, - Byte64Vector.Byte64Mask.class, - Byte64Vector.Byte64Shuffle.class, - Byte64Vector::new); + ByteVector64.class, + ByteVector64.ByteMask64.class, + ByteVector64.ByteShuffle64.class, + ByteVector64::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies SPECIES_128 = new ByteSpecies(VectorShape.S_128_BIT, - Byte128Vector.class, - Byte128Vector.Byte128Mask.class, - Byte128Vector.Byte128Shuffle.class, - Byte128Vector::new); + ByteVector128.class, + ByteVector128.ByteMask128.class, + ByteVector128.ByteShuffle128.class, + ByteVector128::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies SPECIES_256 = new ByteSpecies(VectorShape.S_256_BIT, - Byte256Vector.class, - Byte256Vector.Byte256Mask.class, - Byte256Vector.Byte256Shuffle.class, - Byte256Vector::new); + ByteVector256.class, + ByteVector256.ByteMask256.class, + ByteVector256.ByteShuffle256.class, + ByteVector256::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies SPECIES_512 = new ByteSpecies(VectorShape.S_512_BIT, - Byte512Vector.class, - Byte512Vector.Byte512Mask.class, - Byte512Vector.Byte512Shuffle.class, - Byte512Vector::new); + ByteVector512.class, + ByteVector512.ByteMask512.class, + ByteVector512.ByteShuffle512.class, + ByteVector512::new); /** Species representing {@link ByteVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies SPECIES_MAX = new ByteSpecies(VectorShape.S_Max_BIT, - ByteMaxVector.class, - ByteMaxVector.ByteMaxMask.class, - ByteMaxVector.ByteMaxShuffle.class, - ByteMaxVector::new); + ByteVectorMax.class, + ByteVectorMax.ByteMaskMax.class, + ByteVectorMax.ByteShuffleMax.class, + ByteVectorMax::new); /** * Preferred species for {@link ByteVector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector128.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector128.java index 0b710938ede..c38e8d0f8a0 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector128.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Byte128Vector extends ByteVector { +final class ByteVector128 extends ByteVector { static final ByteSpecies VSPECIES = (ByteSpecies) ByteVector.SPECIES_128; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Byte128Vector.class; + static final Class VCLASS = ByteVector128.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = byte.class; // carrier type used by the JVM + static final Class ETYPE = byte.class; // used by the JVM - Byte128Vector(byte[] v) { + ByteVector128(byte[] v) { super(v); } - // For compatibility as Byte128Vector::new, + // For compatibility as ByteVector128::new, // stored into species.vectorFactory. - Byte128Vector(Object v) { + ByteVector128(Object v) { this((byte[]) v); } - static final Byte128Vector ZERO = new Byte128Vector(new byte[VLENGTH]); - static final Byte128Vector IOTA = new Byte128Vector(VSPECIES.iotaArray()); + static final ByteVector128 ZERO = new ByteVector128(new byte[VLENGTH]); + static final ByteVector128 IOTA = new ByteVector128(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Byte128Vector extends ByteVector { @Override public final Class elementType() { return byte.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Byte.SIZE; } @@ -130,51 +135,51 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline - public final Byte128Vector broadcast(byte e) { - return (Byte128Vector) super.broadcastTemplate(e); // specialize + public final ByteVector128 broadcast(byte e) { + return (ByteVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Byte128Vector broadcast(long e) { - return (Byte128Vector) super.broadcastTemplate(e); // specialize + public final ByteVector128 broadcast(long e) { + return (ByteVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Byte128Mask maskFromArray(boolean[] bits) { - return new Byte128Mask(bits); + ByteMask128 maskFromArray(boolean[] bits) { + return new ByteMask128(bits); } @Override @ForceInline - Byte128Shuffle iotaShuffle() { return Byte128Shuffle.IOTA; } + ByteShuffle128 iotaShuffle() { return ByteShuffle128.IOTA; } @Override @ForceInline - Byte128Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Byte128Shuffle) iotaShuffleTemplate((byte) start, (byte) step, wrap); + ByteShuffle128 iotaShuffle(int start, int step, boolean wrap) { + return (ByteShuffle128) iotaShuffleTemplate((byte) start, (byte) step, wrap); } @Override @ForceInline - Byte128Shuffle shuffleFromArray(int[] indices, int i) { return new Byte128Shuffle(indices, i); } + ByteShuffle128 shuffleFromArray(int[] indices, int i) { return new ByteShuffle128(indices, i); } @Override @ForceInline - Byte128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Byte128Shuffle(fn); } + ByteShuffle128 shuffleFromOp(IntUnaryOperator fn) { return new ByteShuffle128(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Byte128Vector vectorFactory(byte[] vec) { - return new Byte128Vector(vec); + ByteVector128 vectorFactory(byte[] vec) { + return new ByteVector128(vec); } @ForceInline final @Override - Byte128Vector asByteVectorRaw() { - return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector128 asByteVectorRaw() { + return (ByteVector128) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Byte128Vector extends ByteVector { @ForceInline final @Override - Byte128Vector uOp(FUnOp f) { - return (Byte128Vector) super.uOpTemplate(f); // specialize + ByteVector128 uOp(FUnOp f) { + return (ByteVector128) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Byte128Vector uOp(VectorMask m, FUnOp f) { - return (Byte128Vector) - super.uOpTemplate((Byte128Mask)m, f); // specialize + ByteVector128 uOp(VectorMask m, FUnOp f) { + return (ByteVector128) + super.uOpTemplate((ByteMask128)m, f); // specialize } // Binary operator @ForceInline final @Override - Byte128Vector bOp(Vector v, FBinOp f) { - return (Byte128Vector) super.bOpTemplate((Byte128Vector)v, f); // specialize + ByteVector128 bOp(Vector v, FBinOp f) { + return (ByteVector128) super.bOpTemplate((ByteVector128)v, f); // specialize } @ForceInline final @Override - Byte128Vector bOp(Vector v, + ByteVector128 bOp(Vector v, VectorMask m, FBinOp f) { - return (Byte128Vector) - super.bOpTemplate((Byte128Vector)v, (Byte128Mask)m, + return (ByteVector128) + super.bOpTemplate((ByteVector128)v, (ByteMask128)m, f); // specialize } @@ -219,19 +224,19 @@ final class Byte128Vector extends ByteVector { @ForceInline final @Override - Byte128Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Byte128Vector) - super.tOpTemplate((Byte128Vector)v1, (Byte128Vector)v2, + ByteVector128 tOp(Vector v1, Vector v2, FTriOp f) { + return (ByteVector128) + super.tOpTemplate((ByteVector128)v1, (ByteVector128)v2, f); // specialize } @ForceInline final @Override - Byte128Vector tOp(Vector v1, Vector v2, + ByteVector128 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Byte128Vector) - super.tOpTemplate((Byte128Vector)v1, (Byte128Vector)v2, - (Byte128Mask)m, f); // specialize + return (ByteVector128) + super.tOpTemplate((ByteVector128)v1, (ByteVector128)v2, + (ByteMask128)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline - public Byte128Vector lanewise(Unary op) { - return (Byte128Vector) super.lanewiseTemplate(op); // specialize + public ByteVector128 lanewise(Unary op) { + return (ByteVector128) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Byte128Vector lanewise(Unary op, VectorMask m) { - return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialize + public ByteVector128 lanewise(Unary op, VectorMask m) { + return (ByteVector128) super.lanewiseTemplate(op, ByteMask128.class, (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector lanewise(Binary op, Vector v) { - return (Byte128Vector) super.lanewiseTemplate(op, v); // specialize + public ByteVector128 lanewise(Binary op, Vector v) { + return (ByteVector128) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Byte128Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, v, (Byte128Mask) m); // specialize + public ByteVector128 lanewise(Binary op, Vector v, VectorMask m) { + return (ByteVector128) super.lanewiseTemplate(op, ByteMask128.class, v, (ByteMask128) m); // specialize } /*package-private*/ @Override - @ForceInline Byte128Vector + @ForceInline ByteVector128 lanewiseShift(VectorOperators.Binary op, int e) { - return (Byte128Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ByteVector128) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Byte128Vector + @ForceInline ByteVector128 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Byte128Vector) super.lanewiseShiftTemplate(op, Byte128Mask.class, e, (Byte128Mask) m); // specialize + return (ByteVector128) super.lanewiseShiftTemplate(op, ByteMask128.class, e, (ByteMask128) m); // specialize } /*package-private*/ @Override @ForceInline public final - Byte128Vector + ByteVector128 lanewise(Ternary op, Vector v1, Vector v2) { - return (Byte128Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ByteVector128) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Byte128Vector + ByteVector128 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, v1, v2, (Byte128Mask) m); // specialize + return (ByteVector128) super.lanewiseTemplate(op, ByteMask128.class, v1, v2, (ByteMask128) m); // specialize } @Override @ForceInline public final - Byte128Vector addIndex(int scale) { - return (Byte128Vector) super.addIndexTemplate(scale); // specialize + ByteVector128 addIndex(int scale) { + return (ByteVector128) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Byte128Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialized + return super.reduceLanesTemplate(op, ByteMask128.class, (ByteMask128) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Byte128Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ByteMask128.class, (ByteMask128) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline - public final Byte128Shuffle toShuffle() { - return (Byte128Shuffle) toShuffle(vspecies(), false); + public final ByteShuffle128 toShuffle() { + return (ByteShuffle128) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Byte128Mask test(Test op) { - return super.testTemplate(Byte128Mask.class, op); // specialize + public final ByteMask128 test(Test op) { + return super.testTemplate(ByteMask128.class, op); // specialize } @Override @ForceInline - public final Byte128Mask test(Test op, VectorMask m) { - return super.testTemplate(Byte128Mask.class, op, (Byte128Mask) m); // specialize + public final ByteMask128 test(Test op, VectorMask m) { + return super.testTemplate(ByteMask128.class, op, (ByteMask128) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Byte128Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Byte128Mask.class, op, v); // specialize + public final ByteMask128 compare(Comparison op, Vector v) { + return super.compareTemplate(ByteMask128.class, op, v); // specialize } @Override @ForceInline - public final Byte128Mask compare(Comparison op, byte s) { - return super.compareTemplate(Byte128Mask.class, op, s); // specialize + public final ByteMask128 compare(Comparison op, byte s) { + return super.compareTemplate(ByteMask128.class, op, s); // specialize } @Override @ForceInline - public final Byte128Mask compare(Comparison op, long s) { - return super.compareTemplate(Byte128Mask.class, op, s); // specialize + public final ByteMask128 compare(Comparison op, long s) { + return super.compareTemplate(ByteMask128.class, op, s); // specialize } @Override @ForceInline - public final Byte128Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Byte128Mask.class, op, v, (Byte128Mask) m); + public final ByteMask128 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ByteMask128.class, op, v, (ByteMask128) m); } @Override @ForceInline - public Byte128Vector blend(Vector v, VectorMask m) { - return (Byte128Vector) - super.blendTemplate(Byte128Mask.class, - (Byte128Vector) v, - (Byte128Mask) m); // specialize + public ByteVector128 blend(Vector v, VectorMask m) { + return (ByteVector128) + super.blendTemplate(ByteMask128.class, + (ByteVector128) v, + (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector slice(int origin, Vector v) { - return (Byte128Vector) super.sliceTemplate(origin, v); // specialize + public ByteVector128 slice(int origin, Vector v) { + return (ByteVector128) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Byte128Vector slice(int origin) { - return (Byte128Vector) super.sliceTemplate(origin); // specialize + public ByteVector128 slice(int origin) { + return (ByteVector128) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Byte128Vector unslice(int origin, Vector w, int part) { - return (Byte128Vector) super.unsliceTemplate(origin, w, part); // specialize + public ByteVector128 unslice(int origin, Vector w, int part) { + return (ByteVector128) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Byte128Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Byte128Vector) - super.unsliceTemplate(Byte128Mask.class, + public ByteVector128 unslice(int origin, Vector w, int part, VectorMask m) { + return (ByteVector128) + super.unsliceTemplate(ByteMask128.class, origin, w, part, - (Byte128Mask) m); // specialize + (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector unslice(int origin) { - return (Byte128Vector) super.unsliceTemplate(origin); // specialize + public ByteVector128 unslice(int origin) { + return (ByteVector128) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Byte128Vector rearrange(VectorShuffle s) { - return (Byte128Vector) - super.rearrangeTemplate(Byte128Shuffle.class, - (Byte128Shuffle) s); // specialize + public ByteVector128 rearrange(VectorShuffle s) { + return (ByteVector128) + super.rearrangeTemplate(ByteShuffle128.class, + (ByteShuffle128) s); // specialize } @Override @ForceInline - public Byte128Vector rearrange(VectorShuffle shuffle, + public ByteVector128 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Byte128Vector) - super.rearrangeTemplate(Byte128Shuffle.class, - Byte128Mask.class, - (Byte128Shuffle) shuffle, - (Byte128Mask) m); // specialize + return (ByteVector128) + super.rearrangeTemplate(ByteShuffle128.class, + ByteMask128.class, + (ByteShuffle128) shuffle, + (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector rearrange(VectorShuffle s, + public ByteVector128 rearrange(VectorShuffle s, Vector v) { - return (Byte128Vector) - super.rearrangeTemplate(Byte128Shuffle.class, - (Byte128Shuffle) s, - (Byte128Vector) v); // specialize + return (ByteVector128) + super.rearrangeTemplate(ByteShuffle128.class, + (ByteShuffle128) s, + (ByteVector128) v); // specialize } @Override @ForceInline - public Byte128Vector compress(VectorMask m) { - return (Byte128Vector) - super.compressTemplate(Byte128Mask.class, - (Byte128Mask) m); // specialize + public ByteVector128 compress(VectorMask m) { + return (ByteVector128) + super.compressTemplate(ByteMask128.class, + (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector expand(VectorMask m) { - return (Byte128Vector) - super.expandTemplate(Byte128Mask.class, - (Byte128Mask) m); // specialize + public ByteVector128 expand(VectorMask m) { + return (ByteVector128) + super.expandTemplate(ByteMask128.class, + (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector selectFrom(Vector v) { - return (Byte128Vector) - super.selectFromTemplate((Byte128Vector) v); // specialize + public ByteVector128 selectFrom(Vector v) { + return (ByteVector128) + super.selectFromTemplate((ByteVector128) v); // specialize } @Override @ForceInline - public Byte128Vector selectFrom(Vector v, + public ByteVector128 selectFrom(Vector v, VectorMask m) { - return (Byte128Vector) - super.selectFromTemplate((Byte128Vector) v, - Byte128Mask.class, (Byte128Mask) m); // specialize + return (ByteVector128) + super.selectFromTemplate((ByteVector128) v, + ByteMask128.class, (ByteMask128) m); // specialize } @Override @ForceInline - public Byte128Vector selectFrom(Vector v1, + public ByteVector128 selectFrom(Vector v1, Vector v2) { - return (Byte128Vector) - super.selectFromTemplate((Byte128Vector) v1, (Byte128Vector) v2); // specialize + return (ByteVector128) + super.selectFromTemplate((ByteVector128) v1, (ByteVector128) v2); // specialize } @ForceInline @@ -558,7 +563,7 @@ final class Byte128Vector extends ByteVector { @ForceInline @Override - public Byte128Vector withLane(int i, byte e) { + public ByteVector128 withLane(int i, byte e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -581,7 +586,7 @@ final class Byte128Vector extends ByteVector { } @ForceInline - public Byte128Vector withLaneHelper(int i, byte e) { + public ByteVector128 withLaneHelper(int i, byte e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -594,19 +599,20 @@ final class Byte128Vector extends ByteVector { // Mask - static final class Byte128Mask extends AbstractMask { + static final class ByteMask128 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte128Mask(boolean[] bits) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteMask128(boolean[] bits) { this(bits, 0); } - Byte128Mask(boolean[] bits, int offset) { + ByteMask128(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Byte128Mask(boolean val) { + ByteMask128(boolean val) { super(prepare(val)); } @@ -639,31 +645,31 @@ final class Byte128Vector extends ByteVector { } @Override - Byte128Mask uOp(MUnOp f) { + ByteMask128 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Byte128Mask(res); + return new ByteMask128(res); } @Override - Byte128Mask bOp(VectorMask m, MBinOp f) { + ByteMask128 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Byte128Mask)m).getBits(); + boolean[] mbits = ((ByteMask128)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Byte128Mask(res); + return new ByteMask128(res); } @ForceInline @Override public final - Byte128Vector toVector() { - return (Byte128Vector) super.toVectorTemplate(); // specialize + ByteVector128 toVector() { + return (ByteVector128) super.toVectorTemplate(); // specialize } /** @@ -696,25 +702,25 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline /*package-private*/ - Byte128Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Byte128Mask) VectorSupport.indexPartiallyInUpperRange( - Byte128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Byte128Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ByteMask128 indexPartiallyInUpperRange(long offset, long limit) { + return (ByteMask128) VectorSupport.indexPartiallyInUpperRange( + ByteMask128.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ByteMask128) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Byte128Mask not() { + public ByteMask128 not() { return xor(maskAll(true)); } @Override @ForceInline - public Byte128Mask compress() { - return (Byte128Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Byte128Vector.class, Byte128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ByteMask128 compress() { + return (ByteMask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ByteVector128.class, ByteMask128.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -723,30 +729,30 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline - public Byte128Mask and(VectorMask mask) { + public ByteMask128 and(VectorMask mask) { Objects.requireNonNull(mask); - Byte128Mask m = (Byte128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask128 m = (ByteMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Byte128Mask or(VectorMask mask) { + public ByteMask128 or(VectorMask mask) { Objects.requireNonNull(mask); - Byte128Mask m = (Byte128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask128 m = (ByteMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Byte128Mask xor(VectorMask mask) { + public ByteMask128 xor(VectorMask mask) { Objects.requireNonNull(mask); - Byte128Mask m = (Byte128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask128 m = (ByteMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -756,21 +762,21 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -780,7 +786,7 @@ final class Byte128Vector extends ByteVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -790,7 +796,7 @@ final class Byte128Vector extends ByteVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Byte128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ByteMask128.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -799,48 +805,49 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Byte128Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ByteMask128)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Byte128Mask)m).getBits())); + (m, __) -> allTrueHelper(((ByteMask128)m).getBits())); } @ForceInline /*package-private*/ - static Byte128Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Byte128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ByteMask128 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ByteMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Byte128Mask TRUE_MASK = new Byte128Mask(true); - private static final Byte128Mask FALSE_MASK = new Byte128Mask(false); + private static final ByteMask128 TRUE_MASK = new ByteMask128(true); + private static final ByteMask128 FALSE_MASK = new ByteMask128(false); } // Shuffle - static final class Byte128Shuffle extends AbstractShuffle { + static final class ByteShuffle128 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte128Shuffle(byte[] indices) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteShuffle128(byte[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Byte128Shuffle(int[] indices, int i) { + ByteShuffle128(int[] indices, int i) { this(prepare(indices, i)); } - Byte128Shuffle(IntUnaryOperator fn) { + ByteShuffle128(IntUnaryOperator fn) { this(prepare(fn)); } @@ -860,23 +867,23 @@ final class Byte128Vector extends ByteVector { assert(VLENGTH < Byte.MAX_VALUE); assert(Byte.MIN_VALUE <= -VLENGTH); } - static final Byte128Shuffle IOTA = new Byte128Shuffle(IDENTITY); + static final ByteShuffle128 IOTA = new ByteShuffle128(IDENTITY); @Override @ForceInline - public Byte128Vector toVector() { + public ByteVector128 toVector() { return toBitsVector(); } @Override @ForceInline - Byte128Vector toBitsVector() { - return (Byte128Vector) super.toBitsVectorTemplate(); + ByteVector128 toBitsVector() { + return (ByteVector128) super.toBitsVectorTemplate(); } @Override - Byte128Vector toBitsVector0() { - return ((Byte128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ByteVector128 toBitsVector0() { + return ((ByteVector128) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -925,30 +932,30 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline - public final Byte128Mask laneIsValid() { - return (Byte128Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ByteMask128 laneIsValid() { + return (ByteMask128) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Byte128Shuffle rearrange(VectorShuffle shuffle) { - Byte128Shuffle concreteShuffle = (Byte128Shuffle) shuffle; - return (Byte128Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ByteShuffle128 rearrange(VectorShuffle shuffle) { + ByteShuffle128 concreteShuffle = (ByteShuffle128) shuffle; + return (ByteShuffle128) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Byte128Shuffle wrapIndexes() { - Byte128Vector v = toBitsVector(); + public final ByteShuffle128 wrapIndexes() { + ByteVector128 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Byte128Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ByteVector128) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Byte128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ByteVector128) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Byte128Shuffle) v.toShuffle(vspecies(), false); + return (ByteShuffle128) v.toShuffle(vspecies(), false); } private static byte[] prepare(int[] indices, int offset) { @@ -999,14 +1006,14 @@ final class Byte128Vector extends ByteVector { @Override final ByteVector fromArray0(byte[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ByteMask128.class, a, offset, (ByteMask128) m, offsetInRange); // specialize } @ForceInline @Override final ByteVector fromArray0(byte[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Byte128Mask.class, a, offset, indexMap, mapOffset, (Byte128Mask) m); + return super.fromArray0Template(ByteMask128.class, a, offset, indexMap, mapOffset, (ByteMask128) m); } @@ -1021,7 +1028,7 @@ final class Byte128Vector extends ByteVector { @Override final ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromBooleanArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m, offsetInRange); // specialize + return super.fromBooleanArray0Template(ByteMask128.class, a, offset, (ByteMask128) m, offsetInRange); // specialize } @ForceInline @@ -1035,7 +1042,7 @@ final class Byte128Vector extends ByteVector { @Override final ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Byte128Mask.class, ms, offset, (Byte128Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ByteMask128.class, ms, offset, (ByteMask128) m, offsetInRange); // specialize } @ForceInline @@ -1049,7 +1056,7 @@ final class Byte128Vector extends ByteVector { @Override final void intoArray0(byte[] a, int offset, VectorMask m) { - super.intoArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); + super.intoArray0Template(ByteMask128.class, a, offset, (ByteMask128) m); } @@ -1057,14 +1064,14 @@ final class Byte128Vector extends ByteVector { @Override final void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { - super.intoBooleanArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); + super.intoBooleanArray0Template(ByteMask128.class, a, offset, (ByteMask128) m); } @ForceInline @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Byte128Mask.class, ms, offset, (Byte128Mask) m); + super.intoMemorySegment0Template(ByteMask128.class, ms, offset, (ByteMask128) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector256.java similarity index 69% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector256.java index 6b0e57f8b8f..0eec0c56e37 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector256.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Byte256Vector extends ByteVector { +final class ByteVector256 extends ByteVector { static final ByteSpecies VSPECIES = (ByteSpecies) ByteVector.SPECIES_256; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Byte256Vector.class; + static final Class VCLASS = ByteVector256.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = byte.class; // carrier type used by the JVM + static final Class ETYPE = byte.class; // used by the JVM - Byte256Vector(byte[] v) { + ByteVector256(byte[] v) { super(v); } - // For compatibility as Byte256Vector::new, + // For compatibility as ByteVector256::new, // stored into species.vectorFactory. - Byte256Vector(Object v) { + ByteVector256(Object v) { this((byte[]) v); } - static final Byte256Vector ZERO = new Byte256Vector(new byte[VLENGTH]); - static final Byte256Vector IOTA = new Byte256Vector(VSPECIES.iotaArray()); + static final ByteVector256 ZERO = new ByteVector256(new byte[VLENGTH]); + static final ByteVector256 IOTA = new ByteVector256(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Byte256Vector extends ByteVector { @Override public final Class elementType() { return byte.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Byte.SIZE; } @@ -130,51 +135,51 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline - public final Byte256Vector broadcast(byte e) { - return (Byte256Vector) super.broadcastTemplate(e); // specialize + public final ByteVector256 broadcast(byte e) { + return (ByteVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Byte256Vector broadcast(long e) { - return (Byte256Vector) super.broadcastTemplate(e); // specialize + public final ByteVector256 broadcast(long e) { + return (ByteVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Byte256Mask maskFromArray(boolean[] bits) { - return new Byte256Mask(bits); + ByteMask256 maskFromArray(boolean[] bits) { + return new ByteMask256(bits); } @Override @ForceInline - Byte256Shuffle iotaShuffle() { return Byte256Shuffle.IOTA; } + ByteShuffle256 iotaShuffle() { return ByteShuffle256.IOTA; } @Override @ForceInline - Byte256Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Byte256Shuffle) iotaShuffleTemplate((byte) start, (byte) step, wrap); + ByteShuffle256 iotaShuffle(int start, int step, boolean wrap) { + return (ByteShuffle256) iotaShuffleTemplate((byte) start, (byte) step, wrap); } @Override @ForceInline - Byte256Shuffle shuffleFromArray(int[] indices, int i) { return new Byte256Shuffle(indices, i); } + ByteShuffle256 shuffleFromArray(int[] indices, int i) { return new ByteShuffle256(indices, i); } @Override @ForceInline - Byte256Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Byte256Shuffle(fn); } + ByteShuffle256 shuffleFromOp(IntUnaryOperator fn) { return new ByteShuffle256(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Byte256Vector vectorFactory(byte[] vec) { - return new Byte256Vector(vec); + ByteVector256 vectorFactory(byte[] vec) { + return new ByteVector256(vec); } @ForceInline final @Override - Byte256Vector asByteVectorRaw() { - return (Byte256Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector256 asByteVectorRaw() { + return (ByteVector256) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Byte256Vector extends ByteVector { @ForceInline final @Override - Byte256Vector uOp(FUnOp f) { - return (Byte256Vector) super.uOpTemplate(f); // specialize + ByteVector256 uOp(FUnOp f) { + return (ByteVector256) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Byte256Vector uOp(VectorMask m, FUnOp f) { - return (Byte256Vector) - super.uOpTemplate((Byte256Mask)m, f); // specialize + ByteVector256 uOp(VectorMask m, FUnOp f) { + return (ByteVector256) + super.uOpTemplate((ByteMask256)m, f); // specialize } // Binary operator @ForceInline final @Override - Byte256Vector bOp(Vector v, FBinOp f) { - return (Byte256Vector) super.bOpTemplate((Byte256Vector)v, f); // specialize + ByteVector256 bOp(Vector v, FBinOp f) { + return (ByteVector256) super.bOpTemplate((ByteVector256)v, f); // specialize } @ForceInline final @Override - Byte256Vector bOp(Vector v, + ByteVector256 bOp(Vector v, VectorMask m, FBinOp f) { - return (Byte256Vector) - super.bOpTemplate((Byte256Vector)v, (Byte256Mask)m, + return (ByteVector256) + super.bOpTemplate((ByteVector256)v, (ByteMask256)m, f); // specialize } @@ -219,19 +224,19 @@ final class Byte256Vector extends ByteVector { @ForceInline final @Override - Byte256Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Byte256Vector) - super.tOpTemplate((Byte256Vector)v1, (Byte256Vector)v2, + ByteVector256 tOp(Vector v1, Vector v2, FTriOp f) { + return (ByteVector256) + super.tOpTemplate((ByteVector256)v1, (ByteVector256)v2, f); // specialize } @ForceInline final @Override - Byte256Vector tOp(Vector v1, Vector v2, + ByteVector256 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Byte256Vector) - super.tOpTemplate((Byte256Vector)v1, (Byte256Vector)v2, - (Byte256Mask)m, f); // specialize + return (ByteVector256) + super.tOpTemplate((ByteVector256)v1, (ByteVector256)v2, + (ByteMask256)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline - public Byte256Vector lanewise(Unary op) { - return (Byte256Vector) super.lanewiseTemplate(op); // specialize + public ByteVector256 lanewise(Unary op) { + return (ByteVector256) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Byte256Vector lanewise(Unary op, VectorMask m) { - return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialize + public ByteVector256 lanewise(Unary op, VectorMask m) { + return (ByteVector256) super.lanewiseTemplate(op, ByteMask256.class, (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector lanewise(Binary op, Vector v) { - return (Byte256Vector) super.lanewiseTemplate(op, v); // specialize + public ByteVector256 lanewise(Binary op, Vector v) { + return (ByteVector256) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Byte256Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v, (Byte256Mask) m); // specialize + public ByteVector256 lanewise(Binary op, Vector v, VectorMask m) { + return (ByteVector256) super.lanewiseTemplate(op, ByteMask256.class, v, (ByteMask256) m); // specialize } /*package-private*/ @Override - @ForceInline Byte256Vector + @ForceInline ByteVector256 lanewiseShift(VectorOperators.Binary op, int e) { - return (Byte256Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ByteVector256) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Byte256Vector + @ForceInline ByteVector256 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Byte256Vector) super.lanewiseShiftTemplate(op, Byte256Mask.class, e, (Byte256Mask) m); // specialize + return (ByteVector256) super.lanewiseShiftTemplate(op, ByteMask256.class, e, (ByteMask256) m); // specialize } /*package-private*/ @Override @ForceInline public final - Byte256Vector + ByteVector256 lanewise(Ternary op, Vector v1, Vector v2) { - return (Byte256Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ByteVector256) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Byte256Vector + ByteVector256 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v1, v2, (Byte256Mask) m); // specialize + return (ByteVector256) super.lanewiseTemplate(op, ByteMask256.class, v1, v2, (ByteMask256) m); // specialize } @Override @ForceInline public final - Byte256Vector addIndex(int scale) { - return (Byte256Vector) super.addIndexTemplate(scale); // specialize + ByteVector256 addIndex(int scale) { + return (ByteVector256) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Byte256Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialized + return super.reduceLanesTemplate(op, ByteMask256.class, (ByteMask256) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Byte256Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ByteMask256.class, (ByteMask256) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline - public final Byte256Shuffle toShuffle() { - return (Byte256Shuffle) toShuffle(vspecies(), false); + public final ByteShuffle256 toShuffle() { + return (ByteShuffle256) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Byte256Mask test(Test op) { - return super.testTemplate(Byte256Mask.class, op); // specialize + public final ByteMask256 test(Test op) { + return super.testTemplate(ByteMask256.class, op); // specialize } @Override @ForceInline - public final Byte256Mask test(Test op, VectorMask m) { - return super.testTemplate(Byte256Mask.class, op, (Byte256Mask) m); // specialize + public final ByteMask256 test(Test op, VectorMask m) { + return super.testTemplate(ByteMask256.class, op, (ByteMask256) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Byte256Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Byte256Mask.class, op, v); // specialize + public final ByteMask256 compare(Comparison op, Vector v) { + return super.compareTemplate(ByteMask256.class, op, v); // specialize } @Override @ForceInline - public final Byte256Mask compare(Comparison op, byte s) { - return super.compareTemplate(Byte256Mask.class, op, s); // specialize + public final ByteMask256 compare(Comparison op, byte s) { + return super.compareTemplate(ByteMask256.class, op, s); // specialize } @Override @ForceInline - public final Byte256Mask compare(Comparison op, long s) { - return super.compareTemplate(Byte256Mask.class, op, s); // specialize + public final ByteMask256 compare(Comparison op, long s) { + return super.compareTemplate(ByteMask256.class, op, s); // specialize } @Override @ForceInline - public final Byte256Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Byte256Mask.class, op, v, (Byte256Mask) m); + public final ByteMask256 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ByteMask256.class, op, v, (ByteMask256) m); } @Override @ForceInline - public Byte256Vector blend(Vector v, VectorMask m) { - return (Byte256Vector) - super.blendTemplate(Byte256Mask.class, - (Byte256Vector) v, - (Byte256Mask) m); // specialize + public ByteVector256 blend(Vector v, VectorMask m) { + return (ByteVector256) + super.blendTemplate(ByteMask256.class, + (ByteVector256) v, + (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector slice(int origin, Vector v) { - return (Byte256Vector) super.sliceTemplate(origin, v); // specialize + public ByteVector256 slice(int origin, Vector v) { + return (ByteVector256) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Byte256Vector slice(int origin) { - return (Byte256Vector) super.sliceTemplate(origin); // specialize + public ByteVector256 slice(int origin) { + return (ByteVector256) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Byte256Vector unslice(int origin, Vector w, int part) { - return (Byte256Vector) super.unsliceTemplate(origin, w, part); // specialize + public ByteVector256 unslice(int origin, Vector w, int part) { + return (ByteVector256) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Byte256Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Byte256Vector) - super.unsliceTemplate(Byte256Mask.class, + public ByteVector256 unslice(int origin, Vector w, int part, VectorMask m) { + return (ByteVector256) + super.unsliceTemplate(ByteMask256.class, origin, w, part, - (Byte256Mask) m); // specialize + (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector unslice(int origin) { - return (Byte256Vector) super.unsliceTemplate(origin); // specialize + public ByteVector256 unslice(int origin) { + return (ByteVector256) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Byte256Vector rearrange(VectorShuffle s) { - return (Byte256Vector) - super.rearrangeTemplate(Byte256Shuffle.class, - (Byte256Shuffle) s); // specialize + public ByteVector256 rearrange(VectorShuffle s) { + return (ByteVector256) + super.rearrangeTemplate(ByteShuffle256.class, + (ByteShuffle256) s); // specialize } @Override @ForceInline - public Byte256Vector rearrange(VectorShuffle shuffle, + public ByteVector256 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Byte256Vector) - super.rearrangeTemplate(Byte256Shuffle.class, - Byte256Mask.class, - (Byte256Shuffle) shuffle, - (Byte256Mask) m); // specialize + return (ByteVector256) + super.rearrangeTemplate(ByteShuffle256.class, + ByteMask256.class, + (ByteShuffle256) shuffle, + (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector rearrange(VectorShuffle s, + public ByteVector256 rearrange(VectorShuffle s, Vector v) { - return (Byte256Vector) - super.rearrangeTemplate(Byte256Shuffle.class, - (Byte256Shuffle) s, - (Byte256Vector) v); // specialize + return (ByteVector256) + super.rearrangeTemplate(ByteShuffle256.class, + (ByteShuffle256) s, + (ByteVector256) v); // specialize } @Override @ForceInline - public Byte256Vector compress(VectorMask m) { - return (Byte256Vector) - super.compressTemplate(Byte256Mask.class, - (Byte256Mask) m); // specialize + public ByteVector256 compress(VectorMask m) { + return (ByteVector256) + super.compressTemplate(ByteMask256.class, + (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector expand(VectorMask m) { - return (Byte256Vector) - super.expandTemplate(Byte256Mask.class, - (Byte256Mask) m); // specialize + public ByteVector256 expand(VectorMask m) { + return (ByteVector256) + super.expandTemplate(ByteMask256.class, + (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector selectFrom(Vector v) { - return (Byte256Vector) - super.selectFromTemplate((Byte256Vector) v); // specialize + public ByteVector256 selectFrom(Vector v) { + return (ByteVector256) + super.selectFromTemplate((ByteVector256) v); // specialize } @Override @ForceInline - public Byte256Vector selectFrom(Vector v, + public ByteVector256 selectFrom(Vector v, VectorMask m) { - return (Byte256Vector) - super.selectFromTemplate((Byte256Vector) v, - Byte256Mask.class, (Byte256Mask) m); // specialize + return (ByteVector256) + super.selectFromTemplate((ByteVector256) v, + ByteMask256.class, (ByteMask256) m); // specialize } @Override @ForceInline - public Byte256Vector selectFrom(Vector v1, + public ByteVector256 selectFrom(Vector v1, Vector v2) { - return (Byte256Vector) - super.selectFromTemplate((Byte256Vector) v1, (Byte256Vector) v2); // specialize + return (ByteVector256) + super.selectFromTemplate((ByteVector256) v1, (ByteVector256) v2); // specialize } @ForceInline @@ -574,7 +579,7 @@ final class Byte256Vector extends ByteVector { @ForceInline @Override - public Byte256Vector withLane(int i, byte e) { + public ByteVector256 withLane(int i, byte e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -613,7 +618,7 @@ final class Byte256Vector extends ByteVector { } @ForceInline - public Byte256Vector withLaneHelper(int i, byte e) { + public ByteVector256 withLaneHelper(int i, byte e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -626,19 +631,20 @@ final class Byte256Vector extends ByteVector { // Mask - static final class Byte256Mask extends AbstractMask { + static final class ByteMask256 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte256Mask(boolean[] bits) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteMask256(boolean[] bits) { this(bits, 0); } - Byte256Mask(boolean[] bits, int offset) { + ByteMask256(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Byte256Mask(boolean val) { + ByteMask256(boolean val) { super(prepare(val)); } @@ -671,31 +677,31 @@ final class Byte256Vector extends ByteVector { } @Override - Byte256Mask uOp(MUnOp f) { + ByteMask256 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Byte256Mask(res); + return new ByteMask256(res); } @Override - Byte256Mask bOp(VectorMask m, MBinOp f) { + ByteMask256 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Byte256Mask)m).getBits(); + boolean[] mbits = ((ByteMask256)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Byte256Mask(res); + return new ByteMask256(res); } @ForceInline @Override public final - Byte256Vector toVector() { - return (Byte256Vector) super.toVectorTemplate(); // specialize + ByteVector256 toVector() { + return (ByteVector256) super.toVectorTemplate(); // specialize } /** @@ -728,25 +734,25 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline /*package-private*/ - Byte256Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Byte256Mask) VectorSupport.indexPartiallyInUpperRange( - Byte256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Byte256Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ByteMask256 indexPartiallyInUpperRange(long offset, long limit) { + return (ByteMask256) VectorSupport.indexPartiallyInUpperRange( + ByteMask256.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ByteMask256) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Byte256Mask not() { + public ByteMask256 not() { return xor(maskAll(true)); } @Override @ForceInline - public Byte256Mask compress() { - return (Byte256Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Byte256Vector.class, Byte256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ByteMask256 compress() { + return (ByteMask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ByteVector256.class, ByteMask256.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -755,30 +761,30 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline - public Byte256Mask and(VectorMask mask) { + public ByteMask256 and(VectorMask mask) { Objects.requireNonNull(mask); - Byte256Mask m = (Byte256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask256 m = (ByteMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Byte256Mask or(VectorMask mask) { + public ByteMask256 or(VectorMask mask) { Objects.requireNonNull(mask); - Byte256Mask m = (Byte256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask256 m = (ByteMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Byte256Mask xor(VectorMask mask) { + public ByteMask256 xor(VectorMask mask) { Objects.requireNonNull(mask); - Byte256Mask m = (Byte256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask256 m = (ByteMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -788,21 +794,21 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -812,7 +818,7 @@ final class Byte256Vector extends ByteVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -822,7 +828,7 @@ final class Byte256Vector extends ByteVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Byte256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ByteMask256.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -831,48 +837,49 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Byte256Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ByteMask256)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Byte256Mask)m).getBits())); + (m, __) -> allTrueHelper(((ByteMask256)m).getBits())); } @ForceInline /*package-private*/ - static Byte256Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Byte256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ByteMask256 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ByteMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Byte256Mask TRUE_MASK = new Byte256Mask(true); - private static final Byte256Mask FALSE_MASK = new Byte256Mask(false); + private static final ByteMask256 TRUE_MASK = new ByteMask256(true); + private static final ByteMask256 FALSE_MASK = new ByteMask256(false); } // Shuffle - static final class Byte256Shuffle extends AbstractShuffle { + static final class ByteShuffle256 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte256Shuffle(byte[] indices) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteShuffle256(byte[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Byte256Shuffle(int[] indices, int i) { + ByteShuffle256(int[] indices, int i) { this(prepare(indices, i)); } - Byte256Shuffle(IntUnaryOperator fn) { + ByteShuffle256(IntUnaryOperator fn) { this(prepare(fn)); } @@ -892,23 +899,23 @@ final class Byte256Vector extends ByteVector { assert(VLENGTH < Byte.MAX_VALUE); assert(Byte.MIN_VALUE <= -VLENGTH); } - static final Byte256Shuffle IOTA = new Byte256Shuffle(IDENTITY); + static final ByteShuffle256 IOTA = new ByteShuffle256(IDENTITY); @Override @ForceInline - public Byte256Vector toVector() { + public ByteVector256 toVector() { return toBitsVector(); } @Override @ForceInline - Byte256Vector toBitsVector() { - return (Byte256Vector) super.toBitsVectorTemplate(); + ByteVector256 toBitsVector() { + return (ByteVector256) super.toBitsVectorTemplate(); } @Override - Byte256Vector toBitsVector0() { - return ((Byte256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ByteVector256 toBitsVector0() { + return ((ByteVector256) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -957,30 +964,30 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline - public final Byte256Mask laneIsValid() { - return (Byte256Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ByteMask256 laneIsValid() { + return (ByteMask256) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Byte256Shuffle rearrange(VectorShuffle shuffle) { - Byte256Shuffle concreteShuffle = (Byte256Shuffle) shuffle; - return (Byte256Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ByteShuffle256 rearrange(VectorShuffle shuffle) { + ByteShuffle256 concreteShuffle = (ByteShuffle256) shuffle; + return (ByteShuffle256) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Byte256Shuffle wrapIndexes() { - Byte256Vector v = toBitsVector(); + public final ByteShuffle256 wrapIndexes() { + ByteVector256 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Byte256Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ByteVector256) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Byte256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ByteVector256) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Byte256Shuffle) v.toShuffle(vspecies(), false); + return (ByteShuffle256) v.toShuffle(vspecies(), false); } private static byte[] prepare(int[] indices, int offset) { @@ -1031,14 +1038,14 @@ final class Byte256Vector extends ByteVector { @Override final ByteVector fromArray0(byte[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ByteMask256.class, a, offset, (ByteMask256) m, offsetInRange); // specialize } @ForceInline @Override final ByteVector fromArray0(byte[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Byte256Mask.class, a, offset, indexMap, mapOffset, (Byte256Mask) m); + return super.fromArray0Template(ByteMask256.class, a, offset, indexMap, mapOffset, (ByteMask256) m); } @@ -1053,7 +1060,7 @@ final class Byte256Vector extends ByteVector { @Override final ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m, offsetInRange); // specialize + return super.fromBooleanArray0Template(ByteMask256.class, a, offset, (ByteMask256) m, offsetInRange); // specialize } @ForceInline @@ -1067,7 +1074,7 @@ final class Byte256Vector extends ByteVector { @Override final ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Byte256Mask.class, ms, offset, (Byte256Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ByteMask256.class, ms, offset, (ByteMask256) m, offsetInRange); // specialize } @ForceInline @@ -1081,7 +1088,7 @@ final class Byte256Vector extends ByteVector { @Override final void intoArray0(byte[] a, int offset, VectorMask m) { - super.intoArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); + super.intoArray0Template(ByteMask256.class, a, offset, (ByteMask256) m); } @@ -1089,14 +1096,14 @@ final class Byte256Vector extends ByteVector { @Override final void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { - super.intoBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); + super.intoBooleanArray0Template(ByteMask256.class, a, offset, (ByteMask256) m); } @ForceInline @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Byte256Mask.class, ms, offset, (Byte256Mask) m); + super.intoMemorySegment0Template(ByteMask256.class, ms, offset, (ByteMask256) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector512.java similarity index 71% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector512.java index b1df6949e3a..138319b60d4 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector512.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Byte512Vector extends ByteVector { +final class ByteVector512 extends ByteVector { static final ByteSpecies VSPECIES = (ByteSpecies) ByteVector.SPECIES_512; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Byte512Vector.class; + static final Class VCLASS = ByteVector512.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = byte.class; // carrier type used by the JVM + static final Class ETYPE = byte.class; // used by the JVM - Byte512Vector(byte[] v) { + ByteVector512(byte[] v) { super(v); } - // For compatibility as Byte512Vector::new, + // For compatibility as ByteVector512::new, // stored into species.vectorFactory. - Byte512Vector(Object v) { + ByteVector512(Object v) { this((byte[]) v); } - static final Byte512Vector ZERO = new Byte512Vector(new byte[VLENGTH]); - static final Byte512Vector IOTA = new Byte512Vector(VSPECIES.iotaArray()); + static final ByteVector512 ZERO = new ByteVector512(new byte[VLENGTH]); + static final ByteVector512 IOTA = new ByteVector512(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Byte512Vector extends ByteVector { @Override public final Class elementType() { return byte.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Byte.SIZE; } @@ -130,51 +135,51 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline - public final Byte512Vector broadcast(byte e) { - return (Byte512Vector) super.broadcastTemplate(e); // specialize + public final ByteVector512 broadcast(byte e) { + return (ByteVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Byte512Vector broadcast(long e) { - return (Byte512Vector) super.broadcastTemplate(e); // specialize + public final ByteVector512 broadcast(long e) { + return (ByteVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Byte512Mask maskFromArray(boolean[] bits) { - return new Byte512Mask(bits); + ByteMask512 maskFromArray(boolean[] bits) { + return new ByteMask512(bits); } @Override @ForceInline - Byte512Shuffle iotaShuffle() { return Byte512Shuffle.IOTA; } + ByteShuffle512 iotaShuffle() { return ByteShuffle512.IOTA; } @Override @ForceInline - Byte512Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Byte512Shuffle) iotaShuffleTemplate((byte) start, (byte) step, wrap); + ByteShuffle512 iotaShuffle(int start, int step, boolean wrap) { + return (ByteShuffle512) iotaShuffleTemplate((byte) start, (byte) step, wrap); } @Override @ForceInline - Byte512Shuffle shuffleFromArray(int[] indices, int i) { return new Byte512Shuffle(indices, i); } + ByteShuffle512 shuffleFromArray(int[] indices, int i) { return new ByteShuffle512(indices, i); } @Override @ForceInline - Byte512Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Byte512Shuffle(fn); } + ByteShuffle512 shuffleFromOp(IntUnaryOperator fn) { return new ByteShuffle512(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Byte512Vector vectorFactory(byte[] vec) { - return new Byte512Vector(vec); + ByteVector512 vectorFactory(byte[] vec) { + return new ByteVector512(vec); } @ForceInline final @Override - Byte512Vector asByteVectorRaw() { - return (Byte512Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector512 asByteVectorRaw() { + return (ByteVector512) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Byte512Vector extends ByteVector { @ForceInline final @Override - Byte512Vector uOp(FUnOp f) { - return (Byte512Vector) super.uOpTemplate(f); // specialize + ByteVector512 uOp(FUnOp f) { + return (ByteVector512) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Byte512Vector uOp(VectorMask m, FUnOp f) { - return (Byte512Vector) - super.uOpTemplate((Byte512Mask)m, f); // specialize + ByteVector512 uOp(VectorMask m, FUnOp f) { + return (ByteVector512) + super.uOpTemplate((ByteMask512)m, f); // specialize } // Binary operator @ForceInline final @Override - Byte512Vector bOp(Vector v, FBinOp f) { - return (Byte512Vector) super.bOpTemplate((Byte512Vector)v, f); // specialize + ByteVector512 bOp(Vector v, FBinOp f) { + return (ByteVector512) super.bOpTemplate((ByteVector512)v, f); // specialize } @ForceInline final @Override - Byte512Vector bOp(Vector v, + ByteVector512 bOp(Vector v, VectorMask m, FBinOp f) { - return (Byte512Vector) - super.bOpTemplate((Byte512Vector)v, (Byte512Mask)m, + return (ByteVector512) + super.bOpTemplate((ByteVector512)v, (ByteMask512)m, f); // specialize } @@ -219,19 +224,19 @@ final class Byte512Vector extends ByteVector { @ForceInline final @Override - Byte512Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Byte512Vector) - super.tOpTemplate((Byte512Vector)v1, (Byte512Vector)v2, + ByteVector512 tOp(Vector v1, Vector v2, FTriOp f) { + return (ByteVector512) + super.tOpTemplate((ByteVector512)v1, (ByteVector512)v2, f); // specialize } @ForceInline final @Override - Byte512Vector tOp(Vector v1, Vector v2, + ByteVector512 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Byte512Vector) - super.tOpTemplate((Byte512Vector)v1, (Byte512Vector)v2, - (Byte512Mask)m, f); // specialize + return (ByteVector512) + super.tOpTemplate((ByteVector512)v1, (ByteVector512)v2, + (ByteMask512)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline - public Byte512Vector lanewise(Unary op) { - return (Byte512Vector) super.lanewiseTemplate(op); // specialize + public ByteVector512 lanewise(Unary op) { + return (ByteVector512) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Byte512Vector lanewise(Unary op, VectorMask m) { - return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialize + public ByteVector512 lanewise(Unary op, VectorMask m) { + return (ByteVector512) super.lanewiseTemplate(op, ByteMask512.class, (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector lanewise(Binary op, Vector v) { - return (Byte512Vector) super.lanewiseTemplate(op, v); // specialize + public ByteVector512 lanewise(Binary op, Vector v) { + return (ByteVector512) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Byte512Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, v, (Byte512Mask) m); // specialize + public ByteVector512 lanewise(Binary op, Vector v, VectorMask m) { + return (ByteVector512) super.lanewiseTemplate(op, ByteMask512.class, v, (ByteMask512) m); // specialize } /*package-private*/ @Override - @ForceInline Byte512Vector + @ForceInline ByteVector512 lanewiseShift(VectorOperators.Binary op, int e) { - return (Byte512Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ByteVector512) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Byte512Vector + @ForceInline ByteVector512 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Byte512Vector) super.lanewiseShiftTemplate(op, Byte512Mask.class, e, (Byte512Mask) m); // specialize + return (ByteVector512) super.lanewiseShiftTemplate(op, ByteMask512.class, e, (ByteMask512) m); // specialize } /*package-private*/ @Override @ForceInline public final - Byte512Vector + ByteVector512 lanewise(Ternary op, Vector v1, Vector v2) { - return (Byte512Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ByteVector512) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Byte512Vector + ByteVector512 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, v1, v2, (Byte512Mask) m); // specialize + return (ByteVector512) super.lanewiseTemplate(op, ByteMask512.class, v1, v2, (ByteMask512) m); // specialize } @Override @ForceInline public final - Byte512Vector addIndex(int scale) { - return (Byte512Vector) super.addIndexTemplate(scale); // specialize + ByteVector512 addIndex(int scale) { + return (ByteVector512) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Byte512Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialized + return super.reduceLanesTemplate(op, ByteMask512.class, (ByteMask512) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Byte512Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ByteMask512.class, (ByteMask512) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline - public final Byte512Shuffle toShuffle() { - return (Byte512Shuffle) toShuffle(vspecies(), false); + public final ByteShuffle512 toShuffle() { + return (ByteShuffle512) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Byte512Mask test(Test op) { - return super.testTemplate(Byte512Mask.class, op); // specialize + public final ByteMask512 test(Test op) { + return super.testTemplate(ByteMask512.class, op); // specialize } @Override @ForceInline - public final Byte512Mask test(Test op, VectorMask m) { - return super.testTemplate(Byte512Mask.class, op, (Byte512Mask) m); // specialize + public final ByteMask512 test(Test op, VectorMask m) { + return super.testTemplate(ByteMask512.class, op, (ByteMask512) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Byte512Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Byte512Mask.class, op, v); // specialize + public final ByteMask512 compare(Comparison op, Vector v) { + return super.compareTemplate(ByteMask512.class, op, v); // specialize } @Override @ForceInline - public final Byte512Mask compare(Comparison op, byte s) { - return super.compareTemplate(Byte512Mask.class, op, s); // specialize + public final ByteMask512 compare(Comparison op, byte s) { + return super.compareTemplate(ByteMask512.class, op, s); // specialize } @Override @ForceInline - public final Byte512Mask compare(Comparison op, long s) { - return super.compareTemplate(Byte512Mask.class, op, s); // specialize + public final ByteMask512 compare(Comparison op, long s) { + return super.compareTemplate(ByteMask512.class, op, s); // specialize } @Override @ForceInline - public final Byte512Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Byte512Mask.class, op, v, (Byte512Mask) m); + public final ByteMask512 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ByteMask512.class, op, v, (ByteMask512) m); } @Override @ForceInline - public Byte512Vector blend(Vector v, VectorMask m) { - return (Byte512Vector) - super.blendTemplate(Byte512Mask.class, - (Byte512Vector) v, - (Byte512Mask) m); // specialize + public ByteVector512 blend(Vector v, VectorMask m) { + return (ByteVector512) + super.blendTemplate(ByteMask512.class, + (ByteVector512) v, + (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector slice(int origin, Vector v) { - return (Byte512Vector) super.sliceTemplate(origin, v); // specialize + public ByteVector512 slice(int origin, Vector v) { + return (ByteVector512) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Byte512Vector slice(int origin) { - return (Byte512Vector) super.sliceTemplate(origin); // specialize + public ByteVector512 slice(int origin) { + return (ByteVector512) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Byte512Vector unslice(int origin, Vector w, int part) { - return (Byte512Vector) super.unsliceTemplate(origin, w, part); // specialize + public ByteVector512 unslice(int origin, Vector w, int part) { + return (ByteVector512) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Byte512Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Byte512Vector) - super.unsliceTemplate(Byte512Mask.class, + public ByteVector512 unslice(int origin, Vector w, int part, VectorMask m) { + return (ByteVector512) + super.unsliceTemplate(ByteMask512.class, origin, w, part, - (Byte512Mask) m); // specialize + (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector unslice(int origin) { - return (Byte512Vector) super.unsliceTemplate(origin); // specialize + public ByteVector512 unslice(int origin) { + return (ByteVector512) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Byte512Vector rearrange(VectorShuffle s) { - return (Byte512Vector) - super.rearrangeTemplate(Byte512Shuffle.class, - (Byte512Shuffle) s); // specialize + public ByteVector512 rearrange(VectorShuffle s) { + return (ByteVector512) + super.rearrangeTemplate(ByteShuffle512.class, + (ByteShuffle512) s); // specialize } @Override @ForceInline - public Byte512Vector rearrange(VectorShuffle shuffle, + public ByteVector512 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Byte512Vector) - super.rearrangeTemplate(Byte512Shuffle.class, - Byte512Mask.class, - (Byte512Shuffle) shuffle, - (Byte512Mask) m); // specialize + return (ByteVector512) + super.rearrangeTemplate(ByteShuffle512.class, + ByteMask512.class, + (ByteShuffle512) shuffle, + (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector rearrange(VectorShuffle s, + public ByteVector512 rearrange(VectorShuffle s, Vector v) { - return (Byte512Vector) - super.rearrangeTemplate(Byte512Shuffle.class, - (Byte512Shuffle) s, - (Byte512Vector) v); // specialize + return (ByteVector512) + super.rearrangeTemplate(ByteShuffle512.class, + (ByteShuffle512) s, + (ByteVector512) v); // specialize } @Override @ForceInline - public Byte512Vector compress(VectorMask m) { - return (Byte512Vector) - super.compressTemplate(Byte512Mask.class, - (Byte512Mask) m); // specialize + public ByteVector512 compress(VectorMask m) { + return (ByteVector512) + super.compressTemplate(ByteMask512.class, + (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector expand(VectorMask m) { - return (Byte512Vector) - super.expandTemplate(Byte512Mask.class, - (Byte512Mask) m); // specialize + public ByteVector512 expand(VectorMask m) { + return (ByteVector512) + super.expandTemplate(ByteMask512.class, + (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector selectFrom(Vector v) { - return (Byte512Vector) - super.selectFromTemplate((Byte512Vector) v); // specialize + public ByteVector512 selectFrom(Vector v) { + return (ByteVector512) + super.selectFromTemplate((ByteVector512) v); // specialize } @Override @ForceInline - public Byte512Vector selectFrom(Vector v, + public ByteVector512 selectFrom(Vector v, VectorMask m) { - return (Byte512Vector) - super.selectFromTemplate((Byte512Vector) v, - Byte512Mask.class, (Byte512Mask) m); // specialize + return (ByteVector512) + super.selectFromTemplate((ByteVector512) v, + ByteMask512.class, (ByteMask512) m); // specialize } @Override @ForceInline - public Byte512Vector selectFrom(Vector v1, + public ByteVector512 selectFrom(Vector v1, Vector v2) { - return (Byte512Vector) - super.selectFromTemplate((Byte512Vector) v1, (Byte512Vector) v2); // specialize + return (ByteVector512) + super.selectFromTemplate((ByteVector512) v1, (ByteVector512) v2); // specialize } @ForceInline @@ -606,7 +611,7 @@ final class Byte512Vector extends ByteVector { @ForceInline @Override - public Byte512Vector withLane(int i, byte e) { + public ByteVector512 withLane(int i, byte e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -677,7 +682,7 @@ final class Byte512Vector extends ByteVector { } @ForceInline - public Byte512Vector withLaneHelper(int i, byte e) { + public ByteVector512 withLaneHelper(int i, byte e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -690,19 +695,20 @@ final class Byte512Vector extends ByteVector { // Mask - static final class Byte512Mask extends AbstractMask { + static final class ByteMask512 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte512Mask(boolean[] bits) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteMask512(boolean[] bits) { this(bits, 0); } - Byte512Mask(boolean[] bits, int offset) { + ByteMask512(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Byte512Mask(boolean val) { + ByteMask512(boolean val) { super(prepare(val)); } @@ -735,31 +741,31 @@ final class Byte512Vector extends ByteVector { } @Override - Byte512Mask uOp(MUnOp f) { + ByteMask512 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Byte512Mask(res); + return new ByteMask512(res); } @Override - Byte512Mask bOp(VectorMask m, MBinOp f) { + ByteMask512 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Byte512Mask)m).getBits(); + boolean[] mbits = ((ByteMask512)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Byte512Mask(res); + return new ByteMask512(res); } @ForceInline @Override public final - Byte512Vector toVector() { - return (Byte512Vector) super.toVectorTemplate(); // specialize + ByteVector512 toVector() { + return (ByteVector512) super.toVectorTemplate(); // specialize } /** @@ -792,25 +798,25 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline /*package-private*/ - Byte512Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Byte512Mask) VectorSupport.indexPartiallyInUpperRange( - Byte512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Byte512Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ByteMask512 indexPartiallyInUpperRange(long offset, long limit) { + return (ByteMask512) VectorSupport.indexPartiallyInUpperRange( + ByteMask512.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ByteMask512) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Byte512Mask not() { + public ByteMask512 not() { return xor(maskAll(true)); } @Override @ForceInline - public Byte512Mask compress() { - return (Byte512Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Byte512Vector.class, Byte512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ByteMask512 compress() { + return (ByteMask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ByteVector512.class, ByteMask512.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -819,30 +825,30 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline - public Byte512Mask and(VectorMask mask) { + public ByteMask512 and(VectorMask mask) { Objects.requireNonNull(mask); - Byte512Mask m = (Byte512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask512 m = (ByteMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Byte512Mask or(VectorMask mask) { + public ByteMask512 or(VectorMask mask) { Objects.requireNonNull(mask); - Byte512Mask m = (Byte512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask512 m = (ByteMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Byte512Mask xor(VectorMask mask) { + public ByteMask512 xor(VectorMask mask) { Objects.requireNonNull(mask); - Byte512Mask m = (Byte512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask512 m = (ByteMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -852,21 +858,21 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -876,7 +882,7 @@ final class Byte512Vector extends ByteVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -886,7 +892,7 @@ final class Byte512Vector extends ByteVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Byte512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ByteMask512.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -895,48 +901,49 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Byte512Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ByteMask512)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Byte512Mask)m).getBits())); + (m, __) -> allTrueHelper(((ByteMask512)m).getBits())); } @ForceInline /*package-private*/ - static Byte512Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Byte512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ByteMask512 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ByteMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Byte512Mask TRUE_MASK = new Byte512Mask(true); - private static final Byte512Mask FALSE_MASK = new Byte512Mask(false); + private static final ByteMask512 TRUE_MASK = new ByteMask512(true); + private static final ByteMask512 FALSE_MASK = new ByteMask512(false); } // Shuffle - static final class Byte512Shuffle extends AbstractShuffle { + static final class ByteShuffle512 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte512Shuffle(byte[] indices) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteShuffle512(byte[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Byte512Shuffle(int[] indices, int i) { + ByteShuffle512(int[] indices, int i) { this(prepare(indices, i)); } - Byte512Shuffle(IntUnaryOperator fn) { + ByteShuffle512(IntUnaryOperator fn) { this(prepare(fn)); } @@ -956,23 +963,23 @@ final class Byte512Vector extends ByteVector { assert(VLENGTH < Byte.MAX_VALUE); assert(Byte.MIN_VALUE <= -VLENGTH); } - static final Byte512Shuffle IOTA = new Byte512Shuffle(IDENTITY); + static final ByteShuffle512 IOTA = new ByteShuffle512(IDENTITY); @Override @ForceInline - public Byte512Vector toVector() { + public ByteVector512 toVector() { return toBitsVector(); } @Override @ForceInline - Byte512Vector toBitsVector() { - return (Byte512Vector) super.toBitsVectorTemplate(); + ByteVector512 toBitsVector() { + return (ByteVector512) super.toBitsVectorTemplate(); } @Override - Byte512Vector toBitsVector0() { - return ((Byte512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ByteVector512 toBitsVector0() { + return ((ByteVector512) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -1021,30 +1028,30 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline - public final Byte512Mask laneIsValid() { - return (Byte512Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ByteMask512 laneIsValid() { + return (ByteMask512) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Byte512Shuffle rearrange(VectorShuffle shuffle) { - Byte512Shuffle concreteShuffle = (Byte512Shuffle) shuffle; - return (Byte512Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ByteShuffle512 rearrange(VectorShuffle shuffle) { + ByteShuffle512 concreteShuffle = (ByteShuffle512) shuffle; + return (ByteShuffle512) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Byte512Shuffle wrapIndexes() { - Byte512Vector v = toBitsVector(); + public final ByteShuffle512 wrapIndexes() { + ByteVector512 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Byte512Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ByteVector512) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Byte512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ByteVector512) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Byte512Shuffle) v.toShuffle(vspecies(), false); + return (ByteShuffle512) v.toShuffle(vspecies(), false); } private static byte[] prepare(int[] indices, int offset) { @@ -1095,14 +1102,14 @@ final class Byte512Vector extends ByteVector { @Override final ByteVector fromArray0(byte[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ByteMask512.class, a, offset, (ByteMask512) m, offsetInRange); // specialize } @ForceInline @Override final ByteVector fromArray0(byte[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Byte512Mask.class, a, offset, indexMap, mapOffset, (Byte512Mask) m); + return super.fromArray0Template(ByteMask512.class, a, offset, indexMap, mapOffset, (ByteMask512) m); } @@ -1117,7 +1124,7 @@ final class Byte512Vector extends ByteVector { @Override final ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m, offsetInRange); // specialize + return super.fromBooleanArray0Template(ByteMask512.class, a, offset, (ByteMask512) m, offsetInRange); // specialize } @ForceInline @@ -1131,7 +1138,7 @@ final class Byte512Vector extends ByteVector { @Override final ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Byte512Mask.class, ms, offset, (Byte512Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ByteMask512.class, ms, offset, (ByteMask512) m, offsetInRange); // specialize } @ForceInline @@ -1145,7 +1152,7 @@ final class Byte512Vector extends ByteVector { @Override final void intoArray0(byte[] a, int offset, VectorMask m) { - super.intoArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); + super.intoArray0Template(ByteMask512.class, a, offset, (ByteMask512) m); } @@ -1153,14 +1160,14 @@ final class Byte512Vector extends ByteVector { @Override final void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { - super.intoBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); + super.intoBooleanArray0Template(ByteMask512.class, a, offset, (ByteMask512) m); } @ForceInline @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Byte512Mask.class, ms, offset, (Byte512Mask) m); + super.intoMemorySegment0Template(ByteMask512.class, ms, offset, (ByteMask512) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector64.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector64.java index dfd16e1812a..d7c7c78534b 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector64.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Byte64Vector extends ByteVector { +final class ByteVector64 extends ByteVector { static final ByteSpecies VSPECIES = (ByteSpecies) ByteVector.SPECIES_64; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Byte64Vector.class; + static final Class VCLASS = ByteVector64.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = byte.class; // carrier type used by the JVM + static final Class ETYPE = byte.class; // used by the JVM - Byte64Vector(byte[] v) { + ByteVector64(byte[] v) { super(v); } - // For compatibility as Byte64Vector::new, + // For compatibility as ByteVector64::new, // stored into species.vectorFactory. - Byte64Vector(Object v) { + ByteVector64(Object v) { this((byte[]) v); } - static final Byte64Vector ZERO = new Byte64Vector(new byte[VLENGTH]); - static final Byte64Vector IOTA = new Byte64Vector(VSPECIES.iotaArray()); + static final ByteVector64 ZERO = new ByteVector64(new byte[VLENGTH]); + static final ByteVector64 IOTA = new ByteVector64(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Byte64Vector extends ByteVector { @Override public final Class elementType() { return byte.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Byte.SIZE; } @@ -130,51 +135,51 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline - public final Byte64Vector broadcast(byte e) { - return (Byte64Vector) super.broadcastTemplate(e); // specialize + public final ByteVector64 broadcast(byte e) { + return (ByteVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Byte64Vector broadcast(long e) { - return (Byte64Vector) super.broadcastTemplate(e); // specialize + public final ByteVector64 broadcast(long e) { + return (ByteVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Byte64Mask maskFromArray(boolean[] bits) { - return new Byte64Mask(bits); + ByteMask64 maskFromArray(boolean[] bits) { + return new ByteMask64(bits); } @Override @ForceInline - Byte64Shuffle iotaShuffle() { return Byte64Shuffle.IOTA; } + ByteShuffle64 iotaShuffle() { return ByteShuffle64.IOTA; } @Override @ForceInline - Byte64Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Byte64Shuffle) iotaShuffleTemplate((byte) start, (byte) step, wrap); + ByteShuffle64 iotaShuffle(int start, int step, boolean wrap) { + return (ByteShuffle64) iotaShuffleTemplate((byte) start, (byte) step, wrap); } @Override @ForceInline - Byte64Shuffle shuffleFromArray(int[] indices, int i) { return new Byte64Shuffle(indices, i); } + ByteShuffle64 shuffleFromArray(int[] indices, int i) { return new ByteShuffle64(indices, i); } @Override @ForceInline - Byte64Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Byte64Shuffle(fn); } + ByteShuffle64 shuffleFromOp(IntUnaryOperator fn) { return new ByteShuffle64(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Byte64Vector vectorFactory(byte[] vec) { - return new Byte64Vector(vec); + ByteVector64 vectorFactory(byte[] vec) { + return new ByteVector64(vec); } @ForceInline final @Override - Byte64Vector asByteVectorRaw() { - return (Byte64Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector64 asByteVectorRaw() { + return (ByteVector64) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Byte64Vector extends ByteVector { @ForceInline final @Override - Byte64Vector uOp(FUnOp f) { - return (Byte64Vector) super.uOpTemplate(f); // specialize + ByteVector64 uOp(FUnOp f) { + return (ByteVector64) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Byte64Vector uOp(VectorMask m, FUnOp f) { - return (Byte64Vector) - super.uOpTemplate((Byte64Mask)m, f); // specialize + ByteVector64 uOp(VectorMask m, FUnOp f) { + return (ByteVector64) + super.uOpTemplate((ByteMask64)m, f); // specialize } // Binary operator @ForceInline final @Override - Byte64Vector bOp(Vector v, FBinOp f) { - return (Byte64Vector) super.bOpTemplate((Byte64Vector)v, f); // specialize + ByteVector64 bOp(Vector v, FBinOp f) { + return (ByteVector64) super.bOpTemplate((ByteVector64)v, f); // specialize } @ForceInline final @Override - Byte64Vector bOp(Vector v, + ByteVector64 bOp(Vector v, VectorMask m, FBinOp f) { - return (Byte64Vector) - super.bOpTemplate((Byte64Vector)v, (Byte64Mask)m, + return (ByteVector64) + super.bOpTemplate((ByteVector64)v, (ByteMask64)m, f); // specialize } @@ -219,19 +224,19 @@ final class Byte64Vector extends ByteVector { @ForceInline final @Override - Byte64Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Byte64Vector) - super.tOpTemplate((Byte64Vector)v1, (Byte64Vector)v2, + ByteVector64 tOp(Vector v1, Vector v2, FTriOp f) { + return (ByteVector64) + super.tOpTemplate((ByteVector64)v1, (ByteVector64)v2, f); // specialize } @ForceInline final @Override - Byte64Vector tOp(Vector v1, Vector v2, + ByteVector64 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Byte64Vector) - super.tOpTemplate((Byte64Vector)v1, (Byte64Vector)v2, - (Byte64Mask)m, f); // specialize + return (ByteVector64) + super.tOpTemplate((ByteVector64)v1, (ByteVector64)v2, + (ByteMask64)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline - public Byte64Vector lanewise(Unary op) { - return (Byte64Vector) super.lanewiseTemplate(op); // specialize + public ByteVector64 lanewise(Unary op) { + return (ByteVector64) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Byte64Vector lanewise(Unary op, VectorMask m) { - return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialize + public ByteVector64 lanewise(Unary op, VectorMask m) { + return (ByteVector64) super.lanewiseTemplate(op, ByteMask64.class, (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector lanewise(Binary op, Vector v) { - return (Byte64Vector) super.lanewiseTemplate(op, v); // specialize + public ByteVector64 lanewise(Binary op, Vector v) { + return (ByteVector64) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Byte64Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v, (Byte64Mask) m); // specialize + public ByteVector64 lanewise(Binary op, Vector v, VectorMask m) { + return (ByteVector64) super.lanewiseTemplate(op, ByteMask64.class, v, (ByteMask64) m); // specialize } /*package-private*/ @Override - @ForceInline Byte64Vector + @ForceInline ByteVector64 lanewiseShift(VectorOperators.Binary op, int e) { - return (Byte64Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ByteVector64) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Byte64Vector + @ForceInline ByteVector64 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Byte64Vector) super.lanewiseShiftTemplate(op, Byte64Mask.class, e, (Byte64Mask) m); // specialize + return (ByteVector64) super.lanewiseShiftTemplate(op, ByteMask64.class, e, (ByteMask64) m); // specialize } /*package-private*/ @Override @ForceInline public final - Byte64Vector + ByteVector64 lanewise(Ternary op, Vector v1, Vector v2) { - return (Byte64Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ByteVector64) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Byte64Vector + ByteVector64 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v1, v2, (Byte64Mask) m); // specialize + return (ByteVector64) super.lanewiseTemplate(op, ByteMask64.class, v1, v2, (ByteMask64) m); // specialize } @Override @ForceInline public final - Byte64Vector addIndex(int scale) { - return (Byte64Vector) super.addIndexTemplate(scale); // specialize + ByteVector64 addIndex(int scale) { + return (ByteVector64) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Byte64Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialized + return super.reduceLanesTemplate(op, ByteMask64.class, (ByteMask64) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Byte64Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ByteMask64.class, (ByteMask64) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline - public final Byte64Shuffle toShuffle() { - return (Byte64Shuffle) toShuffle(vspecies(), false); + public final ByteShuffle64 toShuffle() { + return (ByteShuffle64) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Byte64Mask test(Test op) { - return super.testTemplate(Byte64Mask.class, op); // specialize + public final ByteMask64 test(Test op) { + return super.testTemplate(ByteMask64.class, op); // specialize } @Override @ForceInline - public final Byte64Mask test(Test op, VectorMask m) { - return super.testTemplate(Byte64Mask.class, op, (Byte64Mask) m); // specialize + public final ByteMask64 test(Test op, VectorMask m) { + return super.testTemplate(ByteMask64.class, op, (ByteMask64) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Byte64Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Byte64Mask.class, op, v); // specialize + public final ByteMask64 compare(Comparison op, Vector v) { + return super.compareTemplate(ByteMask64.class, op, v); // specialize } @Override @ForceInline - public final Byte64Mask compare(Comparison op, byte s) { - return super.compareTemplate(Byte64Mask.class, op, s); // specialize + public final ByteMask64 compare(Comparison op, byte s) { + return super.compareTemplate(ByteMask64.class, op, s); // specialize } @Override @ForceInline - public final Byte64Mask compare(Comparison op, long s) { - return super.compareTemplate(Byte64Mask.class, op, s); // specialize + public final ByteMask64 compare(Comparison op, long s) { + return super.compareTemplate(ByteMask64.class, op, s); // specialize } @Override @ForceInline - public final Byte64Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Byte64Mask.class, op, v, (Byte64Mask) m); + public final ByteMask64 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ByteMask64.class, op, v, (ByteMask64) m); } @Override @ForceInline - public Byte64Vector blend(Vector v, VectorMask m) { - return (Byte64Vector) - super.blendTemplate(Byte64Mask.class, - (Byte64Vector) v, - (Byte64Mask) m); // specialize + public ByteVector64 blend(Vector v, VectorMask m) { + return (ByteVector64) + super.blendTemplate(ByteMask64.class, + (ByteVector64) v, + (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector slice(int origin, Vector v) { - return (Byte64Vector) super.sliceTemplate(origin, v); // specialize + public ByteVector64 slice(int origin, Vector v) { + return (ByteVector64) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Byte64Vector slice(int origin) { - return (Byte64Vector) super.sliceTemplate(origin); // specialize + public ByteVector64 slice(int origin) { + return (ByteVector64) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Byte64Vector unslice(int origin, Vector w, int part) { - return (Byte64Vector) super.unsliceTemplate(origin, w, part); // specialize + public ByteVector64 unslice(int origin, Vector w, int part) { + return (ByteVector64) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Byte64Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Byte64Vector) - super.unsliceTemplate(Byte64Mask.class, + public ByteVector64 unslice(int origin, Vector w, int part, VectorMask m) { + return (ByteVector64) + super.unsliceTemplate(ByteMask64.class, origin, w, part, - (Byte64Mask) m); // specialize + (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector unslice(int origin) { - return (Byte64Vector) super.unsliceTemplate(origin); // specialize + public ByteVector64 unslice(int origin) { + return (ByteVector64) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Byte64Vector rearrange(VectorShuffle s) { - return (Byte64Vector) - super.rearrangeTemplate(Byte64Shuffle.class, - (Byte64Shuffle) s); // specialize + public ByteVector64 rearrange(VectorShuffle s) { + return (ByteVector64) + super.rearrangeTemplate(ByteShuffle64.class, + (ByteShuffle64) s); // specialize } @Override @ForceInline - public Byte64Vector rearrange(VectorShuffle shuffle, + public ByteVector64 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Byte64Vector) - super.rearrangeTemplate(Byte64Shuffle.class, - Byte64Mask.class, - (Byte64Shuffle) shuffle, - (Byte64Mask) m); // specialize + return (ByteVector64) + super.rearrangeTemplate(ByteShuffle64.class, + ByteMask64.class, + (ByteShuffle64) shuffle, + (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector rearrange(VectorShuffle s, + public ByteVector64 rearrange(VectorShuffle s, Vector v) { - return (Byte64Vector) - super.rearrangeTemplate(Byte64Shuffle.class, - (Byte64Shuffle) s, - (Byte64Vector) v); // specialize + return (ByteVector64) + super.rearrangeTemplate(ByteShuffle64.class, + (ByteShuffle64) s, + (ByteVector64) v); // specialize } @Override @ForceInline - public Byte64Vector compress(VectorMask m) { - return (Byte64Vector) - super.compressTemplate(Byte64Mask.class, - (Byte64Mask) m); // specialize + public ByteVector64 compress(VectorMask m) { + return (ByteVector64) + super.compressTemplate(ByteMask64.class, + (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector expand(VectorMask m) { - return (Byte64Vector) - super.expandTemplate(Byte64Mask.class, - (Byte64Mask) m); // specialize + public ByteVector64 expand(VectorMask m) { + return (ByteVector64) + super.expandTemplate(ByteMask64.class, + (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector selectFrom(Vector v) { - return (Byte64Vector) - super.selectFromTemplate((Byte64Vector) v); // specialize + public ByteVector64 selectFrom(Vector v) { + return (ByteVector64) + super.selectFromTemplate((ByteVector64) v); // specialize } @Override @ForceInline - public Byte64Vector selectFrom(Vector v, + public ByteVector64 selectFrom(Vector v, VectorMask m) { - return (Byte64Vector) - super.selectFromTemplate((Byte64Vector) v, - Byte64Mask.class, (Byte64Mask) m); // specialize + return (ByteVector64) + super.selectFromTemplate((ByteVector64) v, + ByteMask64.class, (ByteMask64) m); // specialize } @Override @ForceInline - public Byte64Vector selectFrom(Vector v1, + public ByteVector64 selectFrom(Vector v1, Vector v2) { - return (Byte64Vector) - super.selectFromTemplate((Byte64Vector) v1, (Byte64Vector) v2); // specialize + return (ByteVector64) + super.selectFromTemplate((ByteVector64) v1, (ByteVector64) v2); // specialize } @ForceInline @@ -550,7 +555,7 @@ final class Byte64Vector extends ByteVector { @ForceInline @Override - public Byte64Vector withLane(int i, byte e) { + public ByteVector64 withLane(int i, byte e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -565,7 +570,7 @@ final class Byte64Vector extends ByteVector { } @ForceInline - public Byte64Vector withLaneHelper(int i, byte e) { + public ByteVector64 withLaneHelper(int i, byte e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -578,19 +583,20 @@ final class Byte64Vector extends ByteVector { // Mask - static final class Byte64Mask extends AbstractMask { + static final class ByteMask64 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte64Mask(boolean[] bits) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteMask64(boolean[] bits) { this(bits, 0); } - Byte64Mask(boolean[] bits, int offset) { + ByteMask64(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Byte64Mask(boolean val) { + ByteMask64(boolean val) { super(prepare(val)); } @@ -623,31 +629,31 @@ final class Byte64Vector extends ByteVector { } @Override - Byte64Mask uOp(MUnOp f) { + ByteMask64 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Byte64Mask(res); + return new ByteMask64(res); } @Override - Byte64Mask bOp(VectorMask m, MBinOp f) { + ByteMask64 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Byte64Mask)m).getBits(); + boolean[] mbits = ((ByteMask64)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Byte64Mask(res); + return new ByteMask64(res); } @ForceInline @Override public final - Byte64Vector toVector() { - return (Byte64Vector) super.toVectorTemplate(); // specialize + ByteVector64 toVector() { + return (ByteVector64) super.toVectorTemplate(); // specialize } /** @@ -680,25 +686,25 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline /*package-private*/ - Byte64Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Byte64Mask) VectorSupport.indexPartiallyInUpperRange( - Byte64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Byte64Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ByteMask64 indexPartiallyInUpperRange(long offset, long limit) { + return (ByteMask64) VectorSupport.indexPartiallyInUpperRange( + ByteMask64.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ByteMask64) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Byte64Mask not() { + public ByteMask64 not() { return xor(maskAll(true)); } @Override @ForceInline - public Byte64Mask compress() { - return (Byte64Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Byte64Vector.class, Byte64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ByteMask64 compress() { + return (ByteMask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ByteVector64.class, ByteMask64.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -707,30 +713,30 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline - public Byte64Mask and(VectorMask mask) { + public ByteMask64 and(VectorMask mask) { Objects.requireNonNull(mask); - Byte64Mask m = (Byte64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask64 m = (ByteMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Byte64Mask or(VectorMask mask) { + public ByteMask64 or(VectorMask mask) { Objects.requireNonNull(mask); - Byte64Mask m = (Byte64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask64 m = (ByteMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Byte64Mask xor(VectorMask mask) { + public ByteMask64 xor(VectorMask mask) { Objects.requireNonNull(mask); - Byte64Mask m = (Byte64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMask64 m = (ByteMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -740,21 +746,21 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -764,7 +770,7 @@ final class Byte64Vector extends ByteVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -774,7 +780,7 @@ final class Byte64Vector extends ByteVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Byte64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ByteMask64.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -783,48 +789,49 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Byte64Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ByteMask64)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Byte64Mask)m).getBits())); + (m, __) -> allTrueHelper(((ByteMask64)m).getBits())); } @ForceInline /*package-private*/ - static Byte64Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Byte64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ByteMask64 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ByteMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Byte64Mask TRUE_MASK = new Byte64Mask(true); - private static final Byte64Mask FALSE_MASK = new Byte64Mask(false); + private static final ByteMask64 TRUE_MASK = new ByteMask64(true); + private static final ByteMask64 FALSE_MASK = new ByteMask64(false); } // Shuffle - static final class Byte64Shuffle extends AbstractShuffle { + static final class ByteShuffle64 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - Byte64Shuffle(byte[] indices) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteShuffle64(byte[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Byte64Shuffle(int[] indices, int i) { + ByteShuffle64(int[] indices, int i) { this(prepare(indices, i)); } - Byte64Shuffle(IntUnaryOperator fn) { + ByteShuffle64(IntUnaryOperator fn) { this(prepare(fn)); } @@ -844,23 +851,23 @@ final class Byte64Vector extends ByteVector { assert(VLENGTH < Byte.MAX_VALUE); assert(Byte.MIN_VALUE <= -VLENGTH); } - static final Byte64Shuffle IOTA = new Byte64Shuffle(IDENTITY); + static final ByteShuffle64 IOTA = new ByteShuffle64(IDENTITY); @Override @ForceInline - public Byte64Vector toVector() { + public ByteVector64 toVector() { return toBitsVector(); } @Override @ForceInline - Byte64Vector toBitsVector() { - return (Byte64Vector) super.toBitsVectorTemplate(); + ByteVector64 toBitsVector() { + return (ByteVector64) super.toBitsVectorTemplate(); } @Override - Byte64Vector toBitsVector0() { - return ((Byte64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ByteVector64 toBitsVector0() { + return ((ByteVector64) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -909,30 +916,30 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline - public final Byte64Mask laneIsValid() { - return (Byte64Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ByteMask64 laneIsValid() { + return (ByteMask64) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Byte64Shuffle rearrange(VectorShuffle shuffle) { - Byte64Shuffle concreteShuffle = (Byte64Shuffle) shuffle; - return (Byte64Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ByteShuffle64 rearrange(VectorShuffle shuffle) { + ByteShuffle64 concreteShuffle = (ByteShuffle64) shuffle; + return (ByteShuffle64) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Byte64Shuffle wrapIndexes() { - Byte64Vector v = toBitsVector(); + public final ByteShuffle64 wrapIndexes() { + ByteVector64 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Byte64Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ByteVector64) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Byte64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ByteVector64) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Byte64Shuffle) v.toShuffle(vspecies(), false); + return (ByteShuffle64) v.toShuffle(vspecies(), false); } private static byte[] prepare(int[] indices, int offset) { @@ -983,14 +990,14 @@ final class Byte64Vector extends ByteVector { @Override final ByteVector fromArray0(byte[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ByteMask64.class, a, offset, (ByteMask64) m, offsetInRange); // specialize } @ForceInline @Override final ByteVector fromArray0(byte[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Byte64Mask.class, a, offset, indexMap, mapOffset, (Byte64Mask) m); + return super.fromArray0Template(ByteMask64.class, a, offset, indexMap, mapOffset, (ByteMask64) m); } @@ -1005,7 +1012,7 @@ final class Byte64Vector extends ByteVector { @Override final ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m, offsetInRange); // specialize + return super.fromBooleanArray0Template(ByteMask64.class, a, offset, (ByteMask64) m, offsetInRange); // specialize } @ForceInline @@ -1019,7 +1026,7 @@ final class Byte64Vector extends ByteVector { @Override final ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Byte64Mask.class, ms, offset, (Byte64Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ByteMask64.class, ms, offset, (ByteMask64) m, offsetInRange); // specialize } @ForceInline @@ -1033,7 +1040,7 @@ final class Byte64Vector extends ByteVector { @Override final void intoArray0(byte[] a, int offset, VectorMask m) { - super.intoArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); + super.intoArray0Template(ByteMask64.class, a, offset, (ByteMask64) m); } @@ -1041,14 +1048,14 @@ final class Byte64Vector extends ByteVector { @Override final void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { - super.intoBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); + super.intoBooleanArray0Template(ByteMask64.class, a, offset, (ByteMask64) m); } @ForceInline @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Byte64Mask.class, ms, offset, (Byte64Mask) m); + super.intoMemorySegment0Template(ByteMask64.class, ms, offset, (ByteMask64) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVectorMax.java similarity index 66% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVectorMax.java index 8c3cc68cece..636aa83893a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVectorMax.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class ByteMaxVector extends ByteVector { +final class ByteVectorMax extends ByteVector { static final ByteSpecies VSPECIES = (ByteSpecies) ByteVector.SPECIES_MAX; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = ByteMaxVector.class; + static final Class VCLASS = ByteVectorMax.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = byte.class; // carrier type used by the JVM + static final Class ETYPE = byte.class; // used by the JVM - ByteMaxVector(byte[] v) { + ByteVectorMax(byte[] v) { super(v); } - // For compatibility as ByteMaxVector::new, + // For compatibility as ByteVectorMax::new, // stored into species.vectorFactory. - ByteMaxVector(Object v) { + ByteVectorMax(Object v) { this((byte[]) v); } - static final ByteMaxVector ZERO = new ByteMaxVector(new byte[VLENGTH]); - static final ByteMaxVector IOTA = new ByteMaxVector(VSPECIES.iotaArray()); + static final ByteVectorMax ZERO = new ByteVectorMax(new byte[VLENGTH]); + static final ByteVectorMax IOTA = new ByteVectorMax(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class ByteMaxVector extends ByteVector { @Override public final Class elementType() { return byte.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Byte.SIZE; } @@ -130,51 +135,51 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline - public final ByteMaxVector broadcast(byte e) { - return (ByteMaxVector) super.broadcastTemplate(e); // specialize + public final ByteVectorMax broadcast(byte e) { + return (ByteVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final ByteMaxVector broadcast(long e) { - return (ByteMaxVector) super.broadcastTemplate(e); // specialize + public final ByteVectorMax broadcast(long e) { + return (ByteVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - ByteMaxMask maskFromArray(boolean[] bits) { - return new ByteMaxMask(bits); + ByteMaskMax maskFromArray(boolean[] bits) { + return new ByteMaskMax(bits); } @Override @ForceInline - ByteMaxShuffle iotaShuffle() { return ByteMaxShuffle.IOTA; } + ByteShuffleMax iotaShuffle() { return ByteShuffleMax.IOTA; } @Override @ForceInline - ByteMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - return (ByteMaxShuffle) iotaShuffleTemplate((byte) start, (byte) step, wrap); + ByteShuffleMax iotaShuffle(int start, int step, boolean wrap) { + return (ByteShuffleMax) iotaShuffleTemplate((byte) start, (byte) step, wrap); } @Override @ForceInline - ByteMaxShuffle shuffleFromArray(int[] indices, int i) { return new ByteMaxShuffle(indices, i); } + ByteShuffleMax shuffleFromArray(int[] indices, int i) { return new ByteShuffleMax(indices, i); } @Override @ForceInline - ByteMaxShuffle shuffleFromOp(IntUnaryOperator fn) { return new ByteMaxShuffle(fn); } + ByteShuffleMax shuffleFromOp(IntUnaryOperator fn) { return new ByteShuffleMax(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - ByteMaxVector vectorFactory(byte[] vec) { - return new ByteMaxVector(vec); + ByteVectorMax vectorFactory(byte[] vec) { + return new ByteVectorMax(vec); } @ForceInline final @Override - ByteMaxVector asByteVectorRaw() { - return (ByteMaxVector) super.asByteVectorRawTemplate(); // specialize + ByteVectorMax asByteVectorRaw() { + return (ByteVectorMax) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class ByteMaxVector extends ByteVector { @ForceInline final @Override - ByteMaxVector uOp(FUnOp f) { - return (ByteMaxVector) super.uOpTemplate(f); // specialize + ByteVectorMax uOp(FUnOp f) { + return (ByteVectorMax) super.uOpTemplate(f); // specialize } @ForceInline final @Override - ByteMaxVector uOp(VectorMask m, FUnOp f) { - return (ByteMaxVector) - super.uOpTemplate((ByteMaxMask)m, f); // specialize + ByteVectorMax uOp(VectorMask m, FUnOp f) { + return (ByteVectorMax) + super.uOpTemplate((ByteMaskMax)m, f); // specialize } // Binary operator @ForceInline final @Override - ByteMaxVector bOp(Vector v, FBinOp f) { - return (ByteMaxVector) super.bOpTemplate((ByteMaxVector)v, f); // specialize + ByteVectorMax bOp(Vector v, FBinOp f) { + return (ByteVectorMax) super.bOpTemplate((ByteVectorMax)v, f); // specialize } @ForceInline final @Override - ByteMaxVector bOp(Vector v, + ByteVectorMax bOp(Vector v, VectorMask m, FBinOp f) { - return (ByteMaxVector) - super.bOpTemplate((ByteMaxVector)v, (ByteMaxMask)m, + return (ByteVectorMax) + super.bOpTemplate((ByteVectorMax)v, (ByteMaskMax)m, f); // specialize } @@ -219,19 +224,19 @@ final class ByteMaxVector extends ByteVector { @ForceInline final @Override - ByteMaxVector tOp(Vector v1, Vector v2, FTriOp f) { - return (ByteMaxVector) - super.tOpTemplate((ByteMaxVector)v1, (ByteMaxVector)v2, + ByteVectorMax tOp(Vector v1, Vector v2, FTriOp f) { + return (ByteVectorMax) + super.tOpTemplate((ByteVectorMax)v1, (ByteVectorMax)v2, f); // specialize } @ForceInline final @Override - ByteMaxVector tOp(Vector v1, Vector v2, + ByteVectorMax tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (ByteMaxVector) - super.tOpTemplate((ByteMaxVector)v1, (ByteMaxVector)v2, - (ByteMaxMask)m, f); // specialize + return (ByteVectorMax) + super.tOpTemplate((ByteVectorMax)v1, (ByteVectorMax)v2, + (ByteMaskMax)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline - public ByteMaxVector lanewise(Unary op) { - return (ByteMaxVector) super.lanewiseTemplate(op); // specialize + public ByteVectorMax lanewise(Unary op) { + return (ByteVectorMax) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public ByteMaxVector lanewise(Unary op, VectorMask m) { - return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialize + public ByteVectorMax lanewise(Unary op, VectorMask m) { + return (ByteVectorMax) super.lanewiseTemplate(op, ByteMaskMax.class, (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector lanewise(Binary op, Vector v) { - return (ByteMaxVector) super.lanewiseTemplate(op, v); // specialize + public ByteVectorMax lanewise(Binary op, Vector v) { + return (ByteVectorMax) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public ByteMaxVector lanewise(Binary op, Vector v, VectorMask m) { - return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, v, (ByteMaxMask) m); // specialize + public ByteVectorMax lanewise(Binary op, Vector v, VectorMask m) { + return (ByteVectorMax) super.lanewiseTemplate(op, ByteMaskMax.class, v, (ByteMaskMax) m); // specialize } /*package-private*/ @Override - @ForceInline ByteMaxVector + @ForceInline ByteVectorMax lanewiseShift(VectorOperators.Binary op, int e) { - return (ByteMaxVector) super.lanewiseShiftTemplate(op, e); // specialize + return (ByteVectorMax) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline ByteMaxVector + @ForceInline ByteVectorMax lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (ByteMaxVector) super.lanewiseShiftTemplate(op, ByteMaxMask.class, e, (ByteMaxMask) m); // specialize + return (ByteVectorMax) super.lanewiseShiftTemplate(op, ByteMaskMax.class, e, (ByteMaskMax) m); // specialize } /*package-private*/ @Override @ForceInline public final - ByteMaxVector + ByteVectorMax lanewise(Ternary op, Vector v1, Vector v2) { - return (ByteMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ByteVectorMax) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - ByteMaxVector + ByteVectorMax lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, v1, v2, (ByteMaxMask) m); // specialize + return (ByteVectorMax) super.lanewiseTemplate(op, ByteMaskMax.class, v1, v2, (ByteMaskMax) m); // specialize } @Override @ForceInline public final - ByteMaxVector addIndex(int scale) { - return (ByteMaxVector) super.addIndexTemplate(scale); // specialize + ByteVectorMax addIndex(int scale) { + return (ByteVectorMax) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class ByteMaxVector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialized + return super.reduceLanesTemplate(op, ByteMaskMax.class, (ByteMaskMax) m); // specialized } @Override @@ -354,7 +359,7 @@ final class ByteMaxVector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialized + return (long) super.reduceLanesTemplate(op, ByteMaskMax.class, (ByteMaskMax) m); // specialized } @Override @@ -365,160 +370,160 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline - public final ByteMaxShuffle toShuffle() { - return (ByteMaxShuffle) toShuffle(vspecies(), false); + public final ByteShuffleMax toShuffle() { + return (ByteShuffleMax) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final ByteMaxMask test(Test op) { - return super.testTemplate(ByteMaxMask.class, op); // specialize + public final ByteMaskMax test(Test op) { + return super.testTemplate(ByteMaskMax.class, op); // specialize } @Override @ForceInline - public final ByteMaxMask test(Test op, VectorMask m) { - return super.testTemplate(ByteMaxMask.class, op, (ByteMaxMask) m); // specialize + public final ByteMaskMax test(Test op, VectorMask m) { + return super.testTemplate(ByteMaskMax.class, op, (ByteMaskMax) m); // specialize } // Specialized comparisons @Override @ForceInline - public final ByteMaxMask compare(Comparison op, Vector v) { - return super.compareTemplate(ByteMaxMask.class, op, v); // specialize + public final ByteMaskMax compare(Comparison op, Vector v) { + return super.compareTemplate(ByteMaskMax.class, op, v); // specialize } @Override @ForceInline - public final ByteMaxMask compare(Comparison op, byte s) { - return super.compareTemplate(ByteMaxMask.class, op, s); // specialize + public final ByteMaskMax compare(Comparison op, byte s) { + return super.compareTemplate(ByteMaskMax.class, op, s); // specialize } @Override @ForceInline - public final ByteMaxMask compare(Comparison op, long s) { - return super.compareTemplate(ByteMaxMask.class, op, s); // specialize + public final ByteMaskMax compare(Comparison op, long s) { + return super.compareTemplate(ByteMaskMax.class, op, s); // specialize } @Override @ForceInline - public final ByteMaxMask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(ByteMaxMask.class, op, v, (ByteMaxMask) m); + public final ByteMaskMax compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ByteMaskMax.class, op, v, (ByteMaskMax) m); } @Override @ForceInline - public ByteMaxVector blend(Vector v, VectorMask m) { - return (ByteMaxVector) - super.blendTemplate(ByteMaxMask.class, - (ByteMaxVector) v, - (ByteMaxMask) m); // specialize + public ByteVectorMax blend(Vector v, VectorMask m) { + return (ByteVectorMax) + super.blendTemplate(ByteMaskMax.class, + (ByteVectorMax) v, + (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector slice(int origin, Vector v) { - return (ByteMaxVector) super.sliceTemplate(origin, v); // specialize + public ByteVectorMax slice(int origin, Vector v) { + return (ByteVectorMax) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public ByteMaxVector slice(int origin) { - return (ByteMaxVector) super.sliceTemplate(origin); // specialize + public ByteVectorMax slice(int origin) { + return (ByteVectorMax) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public ByteMaxVector unslice(int origin, Vector w, int part) { - return (ByteMaxVector) super.unsliceTemplate(origin, w, part); // specialize + public ByteVectorMax unslice(int origin, Vector w, int part) { + return (ByteVectorMax) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public ByteMaxVector unslice(int origin, Vector w, int part, VectorMask m) { - return (ByteMaxVector) - super.unsliceTemplate(ByteMaxMask.class, + public ByteVectorMax unslice(int origin, Vector w, int part, VectorMask m) { + return (ByteVectorMax) + super.unsliceTemplate(ByteMaskMax.class, origin, w, part, - (ByteMaxMask) m); // specialize + (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector unslice(int origin) { - return (ByteMaxVector) super.unsliceTemplate(origin); // specialize + public ByteVectorMax unslice(int origin) { + return (ByteVectorMax) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public ByteMaxVector rearrange(VectorShuffle s) { - return (ByteMaxVector) - super.rearrangeTemplate(ByteMaxShuffle.class, - (ByteMaxShuffle) s); // specialize + public ByteVectorMax rearrange(VectorShuffle s) { + return (ByteVectorMax) + super.rearrangeTemplate(ByteShuffleMax.class, + (ByteShuffleMax) s); // specialize } @Override @ForceInline - public ByteMaxVector rearrange(VectorShuffle shuffle, + public ByteVectorMax rearrange(VectorShuffle shuffle, VectorMask m) { - return (ByteMaxVector) - super.rearrangeTemplate(ByteMaxShuffle.class, - ByteMaxMask.class, - (ByteMaxShuffle) shuffle, - (ByteMaxMask) m); // specialize + return (ByteVectorMax) + super.rearrangeTemplate(ByteShuffleMax.class, + ByteMaskMax.class, + (ByteShuffleMax) shuffle, + (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector rearrange(VectorShuffle s, + public ByteVectorMax rearrange(VectorShuffle s, Vector v) { - return (ByteMaxVector) - super.rearrangeTemplate(ByteMaxShuffle.class, - (ByteMaxShuffle) s, - (ByteMaxVector) v); // specialize + return (ByteVectorMax) + super.rearrangeTemplate(ByteShuffleMax.class, + (ByteShuffleMax) s, + (ByteVectorMax) v); // specialize } @Override @ForceInline - public ByteMaxVector compress(VectorMask m) { - return (ByteMaxVector) - super.compressTemplate(ByteMaxMask.class, - (ByteMaxMask) m); // specialize + public ByteVectorMax compress(VectorMask m) { + return (ByteVectorMax) + super.compressTemplate(ByteMaskMax.class, + (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector expand(VectorMask m) { - return (ByteMaxVector) - super.expandTemplate(ByteMaxMask.class, - (ByteMaxMask) m); // specialize + public ByteVectorMax expand(VectorMask m) { + return (ByteVectorMax) + super.expandTemplate(ByteMaskMax.class, + (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector selectFrom(Vector v) { - return (ByteMaxVector) - super.selectFromTemplate((ByteMaxVector) v); // specialize + public ByteVectorMax selectFrom(Vector v) { + return (ByteVectorMax) + super.selectFromTemplate((ByteVectorMax) v); // specialize } @Override @ForceInline - public ByteMaxVector selectFrom(Vector v, + public ByteVectorMax selectFrom(Vector v, VectorMask m) { - return (ByteMaxVector) - super.selectFromTemplate((ByteMaxVector) v, - ByteMaxMask.class, (ByteMaxMask) m); // specialize + return (ByteVectorMax) + super.selectFromTemplate((ByteVectorMax) v, + ByteMaskMax.class, (ByteMaskMax) m); // specialize } @Override @ForceInline - public ByteMaxVector selectFrom(Vector v1, + public ByteVectorMax selectFrom(Vector v1, Vector v2) { - return (ByteMaxVector) - super.selectFromTemplate((ByteMaxVector) v1, (ByteMaxVector) v2); // specialize + return (ByteVectorMax) + super.selectFromTemplate((ByteVectorMax) v1, (ByteVectorMax) v2); // specialize } @ForceInline @@ -543,7 +548,7 @@ final class ByteMaxVector extends ByteVector { @ForceInline @Override - public ByteMaxVector withLane(int i, byte e) { + public ByteVectorMax withLane(int i, byte e) { if (i < 0 || i >= VLENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); } @@ -551,7 +556,7 @@ final class ByteMaxVector extends ByteVector { } @ForceInline - public ByteMaxVector withLaneHelper(int i, byte e) { + public ByteVectorMax withLaneHelper(int i, byte e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -564,19 +569,20 @@ final class ByteMaxVector extends ByteVector { // Mask - static final class ByteMaxMask extends AbstractMask { + static final class ByteMaskMax extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - ByteMaxMask(boolean[] bits) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteMaskMax(boolean[] bits) { this(bits, 0); } - ByteMaxMask(boolean[] bits, int offset) { + ByteMaskMax(boolean[] bits, int offset) { super(prepare(bits, offset)); } - ByteMaxMask(boolean val) { + ByteMaskMax(boolean val) { super(prepare(val)); } @@ -609,31 +615,31 @@ final class ByteMaxVector extends ByteVector { } @Override - ByteMaxMask uOp(MUnOp f) { + ByteMaskMax uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new ByteMaxMask(res); + return new ByteMaskMax(res); } @Override - ByteMaxMask bOp(VectorMask m, MBinOp f) { + ByteMaskMax bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((ByteMaxMask)m).getBits(); + boolean[] mbits = ((ByteMaskMax)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new ByteMaxMask(res); + return new ByteMaskMax(res); } @ForceInline @Override public final - ByteMaxVector toVector() { - return (ByteMaxVector) super.toVectorTemplate(); // specialize + ByteVectorMax toVector() { + return (ByteVectorMax) super.toVectorTemplate(); // specialize } /** @@ -666,25 +672,25 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline /*package-private*/ - ByteMaxMask indexPartiallyInUpperRange(long offset, long limit) { - return (ByteMaxMask) VectorSupport.indexPartiallyInUpperRange( - ByteMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (ByteMaxMask) TRUE_MASK.indexPartiallyInRange(o, l)); + ByteMaskMax indexPartiallyInUpperRange(long offset, long limit) { + return (ByteMaskMax) VectorSupport.indexPartiallyInUpperRange( + ByteMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ByteMaskMax) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public ByteMaxMask not() { + public ByteMaskMax not() { return xor(maskAll(true)); } @Override @ForceInline - public ByteMaxMask compress() { - return (ByteMaxMask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - ByteMaxVector.class, ByteMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ByteMaskMax compress() { + return (ByteMaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ByteVectorMax.class, ByteMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -693,30 +699,30 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline - public ByteMaxMask and(VectorMask mask) { + public ByteMaskMax and(VectorMask mask) { Objects.requireNonNull(mask); - ByteMaxMask m = (ByteMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMaskMax m = (ByteMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public ByteMaxMask or(VectorMask mask) { + public ByteMaskMax or(VectorMask mask) { Objects.requireNonNull(mask); - ByteMaxMask m = (ByteMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMaskMax m = (ByteMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public ByteMaxMask xor(VectorMask mask) { + public ByteMaskMax xor(VectorMask mask) { Objects.requireNonNull(mask); - ByteMaxMask m = (ByteMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ByteMaskMax m = (ByteMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -726,21 +732,21 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -750,7 +756,7 @@ final class ByteMaxVector extends ByteVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -760,7 +766,7 @@ final class ByteMaxVector extends ByteVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(ByteMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ByteMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -769,48 +775,49 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((ByteMaxMask)m).getBits())); + (m, __) -> anyTrueHelper(((ByteMaskMax)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((ByteMaxMask)m).getBits())); + (m, __) -> allTrueHelper(((ByteMaskMax)m).getBits())); } @ForceInline /*package-private*/ - static ByteMaxMask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(ByteMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ByteMaskMax maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ByteMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final ByteMaxMask TRUE_MASK = new ByteMaxMask(true); - private static final ByteMaxMask FALSE_MASK = new ByteMaxMask(false); + private static final ByteMaskMax TRUE_MASK = new ByteMaskMax(true); + private static final ByteMaskMax FALSE_MASK = new ByteMaskMax(false); } // Shuffle - static final class ByteMaxShuffle extends AbstractShuffle { + static final class ByteShuffleMax extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = byte.class; // used by the JVM - ByteMaxShuffle(byte[] indices) { + static final Class CTYPE = byte.class; // used by the JVM + + ByteShuffleMax(byte[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - ByteMaxShuffle(int[] indices, int i) { + ByteShuffleMax(int[] indices, int i) { this(prepare(indices, i)); } - ByteMaxShuffle(IntUnaryOperator fn) { + ByteShuffleMax(IntUnaryOperator fn) { this(prepare(fn)); } @@ -830,23 +837,23 @@ final class ByteMaxVector extends ByteVector { assert(VLENGTH < Byte.MAX_VALUE); assert(Byte.MIN_VALUE <= -VLENGTH); } - static final ByteMaxShuffle IOTA = new ByteMaxShuffle(IDENTITY); + static final ByteShuffleMax IOTA = new ByteShuffleMax(IDENTITY); @Override @ForceInline - public ByteMaxVector toVector() { + public ByteVectorMax toVector() { return toBitsVector(); } @Override @ForceInline - ByteMaxVector toBitsVector() { - return (ByteMaxVector) super.toBitsVectorTemplate(); + ByteVectorMax toBitsVector() { + return (ByteVectorMax) super.toBitsVectorTemplate(); } @Override - ByteMaxVector toBitsVector0() { - return ((ByteMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ByteVectorMax toBitsVector0() { + return ((ByteVectorMax) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -895,30 +902,30 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline - public final ByteMaxMask laneIsValid() { - return (ByteMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + public final ByteMaskMax laneIsValid() { + return (ByteMaskMax) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final ByteMaxShuffle rearrange(VectorShuffle shuffle) { - ByteMaxShuffle concreteShuffle = (ByteMaxShuffle) shuffle; - return (ByteMaxShuffle) toBitsVector().rearrange(concreteShuffle) + public final ByteShuffleMax rearrange(VectorShuffle shuffle) { + ByteShuffleMax concreteShuffle = (ByteShuffleMax) shuffle; + return (ByteShuffleMax) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final ByteMaxShuffle wrapIndexes() { - ByteMaxVector v = toBitsVector(); + public final ByteShuffleMax wrapIndexes() { + ByteVectorMax v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (ByteMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ByteVectorMax) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (ByteMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ByteVectorMax) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (ByteMaxShuffle) v.toShuffle(vspecies(), false); + return (ByteShuffleMax) v.toShuffle(vspecies(), false); } private static byte[] prepare(int[] indices, int offset) { @@ -969,14 +976,14 @@ final class ByteMaxVector extends ByteVector { @Override final ByteVector fromArray0(byte[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m, offsetInRange); // specialize + return super.fromArray0Template(ByteMaskMax.class, a, offset, (ByteMaskMax) m, offsetInRange); // specialize } @ForceInline @Override final ByteVector fromArray0(byte[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(ByteMaxMask.class, a, offset, indexMap, mapOffset, (ByteMaxMask) m); + return super.fromArray0Template(ByteMaskMax.class, a, offset, indexMap, mapOffset, (ByteMaskMax) m); } @@ -991,7 +998,7 @@ final class ByteMaxVector extends ByteVector { @Override final ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m, offsetInRange); // specialize + return super.fromBooleanArray0Template(ByteMaskMax.class, a, offset, (ByteMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -1005,7 +1012,7 @@ final class ByteMaxVector extends ByteVector { @Override final ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(ByteMaxMask.class, ms, offset, (ByteMaxMask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ByteMaskMax.class, ms, offset, (ByteMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -1019,7 +1026,7 @@ final class ByteMaxVector extends ByteVector { @Override final void intoArray0(byte[] a, int offset, VectorMask m) { - super.intoArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); + super.intoArray0Template(ByteMaskMax.class, a, offset, (ByteMaskMax) m); } @@ -1027,14 +1034,14 @@ final class ByteMaxVector extends ByteVector { @Override final void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { - super.intoBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); + super.intoBooleanArray0Template(ByteMaskMax.class, a, offset, (ByteMaskMax) m); } @ForceInline @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(ByteMaxMask.class, ms, offset, (ByteMaxMask) m); + super.intoMemorySegment0Template(ByteMaskMax.class, ms, offset, (ByteMaskMax) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java index 70be5f829f0..5e7c97dc56d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java @@ -84,8 +84,8 @@ public abstract class DoubleVector extends AbstractVector { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -724,7 +724,7 @@ public abstract class DoubleVector extends AbstractVector { @ForceInline final DoubleVector unaryMathOp(VectorOperators.Unary op) { - return VectorMathLibrary.unaryMathOp(op, opCode(op), species(), DoubleVector::unaryOperations, + return VectorMathLibrary.unaryMathOp(op, opCode(op), vspecies(), DoubleVector::unaryOperations, this); } @@ -851,7 +851,7 @@ public abstract class DoubleVector extends AbstractVector { @ForceInline final DoubleVector binaryMathOp(VectorOperators.Binary op, DoubleVector that) { - return VectorMathLibrary.binaryMathOp(op, opCode(op), species(), DoubleVector::binaryOperations, + return VectorMathLibrary.binaryMathOp(op, opCode(op), vspecies(), DoubleVector::binaryOperations, this, that); } @@ -2921,7 +2921,7 @@ public abstract class DoubleVector extends AbstractVector { // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For DoubleMaxVector, if vector length is non-power-of-two or + // For DoubleVectorMax, if vector length is non-power-of-two or // 2048 bits, indexShape of Double species is S_MAX_BIT. // Assume that vector length is 2048, then the lane count of Double // vector is 32. When converting Double species to int species, @@ -2929,7 +2929,7 @@ public abstract class DoubleVector extends AbstractVector { // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3212,14 +3212,14 @@ public abstract class DoubleVector extends AbstractVector { // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For DoubleMaxVector, if vector length is 2048 bits, indexShape + // For DoubleVectorMax, if vector length is 2048 bits, indexShape // of Double species is S_MAX_BIT. and the lane count of Double // vector is 32. When converting Double species to int species, // indexShape is still S_MAX_BIT, but the lane count of int vector // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3406,7 +3406,7 @@ public abstract class DoubleVector extends AbstractVector { // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For DoubleMaxVector, if vector length is non-power-of-two or + // For DoubleVectorMax, if vector length is non-power-of-two or // 2048 bits, indexShape of Double species is S_MAX_BIT. // Assume that vector length is 2048, then the lane count of Double // vector is 32. When converting Double species to int species, @@ -3414,7 +3414,7 @@ public abstract class DoubleVector extends AbstractVector { // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3522,14 +3522,14 @@ public abstract class DoubleVector extends AbstractVector { // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For DoubleMaxVector, if vector length is 2048 bits, indexShape + // For DoubleVectorMax, if vector length is 2048 bits, indexShape // of Double species is S_MAX_BIT. and the lane count of Double // vector is 32. When converting Double species to int species, // indexShape is still S_MAX_BIT, but the lane count of int vector // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3976,13 +3976,13 @@ public abstract class DoubleVector extends AbstractVector { @Override @ForceInline public final DoubleVector zero() { - if ((Class) vectorType() == DoubleMaxVector.class) - return DoubleMaxVector.ZERO; + if ((Class) vectorType() == DoubleVectorMax.class) + return DoubleVectorMax.ZERO; switch (vectorBitSize()) { - case 64: return Double64Vector.ZERO; - case 128: return Double128Vector.ZERO; - case 256: return Double256Vector.ZERO; - case 512: return Double512Vector.ZERO; + case 64: return DoubleVector64.ZERO; + case 128: return DoubleVector128.ZERO; + case 256: return DoubleVector256.ZERO; + case 512: return DoubleVector512.ZERO; } throw new AssertionError(); } @@ -3990,13 +3990,13 @@ public abstract class DoubleVector extends AbstractVector { @Override @ForceInline public final DoubleVector iota() { - if ((Class) vectorType() == DoubleMaxVector.class) - return DoubleMaxVector.IOTA; + if ((Class) vectorType() == DoubleVectorMax.class) + return DoubleVectorMax.IOTA; switch (vectorBitSize()) { - case 64: return Double64Vector.IOTA; - case 128: return Double128Vector.IOTA; - case 256: return Double256Vector.IOTA; - case 512: return Double512Vector.IOTA; + case 64: return DoubleVector64.IOTA; + case 128: return DoubleVector128.IOTA; + case 256: return DoubleVector256.IOTA; + case 512: return DoubleVector512.IOTA; } throw new AssertionError(); } @@ -4005,13 +4005,13 @@ public abstract class DoubleVector extends AbstractVector { @Override @ForceInline public final VectorMask maskAll(boolean bit) { - if ((Class) vectorType() == DoubleMaxVector.class) - return DoubleMaxVector.DoubleMaxMask.maskAll(bit); + if ((Class) vectorType() == DoubleVectorMax.class) + return DoubleVectorMax.DoubleMaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return Double64Vector.Double64Mask.maskAll(bit); - case 128: return Double128Vector.Double128Mask.maskAll(bit); - case 256: return Double256Vector.Double256Mask.maskAll(bit); - case 512: return Double512Vector.Double512Mask.maskAll(bit); + case 64: return DoubleVector64.DoubleMask64.maskAll(bit); + case 128: return DoubleVector128.DoubleMask128.maskAll(bit); + case 256: return DoubleVector256.DoubleMask256.maskAll(bit); + case 512: return DoubleVector512.DoubleMask512.maskAll(bit); } throw new AssertionError(); } @@ -4039,42 +4039,42 @@ public abstract class DoubleVector extends AbstractVector { /** Species representing {@link DoubleVector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies SPECIES_64 = new DoubleSpecies(VectorShape.S_64_BIT, - Double64Vector.class, - Double64Vector.Double64Mask.class, - Double64Vector.Double64Shuffle.class, - Double64Vector::new); + DoubleVector64.class, + DoubleVector64.DoubleMask64.class, + DoubleVector64.DoubleShuffle64.class, + DoubleVector64::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies SPECIES_128 = new DoubleSpecies(VectorShape.S_128_BIT, - Double128Vector.class, - Double128Vector.Double128Mask.class, - Double128Vector.Double128Shuffle.class, - Double128Vector::new); + DoubleVector128.class, + DoubleVector128.DoubleMask128.class, + DoubleVector128.DoubleShuffle128.class, + DoubleVector128::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies SPECIES_256 = new DoubleSpecies(VectorShape.S_256_BIT, - Double256Vector.class, - Double256Vector.Double256Mask.class, - Double256Vector.Double256Shuffle.class, - Double256Vector::new); + DoubleVector256.class, + DoubleVector256.DoubleMask256.class, + DoubleVector256.DoubleShuffle256.class, + DoubleVector256::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies SPECIES_512 = new DoubleSpecies(VectorShape.S_512_BIT, - Double512Vector.class, - Double512Vector.Double512Mask.class, - Double512Vector.Double512Shuffle.class, - Double512Vector::new); + DoubleVector512.class, + DoubleVector512.DoubleMask512.class, + DoubleVector512.DoubleShuffle512.class, + DoubleVector512::new); /** Species representing {@link DoubleVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies SPECIES_MAX = new DoubleSpecies(VectorShape.S_Max_BIT, - DoubleMaxVector.class, - DoubleMaxVector.DoubleMaxMask.class, - DoubleMaxVector.DoubleMaxShuffle.class, - DoubleMaxVector::new); + DoubleVectorMax.class, + DoubleVectorMax.DoubleMaskMax.class, + DoubleVectorMax.DoubleShuffleMax.class, + DoubleVectorMax::new); /** * Preferred species for {@link DoubleVector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector128.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector128.java index f00efcf5163..1140d377e9b 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector128.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Double128Vector extends DoubleVector { +final class DoubleVector128 extends DoubleVector { static final DoubleSpecies VSPECIES = (DoubleSpecies) DoubleVector.SPECIES_128; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Double128Vector.class; + static final Class VCLASS = DoubleVector128.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = double.class; // carrier type used by the JVM + static final Class ETYPE = double.class; // used by the JVM - Double128Vector(double[] v) { + DoubleVector128(double[] v) { super(v); } - // For compatibility as Double128Vector::new, + // For compatibility as DoubleVector128::new, // stored into species.vectorFactory. - Double128Vector(Object v) { + DoubleVector128(Object v) { this((double[]) v); } - static final Double128Vector ZERO = new Double128Vector(new double[VLENGTH]); - static final Double128Vector IOTA = new Double128Vector(VSPECIES.iotaArray()); + static final DoubleVector128 ZERO = new DoubleVector128(new double[VLENGTH]); + static final DoubleVector128 IOTA = new DoubleVector128(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Double128Vector extends DoubleVector { @Override public final Class elementType() { return double.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Double.SIZE; } @@ -130,51 +135,51 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline - public final Double128Vector broadcast(double e) { - return (Double128Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector128 broadcast(double e) { + return (DoubleVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Double128Vector broadcast(long e) { - return (Double128Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector128 broadcast(long e) { + return (DoubleVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Double128Mask maskFromArray(boolean[] bits) { - return new Double128Mask(bits); + DoubleMask128 maskFromArray(boolean[] bits) { + return new DoubleMask128(bits); } @Override @ForceInline - Double128Shuffle iotaShuffle() { return Double128Shuffle.IOTA; } + DoubleShuffle128 iotaShuffle() { return DoubleShuffle128.IOTA; } @Override @ForceInline - Double128Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Double128Shuffle) iotaShuffleTemplate(start, step, wrap); + DoubleShuffle128 iotaShuffle(int start, int step, boolean wrap) { + return (DoubleShuffle128) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double128Shuffle shuffleFromArray(int[] indices, int i) { return new Double128Shuffle(indices, i); } + DoubleShuffle128 shuffleFromArray(int[] indices, int i) { return new DoubleShuffle128(indices, i); } @Override @ForceInline - Double128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Double128Shuffle(fn); } + DoubleShuffle128 shuffleFromOp(IntUnaryOperator fn) { return new DoubleShuffle128(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Double128Vector vectorFactory(double[] vec) { - return new Double128Vector(vec); + DoubleVector128 vectorFactory(double[] vec) { + return new DoubleVector128(vec); } @ForceInline final @Override - Byte128Vector asByteVectorRaw() { - return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector128 asByteVectorRaw() { + return (ByteVector128) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Double128Vector extends DoubleVector { @ForceInline final @Override - Double128Vector uOp(FUnOp f) { - return (Double128Vector) super.uOpTemplate(f); // specialize + DoubleVector128 uOp(FUnOp f) { + return (DoubleVector128) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Double128Vector uOp(VectorMask m, FUnOp f) { - return (Double128Vector) - super.uOpTemplate((Double128Mask)m, f); // specialize + DoubleVector128 uOp(VectorMask m, FUnOp f) { + return (DoubleVector128) + super.uOpTemplate((DoubleMask128)m, f); // specialize } // Binary operator @ForceInline final @Override - Double128Vector bOp(Vector v, FBinOp f) { - return (Double128Vector) super.bOpTemplate((Double128Vector)v, f); // specialize + DoubleVector128 bOp(Vector v, FBinOp f) { + return (DoubleVector128) super.bOpTemplate((DoubleVector128)v, f); // specialize } @ForceInline final @Override - Double128Vector bOp(Vector v, + DoubleVector128 bOp(Vector v, VectorMask m, FBinOp f) { - return (Double128Vector) - super.bOpTemplate((Double128Vector)v, (Double128Mask)m, + return (DoubleVector128) + super.bOpTemplate((DoubleVector128)v, (DoubleMask128)m, f); // specialize } @@ -219,19 +224,19 @@ final class Double128Vector extends DoubleVector { @ForceInline final @Override - Double128Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Double128Vector) - super.tOpTemplate((Double128Vector)v1, (Double128Vector)v2, + DoubleVector128 tOp(Vector v1, Vector v2, FTriOp f) { + return (DoubleVector128) + super.tOpTemplate((DoubleVector128)v1, (DoubleVector128)v2, f); // specialize } @ForceInline final @Override - Double128Vector tOp(Vector v1, Vector v2, + DoubleVector128 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Double128Vector) - super.tOpTemplate((Double128Vector)v1, (Double128Vector)v2, - (Double128Mask)m, f); // specialize + return (DoubleVector128) + super.tOpTemplate((DoubleVector128)v1, (DoubleVector128)v2, + (DoubleMask128)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline - public Double128Vector lanewise(Unary op) { - return (Double128Vector) super.lanewiseTemplate(op); // specialize + public DoubleVector128 lanewise(Unary op) { + return (DoubleVector128) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Double128Vector lanewise(Unary op, VectorMask m) { - return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, (Double128Mask) m); // specialize + public DoubleVector128 lanewise(Unary op, VectorMask m) { + return (DoubleVector128) super.lanewiseTemplate(op, DoubleMask128.class, (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector lanewise(Binary op, Vector v) { - return (Double128Vector) super.lanewiseTemplate(op, v); // specialize + public DoubleVector128 lanewise(Binary op, Vector v) { + return (DoubleVector128) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Double128Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, v, (Double128Mask) m); // specialize + public DoubleVector128 lanewise(Binary op, Vector v, VectorMask m) { + return (DoubleVector128) super.lanewiseTemplate(op, DoubleMask128.class, v, (DoubleMask128) m); // specialize } @@ -296,24 +301,24 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline public final - Double128Vector + DoubleVector128 lanewise(Ternary op, Vector v1, Vector v2) { - return (Double128Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (DoubleVector128) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Double128Vector + DoubleVector128 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, v1, v2, (Double128Mask) m); // specialize + return (DoubleVector128) super.lanewiseTemplate(op, DoubleMask128.class, v1, v2, (DoubleMask128) m); // specialize } @Override @ForceInline public final - Double128Vector addIndex(int scale) { - return (Double128Vector) super.addIndexTemplate(scale); // specialize + DoubleVector128 addIndex(int scale) { + return (DoubleVector128) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Double128Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized + return super.reduceLanesTemplate(op, DoubleMask128.class, (DoubleMask128) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Double128Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, DoubleMask128.class, (DoubleMask128) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline - public final Double128Shuffle toShuffle() { - return (Double128Shuffle) toShuffle(vspecies(), false); + public final DoubleShuffle128 toShuffle() { + return (DoubleShuffle128) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Double128Mask test(Test op) { - return super.testTemplate(Double128Mask.class, op); // specialize + public final DoubleMask128 test(Test op) { + return super.testTemplate(DoubleMask128.class, op); // specialize } @Override @ForceInline - public final Double128Mask test(Test op, VectorMask m) { - return super.testTemplate(Double128Mask.class, op, (Double128Mask) m); // specialize + public final DoubleMask128 test(Test op, VectorMask m) { + return super.testTemplate(DoubleMask128.class, op, (DoubleMask128) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Double128Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Double128Mask.class, op, v); // specialize + public final DoubleMask128 compare(Comparison op, Vector v) { + return super.compareTemplate(DoubleMask128.class, op, v); // specialize } @Override @ForceInline - public final Double128Mask compare(Comparison op, double s) { - return super.compareTemplate(Double128Mask.class, op, s); // specialize + public final DoubleMask128 compare(Comparison op, double s) { + return super.compareTemplate(DoubleMask128.class, op, s); // specialize } @Override @ForceInline - public final Double128Mask compare(Comparison op, long s) { - return super.compareTemplate(Double128Mask.class, op, s); // specialize + public final DoubleMask128 compare(Comparison op, long s) { + return super.compareTemplate(DoubleMask128.class, op, s); // specialize } @Override @ForceInline - public final Double128Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Double128Mask.class, op, v, (Double128Mask) m); + public final DoubleMask128 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(DoubleMask128.class, op, v, (DoubleMask128) m); } @Override @ForceInline - public Double128Vector blend(Vector v, VectorMask m) { - return (Double128Vector) - super.blendTemplate(Double128Mask.class, - (Double128Vector) v, - (Double128Mask) m); // specialize + public DoubleVector128 blend(Vector v, VectorMask m) { + return (DoubleVector128) + super.blendTemplate(DoubleMask128.class, + (DoubleVector128) v, + (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector slice(int origin, Vector v) { - return (Double128Vector) super.sliceTemplate(origin, v); // specialize + public DoubleVector128 slice(int origin, Vector v) { + return (DoubleVector128) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Double128Vector slice(int origin) { - return (Double128Vector) super.sliceTemplate(origin); // specialize + public DoubleVector128 slice(int origin) { + return (DoubleVector128) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Double128Vector unslice(int origin, Vector w, int part) { - return (Double128Vector) super.unsliceTemplate(origin, w, part); // specialize + public DoubleVector128 unslice(int origin, Vector w, int part) { + return (DoubleVector128) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Double128Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Double128Vector) - super.unsliceTemplate(Double128Mask.class, + public DoubleVector128 unslice(int origin, Vector w, int part, VectorMask m) { + return (DoubleVector128) + super.unsliceTemplate(DoubleMask128.class, origin, w, part, - (Double128Mask) m); // specialize + (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector unslice(int origin) { - return (Double128Vector) super.unsliceTemplate(origin); // specialize + public DoubleVector128 unslice(int origin) { + return (DoubleVector128) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Double128Vector rearrange(VectorShuffle s) { - return (Double128Vector) - super.rearrangeTemplate(Double128Shuffle.class, - (Double128Shuffle) s); // specialize + public DoubleVector128 rearrange(VectorShuffle s) { + return (DoubleVector128) + super.rearrangeTemplate(DoubleShuffle128.class, + (DoubleShuffle128) s); // specialize } @Override @ForceInline - public Double128Vector rearrange(VectorShuffle shuffle, + public DoubleVector128 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Double128Vector) - super.rearrangeTemplate(Double128Shuffle.class, - Double128Mask.class, - (Double128Shuffle) shuffle, - (Double128Mask) m); // specialize + return (DoubleVector128) + super.rearrangeTemplate(DoubleShuffle128.class, + DoubleMask128.class, + (DoubleShuffle128) shuffle, + (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector rearrange(VectorShuffle s, + public DoubleVector128 rearrange(VectorShuffle s, Vector v) { - return (Double128Vector) - super.rearrangeTemplate(Double128Shuffle.class, - (Double128Shuffle) s, - (Double128Vector) v); // specialize + return (DoubleVector128) + super.rearrangeTemplate(DoubleShuffle128.class, + (DoubleShuffle128) s, + (DoubleVector128) v); // specialize } @Override @ForceInline - public Double128Vector compress(VectorMask m) { - return (Double128Vector) - super.compressTemplate(Double128Mask.class, - (Double128Mask) m); // specialize + public DoubleVector128 compress(VectorMask m) { + return (DoubleVector128) + super.compressTemplate(DoubleMask128.class, + (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector expand(VectorMask m) { - return (Double128Vector) - super.expandTemplate(Double128Mask.class, - (Double128Mask) m); // specialize + public DoubleVector128 expand(VectorMask m) { + return (DoubleVector128) + super.expandTemplate(DoubleMask128.class, + (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector selectFrom(Vector v) { - return (Double128Vector) - super.selectFromTemplate((Double128Vector) v); // specialize + public DoubleVector128 selectFrom(Vector v) { + return (DoubleVector128) + super.selectFromTemplate((DoubleVector128) v); // specialize } @Override @ForceInline - public Double128Vector selectFrom(Vector v, + public DoubleVector128 selectFrom(Vector v, VectorMask m) { - return (Double128Vector) - super.selectFromTemplate((Double128Vector) v, - Double128Mask.class, (Double128Mask) m); // specialize + return (DoubleVector128) + super.selectFromTemplate((DoubleVector128) v, + DoubleMask128.class, (DoubleMask128) m); // specialize } @Override @ForceInline - public Double128Vector selectFrom(Vector v1, + public DoubleVector128 selectFrom(Vector v1, Vector v2) { - return (Double128Vector) - super.selectFromTemplate((Double128Vector) v1, (Double128Vector) v2); // specialize + return (DoubleVector128) + super.selectFromTemplate((DoubleVector128) v1, (DoubleVector128) v2); // specialize } @ForceInline @@ -533,7 +538,7 @@ final class Double128Vector extends DoubleVector { @ForceInline @Override - public Double128Vector withLane(int i, double e) { + public DoubleVector128 withLane(int i, double e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -542,7 +547,7 @@ final class Double128Vector extends DoubleVector { } @ForceInline - public Double128Vector withLaneHelper(int i, double e) { + public DoubleVector128 withLaneHelper(int i, double e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Double.doubleToRawLongBits(e), @@ -555,19 +560,20 @@ final class Double128Vector extends DoubleVector { // Mask - static final class Double128Mask extends AbstractMask { + static final class DoubleMask128 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM - Double128Mask(boolean[] bits) { + static final Class CTYPE = double.class; // used by the JVM + + DoubleMask128(boolean[] bits) { this(bits, 0); } - Double128Mask(boolean[] bits, int offset) { + DoubleMask128(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Double128Mask(boolean val) { + DoubleMask128(boolean val) { super(prepare(val)); } @@ -600,31 +606,31 @@ final class Double128Vector extends DoubleVector { } @Override - Double128Mask uOp(MUnOp f) { + DoubleMask128 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Double128Mask(res); + return new DoubleMask128(res); } @Override - Double128Mask bOp(VectorMask m, MBinOp f) { + DoubleMask128 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Double128Mask)m).getBits(); + boolean[] mbits = ((DoubleMask128)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Double128Mask(res); + return new DoubleMask128(res); } @ForceInline @Override public final - Double128Vector toVector() { - return (Double128Vector) super.toVectorTemplate(); // specialize + DoubleVector128 toVector() { + return (DoubleVector128) super.toVectorTemplate(); // specialize } /** @@ -657,25 +663,25 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline /*package-private*/ - Double128Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Double128Mask) VectorSupport.indexPartiallyInUpperRange( - Double128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Double128Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + DoubleMask128 indexPartiallyInUpperRange(long offset, long limit) { + return (DoubleMask128) VectorSupport.indexPartiallyInUpperRange( + DoubleMask128.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (DoubleMask128) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Double128Mask not() { + public DoubleMask128 not() { return xor(maskAll(true)); } @Override @ForceInline - public Double128Mask compress() { - return (Double128Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Double128Vector.class, Double128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public DoubleMask128 compress() { + return (DoubleMask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + DoubleVector128.class, DoubleMask128.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -684,30 +690,30 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline - public Double128Mask and(VectorMask mask) { + public DoubleMask128 and(VectorMask mask) { Objects.requireNonNull(mask); - Double128Mask m = (Double128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask128 m = (DoubleMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Double128Mask or(VectorMask mask) { + public DoubleMask128 or(VectorMask mask) { Objects.requireNonNull(mask); - Double128Mask m = (Double128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask128 m = (DoubleMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Double128Mask xor(VectorMask mask) { + public DoubleMask128 xor(VectorMask mask) { Objects.requireNonNull(mask); - Double128Mask m = (Double128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask128 m = (DoubleMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -717,21 +723,21 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -741,7 +747,7 @@ final class Double128Vector extends DoubleVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -751,7 +757,7 @@ final class Double128Vector extends DoubleVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Double128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(DoubleMask128.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -760,48 +766,49 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Double128Mask)m).getBits())); + (m, __) -> anyTrueHelper(((DoubleMask128)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Double128Mask)m).getBits())); + (m, __) -> allTrueHelper(((DoubleMask128)m).getBits())); } @ForceInline /*package-private*/ - static Double128Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Double128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static DoubleMask128 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(DoubleMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Double128Mask TRUE_MASK = new Double128Mask(true); - private static final Double128Mask FALSE_MASK = new Double128Mask(false); + private static final DoubleMask128 TRUE_MASK = new DoubleMask128(true); + private static final DoubleMask128 FALSE_MASK = new DoubleMask128(false); } // Shuffle - static final class Double128Shuffle extends AbstractShuffle { + static final class DoubleShuffle128 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Double128Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + DoubleShuffle128(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Double128Shuffle(int[] indices, int i) { + DoubleShuffle128(int[] indices, int i) { this(prepare(indices, i)); } - Double128Shuffle(IntUnaryOperator fn) { + DoubleShuffle128(IntUnaryOperator fn) { this(prepare(fn)); } @@ -821,23 +828,23 @@ final class Double128Vector extends DoubleVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Double128Shuffle IOTA = new Double128Shuffle(IDENTITY); + static final DoubleShuffle128 IOTA = new DoubleShuffle128(IDENTITY); @Override @ForceInline - public Double128Vector toVector() { - return (Double128Vector) toBitsVector().castShape(vspecies(), 0); + public DoubleVector128 toVector() { + return (DoubleVector128) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Long128Vector toBitsVector() { - return (Long128Vector) super.toBitsVectorTemplate(); + LongVector128 toBitsVector() { + return (LongVector128) super.toBitsVectorTemplate(); } @Override - Long128Vector toBitsVector0() { - return ((Long128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector128 toBitsVector0() { + return ((LongVector128) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -909,30 +916,30 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline - public final Double128Mask laneIsValid() { - return (Double128Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final DoubleMask128 laneIsValid() { + return (DoubleMask128) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Double128Shuffle rearrange(VectorShuffle shuffle) { - Double128Shuffle concreteShuffle = (Double128Shuffle) shuffle; - return (Double128Shuffle) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_128)) + public final DoubleShuffle128 rearrange(VectorShuffle shuffle) { + DoubleShuffle128 concreteShuffle = (DoubleShuffle128) shuffle; + return (DoubleShuffle128) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_128)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Double128Shuffle wrapIndexes() { - Long128Vector v = toBitsVector(); + public final DoubleShuffle128 wrapIndexes() { + LongVector128 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long128Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector128) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector128) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Double128Shuffle) v.toShuffle(vspecies(), false); + return (DoubleShuffle128) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -983,14 +990,14 @@ final class Double128Vector extends DoubleVector { @Override final DoubleVector fromArray0(double[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Double128Mask.class, a, offset, (Double128Mask) m, offsetInRange); // specialize + return super.fromArray0Template(DoubleMask128.class, a, offset, (DoubleMask128) m, offsetInRange); // specialize } @ForceInline @Override final DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Double128Mask.class, a, offset, indexMap, mapOffset, (Double128Mask) m); + return super.fromArray0Template(DoubleMask128.class, a, offset, indexMap, mapOffset, (DoubleMask128) m); } @@ -1006,7 +1013,7 @@ final class Double128Vector extends DoubleVector { @Override final DoubleVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Double128Mask.class, ms, offset, (Double128Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(DoubleMask128.class, ms, offset, (DoubleMask128) m, offsetInRange); // specialize } @ForceInline @@ -1020,14 +1027,14 @@ final class Double128Vector extends DoubleVector { @Override final void intoArray0(double[] a, int offset, VectorMask m) { - super.intoArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); + super.intoArray0Template(DoubleMask128.class, a, offset, (DoubleMask128) m); } @ForceInline @Override final void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Double128Mask.class, a, offset, indexMap, mapOffset, (Double128Mask) m); + super.intoArray0Template(DoubleMask128.class, a, offset, indexMap, mapOffset, (DoubleMask128) m); } @@ -1035,7 +1042,7 @@ final class Double128Vector extends DoubleVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Double128Mask.class, ms, offset, (Double128Mask) m); + super.intoMemorySegment0Template(DoubleMask128.class, ms, offset, (DoubleMask128) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector256.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector256.java index 0f145bf06e2..59b7913cfcb 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector256.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Double256Vector extends DoubleVector { +final class DoubleVector256 extends DoubleVector { static final DoubleSpecies VSPECIES = (DoubleSpecies) DoubleVector.SPECIES_256; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Double256Vector.class; + static final Class VCLASS = DoubleVector256.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = double.class; // carrier type used by the JVM + static final Class ETYPE = double.class; // used by the JVM - Double256Vector(double[] v) { + DoubleVector256(double[] v) { super(v); } - // For compatibility as Double256Vector::new, + // For compatibility as DoubleVector256::new, // stored into species.vectorFactory. - Double256Vector(Object v) { + DoubleVector256(Object v) { this((double[]) v); } - static final Double256Vector ZERO = new Double256Vector(new double[VLENGTH]); - static final Double256Vector IOTA = new Double256Vector(VSPECIES.iotaArray()); + static final DoubleVector256 ZERO = new DoubleVector256(new double[VLENGTH]); + static final DoubleVector256 IOTA = new DoubleVector256(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Double256Vector extends DoubleVector { @Override public final Class elementType() { return double.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Double.SIZE; } @@ -130,51 +135,51 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline - public final Double256Vector broadcast(double e) { - return (Double256Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector256 broadcast(double e) { + return (DoubleVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Double256Vector broadcast(long e) { - return (Double256Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector256 broadcast(long e) { + return (DoubleVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Double256Mask maskFromArray(boolean[] bits) { - return new Double256Mask(bits); + DoubleMask256 maskFromArray(boolean[] bits) { + return new DoubleMask256(bits); } @Override @ForceInline - Double256Shuffle iotaShuffle() { return Double256Shuffle.IOTA; } + DoubleShuffle256 iotaShuffle() { return DoubleShuffle256.IOTA; } @Override @ForceInline - Double256Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Double256Shuffle) iotaShuffleTemplate(start, step, wrap); + DoubleShuffle256 iotaShuffle(int start, int step, boolean wrap) { + return (DoubleShuffle256) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double256Shuffle shuffleFromArray(int[] indices, int i) { return new Double256Shuffle(indices, i); } + DoubleShuffle256 shuffleFromArray(int[] indices, int i) { return new DoubleShuffle256(indices, i); } @Override @ForceInline - Double256Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Double256Shuffle(fn); } + DoubleShuffle256 shuffleFromOp(IntUnaryOperator fn) { return new DoubleShuffle256(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Double256Vector vectorFactory(double[] vec) { - return new Double256Vector(vec); + DoubleVector256 vectorFactory(double[] vec) { + return new DoubleVector256(vec); } @ForceInline final @Override - Byte256Vector asByteVectorRaw() { - return (Byte256Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector256 asByteVectorRaw() { + return (ByteVector256) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Double256Vector extends DoubleVector { @ForceInline final @Override - Double256Vector uOp(FUnOp f) { - return (Double256Vector) super.uOpTemplate(f); // specialize + DoubleVector256 uOp(FUnOp f) { + return (DoubleVector256) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Double256Vector uOp(VectorMask m, FUnOp f) { - return (Double256Vector) - super.uOpTemplate((Double256Mask)m, f); // specialize + DoubleVector256 uOp(VectorMask m, FUnOp f) { + return (DoubleVector256) + super.uOpTemplate((DoubleMask256)m, f); // specialize } // Binary operator @ForceInline final @Override - Double256Vector bOp(Vector v, FBinOp f) { - return (Double256Vector) super.bOpTemplate((Double256Vector)v, f); // specialize + DoubleVector256 bOp(Vector v, FBinOp f) { + return (DoubleVector256) super.bOpTemplate((DoubleVector256)v, f); // specialize } @ForceInline final @Override - Double256Vector bOp(Vector v, + DoubleVector256 bOp(Vector v, VectorMask m, FBinOp f) { - return (Double256Vector) - super.bOpTemplate((Double256Vector)v, (Double256Mask)m, + return (DoubleVector256) + super.bOpTemplate((DoubleVector256)v, (DoubleMask256)m, f); // specialize } @@ -219,19 +224,19 @@ final class Double256Vector extends DoubleVector { @ForceInline final @Override - Double256Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Double256Vector) - super.tOpTemplate((Double256Vector)v1, (Double256Vector)v2, + DoubleVector256 tOp(Vector v1, Vector v2, FTriOp f) { + return (DoubleVector256) + super.tOpTemplate((DoubleVector256)v1, (DoubleVector256)v2, f); // specialize } @ForceInline final @Override - Double256Vector tOp(Vector v1, Vector v2, + DoubleVector256 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Double256Vector) - super.tOpTemplate((Double256Vector)v1, (Double256Vector)v2, - (Double256Mask)m, f); // specialize + return (DoubleVector256) + super.tOpTemplate((DoubleVector256)v1, (DoubleVector256)v2, + (DoubleMask256)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline - public Double256Vector lanewise(Unary op) { - return (Double256Vector) super.lanewiseTemplate(op); // specialize + public DoubleVector256 lanewise(Unary op) { + return (DoubleVector256) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Double256Vector lanewise(Unary op, VectorMask m) { - return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, (Double256Mask) m); // specialize + public DoubleVector256 lanewise(Unary op, VectorMask m) { + return (DoubleVector256) super.lanewiseTemplate(op, DoubleMask256.class, (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector lanewise(Binary op, Vector v) { - return (Double256Vector) super.lanewiseTemplate(op, v); // specialize + public DoubleVector256 lanewise(Binary op, Vector v) { + return (DoubleVector256) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Double256Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, v, (Double256Mask) m); // specialize + public DoubleVector256 lanewise(Binary op, Vector v, VectorMask m) { + return (DoubleVector256) super.lanewiseTemplate(op, DoubleMask256.class, v, (DoubleMask256) m); // specialize } @@ -296,24 +301,24 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline public final - Double256Vector + DoubleVector256 lanewise(Ternary op, Vector v1, Vector v2) { - return (Double256Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (DoubleVector256) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Double256Vector + DoubleVector256 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, v1, v2, (Double256Mask) m); // specialize + return (DoubleVector256) super.lanewiseTemplate(op, DoubleMask256.class, v1, v2, (DoubleMask256) m); // specialize } @Override @ForceInline public final - Double256Vector addIndex(int scale) { - return (Double256Vector) super.addIndexTemplate(scale); // specialize + DoubleVector256 addIndex(int scale) { + return (DoubleVector256) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Double256Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized + return super.reduceLanesTemplate(op, DoubleMask256.class, (DoubleMask256) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Double256Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, DoubleMask256.class, (DoubleMask256) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline - public final Double256Shuffle toShuffle() { - return (Double256Shuffle) toShuffle(vspecies(), false); + public final DoubleShuffle256 toShuffle() { + return (DoubleShuffle256) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Double256Mask test(Test op) { - return super.testTemplate(Double256Mask.class, op); // specialize + public final DoubleMask256 test(Test op) { + return super.testTemplate(DoubleMask256.class, op); // specialize } @Override @ForceInline - public final Double256Mask test(Test op, VectorMask m) { - return super.testTemplate(Double256Mask.class, op, (Double256Mask) m); // specialize + public final DoubleMask256 test(Test op, VectorMask m) { + return super.testTemplate(DoubleMask256.class, op, (DoubleMask256) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Double256Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Double256Mask.class, op, v); // specialize + public final DoubleMask256 compare(Comparison op, Vector v) { + return super.compareTemplate(DoubleMask256.class, op, v); // specialize } @Override @ForceInline - public final Double256Mask compare(Comparison op, double s) { - return super.compareTemplate(Double256Mask.class, op, s); // specialize + public final DoubleMask256 compare(Comparison op, double s) { + return super.compareTemplate(DoubleMask256.class, op, s); // specialize } @Override @ForceInline - public final Double256Mask compare(Comparison op, long s) { - return super.compareTemplate(Double256Mask.class, op, s); // specialize + public final DoubleMask256 compare(Comparison op, long s) { + return super.compareTemplate(DoubleMask256.class, op, s); // specialize } @Override @ForceInline - public final Double256Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Double256Mask.class, op, v, (Double256Mask) m); + public final DoubleMask256 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(DoubleMask256.class, op, v, (DoubleMask256) m); } @Override @ForceInline - public Double256Vector blend(Vector v, VectorMask m) { - return (Double256Vector) - super.blendTemplate(Double256Mask.class, - (Double256Vector) v, - (Double256Mask) m); // specialize + public DoubleVector256 blend(Vector v, VectorMask m) { + return (DoubleVector256) + super.blendTemplate(DoubleMask256.class, + (DoubleVector256) v, + (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector slice(int origin, Vector v) { - return (Double256Vector) super.sliceTemplate(origin, v); // specialize + public DoubleVector256 slice(int origin, Vector v) { + return (DoubleVector256) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Double256Vector slice(int origin) { - return (Double256Vector) super.sliceTemplate(origin); // specialize + public DoubleVector256 slice(int origin) { + return (DoubleVector256) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Double256Vector unslice(int origin, Vector w, int part) { - return (Double256Vector) super.unsliceTemplate(origin, w, part); // specialize + public DoubleVector256 unslice(int origin, Vector w, int part) { + return (DoubleVector256) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Double256Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Double256Vector) - super.unsliceTemplate(Double256Mask.class, + public DoubleVector256 unslice(int origin, Vector w, int part, VectorMask m) { + return (DoubleVector256) + super.unsliceTemplate(DoubleMask256.class, origin, w, part, - (Double256Mask) m); // specialize + (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector unslice(int origin) { - return (Double256Vector) super.unsliceTemplate(origin); // specialize + public DoubleVector256 unslice(int origin) { + return (DoubleVector256) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Double256Vector rearrange(VectorShuffle s) { - return (Double256Vector) - super.rearrangeTemplate(Double256Shuffle.class, - (Double256Shuffle) s); // specialize + public DoubleVector256 rearrange(VectorShuffle s) { + return (DoubleVector256) + super.rearrangeTemplate(DoubleShuffle256.class, + (DoubleShuffle256) s); // specialize } @Override @ForceInline - public Double256Vector rearrange(VectorShuffle shuffle, + public DoubleVector256 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Double256Vector) - super.rearrangeTemplate(Double256Shuffle.class, - Double256Mask.class, - (Double256Shuffle) shuffle, - (Double256Mask) m); // specialize + return (DoubleVector256) + super.rearrangeTemplate(DoubleShuffle256.class, + DoubleMask256.class, + (DoubleShuffle256) shuffle, + (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector rearrange(VectorShuffle s, + public DoubleVector256 rearrange(VectorShuffle s, Vector v) { - return (Double256Vector) - super.rearrangeTemplate(Double256Shuffle.class, - (Double256Shuffle) s, - (Double256Vector) v); // specialize + return (DoubleVector256) + super.rearrangeTemplate(DoubleShuffle256.class, + (DoubleShuffle256) s, + (DoubleVector256) v); // specialize } @Override @ForceInline - public Double256Vector compress(VectorMask m) { - return (Double256Vector) - super.compressTemplate(Double256Mask.class, - (Double256Mask) m); // specialize + public DoubleVector256 compress(VectorMask m) { + return (DoubleVector256) + super.compressTemplate(DoubleMask256.class, + (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector expand(VectorMask m) { - return (Double256Vector) - super.expandTemplate(Double256Mask.class, - (Double256Mask) m); // specialize + public DoubleVector256 expand(VectorMask m) { + return (DoubleVector256) + super.expandTemplate(DoubleMask256.class, + (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector selectFrom(Vector v) { - return (Double256Vector) - super.selectFromTemplate((Double256Vector) v); // specialize + public DoubleVector256 selectFrom(Vector v) { + return (DoubleVector256) + super.selectFromTemplate((DoubleVector256) v); // specialize } @Override @ForceInline - public Double256Vector selectFrom(Vector v, + public DoubleVector256 selectFrom(Vector v, VectorMask m) { - return (Double256Vector) - super.selectFromTemplate((Double256Vector) v, - Double256Mask.class, (Double256Mask) m); // specialize + return (DoubleVector256) + super.selectFromTemplate((DoubleVector256) v, + DoubleMask256.class, (DoubleMask256) m); // specialize } @Override @ForceInline - public Double256Vector selectFrom(Vector v1, + public DoubleVector256 selectFrom(Vector v1, Vector v2) { - return (Double256Vector) - super.selectFromTemplate((Double256Vector) v1, (Double256Vector) v2); // specialize + return (DoubleVector256) + super.selectFromTemplate((DoubleVector256) v1, (DoubleVector256) v2); // specialize } @ForceInline @@ -535,7 +540,7 @@ final class Double256Vector extends DoubleVector { @ForceInline @Override - public Double256Vector withLane(int i, double e) { + public DoubleVector256 withLane(int i, double e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -546,7 +551,7 @@ final class Double256Vector extends DoubleVector { } @ForceInline - public Double256Vector withLaneHelper(int i, double e) { + public DoubleVector256 withLaneHelper(int i, double e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Double.doubleToRawLongBits(e), @@ -559,19 +564,20 @@ final class Double256Vector extends DoubleVector { // Mask - static final class Double256Mask extends AbstractMask { + static final class DoubleMask256 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM - Double256Mask(boolean[] bits) { + static final Class CTYPE = double.class; // used by the JVM + + DoubleMask256(boolean[] bits) { this(bits, 0); } - Double256Mask(boolean[] bits, int offset) { + DoubleMask256(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Double256Mask(boolean val) { + DoubleMask256(boolean val) { super(prepare(val)); } @@ -604,31 +610,31 @@ final class Double256Vector extends DoubleVector { } @Override - Double256Mask uOp(MUnOp f) { + DoubleMask256 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Double256Mask(res); + return new DoubleMask256(res); } @Override - Double256Mask bOp(VectorMask m, MBinOp f) { + DoubleMask256 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Double256Mask)m).getBits(); + boolean[] mbits = ((DoubleMask256)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Double256Mask(res); + return new DoubleMask256(res); } @ForceInline @Override public final - Double256Vector toVector() { - return (Double256Vector) super.toVectorTemplate(); // specialize + DoubleVector256 toVector() { + return (DoubleVector256) super.toVectorTemplate(); // specialize } /** @@ -661,25 +667,25 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline /*package-private*/ - Double256Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Double256Mask) VectorSupport.indexPartiallyInUpperRange( - Double256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Double256Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + DoubleMask256 indexPartiallyInUpperRange(long offset, long limit) { + return (DoubleMask256) VectorSupport.indexPartiallyInUpperRange( + DoubleMask256.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (DoubleMask256) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Double256Mask not() { + public DoubleMask256 not() { return xor(maskAll(true)); } @Override @ForceInline - public Double256Mask compress() { - return (Double256Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Double256Vector.class, Double256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public DoubleMask256 compress() { + return (DoubleMask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + DoubleVector256.class, DoubleMask256.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -688,30 +694,30 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline - public Double256Mask and(VectorMask mask) { + public DoubleMask256 and(VectorMask mask) { Objects.requireNonNull(mask); - Double256Mask m = (Double256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask256 m = (DoubleMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Double256Mask or(VectorMask mask) { + public DoubleMask256 or(VectorMask mask) { Objects.requireNonNull(mask); - Double256Mask m = (Double256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask256 m = (DoubleMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Double256Mask xor(VectorMask mask) { + public DoubleMask256 xor(VectorMask mask) { Objects.requireNonNull(mask); - Double256Mask m = (Double256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask256 m = (DoubleMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -721,21 +727,21 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -745,7 +751,7 @@ final class Double256Vector extends DoubleVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -755,7 +761,7 @@ final class Double256Vector extends DoubleVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Double256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(DoubleMask256.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -764,48 +770,49 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Double256Mask)m).getBits())); + (m, __) -> anyTrueHelper(((DoubleMask256)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Double256Mask)m).getBits())); + (m, __) -> allTrueHelper(((DoubleMask256)m).getBits())); } @ForceInline /*package-private*/ - static Double256Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Double256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static DoubleMask256 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(DoubleMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Double256Mask TRUE_MASK = new Double256Mask(true); - private static final Double256Mask FALSE_MASK = new Double256Mask(false); + private static final DoubleMask256 TRUE_MASK = new DoubleMask256(true); + private static final DoubleMask256 FALSE_MASK = new DoubleMask256(false); } // Shuffle - static final class Double256Shuffle extends AbstractShuffle { + static final class DoubleShuffle256 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Double256Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + DoubleShuffle256(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Double256Shuffle(int[] indices, int i) { + DoubleShuffle256(int[] indices, int i) { this(prepare(indices, i)); } - Double256Shuffle(IntUnaryOperator fn) { + DoubleShuffle256(IntUnaryOperator fn) { this(prepare(fn)); } @@ -825,23 +832,23 @@ final class Double256Vector extends DoubleVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Double256Shuffle IOTA = new Double256Shuffle(IDENTITY); + static final DoubleShuffle256 IOTA = new DoubleShuffle256(IDENTITY); @Override @ForceInline - public Double256Vector toVector() { - return (Double256Vector) toBitsVector().castShape(vspecies(), 0); + public DoubleVector256 toVector() { + return (DoubleVector256) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Long256Vector toBitsVector() { - return (Long256Vector) super.toBitsVectorTemplate(); + LongVector256 toBitsVector() { + return (LongVector256) super.toBitsVectorTemplate(); } @Override - Long256Vector toBitsVector0() { - return ((Long256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector256 toBitsVector0() { + return ((LongVector256) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -913,30 +920,30 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline - public final Double256Mask laneIsValid() { - return (Double256Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final DoubleMask256 laneIsValid() { + return (DoubleMask256) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Double256Shuffle rearrange(VectorShuffle shuffle) { - Double256Shuffle concreteShuffle = (Double256Shuffle) shuffle; - return (Double256Shuffle) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_256)) + public final DoubleShuffle256 rearrange(VectorShuffle shuffle) { + DoubleShuffle256 concreteShuffle = (DoubleShuffle256) shuffle; + return (DoubleShuffle256) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_256)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Double256Shuffle wrapIndexes() { - Long256Vector v = toBitsVector(); + public final DoubleShuffle256 wrapIndexes() { + LongVector256 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long256Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector256) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector256) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Double256Shuffle) v.toShuffle(vspecies(), false); + return (DoubleShuffle256) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -987,14 +994,14 @@ final class Double256Vector extends DoubleVector { @Override final DoubleVector fromArray0(double[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Double256Mask.class, a, offset, (Double256Mask) m, offsetInRange); // specialize + return super.fromArray0Template(DoubleMask256.class, a, offset, (DoubleMask256) m, offsetInRange); // specialize } @ForceInline @Override final DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Double256Mask.class, a, offset, indexMap, mapOffset, (Double256Mask) m); + return super.fromArray0Template(DoubleMask256.class, a, offset, indexMap, mapOffset, (DoubleMask256) m); } @@ -1010,7 +1017,7 @@ final class Double256Vector extends DoubleVector { @Override final DoubleVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Double256Mask.class, ms, offset, (Double256Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(DoubleMask256.class, ms, offset, (DoubleMask256) m, offsetInRange); // specialize } @ForceInline @@ -1024,14 +1031,14 @@ final class Double256Vector extends DoubleVector { @Override final void intoArray0(double[] a, int offset, VectorMask m) { - super.intoArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); + super.intoArray0Template(DoubleMask256.class, a, offset, (DoubleMask256) m); } @ForceInline @Override final void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Double256Mask.class, a, offset, indexMap, mapOffset, (Double256Mask) m); + super.intoArray0Template(DoubleMask256.class, a, offset, indexMap, mapOffset, (DoubleMask256) m); } @@ -1039,7 +1046,7 @@ final class Double256Vector extends DoubleVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Double256Mask.class, ms, offset, (Double256Mask) m); + super.intoMemorySegment0Template(DoubleMask256.class, ms, offset, (DoubleMask256) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector512.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector512.java index 581a3ac7329..8ed21953394 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector512.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Double512Vector extends DoubleVector { +final class DoubleVector512 extends DoubleVector { static final DoubleSpecies VSPECIES = (DoubleSpecies) DoubleVector.SPECIES_512; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Double512Vector.class; + static final Class VCLASS = DoubleVector512.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = double.class; // carrier type used by the JVM + static final Class ETYPE = double.class; // used by the JVM - Double512Vector(double[] v) { + DoubleVector512(double[] v) { super(v); } - // For compatibility as Double512Vector::new, + // For compatibility as DoubleVector512::new, // stored into species.vectorFactory. - Double512Vector(Object v) { + DoubleVector512(Object v) { this((double[]) v); } - static final Double512Vector ZERO = new Double512Vector(new double[VLENGTH]); - static final Double512Vector IOTA = new Double512Vector(VSPECIES.iotaArray()); + static final DoubleVector512 ZERO = new DoubleVector512(new double[VLENGTH]); + static final DoubleVector512 IOTA = new DoubleVector512(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Double512Vector extends DoubleVector { @Override public final Class elementType() { return double.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Double.SIZE; } @@ -130,51 +135,51 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline - public final Double512Vector broadcast(double e) { - return (Double512Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector512 broadcast(double e) { + return (DoubleVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Double512Vector broadcast(long e) { - return (Double512Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector512 broadcast(long e) { + return (DoubleVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Double512Mask maskFromArray(boolean[] bits) { - return new Double512Mask(bits); + DoubleMask512 maskFromArray(boolean[] bits) { + return new DoubleMask512(bits); } @Override @ForceInline - Double512Shuffle iotaShuffle() { return Double512Shuffle.IOTA; } + DoubleShuffle512 iotaShuffle() { return DoubleShuffle512.IOTA; } @Override @ForceInline - Double512Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Double512Shuffle) iotaShuffleTemplate(start, step, wrap); + DoubleShuffle512 iotaShuffle(int start, int step, boolean wrap) { + return (DoubleShuffle512) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double512Shuffle shuffleFromArray(int[] indices, int i) { return new Double512Shuffle(indices, i); } + DoubleShuffle512 shuffleFromArray(int[] indices, int i) { return new DoubleShuffle512(indices, i); } @Override @ForceInline - Double512Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Double512Shuffle(fn); } + DoubleShuffle512 shuffleFromOp(IntUnaryOperator fn) { return new DoubleShuffle512(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Double512Vector vectorFactory(double[] vec) { - return new Double512Vector(vec); + DoubleVector512 vectorFactory(double[] vec) { + return new DoubleVector512(vec); } @ForceInline final @Override - Byte512Vector asByteVectorRaw() { - return (Byte512Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector512 asByteVectorRaw() { + return (ByteVector512) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Double512Vector extends DoubleVector { @ForceInline final @Override - Double512Vector uOp(FUnOp f) { - return (Double512Vector) super.uOpTemplate(f); // specialize + DoubleVector512 uOp(FUnOp f) { + return (DoubleVector512) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Double512Vector uOp(VectorMask m, FUnOp f) { - return (Double512Vector) - super.uOpTemplate((Double512Mask)m, f); // specialize + DoubleVector512 uOp(VectorMask m, FUnOp f) { + return (DoubleVector512) + super.uOpTemplate((DoubleMask512)m, f); // specialize } // Binary operator @ForceInline final @Override - Double512Vector bOp(Vector v, FBinOp f) { - return (Double512Vector) super.bOpTemplate((Double512Vector)v, f); // specialize + DoubleVector512 bOp(Vector v, FBinOp f) { + return (DoubleVector512) super.bOpTemplate((DoubleVector512)v, f); // specialize } @ForceInline final @Override - Double512Vector bOp(Vector v, + DoubleVector512 bOp(Vector v, VectorMask m, FBinOp f) { - return (Double512Vector) - super.bOpTemplate((Double512Vector)v, (Double512Mask)m, + return (DoubleVector512) + super.bOpTemplate((DoubleVector512)v, (DoubleMask512)m, f); // specialize } @@ -219,19 +224,19 @@ final class Double512Vector extends DoubleVector { @ForceInline final @Override - Double512Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Double512Vector) - super.tOpTemplate((Double512Vector)v1, (Double512Vector)v2, + DoubleVector512 tOp(Vector v1, Vector v2, FTriOp f) { + return (DoubleVector512) + super.tOpTemplate((DoubleVector512)v1, (DoubleVector512)v2, f); // specialize } @ForceInline final @Override - Double512Vector tOp(Vector v1, Vector v2, + DoubleVector512 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Double512Vector) - super.tOpTemplate((Double512Vector)v1, (Double512Vector)v2, - (Double512Mask)m, f); // specialize + return (DoubleVector512) + super.tOpTemplate((DoubleVector512)v1, (DoubleVector512)v2, + (DoubleMask512)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline - public Double512Vector lanewise(Unary op) { - return (Double512Vector) super.lanewiseTemplate(op); // specialize + public DoubleVector512 lanewise(Unary op) { + return (DoubleVector512) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Double512Vector lanewise(Unary op, VectorMask m) { - return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, (Double512Mask) m); // specialize + public DoubleVector512 lanewise(Unary op, VectorMask m) { + return (DoubleVector512) super.lanewiseTemplate(op, DoubleMask512.class, (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector lanewise(Binary op, Vector v) { - return (Double512Vector) super.lanewiseTemplate(op, v); // specialize + public DoubleVector512 lanewise(Binary op, Vector v) { + return (DoubleVector512) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Double512Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, v, (Double512Mask) m); // specialize + public DoubleVector512 lanewise(Binary op, Vector v, VectorMask m) { + return (DoubleVector512) super.lanewiseTemplate(op, DoubleMask512.class, v, (DoubleMask512) m); // specialize } @@ -296,24 +301,24 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline public final - Double512Vector + DoubleVector512 lanewise(Ternary op, Vector v1, Vector v2) { - return (Double512Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (DoubleVector512) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Double512Vector + DoubleVector512 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, v1, v2, (Double512Mask) m); // specialize + return (DoubleVector512) super.lanewiseTemplate(op, DoubleMask512.class, v1, v2, (DoubleMask512) m); // specialize } @Override @ForceInline public final - Double512Vector addIndex(int scale) { - return (Double512Vector) super.addIndexTemplate(scale); // specialize + DoubleVector512 addIndex(int scale) { + return (DoubleVector512) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Double512Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized + return super.reduceLanesTemplate(op, DoubleMask512.class, (DoubleMask512) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Double512Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, DoubleMask512.class, (DoubleMask512) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline - public final Double512Shuffle toShuffle() { - return (Double512Shuffle) toShuffle(vspecies(), false); + public final DoubleShuffle512 toShuffle() { + return (DoubleShuffle512) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Double512Mask test(Test op) { - return super.testTemplate(Double512Mask.class, op); // specialize + public final DoubleMask512 test(Test op) { + return super.testTemplate(DoubleMask512.class, op); // specialize } @Override @ForceInline - public final Double512Mask test(Test op, VectorMask m) { - return super.testTemplate(Double512Mask.class, op, (Double512Mask) m); // specialize + public final DoubleMask512 test(Test op, VectorMask m) { + return super.testTemplate(DoubleMask512.class, op, (DoubleMask512) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Double512Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Double512Mask.class, op, v); // specialize + public final DoubleMask512 compare(Comparison op, Vector v) { + return super.compareTemplate(DoubleMask512.class, op, v); // specialize } @Override @ForceInline - public final Double512Mask compare(Comparison op, double s) { - return super.compareTemplate(Double512Mask.class, op, s); // specialize + public final DoubleMask512 compare(Comparison op, double s) { + return super.compareTemplate(DoubleMask512.class, op, s); // specialize } @Override @ForceInline - public final Double512Mask compare(Comparison op, long s) { - return super.compareTemplate(Double512Mask.class, op, s); // specialize + public final DoubleMask512 compare(Comparison op, long s) { + return super.compareTemplate(DoubleMask512.class, op, s); // specialize } @Override @ForceInline - public final Double512Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Double512Mask.class, op, v, (Double512Mask) m); + public final DoubleMask512 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(DoubleMask512.class, op, v, (DoubleMask512) m); } @Override @ForceInline - public Double512Vector blend(Vector v, VectorMask m) { - return (Double512Vector) - super.blendTemplate(Double512Mask.class, - (Double512Vector) v, - (Double512Mask) m); // specialize + public DoubleVector512 blend(Vector v, VectorMask m) { + return (DoubleVector512) + super.blendTemplate(DoubleMask512.class, + (DoubleVector512) v, + (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector slice(int origin, Vector v) { - return (Double512Vector) super.sliceTemplate(origin, v); // specialize + public DoubleVector512 slice(int origin, Vector v) { + return (DoubleVector512) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Double512Vector slice(int origin) { - return (Double512Vector) super.sliceTemplate(origin); // specialize + public DoubleVector512 slice(int origin) { + return (DoubleVector512) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Double512Vector unslice(int origin, Vector w, int part) { - return (Double512Vector) super.unsliceTemplate(origin, w, part); // specialize + public DoubleVector512 unslice(int origin, Vector w, int part) { + return (DoubleVector512) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Double512Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Double512Vector) - super.unsliceTemplate(Double512Mask.class, + public DoubleVector512 unslice(int origin, Vector w, int part, VectorMask m) { + return (DoubleVector512) + super.unsliceTemplate(DoubleMask512.class, origin, w, part, - (Double512Mask) m); // specialize + (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector unslice(int origin) { - return (Double512Vector) super.unsliceTemplate(origin); // specialize + public DoubleVector512 unslice(int origin) { + return (DoubleVector512) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Double512Vector rearrange(VectorShuffle s) { - return (Double512Vector) - super.rearrangeTemplate(Double512Shuffle.class, - (Double512Shuffle) s); // specialize + public DoubleVector512 rearrange(VectorShuffle s) { + return (DoubleVector512) + super.rearrangeTemplate(DoubleShuffle512.class, + (DoubleShuffle512) s); // specialize } @Override @ForceInline - public Double512Vector rearrange(VectorShuffle shuffle, + public DoubleVector512 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Double512Vector) - super.rearrangeTemplate(Double512Shuffle.class, - Double512Mask.class, - (Double512Shuffle) shuffle, - (Double512Mask) m); // specialize + return (DoubleVector512) + super.rearrangeTemplate(DoubleShuffle512.class, + DoubleMask512.class, + (DoubleShuffle512) shuffle, + (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector rearrange(VectorShuffle s, + public DoubleVector512 rearrange(VectorShuffle s, Vector v) { - return (Double512Vector) - super.rearrangeTemplate(Double512Shuffle.class, - (Double512Shuffle) s, - (Double512Vector) v); // specialize + return (DoubleVector512) + super.rearrangeTemplate(DoubleShuffle512.class, + (DoubleShuffle512) s, + (DoubleVector512) v); // specialize } @Override @ForceInline - public Double512Vector compress(VectorMask m) { - return (Double512Vector) - super.compressTemplate(Double512Mask.class, - (Double512Mask) m); // specialize + public DoubleVector512 compress(VectorMask m) { + return (DoubleVector512) + super.compressTemplate(DoubleMask512.class, + (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector expand(VectorMask m) { - return (Double512Vector) - super.expandTemplate(Double512Mask.class, - (Double512Mask) m); // specialize + public DoubleVector512 expand(VectorMask m) { + return (DoubleVector512) + super.expandTemplate(DoubleMask512.class, + (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector selectFrom(Vector v) { - return (Double512Vector) - super.selectFromTemplate((Double512Vector) v); // specialize + public DoubleVector512 selectFrom(Vector v) { + return (DoubleVector512) + super.selectFromTemplate((DoubleVector512) v); // specialize } @Override @ForceInline - public Double512Vector selectFrom(Vector v, + public DoubleVector512 selectFrom(Vector v, VectorMask m) { - return (Double512Vector) - super.selectFromTemplate((Double512Vector) v, - Double512Mask.class, (Double512Mask) m); // specialize + return (DoubleVector512) + super.selectFromTemplate((DoubleVector512) v, + DoubleMask512.class, (DoubleMask512) m); // specialize } @Override @ForceInline - public Double512Vector selectFrom(Vector v1, + public DoubleVector512 selectFrom(Vector v1, Vector v2) { - return (Double512Vector) - super.selectFromTemplate((Double512Vector) v1, (Double512Vector) v2); // specialize + return (DoubleVector512) + super.selectFromTemplate((DoubleVector512) v1, (DoubleVector512) v2); // specialize } @ForceInline @@ -539,7 +544,7 @@ final class Double512Vector extends DoubleVector { @ForceInline @Override - public Double512Vector withLane(int i, double e) { + public DoubleVector512 withLane(int i, double e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -554,7 +559,7 @@ final class Double512Vector extends DoubleVector { } @ForceInline - public Double512Vector withLaneHelper(int i, double e) { + public DoubleVector512 withLaneHelper(int i, double e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Double.doubleToRawLongBits(e), @@ -567,19 +572,20 @@ final class Double512Vector extends DoubleVector { // Mask - static final class Double512Mask extends AbstractMask { + static final class DoubleMask512 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM - Double512Mask(boolean[] bits) { + static final Class CTYPE = double.class; // used by the JVM + + DoubleMask512(boolean[] bits) { this(bits, 0); } - Double512Mask(boolean[] bits, int offset) { + DoubleMask512(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Double512Mask(boolean val) { + DoubleMask512(boolean val) { super(prepare(val)); } @@ -612,31 +618,31 @@ final class Double512Vector extends DoubleVector { } @Override - Double512Mask uOp(MUnOp f) { + DoubleMask512 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Double512Mask(res); + return new DoubleMask512(res); } @Override - Double512Mask bOp(VectorMask m, MBinOp f) { + DoubleMask512 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Double512Mask)m).getBits(); + boolean[] mbits = ((DoubleMask512)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Double512Mask(res); + return new DoubleMask512(res); } @ForceInline @Override public final - Double512Vector toVector() { - return (Double512Vector) super.toVectorTemplate(); // specialize + DoubleVector512 toVector() { + return (DoubleVector512) super.toVectorTemplate(); // specialize } /** @@ -669,25 +675,25 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline /*package-private*/ - Double512Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Double512Mask) VectorSupport.indexPartiallyInUpperRange( - Double512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Double512Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + DoubleMask512 indexPartiallyInUpperRange(long offset, long limit) { + return (DoubleMask512) VectorSupport.indexPartiallyInUpperRange( + DoubleMask512.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (DoubleMask512) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Double512Mask not() { + public DoubleMask512 not() { return xor(maskAll(true)); } @Override @ForceInline - public Double512Mask compress() { - return (Double512Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Double512Vector.class, Double512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public DoubleMask512 compress() { + return (DoubleMask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + DoubleVector512.class, DoubleMask512.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -696,30 +702,30 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline - public Double512Mask and(VectorMask mask) { + public DoubleMask512 and(VectorMask mask) { Objects.requireNonNull(mask); - Double512Mask m = (Double512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask512 m = (DoubleMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Double512Mask or(VectorMask mask) { + public DoubleMask512 or(VectorMask mask) { Objects.requireNonNull(mask); - Double512Mask m = (Double512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask512 m = (DoubleMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Double512Mask xor(VectorMask mask) { + public DoubleMask512 xor(VectorMask mask) { Objects.requireNonNull(mask); - Double512Mask m = (Double512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask512 m = (DoubleMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -729,21 +735,21 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -753,7 +759,7 @@ final class Double512Vector extends DoubleVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -763,7 +769,7 @@ final class Double512Vector extends DoubleVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Double512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(DoubleMask512.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -772,48 +778,49 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Double512Mask)m).getBits())); + (m, __) -> anyTrueHelper(((DoubleMask512)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Double512Mask)m).getBits())); + (m, __) -> allTrueHelper(((DoubleMask512)m).getBits())); } @ForceInline /*package-private*/ - static Double512Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Double512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static DoubleMask512 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(DoubleMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Double512Mask TRUE_MASK = new Double512Mask(true); - private static final Double512Mask FALSE_MASK = new Double512Mask(false); + private static final DoubleMask512 TRUE_MASK = new DoubleMask512(true); + private static final DoubleMask512 FALSE_MASK = new DoubleMask512(false); } // Shuffle - static final class Double512Shuffle extends AbstractShuffle { + static final class DoubleShuffle512 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Double512Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + DoubleShuffle512(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Double512Shuffle(int[] indices, int i) { + DoubleShuffle512(int[] indices, int i) { this(prepare(indices, i)); } - Double512Shuffle(IntUnaryOperator fn) { + DoubleShuffle512(IntUnaryOperator fn) { this(prepare(fn)); } @@ -833,23 +840,23 @@ final class Double512Vector extends DoubleVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Double512Shuffle IOTA = new Double512Shuffle(IDENTITY); + static final DoubleShuffle512 IOTA = new DoubleShuffle512(IDENTITY); @Override @ForceInline - public Double512Vector toVector() { - return (Double512Vector) toBitsVector().castShape(vspecies(), 0); + public DoubleVector512 toVector() { + return (DoubleVector512) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Long512Vector toBitsVector() { - return (Long512Vector) super.toBitsVectorTemplate(); + LongVector512 toBitsVector() { + return (LongVector512) super.toBitsVectorTemplate(); } @Override - Long512Vector toBitsVector0() { - return ((Long512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector512 toBitsVector0() { + return ((LongVector512) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -921,30 +928,30 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline - public final Double512Mask laneIsValid() { - return (Double512Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final DoubleMask512 laneIsValid() { + return (DoubleMask512) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Double512Shuffle rearrange(VectorShuffle shuffle) { - Double512Shuffle concreteShuffle = (Double512Shuffle) shuffle; - return (Double512Shuffle) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_512)) + public final DoubleShuffle512 rearrange(VectorShuffle shuffle) { + DoubleShuffle512 concreteShuffle = (DoubleShuffle512) shuffle; + return (DoubleShuffle512) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_512)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Double512Shuffle wrapIndexes() { - Long512Vector v = toBitsVector(); + public final DoubleShuffle512 wrapIndexes() { + LongVector512 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long512Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector512) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector512) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Double512Shuffle) v.toShuffle(vspecies(), false); + return (DoubleShuffle512) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -995,14 +1002,14 @@ final class Double512Vector extends DoubleVector { @Override final DoubleVector fromArray0(double[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Double512Mask.class, a, offset, (Double512Mask) m, offsetInRange); // specialize + return super.fromArray0Template(DoubleMask512.class, a, offset, (DoubleMask512) m, offsetInRange); // specialize } @ForceInline @Override final DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Double512Mask.class, a, offset, indexMap, mapOffset, (Double512Mask) m); + return super.fromArray0Template(DoubleMask512.class, a, offset, indexMap, mapOffset, (DoubleMask512) m); } @@ -1018,7 +1025,7 @@ final class Double512Vector extends DoubleVector { @Override final DoubleVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Double512Mask.class, ms, offset, (Double512Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(DoubleMask512.class, ms, offset, (DoubleMask512) m, offsetInRange); // specialize } @ForceInline @@ -1032,14 +1039,14 @@ final class Double512Vector extends DoubleVector { @Override final void intoArray0(double[] a, int offset, VectorMask m) { - super.intoArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); + super.intoArray0Template(DoubleMask512.class, a, offset, (DoubleMask512) m); } @ForceInline @Override final void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Double512Mask.class, a, offset, indexMap, mapOffset, (Double512Mask) m); + super.intoArray0Template(DoubleMask512.class, a, offset, indexMap, mapOffset, (DoubleMask512) m); } @@ -1047,7 +1054,7 @@ final class Double512Vector extends DoubleVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Double512Mask.class, ms, offset, (Double512Mask) m); + super.intoMemorySegment0Template(DoubleMask512.class, ms, offset, (DoubleMask512) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector64.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector64.java index 9535f112ada..7e1a8cf768d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector64.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Double64Vector extends DoubleVector { +final class DoubleVector64 extends DoubleVector { static final DoubleSpecies VSPECIES = (DoubleSpecies) DoubleVector.SPECIES_64; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Double64Vector.class; + static final Class VCLASS = DoubleVector64.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = double.class; // carrier type used by the JVM + static final Class ETYPE = double.class; // used by the JVM - Double64Vector(double[] v) { + DoubleVector64(double[] v) { super(v); } - // For compatibility as Double64Vector::new, + // For compatibility as DoubleVector64::new, // stored into species.vectorFactory. - Double64Vector(Object v) { + DoubleVector64(Object v) { this((double[]) v); } - static final Double64Vector ZERO = new Double64Vector(new double[VLENGTH]); - static final Double64Vector IOTA = new Double64Vector(VSPECIES.iotaArray()); + static final DoubleVector64 ZERO = new DoubleVector64(new double[VLENGTH]); + static final DoubleVector64 IOTA = new DoubleVector64(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Double64Vector extends DoubleVector { @Override public final Class elementType() { return double.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Double.SIZE; } @@ -130,51 +135,51 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline - public final Double64Vector broadcast(double e) { - return (Double64Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector64 broadcast(double e) { + return (DoubleVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Double64Vector broadcast(long e) { - return (Double64Vector) super.broadcastTemplate(e); // specialize + public final DoubleVector64 broadcast(long e) { + return (DoubleVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Double64Mask maskFromArray(boolean[] bits) { - return new Double64Mask(bits); + DoubleMask64 maskFromArray(boolean[] bits) { + return new DoubleMask64(bits); } @Override @ForceInline - Double64Shuffle iotaShuffle() { return Double64Shuffle.IOTA; } + DoubleShuffle64 iotaShuffle() { return DoubleShuffle64.IOTA; } @Override @ForceInline - Double64Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Double64Shuffle) iotaShuffleTemplate(start, step, wrap); + DoubleShuffle64 iotaShuffle(int start, int step, boolean wrap) { + return (DoubleShuffle64) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Double64Shuffle shuffleFromArray(int[] indices, int i) { return new Double64Shuffle(indices, i); } + DoubleShuffle64 shuffleFromArray(int[] indices, int i) { return new DoubleShuffle64(indices, i); } @Override @ForceInline - Double64Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Double64Shuffle(fn); } + DoubleShuffle64 shuffleFromOp(IntUnaryOperator fn) { return new DoubleShuffle64(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Double64Vector vectorFactory(double[] vec) { - return new Double64Vector(vec); + DoubleVector64 vectorFactory(double[] vec) { + return new DoubleVector64(vec); } @ForceInline final @Override - Byte64Vector asByteVectorRaw() { - return (Byte64Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector64 asByteVectorRaw() { + return (ByteVector64) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Double64Vector extends DoubleVector { @ForceInline final @Override - Double64Vector uOp(FUnOp f) { - return (Double64Vector) super.uOpTemplate(f); // specialize + DoubleVector64 uOp(FUnOp f) { + return (DoubleVector64) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Double64Vector uOp(VectorMask m, FUnOp f) { - return (Double64Vector) - super.uOpTemplate((Double64Mask)m, f); // specialize + DoubleVector64 uOp(VectorMask m, FUnOp f) { + return (DoubleVector64) + super.uOpTemplate((DoubleMask64)m, f); // specialize } // Binary operator @ForceInline final @Override - Double64Vector bOp(Vector v, FBinOp f) { - return (Double64Vector) super.bOpTemplate((Double64Vector)v, f); // specialize + DoubleVector64 bOp(Vector v, FBinOp f) { + return (DoubleVector64) super.bOpTemplate((DoubleVector64)v, f); // specialize } @ForceInline final @Override - Double64Vector bOp(Vector v, + DoubleVector64 bOp(Vector v, VectorMask m, FBinOp f) { - return (Double64Vector) - super.bOpTemplate((Double64Vector)v, (Double64Mask)m, + return (DoubleVector64) + super.bOpTemplate((DoubleVector64)v, (DoubleMask64)m, f); // specialize } @@ -219,19 +224,19 @@ final class Double64Vector extends DoubleVector { @ForceInline final @Override - Double64Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Double64Vector) - super.tOpTemplate((Double64Vector)v1, (Double64Vector)v2, + DoubleVector64 tOp(Vector v1, Vector v2, FTriOp f) { + return (DoubleVector64) + super.tOpTemplate((DoubleVector64)v1, (DoubleVector64)v2, f); // specialize } @ForceInline final @Override - Double64Vector tOp(Vector v1, Vector v2, + DoubleVector64 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Double64Vector) - super.tOpTemplate((Double64Vector)v1, (Double64Vector)v2, - (Double64Mask)m, f); // specialize + return (DoubleVector64) + super.tOpTemplate((DoubleVector64)v1, (DoubleVector64)v2, + (DoubleMask64)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline - public Double64Vector lanewise(Unary op) { - return (Double64Vector) super.lanewiseTemplate(op); // specialize + public DoubleVector64 lanewise(Unary op) { + return (DoubleVector64) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Double64Vector lanewise(Unary op, VectorMask m) { - return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, (Double64Mask) m); // specialize + public DoubleVector64 lanewise(Unary op, VectorMask m) { + return (DoubleVector64) super.lanewiseTemplate(op, DoubleMask64.class, (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector lanewise(Binary op, Vector v) { - return (Double64Vector) super.lanewiseTemplate(op, v); // specialize + public DoubleVector64 lanewise(Binary op, Vector v) { + return (DoubleVector64) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Double64Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, v, (Double64Mask) m); // specialize + public DoubleVector64 lanewise(Binary op, Vector v, VectorMask m) { + return (DoubleVector64) super.lanewiseTemplate(op, DoubleMask64.class, v, (DoubleMask64) m); // specialize } @@ -296,24 +301,24 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline public final - Double64Vector + DoubleVector64 lanewise(Ternary op, Vector v1, Vector v2) { - return (Double64Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (DoubleVector64) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Double64Vector + DoubleVector64 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, v1, v2, (Double64Mask) m); // specialize + return (DoubleVector64) super.lanewiseTemplate(op, DoubleMask64.class, v1, v2, (DoubleMask64) m); // specialize } @Override @ForceInline public final - Double64Vector addIndex(int scale) { - return (Double64Vector) super.addIndexTemplate(scale); // specialize + DoubleVector64 addIndex(int scale) { + return (DoubleVector64) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Double64Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized + return super.reduceLanesTemplate(op, DoubleMask64.class, (DoubleMask64) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Double64Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, DoubleMask64.class, (DoubleMask64) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline - public final Double64Shuffle toShuffle() { - return (Double64Shuffle) toShuffle(vspecies(), false); + public final DoubleShuffle64 toShuffle() { + return (DoubleShuffle64) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Double64Mask test(Test op) { - return super.testTemplate(Double64Mask.class, op); // specialize + public final DoubleMask64 test(Test op) { + return super.testTemplate(DoubleMask64.class, op); // specialize } @Override @ForceInline - public final Double64Mask test(Test op, VectorMask m) { - return super.testTemplate(Double64Mask.class, op, (Double64Mask) m); // specialize + public final DoubleMask64 test(Test op, VectorMask m) { + return super.testTemplate(DoubleMask64.class, op, (DoubleMask64) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Double64Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Double64Mask.class, op, v); // specialize + public final DoubleMask64 compare(Comparison op, Vector v) { + return super.compareTemplate(DoubleMask64.class, op, v); // specialize } @Override @ForceInline - public final Double64Mask compare(Comparison op, double s) { - return super.compareTemplate(Double64Mask.class, op, s); // specialize + public final DoubleMask64 compare(Comparison op, double s) { + return super.compareTemplate(DoubleMask64.class, op, s); // specialize } @Override @ForceInline - public final Double64Mask compare(Comparison op, long s) { - return super.compareTemplate(Double64Mask.class, op, s); // specialize + public final DoubleMask64 compare(Comparison op, long s) { + return super.compareTemplate(DoubleMask64.class, op, s); // specialize } @Override @ForceInline - public final Double64Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Double64Mask.class, op, v, (Double64Mask) m); + public final DoubleMask64 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(DoubleMask64.class, op, v, (DoubleMask64) m); } @Override @ForceInline - public Double64Vector blend(Vector v, VectorMask m) { - return (Double64Vector) - super.blendTemplate(Double64Mask.class, - (Double64Vector) v, - (Double64Mask) m); // specialize + public DoubleVector64 blend(Vector v, VectorMask m) { + return (DoubleVector64) + super.blendTemplate(DoubleMask64.class, + (DoubleVector64) v, + (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector slice(int origin, Vector v) { - return (Double64Vector) super.sliceTemplate(origin, v); // specialize + public DoubleVector64 slice(int origin, Vector v) { + return (DoubleVector64) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Double64Vector slice(int origin) { - return (Double64Vector) super.sliceTemplate(origin); // specialize + public DoubleVector64 slice(int origin) { + return (DoubleVector64) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Double64Vector unslice(int origin, Vector w, int part) { - return (Double64Vector) super.unsliceTemplate(origin, w, part); // specialize + public DoubleVector64 unslice(int origin, Vector w, int part) { + return (DoubleVector64) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Double64Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Double64Vector) - super.unsliceTemplate(Double64Mask.class, + public DoubleVector64 unslice(int origin, Vector w, int part, VectorMask m) { + return (DoubleVector64) + super.unsliceTemplate(DoubleMask64.class, origin, w, part, - (Double64Mask) m); // specialize + (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector unslice(int origin) { - return (Double64Vector) super.unsliceTemplate(origin); // specialize + public DoubleVector64 unslice(int origin) { + return (DoubleVector64) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Double64Vector rearrange(VectorShuffle s) { - return (Double64Vector) - super.rearrangeTemplate(Double64Shuffle.class, - (Double64Shuffle) s); // specialize + public DoubleVector64 rearrange(VectorShuffle s) { + return (DoubleVector64) + super.rearrangeTemplate(DoubleShuffle64.class, + (DoubleShuffle64) s); // specialize } @Override @ForceInline - public Double64Vector rearrange(VectorShuffle shuffle, + public DoubleVector64 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Double64Vector) - super.rearrangeTemplate(Double64Shuffle.class, - Double64Mask.class, - (Double64Shuffle) shuffle, - (Double64Mask) m); // specialize + return (DoubleVector64) + super.rearrangeTemplate(DoubleShuffle64.class, + DoubleMask64.class, + (DoubleShuffle64) shuffle, + (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector rearrange(VectorShuffle s, + public DoubleVector64 rearrange(VectorShuffle s, Vector v) { - return (Double64Vector) - super.rearrangeTemplate(Double64Shuffle.class, - (Double64Shuffle) s, - (Double64Vector) v); // specialize + return (DoubleVector64) + super.rearrangeTemplate(DoubleShuffle64.class, + (DoubleShuffle64) s, + (DoubleVector64) v); // specialize } @Override @ForceInline - public Double64Vector compress(VectorMask m) { - return (Double64Vector) - super.compressTemplate(Double64Mask.class, - (Double64Mask) m); // specialize + public DoubleVector64 compress(VectorMask m) { + return (DoubleVector64) + super.compressTemplate(DoubleMask64.class, + (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector expand(VectorMask m) { - return (Double64Vector) - super.expandTemplate(Double64Mask.class, - (Double64Mask) m); // specialize + public DoubleVector64 expand(VectorMask m) { + return (DoubleVector64) + super.expandTemplate(DoubleMask64.class, + (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector selectFrom(Vector v) { - return (Double64Vector) - super.selectFromTemplate((Double64Vector) v); // specialize + public DoubleVector64 selectFrom(Vector v) { + return (DoubleVector64) + super.selectFromTemplate((DoubleVector64) v); // specialize } @Override @ForceInline - public Double64Vector selectFrom(Vector v, + public DoubleVector64 selectFrom(Vector v, VectorMask m) { - return (Double64Vector) - super.selectFromTemplate((Double64Vector) v, - Double64Mask.class, (Double64Mask) m); // specialize + return (DoubleVector64) + super.selectFromTemplate((DoubleVector64) v, + DoubleMask64.class, (DoubleMask64) m); // specialize } @Override @ForceInline - public Double64Vector selectFrom(Vector v1, + public DoubleVector64 selectFrom(Vector v1, Vector v2) { - return (Double64Vector) - super.selectFromTemplate((Double64Vector) v1, (Double64Vector) v2); // specialize + return (DoubleVector64) + super.selectFromTemplate((DoubleVector64) v1, (DoubleVector64) v2); // specialize } @ForceInline @@ -532,7 +537,7 @@ final class Double64Vector extends DoubleVector { @ForceInline @Override - public Double64Vector withLane(int i, double e) { + public DoubleVector64 withLane(int i, double e) { switch(i) { case 0: return withLaneHelper(0, e); default: throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); @@ -540,7 +545,7 @@ final class Double64Vector extends DoubleVector { } @ForceInline - public Double64Vector withLaneHelper(int i, double e) { + public DoubleVector64 withLaneHelper(int i, double e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Double.doubleToRawLongBits(e), @@ -553,19 +558,20 @@ final class Double64Vector extends DoubleVector { // Mask - static final class Double64Mask extends AbstractMask { + static final class DoubleMask64 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM - Double64Mask(boolean[] bits) { + static final Class CTYPE = double.class; // used by the JVM + + DoubleMask64(boolean[] bits) { this(bits, 0); } - Double64Mask(boolean[] bits, int offset) { + DoubleMask64(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Double64Mask(boolean val) { + DoubleMask64(boolean val) { super(prepare(val)); } @@ -598,31 +604,31 @@ final class Double64Vector extends DoubleVector { } @Override - Double64Mask uOp(MUnOp f) { + DoubleMask64 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Double64Mask(res); + return new DoubleMask64(res); } @Override - Double64Mask bOp(VectorMask m, MBinOp f) { + DoubleMask64 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Double64Mask)m).getBits(); + boolean[] mbits = ((DoubleMask64)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Double64Mask(res); + return new DoubleMask64(res); } @ForceInline @Override public final - Double64Vector toVector() { - return (Double64Vector) super.toVectorTemplate(); // specialize + DoubleVector64 toVector() { + return (DoubleVector64) super.toVectorTemplate(); // specialize } /** @@ -655,25 +661,25 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline /*package-private*/ - Double64Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Double64Mask) VectorSupport.indexPartiallyInUpperRange( - Double64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Double64Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + DoubleMask64 indexPartiallyInUpperRange(long offset, long limit) { + return (DoubleMask64) VectorSupport.indexPartiallyInUpperRange( + DoubleMask64.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (DoubleMask64) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Double64Mask not() { + public DoubleMask64 not() { return xor(maskAll(true)); } @Override @ForceInline - public Double64Mask compress() { - return (Double64Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Double64Vector.class, Double64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public DoubleMask64 compress() { + return (DoubleMask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + DoubleVector64.class, DoubleMask64.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -682,30 +688,30 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline - public Double64Mask and(VectorMask mask) { + public DoubleMask64 and(VectorMask mask) { Objects.requireNonNull(mask); - Double64Mask m = (Double64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask64 m = (DoubleMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Double64Mask or(VectorMask mask) { + public DoubleMask64 or(VectorMask mask) { Objects.requireNonNull(mask); - Double64Mask m = (Double64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask64 m = (DoubleMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Double64Mask xor(VectorMask mask) { + public DoubleMask64 xor(VectorMask mask) { Objects.requireNonNull(mask); - Double64Mask m = (Double64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMask64 m = (DoubleMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -715,21 +721,21 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -739,7 +745,7 @@ final class Double64Vector extends DoubleVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -749,7 +755,7 @@ final class Double64Vector extends DoubleVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Double64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(DoubleMask64.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -758,48 +764,49 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Double64Mask)m).getBits())); + (m, __) -> anyTrueHelper(((DoubleMask64)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Double64Mask)m).getBits())); + (m, __) -> allTrueHelper(((DoubleMask64)m).getBits())); } @ForceInline /*package-private*/ - static Double64Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Double64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static DoubleMask64 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(DoubleMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Double64Mask TRUE_MASK = new Double64Mask(true); - private static final Double64Mask FALSE_MASK = new Double64Mask(false); + private static final DoubleMask64 TRUE_MASK = new DoubleMask64(true); + private static final DoubleMask64 FALSE_MASK = new DoubleMask64(false); } // Shuffle - static final class Double64Shuffle extends AbstractShuffle { + static final class DoubleShuffle64 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Double64Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + DoubleShuffle64(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Double64Shuffle(int[] indices, int i) { + DoubleShuffle64(int[] indices, int i) { this(prepare(indices, i)); } - Double64Shuffle(IntUnaryOperator fn) { + DoubleShuffle64(IntUnaryOperator fn) { this(prepare(fn)); } @@ -819,23 +826,23 @@ final class Double64Vector extends DoubleVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Double64Shuffle IOTA = new Double64Shuffle(IDENTITY); + static final DoubleShuffle64 IOTA = new DoubleShuffle64(IDENTITY); @Override @ForceInline - public Double64Vector toVector() { - return (Double64Vector) toBitsVector().castShape(vspecies(), 0); + public DoubleVector64 toVector() { + return (DoubleVector64) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Long64Vector toBitsVector() { - return (Long64Vector) super.toBitsVectorTemplate(); + LongVector64 toBitsVector() { + return (LongVector64) super.toBitsVectorTemplate(); } @Override - Long64Vector toBitsVector0() { - return ((Long64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector64 toBitsVector0() { + return ((LongVector64) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -907,30 +914,30 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline - public final Double64Mask laneIsValid() { - return (Double64Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final DoubleMask64 laneIsValid() { + return (DoubleMask64) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Double64Shuffle rearrange(VectorShuffle shuffle) { - Double64Shuffle concreteShuffle = (Double64Shuffle) shuffle; - return (Double64Shuffle) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_64)) + public final DoubleShuffle64 rearrange(VectorShuffle shuffle) { + DoubleShuffle64 concreteShuffle = (DoubleShuffle64) shuffle; + return (DoubleShuffle64) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_64)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Double64Shuffle wrapIndexes() { - Long64Vector v = toBitsVector(); + public final DoubleShuffle64 wrapIndexes() { + LongVector64 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long64Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector64) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector64) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Double64Shuffle) v.toShuffle(vspecies(), false); + return (DoubleShuffle64) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -981,14 +988,14 @@ final class Double64Vector extends DoubleVector { @Override final DoubleVector fromArray0(double[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Double64Mask.class, a, offset, (Double64Mask) m, offsetInRange); // specialize + return super.fromArray0Template(DoubleMask64.class, a, offset, (DoubleMask64) m, offsetInRange); // specialize } @ForceInline @Override final DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Double64Mask.class, a, offset, indexMap, mapOffset, (Double64Mask) m); + return super.fromArray0Template(DoubleMask64.class, a, offset, indexMap, mapOffset, (DoubleMask64) m); } @@ -1004,7 +1011,7 @@ final class Double64Vector extends DoubleVector { @Override final DoubleVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Double64Mask.class, ms, offset, (Double64Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(DoubleMask64.class, ms, offset, (DoubleMask64) m, offsetInRange); // specialize } @ForceInline @@ -1018,14 +1025,14 @@ final class Double64Vector extends DoubleVector { @Override final void intoArray0(double[] a, int offset, VectorMask m) { - super.intoArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); + super.intoArray0Template(DoubleMask64.class, a, offset, (DoubleMask64) m); } @ForceInline @Override final void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Double64Mask.class, a, offset, indexMap, mapOffset, (Double64Mask) m); + super.intoArray0Template(DoubleMask64.class, a, offset, indexMap, mapOffset, (DoubleMask64) m); } @@ -1033,7 +1040,7 @@ final class Double64Vector extends DoubleVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Double64Mask.class, ms, offset, (Double64Mask) m); + super.intoMemorySegment0Template(DoubleMask64.class, ms, offset, (DoubleMask64) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVectorMax.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVectorMax.java index 8daa77dfc49..46c090e066e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVectorMax.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class DoubleMaxVector extends DoubleVector { +final class DoubleVectorMax extends DoubleVector { static final DoubleSpecies VSPECIES = (DoubleSpecies) DoubleVector.SPECIES_MAX; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = DoubleMaxVector.class; + static final Class VCLASS = DoubleVectorMax.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = double.class; // carrier type used by the JVM + static final Class ETYPE = double.class; // used by the JVM - DoubleMaxVector(double[] v) { + DoubleVectorMax(double[] v) { super(v); } - // For compatibility as DoubleMaxVector::new, + // For compatibility as DoubleVectorMax::new, // stored into species.vectorFactory. - DoubleMaxVector(Object v) { + DoubleVectorMax(Object v) { this((double[]) v); } - static final DoubleMaxVector ZERO = new DoubleMaxVector(new double[VLENGTH]); - static final DoubleMaxVector IOTA = new DoubleMaxVector(VSPECIES.iotaArray()); + static final DoubleVectorMax ZERO = new DoubleVectorMax(new double[VLENGTH]); + static final DoubleVectorMax IOTA = new DoubleVectorMax(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class DoubleMaxVector extends DoubleVector { @Override public final Class elementType() { return double.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Double.SIZE; } @@ -130,51 +135,51 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline - public final DoubleMaxVector broadcast(double e) { - return (DoubleMaxVector) super.broadcastTemplate(e); // specialize + public final DoubleVectorMax broadcast(double e) { + return (DoubleVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final DoubleMaxVector broadcast(long e) { - return (DoubleMaxVector) super.broadcastTemplate(e); // specialize + public final DoubleVectorMax broadcast(long e) { + return (DoubleVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - DoubleMaxMask maskFromArray(boolean[] bits) { - return new DoubleMaxMask(bits); + DoubleMaskMax maskFromArray(boolean[] bits) { + return new DoubleMaskMax(bits); } @Override @ForceInline - DoubleMaxShuffle iotaShuffle() { return DoubleMaxShuffle.IOTA; } + DoubleShuffleMax iotaShuffle() { return DoubleShuffleMax.IOTA; } @Override @ForceInline - DoubleMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - return (DoubleMaxShuffle) iotaShuffleTemplate(start, step, wrap); + DoubleShuffleMax iotaShuffle(int start, int step, boolean wrap) { + return (DoubleShuffleMax) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - DoubleMaxShuffle shuffleFromArray(int[] indices, int i) { return new DoubleMaxShuffle(indices, i); } + DoubleShuffleMax shuffleFromArray(int[] indices, int i) { return new DoubleShuffleMax(indices, i); } @Override @ForceInline - DoubleMaxShuffle shuffleFromOp(IntUnaryOperator fn) { return new DoubleMaxShuffle(fn); } + DoubleShuffleMax shuffleFromOp(IntUnaryOperator fn) { return new DoubleShuffleMax(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - DoubleMaxVector vectorFactory(double[] vec) { - return new DoubleMaxVector(vec); + DoubleVectorMax vectorFactory(double[] vec) { + return new DoubleVectorMax(vec); } @ForceInline final @Override - ByteMaxVector asByteVectorRaw() { - return (ByteMaxVector) super.asByteVectorRawTemplate(); // specialize + ByteVectorMax asByteVectorRaw() { + return (ByteVectorMax) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline final @Override - DoubleMaxVector uOp(FUnOp f) { - return (DoubleMaxVector) super.uOpTemplate(f); // specialize + DoubleVectorMax uOp(FUnOp f) { + return (DoubleVectorMax) super.uOpTemplate(f); // specialize } @ForceInline final @Override - DoubleMaxVector uOp(VectorMask m, FUnOp f) { - return (DoubleMaxVector) - super.uOpTemplate((DoubleMaxMask)m, f); // specialize + DoubleVectorMax uOp(VectorMask m, FUnOp f) { + return (DoubleVectorMax) + super.uOpTemplate((DoubleMaskMax)m, f); // specialize } // Binary operator @ForceInline final @Override - DoubleMaxVector bOp(Vector v, FBinOp f) { - return (DoubleMaxVector) super.bOpTemplate((DoubleMaxVector)v, f); // specialize + DoubleVectorMax bOp(Vector v, FBinOp f) { + return (DoubleVectorMax) super.bOpTemplate((DoubleVectorMax)v, f); // specialize } @ForceInline final @Override - DoubleMaxVector bOp(Vector v, + DoubleVectorMax bOp(Vector v, VectorMask m, FBinOp f) { - return (DoubleMaxVector) - super.bOpTemplate((DoubleMaxVector)v, (DoubleMaxMask)m, + return (DoubleVectorMax) + super.bOpTemplate((DoubleVectorMax)v, (DoubleMaskMax)m, f); // specialize } @@ -219,19 +224,19 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline final @Override - DoubleMaxVector tOp(Vector v1, Vector v2, FTriOp f) { - return (DoubleMaxVector) - super.tOpTemplate((DoubleMaxVector)v1, (DoubleMaxVector)v2, + DoubleVectorMax tOp(Vector v1, Vector v2, FTriOp f) { + return (DoubleVectorMax) + super.tOpTemplate((DoubleVectorMax)v1, (DoubleVectorMax)v2, f); // specialize } @ForceInline final @Override - DoubleMaxVector tOp(Vector v1, Vector v2, + DoubleVectorMax tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (DoubleMaxVector) - super.tOpTemplate((DoubleMaxVector)v1, (DoubleMaxVector)v2, - (DoubleMaxMask)m, f); // specialize + return (DoubleVectorMax) + super.tOpTemplate((DoubleVectorMax)v1, (DoubleVectorMax)v2, + (DoubleMaskMax)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline - public DoubleMaxVector lanewise(Unary op) { - return (DoubleMaxVector) super.lanewiseTemplate(op); // specialize + public DoubleVectorMax lanewise(Unary op) { + return (DoubleVectorMax) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public DoubleMaxVector lanewise(Unary op, VectorMask m) { - return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialize + public DoubleVectorMax lanewise(Unary op, VectorMask m) { + return (DoubleVectorMax) super.lanewiseTemplate(op, DoubleMaskMax.class, (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector lanewise(Binary op, Vector v) { - return (DoubleMaxVector) super.lanewiseTemplate(op, v); // specialize + public DoubleVectorMax lanewise(Binary op, Vector v) { + return (DoubleVectorMax) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public DoubleMaxVector lanewise(Binary op, Vector v, VectorMask m) { - return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, v, (DoubleMaxMask) m); // specialize + public DoubleVectorMax lanewise(Binary op, Vector v, VectorMask m) { + return (DoubleVectorMax) super.lanewiseTemplate(op, DoubleMaskMax.class, v, (DoubleMaskMax) m); // specialize } @@ -296,24 +301,24 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline public final - DoubleMaxVector + DoubleVectorMax lanewise(Ternary op, Vector v1, Vector v2) { - return (DoubleMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize + return (DoubleVectorMax) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - DoubleMaxVector + DoubleVectorMax lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, v1, v2, (DoubleMaxMask) m); // specialize + return (DoubleVectorMax) super.lanewiseTemplate(op, DoubleMaskMax.class, v1, v2, (DoubleMaskMax) m); // specialize } @Override @ForceInline public final - DoubleMaxVector addIndex(int scale) { - return (DoubleMaxVector) super.addIndexTemplate(scale); // specialize + DoubleVectorMax addIndex(int scale) { + return (DoubleVectorMax) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized + return super.reduceLanesTemplate(op, DoubleMaskMax.class, (DoubleMaskMax) m); // specialized } @Override @@ -341,7 +346,7 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized + return (long) super.reduceLanesTemplate(op, DoubleMaskMax.class, (DoubleMaskMax) m); // specialized } @Override @@ -352,160 +357,160 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline - public final DoubleMaxShuffle toShuffle() { - return (DoubleMaxShuffle) toShuffle(vspecies(), false); + public final DoubleShuffleMax toShuffle() { + return (DoubleShuffleMax) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final DoubleMaxMask test(Test op) { - return super.testTemplate(DoubleMaxMask.class, op); // specialize + public final DoubleMaskMax test(Test op) { + return super.testTemplate(DoubleMaskMax.class, op); // specialize } @Override @ForceInline - public final DoubleMaxMask test(Test op, VectorMask m) { - return super.testTemplate(DoubleMaxMask.class, op, (DoubleMaxMask) m); // specialize + public final DoubleMaskMax test(Test op, VectorMask m) { + return super.testTemplate(DoubleMaskMax.class, op, (DoubleMaskMax) m); // specialize } // Specialized comparisons @Override @ForceInline - public final DoubleMaxMask compare(Comparison op, Vector v) { - return super.compareTemplate(DoubleMaxMask.class, op, v); // specialize + public final DoubleMaskMax compare(Comparison op, Vector v) { + return super.compareTemplate(DoubleMaskMax.class, op, v); // specialize } @Override @ForceInline - public final DoubleMaxMask compare(Comparison op, double s) { - return super.compareTemplate(DoubleMaxMask.class, op, s); // specialize + public final DoubleMaskMax compare(Comparison op, double s) { + return super.compareTemplate(DoubleMaskMax.class, op, s); // specialize } @Override @ForceInline - public final DoubleMaxMask compare(Comparison op, long s) { - return super.compareTemplate(DoubleMaxMask.class, op, s); // specialize + public final DoubleMaskMax compare(Comparison op, long s) { + return super.compareTemplate(DoubleMaskMax.class, op, s); // specialize } @Override @ForceInline - public final DoubleMaxMask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(DoubleMaxMask.class, op, v, (DoubleMaxMask) m); + public final DoubleMaskMax compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(DoubleMaskMax.class, op, v, (DoubleMaskMax) m); } @Override @ForceInline - public DoubleMaxVector blend(Vector v, VectorMask m) { - return (DoubleMaxVector) - super.blendTemplate(DoubleMaxMask.class, - (DoubleMaxVector) v, - (DoubleMaxMask) m); // specialize + public DoubleVectorMax blend(Vector v, VectorMask m) { + return (DoubleVectorMax) + super.blendTemplate(DoubleMaskMax.class, + (DoubleVectorMax) v, + (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector slice(int origin, Vector v) { - return (DoubleMaxVector) super.sliceTemplate(origin, v); // specialize + public DoubleVectorMax slice(int origin, Vector v) { + return (DoubleVectorMax) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public DoubleMaxVector slice(int origin) { - return (DoubleMaxVector) super.sliceTemplate(origin); // specialize + public DoubleVectorMax slice(int origin) { + return (DoubleVectorMax) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public DoubleMaxVector unslice(int origin, Vector w, int part) { - return (DoubleMaxVector) super.unsliceTemplate(origin, w, part); // specialize + public DoubleVectorMax unslice(int origin, Vector w, int part) { + return (DoubleVectorMax) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public DoubleMaxVector unslice(int origin, Vector w, int part, VectorMask m) { - return (DoubleMaxVector) - super.unsliceTemplate(DoubleMaxMask.class, + public DoubleVectorMax unslice(int origin, Vector w, int part, VectorMask m) { + return (DoubleVectorMax) + super.unsliceTemplate(DoubleMaskMax.class, origin, w, part, - (DoubleMaxMask) m); // specialize + (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector unslice(int origin) { - return (DoubleMaxVector) super.unsliceTemplate(origin); // specialize + public DoubleVectorMax unslice(int origin) { + return (DoubleVectorMax) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public DoubleMaxVector rearrange(VectorShuffle s) { - return (DoubleMaxVector) - super.rearrangeTemplate(DoubleMaxShuffle.class, - (DoubleMaxShuffle) s); // specialize + public DoubleVectorMax rearrange(VectorShuffle s) { + return (DoubleVectorMax) + super.rearrangeTemplate(DoubleShuffleMax.class, + (DoubleShuffleMax) s); // specialize } @Override @ForceInline - public DoubleMaxVector rearrange(VectorShuffle shuffle, + public DoubleVectorMax rearrange(VectorShuffle shuffle, VectorMask m) { - return (DoubleMaxVector) - super.rearrangeTemplate(DoubleMaxShuffle.class, - DoubleMaxMask.class, - (DoubleMaxShuffle) shuffle, - (DoubleMaxMask) m); // specialize + return (DoubleVectorMax) + super.rearrangeTemplate(DoubleShuffleMax.class, + DoubleMaskMax.class, + (DoubleShuffleMax) shuffle, + (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector rearrange(VectorShuffle s, + public DoubleVectorMax rearrange(VectorShuffle s, Vector v) { - return (DoubleMaxVector) - super.rearrangeTemplate(DoubleMaxShuffle.class, - (DoubleMaxShuffle) s, - (DoubleMaxVector) v); // specialize + return (DoubleVectorMax) + super.rearrangeTemplate(DoubleShuffleMax.class, + (DoubleShuffleMax) s, + (DoubleVectorMax) v); // specialize } @Override @ForceInline - public DoubleMaxVector compress(VectorMask m) { - return (DoubleMaxVector) - super.compressTemplate(DoubleMaxMask.class, - (DoubleMaxMask) m); // specialize + public DoubleVectorMax compress(VectorMask m) { + return (DoubleVectorMax) + super.compressTemplate(DoubleMaskMax.class, + (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector expand(VectorMask m) { - return (DoubleMaxVector) - super.expandTemplate(DoubleMaxMask.class, - (DoubleMaxMask) m); // specialize + public DoubleVectorMax expand(VectorMask m) { + return (DoubleVectorMax) + super.expandTemplate(DoubleMaskMax.class, + (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector selectFrom(Vector v) { - return (DoubleMaxVector) - super.selectFromTemplate((DoubleMaxVector) v); // specialize + public DoubleVectorMax selectFrom(Vector v) { + return (DoubleVectorMax) + super.selectFromTemplate((DoubleVectorMax) v); // specialize } @Override @ForceInline - public DoubleMaxVector selectFrom(Vector v, + public DoubleVectorMax selectFrom(Vector v, VectorMask m) { - return (DoubleMaxVector) - super.selectFromTemplate((DoubleMaxVector) v, - DoubleMaxMask.class, (DoubleMaxMask) m); // specialize + return (DoubleVectorMax) + super.selectFromTemplate((DoubleVectorMax) v, + DoubleMaskMax.class, (DoubleMaskMax) m); // specialize } @Override @ForceInline - public DoubleMaxVector selectFrom(Vector v1, + public DoubleVectorMax selectFrom(Vector v1, Vector v2) { - return (DoubleMaxVector) - super.selectFromTemplate((DoubleMaxVector) v1, (DoubleMaxVector) v2); // specialize + return (DoubleVectorMax) + super.selectFromTemplate((DoubleVectorMax) v1, (DoubleVectorMax) v2); // specialize } @ForceInline @@ -531,7 +536,7 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline @Override - public DoubleMaxVector withLane(int i, double e) { + public DoubleVectorMax withLane(int i, double e) { if (i < 0 || i >= VLENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); } @@ -539,7 +544,7 @@ final class DoubleMaxVector extends DoubleVector { } @ForceInline - public DoubleMaxVector withLaneHelper(int i, double e) { + public DoubleVectorMax withLaneHelper(int i, double e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Double.doubleToRawLongBits(e), @@ -552,19 +557,20 @@ final class DoubleMaxVector extends DoubleVector { // Mask - static final class DoubleMaxMask extends AbstractMask { + static final class DoubleMaskMax extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = double.class; // used by the JVM - DoubleMaxMask(boolean[] bits) { + static final Class CTYPE = double.class; // used by the JVM + + DoubleMaskMax(boolean[] bits) { this(bits, 0); } - DoubleMaxMask(boolean[] bits, int offset) { + DoubleMaskMax(boolean[] bits, int offset) { super(prepare(bits, offset)); } - DoubleMaxMask(boolean val) { + DoubleMaskMax(boolean val) { super(prepare(val)); } @@ -597,31 +603,31 @@ final class DoubleMaxVector extends DoubleVector { } @Override - DoubleMaxMask uOp(MUnOp f) { + DoubleMaskMax uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new DoubleMaxMask(res); + return new DoubleMaskMax(res); } @Override - DoubleMaxMask bOp(VectorMask m, MBinOp f) { + DoubleMaskMax bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((DoubleMaxMask)m).getBits(); + boolean[] mbits = ((DoubleMaskMax)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new DoubleMaxMask(res); + return new DoubleMaskMax(res); } @ForceInline @Override public final - DoubleMaxVector toVector() { - return (DoubleMaxVector) super.toVectorTemplate(); // specialize + DoubleVectorMax toVector() { + return (DoubleVectorMax) super.toVectorTemplate(); // specialize } /** @@ -654,25 +660,25 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline /*package-private*/ - DoubleMaxMask indexPartiallyInUpperRange(long offset, long limit) { - return (DoubleMaxMask) VectorSupport.indexPartiallyInUpperRange( - DoubleMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (DoubleMaxMask) TRUE_MASK.indexPartiallyInRange(o, l)); + DoubleMaskMax indexPartiallyInUpperRange(long offset, long limit) { + return (DoubleMaskMax) VectorSupport.indexPartiallyInUpperRange( + DoubleMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (DoubleMaskMax) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public DoubleMaxMask not() { + public DoubleMaskMax not() { return xor(maskAll(true)); } @Override @ForceInline - public DoubleMaxMask compress() { - return (DoubleMaxMask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - DoubleMaxVector.class, DoubleMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public DoubleMaskMax compress() { + return (DoubleMaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + DoubleVectorMax.class, DoubleMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -681,30 +687,30 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline - public DoubleMaxMask and(VectorMask mask) { + public DoubleMaskMax and(VectorMask mask) { Objects.requireNonNull(mask); - DoubleMaxMask m = (DoubleMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMaskMax m = (DoubleMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public DoubleMaxMask or(VectorMask mask) { + public DoubleMaskMax or(VectorMask mask) { Objects.requireNonNull(mask); - DoubleMaxMask m = (DoubleMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMaskMax m = (DoubleMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public DoubleMaxMask xor(VectorMask mask) { + public DoubleMaskMax xor(VectorMask mask) { Objects.requireNonNull(mask); - DoubleMaxMask m = (DoubleMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + DoubleMaskMax m = (DoubleMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -714,21 +720,21 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -738,7 +744,7 @@ final class DoubleMaxVector extends DoubleVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -748,7 +754,7 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(DoubleMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(DoubleMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -757,48 +763,49 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((DoubleMaxMask)m).getBits())); + (m, __) -> anyTrueHelper(((DoubleMaskMax)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((DoubleMaxMask)m).getBits())); + (m, __) -> allTrueHelper(((DoubleMaskMax)m).getBits())); } @ForceInline /*package-private*/ - static DoubleMaxMask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(DoubleMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static DoubleMaskMax maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(DoubleMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final DoubleMaxMask TRUE_MASK = new DoubleMaxMask(true); - private static final DoubleMaxMask FALSE_MASK = new DoubleMaxMask(false); + private static final DoubleMaskMax TRUE_MASK = new DoubleMaskMax(true); + private static final DoubleMaskMax FALSE_MASK = new DoubleMaskMax(false); } // Shuffle - static final class DoubleMaxShuffle extends AbstractShuffle { + static final class DoubleShuffleMax extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - DoubleMaxShuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + DoubleShuffleMax(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - DoubleMaxShuffle(int[] indices, int i) { + DoubleShuffleMax(int[] indices, int i) { this(prepare(indices, i)); } - DoubleMaxShuffle(IntUnaryOperator fn) { + DoubleShuffleMax(IntUnaryOperator fn) { this(prepare(fn)); } @@ -818,23 +825,23 @@ final class DoubleMaxVector extends DoubleVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final DoubleMaxShuffle IOTA = new DoubleMaxShuffle(IDENTITY); + static final DoubleShuffleMax IOTA = new DoubleShuffleMax(IDENTITY); @Override @ForceInline - public DoubleMaxVector toVector() { - return (DoubleMaxVector) toBitsVector().castShape(vspecies(), 0); + public DoubleVectorMax toVector() { + return (DoubleVectorMax) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - LongMaxVector toBitsVector() { - return (LongMaxVector) super.toBitsVectorTemplate(); + LongVectorMax toBitsVector() { + return (LongVectorMax) super.toBitsVectorTemplate(); } @Override - LongMaxVector toBitsVector0() { - return ((LongMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVectorMax toBitsVector0() { + return ((LongVectorMax) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -906,30 +913,30 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline - public final DoubleMaxMask laneIsValid() { - return (DoubleMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + public final DoubleMaskMax laneIsValid() { + return (DoubleMaskMax) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final DoubleMaxShuffle rearrange(VectorShuffle shuffle) { - DoubleMaxShuffle concreteShuffle = (DoubleMaxShuffle) shuffle; - return (DoubleMaxShuffle) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_MAX)) + public final DoubleShuffleMax rearrange(VectorShuffle shuffle) { + DoubleShuffleMax concreteShuffle = (DoubleShuffleMax) shuffle; + return (DoubleShuffleMax) toBitsVector().rearrange(concreteShuffle.cast(LongVector.SPECIES_MAX)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final DoubleMaxShuffle wrapIndexes() { - LongMaxVector v = toBitsVector(); + public final DoubleShuffleMax wrapIndexes() { + LongVectorMax v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (LongMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVectorMax) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (LongMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVectorMax) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (DoubleMaxShuffle) v.toShuffle(vspecies(), false); + return (DoubleShuffleMax) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -980,14 +987,14 @@ final class DoubleMaxVector extends DoubleVector { @Override final DoubleVector fromArray0(double[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m, offsetInRange); // specialize + return super.fromArray0Template(DoubleMaskMax.class, a, offset, (DoubleMaskMax) m, offsetInRange); // specialize } @ForceInline @Override final DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(DoubleMaxMask.class, a, offset, indexMap, mapOffset, (DoubleMaxMask) m); + return super.fromArray0Template(DoubleMaskMax.class, a, offset, indexMap, mapOffset, (DoubleMaskMax) m); } @@ -1003,7 +1010,7 @@ final class DoubleMaxVector extends DoubleVector { @Override final DoubleVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(DoubleMaxMask.class, ms, offset, (DoubleMaxMask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(DoubleMaskMax.class, ms, offset, (DoubleMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -1017,14 +1024,14 @@ final class DoubleMaxVector extends DoubleVector { @Override final void intoArray0(double[] a, int offset, VectorMask m) { - super.intoArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); + super.intoArray0Template(DoubleMaskMax.class, a, offset, (DoubleMaskMax) m); } @ForceInline @Override final void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(DoubleMaxMask.class, a, offset, indexMap, mapOffset, (DoubleMaxMask) m); + super.intoArray0Template(DoubleMaskMax.class, a, offset, indexMap, mapOffset, (DoubleMaskMax) m); } @@ -1032,7 +1039,7 @@ final class DoubleMaxVector extends DoubleVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(DoubleMaxMask.class, ms, offset, (DoubleMaxMask) m); + super.intoMemorySegment0Template(DoubleMaskMax.class, ms, offset, (DoubleMaskMax) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java index ee9cb9119fd..5862a295fa3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java @@ -84,8 +84,8 @@ public abstract class FloatVector extends AbstractVector { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -724,7 +724,7 @@ public abstract class FloatVector extends AbstractVector { @ForceInline final FloatVector unaryMathOp(VectorOperators.Unary op) { - return VectorMathLibrary.unaryMathOp(op, opCode(op), species(), FloatVector::unaryOperations, + return VectorMathLibrary.unaryMathOp(op, opCode(op), vspecies(), FloatVector::unaryOperations, this); } @@ -851,7 +851,7 @@ public abstract class FloatVector extends AbstractVector { @ForceInline final FloatVector binaryMathOp(VectorOperators.Binary op, FloatVector that) { - return VectorMathLibrary.binaryMathOp(op, opCode(op), species(), FloatVector::binaryOperations, + return VectorMathLibrary.binaryMathOp(op, opCode(op), vspecies(), FloatVector::binaryOperations, this, that); } @@ -3926,13 +3926,13 @@ public abstract class FloatVector extends AbstractVector { @Override @ForceInline public final FloatVector zero() { - if ((Class) vectorType() == FloatMaxVector.class) - return FloatMaxVector.ZERO; + if ((Class) vectorType() == FloatVectorMax.class) + return FloatVectorMax.ZERO; switch (vectorBitSize()) { - case 64: return Float64Vector.ZERO; - case 128: return Float128Vector.ZERO; - case 256: return Float256Vector.ZERO; - case 512: return Float512Vector.ZERO; + case 64: return FloatVector64.ZERO; + case 128: return FloatVector128.ZERO; + case 256: return FloatVector256.ZERO; + case 512: return FloatVector512.ZERO; } throw new AssertionError(); } @@ -3940,13 +3940,13 @@ public abstract class FloatVector extends AbstractVector { @Override @ForceInline public final FloatVector iota() { - if ((Class) vectorType() == FloatMaxVector.class) - return FloatMaxVector.IOTA; + if ((Class) vectorType() == FloatVectorMax.class) + return FloatVectorMax.IOTA; switch (vectorBitSize()) { - case 64: return Float64Vector.IOTA; - case 128: return Float128Vector.IOTA; - case 256: return Float256Vector.IOTA; - case 512: return Float512Vector.IOTA; + case 64: return FloatVector64.IOTA; + case 128: return FloatVector128.IOTA; + case 256: return FloatVector256.IOTA; + case 512: return FloatVector512.IOTA; } throw new AssertionError(); } @@ -3955,13 +3955,13 @@ public abstract class FloatVector extends AbstractVector { @Override @ForceInline public final VectorMask maskAll(boolean bit) { - if ((Class) vectorType() == FloatMaxVector.class) - return FloatMaxVector.FloatMaxMask.maskAll(bit); + if ((Class) vectorType() == FloatVectorMax.class) + return FloatVectorMax.FloatMaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return Float64Vector.Float64Mask.maskAll(bit); - case 128: return Float128Vector.Float128Mask.maskAll(bit); - case 256: return Float256Vector.Float256Mask.maskAll(bit); - case 512: return Float512Vector.Float512Mask.maskAll(bit); + case 64: return FloatVector64.FloatMask64.maskAll(bit); + case 128: return FloatVector128.FloatMask128.maskAll(bit); + case 256: return FloatVector256.FloatMask256.maskAll(bit); + case 512: return FloatVector512.FloatMask512.maskAll(bit); } throw new AssertionError(); } @@ -3989,42 +3989,42 @@ public abstract class FloatVector extends AbstractVector { /** Species representing {@link FloatVector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies SPECIES_64 = new FloatSpecies(VectorShape.S_64_BIT, - Float64Vector.class, - Float64Vector.Float64Mask.class, - Float64Vector.Float64Shuffle.class, - Float64Vector::new); + FloatVector64.class, + FloatVector64.FloatMask64.class, + FloatVector64.FloatShuffle64.class, + FloatVector64::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies SPECIES_128 = new FloatSpecies(VectorShape.S_128_BIT, - Float128Vector.class, - Float128Vector.Float128Mask.class, - Float128Vector.Float128Shuffle.class, - Float128Vector::new); + FloatVector128.class, + FloatVector128.FloatMask128.class, + FloatVector128.FloatShuffle128.class, + FloatVector128::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies SPECIES_256 = new FloatSpecies(VectorShape.S_256_BIT, - Float256Vector.class, - Float256Vector.Float256Mask.class, - Float256Vector.Float256Shuffle.class, - Float256Vector::new); + FloatVector256.class, + FloatVector256.FloatMask256.class, + FloatVector256.FloatShuffle256.class, + FloatVector256::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies SPECIES_512 = new FloatSpecies(VectorShape.S_512_BIT, - Float512Vector.class, - Float512Vector.Float512Mask.class, - Float512Vector.Float512Shuffle.class, - Float512Vector::new); + FloatVector512.class, + FloatVector512.FloatMask512.class, + FloatVector512.FloatShuffle512.class, + FloatVector512::new); /** Species representing {@link FloatVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies SPECIES_MAX = new FloatSpecies(VectorShape.S_Max_BIT, - FloatMaxVector.class, - FloatMaxVector.FloatMaxMask.class, - FloatMaxVector.FloatMaxShuffle.class, - FloatMaxVector::new); + FloatVectorMax.class, + FloatVectorMax.FloatMaskMax.class, + FloatVectorMax.FloatShuffleMax.class, + FloatVectorMax::new); /** * Preferred species for {@link FloatVector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector128.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector128.java index 62c7d535fc7..1e3867e84fc 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector128.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Float128Vector extends FloatVector { +final class FloatVector128 extends FloatVector { static final FloatSpecies VSPECIES = (FloatSpecies) FloatVector.SPECIES_128; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Float128Vector.class; + static final Class VCLASS = FloatVector128.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = float.class; // carrier type used by the JVM + static final Class ETYPE = float.class; // used by the JVM - Float128Vector(float[] v) { + FloatVector128(float[] v) { super(v); } - // For compatibility as Float128Vector::new, + // For compatibility as FloatVector128::new, // stored into species.vectorFactory. - Float128Vector(Object v) { + FloatVector128(Object v) { this((float[]) v); } - static final Float128Vector ZERO = new Float128Vector(new float[VLENGTH]); - static final Float128Vector IOTA = new Float128Vector(VSPECIES.iotaArray()); + static final FloatVector128 ZERO = new FloatVector128(new float[VLENGTH]); + static final FloatVector128 IOTA = new FloatVector128(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Float128Vector extends FloatVector { @Override public final Class elementType() { return float.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Float.SIZE; } @@ -130,51 +135,51 @@ final class Float128Vector extends FloatVector { @Override @ForceInline - public final Float128Vector broadcast(float e) { - return (Float128Vector) super.broadcastTemplate(e); // specialize + public final FloatVector128 broadcast(float e) { + return (FloatVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Float128Vector broadcast(long e) { - return (Float128Vector) super.broadcastTemplate(e); // specialize + public final FloatVector128 broadcast(long e) { + return (FloatVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Float128Mask maskFromArray(boolean[] bits) { - return new Float128Mask(bits); + FloatMask128 maskFromArray(boolean[] bits) { + return new FloatMask128(bits); } @Override @ForceInline - Float128Shuffle iotaShuffle() { return Float128Shuffle.IOTA; } + FloatShuffle128 iotaShuffle() { return FloatShuffle128.IOTA; } @Override @ForceInline - Float128Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Float128Shuffle) iotaShuffleTemplate(start, step, wrap); + FloatShuffle128 iotaShuffle(int start, int step, boolean wrap) { + return (FloatShuffle128) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float128Shuffle shuffleFromArray(int[] indices, int i) { return new Float128Shuffle(indices, i); } + FloatShuffle128 shuffleFromArray(int[] indices, int i) { return new FloatShuffle128(indices, i); } @Override @ForceInline - Float128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Float128Shuffle(fn); } + FloatShuffle128 shuffleFromOp(IntUnaryOperator fn) { return new FloatShuffle128(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Float128Vector vectorFactory(float[] vec) { - return new Float128Vector(vec); + FloatVector128 vectorFactory(float[] vec) { + return new FloatVector128(vec); } @ForceInline final @Override - Byte128Vector asByteVectorRaw() { - return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector128 asByteVectorRaw() { + return (ByteVector128) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Float128Vector extends FloatVector { @ForceInline final @Override - Float128Vector uOp(FUnOp f) { - return (Float128Vector) super.uOpTemplate(f); // specialize + FloatVector128 uOp(FUnOp f) { + return (FloatVector128) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Float128Vector uOp(VectorMask m, FUnOp f) { - return (Float128Vector) - super.uOpTemplate((Float128Mask)m, f); // specialize + FloatVector128 uOp(VectorMask m, FUnOp f) { + return (FloatVector128) + super.uOpTemplate((FloatMask128)m, f); // specialize } // Binary operator @ForceInline final @Override - Float128Vector bOp(Vector v, FBinOp f) { - return (Float128Vector) super.bOpTemplate((Float128Vector)v, f); // specialize + FloatVector128 bOp(Vector v, FBinOp f) { + return (FloatVector128) super.bOpTemplate((FloatVector128)v, f); // specialize } @ForceInline final @Override - Float128Vector bOp(Vector v, + FloatVector128 bOp(Vector v, VectorMask m, FBinOp f) { - return (Float128Vector) - super.bOpTemplate((Float128Vector)v, (Float128Mask)m, + return (FloatVector128) + super.bOpTemplate((FloatVector128)v, (FloatMask128)m, f); // specialize } @@ -219,19 +224,19 @@ final class Float128Vector extends FloatVector { @ForceInline final @Override - Float128Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Float128Vector) - super.tOpTemplate((Float128Vector)v1, (Float128Vector)v2, + FloatVector128 tOp(Vector v1, Vector v2, FTriOp f) { + return (FloatVector128) + super.tOpTemplate((FloatVector128)v1, (FloatVector128)v2, f); // specialize } @ForceInline final @Override - Float128Vector tOp(Vector v1, Vector v2, + FloatVector128 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Float128Vector) - super.tOpTemplate((Float128Vector)v1, (Float128Vector)v2, - (Float128Mask)m, f); // specialize + return (FloatVector128) + super.tOpTemplate((FloatVector128)v1, (FloatVector128)v2, + (FloatMask128)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Float128Vector extends FloatVector { @Override @ForceInline - public Float128Vector lanewise(Unary op) { - return (Float128Vector) super.lanewiseTemplate(op); // specialize + public FloatVector128 lanewise(Unary op) { + return (FloatVector128) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Float128Vector lanewise(Unary op, VectorMask m) { - return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, (Float128Mask) m); // specialize + public FloatVector128 lanewise(Unary op, VectorMask m) { + return (FloatVector128) super.lanewiseTemplate(op, FloatMask128.class, (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector lanewise(Binary op, Vector v) { - return (Float128Vector) super.lanewiseTemplate(op, v); // specialize + public FloatVector128 lanewise(Binary op, Vector v) { + return (FloatVector128) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Float128Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, v, (Float128Mask) m); // specialize + public FloatVector128 lanewise(Binary op, Vector v, VectorMask m) { + return (FloatVector128) super.lanewiseTemplate(op, FloatMask128.class, v, (FloatMask128) m); // specialize } @@ -296,24 +301,24 @@ final class Float128Vector extends FloatVector { @Override @ForceInline public final - Float128Vector + FloatVector128 lanewise(Ternary op, Vector v1, Vector v2) { - return (Float128Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (FloatVector128) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Float128Vector + FloatVector128 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, v1, v2, (Float128Mask) m); // specialize + return (FloatVector128) super.lanewiseTemplate(op, FloatMask128.class, v1, v2, (FloatMask128) m); // specialize } @Override @ForceInline public final - Float128Vector addIndex(int scale) { - return (Float128Vector) super.addIndexTemplate(scale); // specialize + FloatVector128 addIndex(int scale) { + return (FloatVector128) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Float128Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized + return super.reduceLanesTemplate(op, FloatMask128.class, (FloatMask128) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Float128Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, FloatMask128.class, (FloatMask128) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Float128Vector extends FloatVector { @Override @ForceInline - public final Float128Shuffle toShuffle() { - return (Float128Shuffle) toShuffle(vspecies(), false); + public final FloatShuffle128 toShuffle() { + return (FloatShuffle128) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Float128Mask test(Test op) { - return super.testTemplate(Float128Mask.class, op); // specialize + public final FloatMask128 test(Test op) { + return super.testTemplate(FloatMask128.class, op); // specialize } @Override @ForceInline - public final Float128Mask test(Test op, VectorMask m) { - return super.testTemplate(Float128Mask.class, op, (Float128Mask) m); // specialize + public final FloatMask128 test(Test op, VectorMask m) { + return super.testTemplate(FloatMask128.class, op, (FloatMask128) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Float128Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Float128Mask.class, op, v); // specialize + public final FloatMask128 compare(Comparison op, Vector v) { + return super.compareTemplate(FloatMask128.class, op, v); // specialize } @Override @ForceInline - public final Float128Mask compare(Comparison op, float s) { - return super.compareTemplate(Float128Mask.class, op, s); // specialize + public final FloatMask128 compare(Comparison op, float s) { + return super.compareTemplate(FloatMask128.class, op, s); // specialize } @Override @ForceInline - public final Float128Mask compare(Comparison op, long s) { - return super.compareTemplate(Float128Mask.class, op, s); // specialize + public final FloatMask128 compare(Comparison op, long s) { + return super.compareTemplate(FloatMask128.class, op, s); // specialize } @Override @ForceInline - public final Float128Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Float128Mask.class, op, v, (Float128Mask) m); + public final FloatMask128 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(FloatMask128.class, op, v, (FloatMask128) m); } @Override @ForceInline - public Float128Vector blend(Vector v, VectorMask m) { - return (Float128Vector) - super.blendTemplate(Float128Mask.class, - (Float128Vector) v, - (Float128Mask) m); // specialize + public FloatVector128 blend(Vector v, VectorMask m) { + return (FloatVector128) + super.blendTemplate(FloatMask128.class, + (FloatVector128) v, + (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector slice(int origin, Vector v) { - return (Float128Vector) super.sliceTemplate(origin, v); // specialize + public FloatVector128 slice(int origin, Vector v) { + return (FloatVector128) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Float128Vector slice(int origin) { - return (Float128Vector) super.sliceTemplate(origin); // specialize + public FloatVector128 slice(int origin) { + return (FloatVector128) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Float128Vector unslice(int origin, Vector w, int part) { - return (Float128Vector) super.unsliceTemplate(origin, w, part); // specialize + public FloatVector128 unslice(int origin, Vector w, int part) { + return (FloatVector128) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Float128Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Float128Vector) - super.unsliceTemplate(Float128Mask.class, + public FloatVector128 unslice(int origin, Vector w, int part, VectorMask m) { + return (FloatVector128) + super.unsliceTemplate(FloatMask128.class, origin, w, part, - (Float128Mask) m); // specialize + (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector unslice(int origin) { - return (Float128Vector) super.unsliceTemplate(origin); // specialize + public FloatVector128 unslice(int origin) { + return (FloatVector128) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Float128Vector rearrange(VectorShuffle s) { - return (Float128Vector) - super.rearrangeTemplate(Float128Shuffle.class, - (Float128Shuffle) s); // specialize + public FloatVector128 rearrange(VectorShuffle s) { + return (FloatVector128) + super.rearrangeTemplate(FloatShuffle128.class, + (FloatShuffle128) s); // specialize } @Override @ForceInline - public Float128Vector rearrange(VectorShuffle shuffle, + public FloatVector128 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Float128Vector) - super.rearrangeTemplate(Float128Shuffle.class, - Float128Mask.class, - (Float128Shuffle) shuffle, - (Float128Mask) m); // specialize + return (FloatVector128) + super.rearrangeTemplate(FloatShuffle128.class, + FloatMask128.class, + (FloatShuffle128) shuffle, + (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector rearrange(VectorShuffle s, + public FloatVector128 rearrange(VectorShuffle s, Vector v) { - return (Float128Vector) - super.rearrangeTemplate(Float128Shuffle.class, - (Float128Shuffle) s, - (Float128Vector) v); // specialize + return (FloatVector128) + super.rearrangeTemplate(FloatShuffle128.class, + (FloatShuffle128) s, + (FloatVector128) v); // specialize } @Override @ForceInline - public Float128Vector compress(VectorMask m) { - return (Float128Vector) - super.compressTemplate(Float128Mask.class, - (Float128Mask) m); // specialize + public FloatVector128 compress(VectorMask m) { + return (FloatVector128) + super.compressTemplate(FloatMask128.class, + (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector expand(VectorMask m) { - return (Float128Vector) - super.expandTemplate(Float128Mask.class, - (Float128Mask) m); // specialize + public FloatVector128 expand(VectorMask m) { + return (FloatVector128) + super.expandTemplate(FloatMask128.class, + (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector selectFrom(Vector v) { - return (Float128Vector) - super.selectFromTemplate((Float128Vector) v); // specialize + public FloatVector128 selectFrom(Vector v) { + return (FloatVector128) + super.selectFromTemplate((FloatVector128) v); // specialize } @Override @ForceInline - public Float128Vector selectFrom(Vector v, + public FloatVector128 selectFrom(Vector v, VectorMask m) { - return (Float128Vector) - super.selectFromTemplate((Float128Vector) v, - Float128Mask.class, (Float128Mask) m); // specialize + return (FloatVector128) + super.selectFromTemplate((FloatVector128) v, + FloatMask128.class, (FloatMask128) m); // specialize } @Override @ForceInline - public Float128Vector selectFrom(Vector v1, + public FloatVector128 selectFrom(Vector v1, Vector v2) { - return (Float128Vector) - super.selectFromTemplate((Float128Vector) v1, (Float128Vector) v2); // specialize + return (FloatVector128) + super.selectFromTemplate((FloatVector128) v1, (FloatVector128) v2); // specialize } @ForceInline @@ -535,7 +540,7 @@ final class Float128Vector extends FloatVector { @ForceInline @Override - public Float128Vector withLane(int i, float e) { + public FloatVector128 withLane(int i, float e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -546,7 +551,7 @@ final class Float128Vector extends FloatVector { } @ForceInline - public Float128Vector withLaneHelper(int i, float e) { + public FloatVector128 withLaneHelper(int i, float e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Float.floatToRawIntBits(e), @@ -559,19 +564,20 @@ final class Float128Vector extends FloatVector { // Mask - static final class Float128Mask extends AbstractMask { + static final class FloatMask128 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM - Float128Mask(boolean[] bits) { + static final Class CTYPE = float.class; // used by the JVM + + FloatMask128(boolean[] bits) { this(bits, 0); } - Float128Mask(boolean[] bits, int offset) { + FloatMask128(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Float128Mask(boolean val) { + FloatMask128(boolean val) { super(prepare(val)); } @@ -604,31 +610,31 @@ final class Float128Vector extends FloatVector { } @Override - Float128Mask uOp(MUnOp f) { + FloatMask128 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Float128Mask(res); + return new FloatMask128(res); } @Override - Float128Mask bOp(VectorMask m, MBinOp f) { + FloatMask128 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Float128Mask)m).getBits(); + boolean[] mbits = ((FloatMask128)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Float128Mask(res); + return new FloatMask128(res); } @ForceInline @Override public final - Float128Vector toVector() { - return (Float128Vector) super.toVectorTemplate(); // specialize + FloatVector128 toVector() { + return (FloatVector128) super.toVectorTemplate(); // specialize } /** @@ -661,25 +667,25 @@ final class Float128Vector extends FloatVector { @Override @ForceInline /*package-private*/ - Float128Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Float128Mask) VectorSupport.indexPartiallyInUpperRange( - Float128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Float128Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + FloatMask128 indexPartiallyInUpperRange(long offset, long limit) { + return (FloatMask128) VectorSupport.indexPartiallyInUpperRange( + FloatMask128.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (FloatMask128) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Float128Mask not() { + public FloatMask128 not() { return xor(maskAll(true)); } @Override @ForceInline - public Float128Mask compress() { - return (Float128Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Float128Vector.class, Float128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public FloatMask128 compress() { + return (FloatMask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + FloatVector128.class, FloatMask128.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -688,30 +694,30 @@ final class Float128Vector extends FloatVector { @Override @ForceInline - public Float128Mask and(VectorMask mask) { + public FloatMask128 and(VectorMask mask) { Objects.requireNonNull(mask); - Float128Mask m = (Float128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask128 m = (FloatMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Float128Mask or(VectorMask mask) { + public FloatMask128 or(VectorMask mask) { Objects.requireNonNull(mask); - Float128Mask m = (Float128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask128 m = (FloatMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Float128Mask xor(VectorMask mask) { + public FloatMask128 xor(VectorMask mask) { Objects.requireNonNull(mask); - Float128Mask m = (Float128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask128 m = (FloatMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -721,21 +727,21 @@ final class Float128Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -745,7 +751,7 @@ final class Float128Vector extends FloatVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -755,7 +761,7 @@ final class Float128Vector extends FloatVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Float128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(FloatMask128.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -764,48 +770,49 @@ final class Float128Vector extends FloatVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Float128Mask)m).getBits())); + (m, __) -> anyTrueHelper(((FloatMask128)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Float128Mask)m).getBits())); + (m, __) -> allTrueHelper(((FloatMask128)m).getBits())); } @ForceInline /*package-private*/ - static Float128Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Float128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static FloatMask128 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(FloatMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Float128Mask TRUE_MASK = new Float128Mask(true); - private static final Float128Mask FALSE_MASK = new Float128Mask(false); + private static final FloatMask128 TRUE_MASK = new FloatMask128(true); + private static final FloatMask128 FALSE_MASK = new FloatMask128(false); } // Shuffle - static final class Float128Shuffle extends AbstractShuffle { + static final class FloatShuffle128 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Float128Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + FloatShuffle128(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Float128Shuffle(int[] indices, int i) { + FloatShuffle128(int[] indices, int i) { this(prepare(indices, i)); } - Float128Shuffle(IntUnaryOperator fn) { + FloatShuffle128(IntUnaryOperator fn) { this(prepare(fn)); } @@ -825,23 +832,23 @@ final class Float128Vector extends FloatVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Float128Shuffle IOTA = new Float128Shuffle(IDENTITY); + static final FloatShuffle128 IOTA = new FloatShuffle128(IDENTITY); @Override @ForceInline - public Float128Vector toVector() { - return (Float128Vector) toBitsVector().castShape(vspecies(), 0); + public FloatVector128 toVector() { + return (FloatVector128) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Int128Vector toBitsVector() { - return (Int128Vector) super.toBitsVectorTemplate(); + IntVector128 toBitsVector() { + return (IntVector128) super.toBitsVectorTemplate(); } @Override - Int128Vector toBitsVector0() { - return ((Int128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector128 toBitsVector0() { + return ((IntVector128) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -864,30 +871,30 @@ final class Float128Vector extends FloatVector { @Override @ForceInline - public final Float128Mask laneIsValid() { - return (Float128Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final FloatMask128 laneIsValid() { + return (FloatMask128) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Float128Shuffle rearrange(VectorShuffle shuffle) { - Float128Shuffle concreteShuffle = (Float128Shuffle) shuffle; - return (Float128Shuffle) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_128)) + public final FloatShuffle128 rearrange(VectorShuffle shuffle) { + FloatShuffle128 concreteShuffle = (FloatShuffle128) shuffle; + return (FloatShuffle128) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_128)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Float128Shuffle wrapIndexes() { - Int128Vector v = toBitsVector(); + public final FloatShuffle128 wrapIndexes() { + IntVector128 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int128Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector128) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector128) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Float128Shuffle) v.toShuffle(vspecies(), false); + return (FloatShuffle128) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -938,14 +945,14 @@ final class Float128Vector extends FloatVector { @Override final FloatVector fromArray0(float[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Float128Mask.class, a, offset, (Float128Mask) m, offsetInRange); // specialize + return super.fromArray0Template(FloatMask128.class, a, offset, (FloatMask128) m, offsetInRange); // specialize } @ForceInline @Override final FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Float128Mask.class, a, offset, indexMap, mapOffset, (Float128Mask) m); + return super.fromArray0Template(FloatMask128.class, a, offset, indexMap, mapOffset, (FloatMask128) m); } @@ -961,7 +968,7 @@ final class Float128Vector extends FloatVector { @Override final FloatVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Float128Mask.class, ms, offset, (Float128Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(FloatMask128.class, ms, offset, (FloatMask128) m, offsetInRange); // specialize } @ForceInline @@ -975,14 +982,14 @@ final class Float128Vector extends FloatVector { @Override final void intoArray0(float[] a, int offset, VectorMask m) { - super.intoArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); + super.intoArray0Template(FloatMask128.class, a, offset, (FloatMask128) m); } @ForceInline @Override final void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Float128Mask.class, a, offset, indexMap, mapOffset, (Float128Mask) m); + super.intoArray0Template(FloatMask128.class, a, offset, indexMap, mapOffset, (FloatMask128) m); } @@ -990,7 +997,7 @@ final class Float128Vector extends FloatVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Float128Mask.class, ms, offset, (Float128Mask) m); + super.intoMemorySegment0Template(FloatMask128.class, ms, offset, (FloatMask128) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector256.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector256.java index f41194500f9..f267025972d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector256.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Float256Vector extends FloatVector { +final class FloatVector256 extends FloatVector { static final FloatSpecies VSPECIES = (FloatSpecies) FloatVector.SPECIES_256; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Float256Vector.class; + static final Class VCLASS = FloatVector256.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = float.class; // carrier type used by the JVM + static final Class ETYPE = float.class; // used by the JVM - Float256Vector(float[] v) { + FloatVector256(float[] v) { super(v); } - // For compatibility as Float256Vector::new, + // For compatibility as FloatVector256::new, // stored into species.vectorFactory. - Float256Vector(Object v) { + FloatVector256(Object v) { this((float[]) v); } - static final Float256Vector ZERO = new Float256Vector(new float[VLENGTH]); - static final Float256Vector IOTA = new Float256Vector(VSPECIES.iotaArray()); + static final FloatVector256 ZERO = new FloatVector256(new float[VLENGTH]); + static final FloatVector256 IOTA = new FloatVector256(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Float256Vector extends FloatVector { @Override public final Class elementType() { return float.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Float.SIZE; } @@ -130,51 +135,51 @@ final class Float256Vector extends FloatVector { @Override @ForceInline - public final Float256Vector broadcast(float e) { - return (Float256Vector) super.broadcastTemplate(e); // specialize + public final FloatVector256 broadcast(float e) { + return (FloatVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Float256Vector broadcast(long e) { - return (Float256Vector) super.broadcastTemplate(e); // specialize + public final FloatVector256 broadcast(long e) { + return (FloatVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Float256Mask maskFromArray(boolean[] bits) { - return new Float256Mask(bits); + FloatMask256 maskFromArray(boolean[] bits) { + return new FloatMask256(bits); } @Override @ForceInline - Float256Shuffle iotaShuffle() { return Float256Shuffle.IOTA; } + FloatShuffle256 iotaShuffle() { return FloatShuffle256.IOTA; } @Override @ForceInline - Float256Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Float256Shuffle) iotaShuffleTemplate(start, step, wrap); + FloatShuffle256 iotaShuffle(int start, int step, boolean wrap) { + return (FloatShuffle256) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float256Shuffle shuffleFromArray(int[] indices, int i) { return new Float256Shuffle(indices, i); } + FloatShuffle256 shuffleFromArray(int[] indices, int i) { return new FloatShuffle256(indices, i); } @Override @ForceInline - Float256Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Float256Shuffle(fn); } + FloatShuffle256 shuffleFromOp(IntUnaryOperator fn) { return new FloatShuffle256(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Float256Vector vectorFactory(float[] vec) { - return new Float256Vector(vec); + FloatVector256 vectorFactory(float[] vec) { + return new FloatVector256(vec); } @ForceInline final @Override - Byte256Vector asByteVectorRaw() { - return (Byte256Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector256 asByteVectorRaw() { + return (ByteVector256) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Float256Vector extends FloatVector { @ForceInline final @Override - Float256Vector uOp(FUnOp f) { - return (Float256Vector) super.uOpTemplate(f); // specialize + FloatVector256 uOp(FUnOp f) { + return (FloatVector256) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Float256Vector uOp(VectorMask m, FUnOp f) { - return (Float256Vector) - super.uOpTemplate((Float256Mask)m, f); // specialize + FloatVector256 uOp(VectorMask m, FUnOp f) { + return (FloatVector256) + super.uOpTemplate((FloatMask256)m, f); // specialize } // Binary operator @ForceInline final @Override - Float256Vector bOp(Vector v, FBinOp f) { - return (Float256Vector) super.bOpTemplate((Float256Vector)v, f); // specialize + FloatVector256 bOp(Vector v, FBinOp f) { + return (FloatVector256) super.bOpTemplate((FloatVector256)v, f); // specialize } @ForceInline final @Override - Float256Vector bOp(Vector v, + FloatVector256 bOp(Vector v, VectorMask m, FBinOp f) { - return (Float256Vector) - super.bOpTemplate((Float256Vector)v, (Float256Mask)m, + return (FloatVector256) + super.bOpTemplate((FloatVector256)v, (FloatMask256)m, f); // specialize } @@ -219,19 +224,19 @@ final class Float256Vector extends FloatVector { @ForceInline final @Override - Float256Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Float256Vector) - super.tOpTemplate((Float256Vector)v1, (Float256Vector)v2, + FloatVector256 tOp(Vector v1, Vector v2, FTriOp f) { + return (FloatVector256) + super.tOpTemplate((FloatVector256)v1, (FloatVector256)v2, f); // specialize } @ForceInline final @Override - Float256Vector tOp(Vector v1, Vector v2, + FloatVector256 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Float256Vector) - super.tOpTemplate((Float256Vector)v1, (Float256Vector)v2, - (Float256Mask)m, f); // specialize + return (FloatVector256) + super.tOpTemplate((FloatVector256)v1, (FloatVector256)v2, + (FloatMask256)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Float256Vector extends FloatVector { @Override @ForceInline - public Float256Vector lanewise(Unary op) { - return (Float256Vector) super.lanewiseTemplate(op); // specialize + public FloatVector256 lanewise(Unary op) { + return (FloatVector256) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Float256Vector lanewise(Unary op, VectorMask m) { - return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, (Float256Mask) m); // specialize + public FloatVector256 lanewise(Unary op, VectorMask m) { + return (FloatVector256) super.lanewiseTemplate(op, FloatMask256.class, (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector lanewise(Binary op, Vector v) { - return (Float256Vector) super.lanewiseTemplate(op, v); // specialize + public FloatVector256 lanewise(Binary op, Vector v) { + return (FloatVector256) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Float256Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v, (Float256Mask) m); // specialize + public FloatVector256 lanewise(Binary op, Vector v, VectorMask m) { + return (FloatVector256) super.lanewiseTemplate(op, FloatMask256.class, v, (FloatMask256) m); // specialize } @@ -296,24 +301,24 @@ final class Float256Vector extends FloatVector { @Override @ForceInline public final - Float256Vector + FloatVector256 lanewise(Ternary op, Vector v1, Vector v2) { - return (Float256Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (FloatVector256) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Float256Vector + FloatVector256 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v1, v2, (Float256Mask) m); // specialize + return (FloatVector256) super.lanewiseTemplate(op, FloatMask256.class, v1, v2, (FloatMask256) m); // specialize } @Override @ForceInline public final - Float256Vector addIndex(int scale) { - return (Float256Vector) super.addIndexTemplate(scale); // specialize + FloatVector256 addIndex(int scale) { + return (FloatVector256) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Float256Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized + return super.reduceLanesTemplate(op, FloatMask256.class, (FloatMask256) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Float256Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, FloatMask256.class, (FloatMask256) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Float256Vector extends FloatVector { @Override @ForceInline - public final Float256Shuffle toShuffle() { - return (Float256Shuffle) toShuffle(vspecies(), false); + public final FloatShuffle256 toShuffle() { + return (FloatShuffle256) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Float256Mask test(Test op) { - return super.testTemplate(Float256Mask.class, op); // specialize + public final FloatMask256 test(Test op) { + return super.testTemplate(FloatMask256.class, op); // specialize } @Override @ForceInline - public final Float256Mask test(Test op, VectorMask m) { - return super.testTemplate(Float256Mask.class, op, (Float256Mask) m); // specialize + public final FloatMask256 test(Test op, VectorMask m) { + return super.testTemplate(FloatMask256.class, op, (FloatMask256) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Float256Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Float256Mask.class, op, v); // specialize + public final FloatMask256 compare(Comparison op, Vector v) { + return super.compareTemplate(FloatMask256.class, op, v); // specialize } @Override @ForceInline - public final Float256Mask compare(Comparison op, float s) { - return super.compareTemplate(Float256Mask.class, op, s); // specialize + public final FloatMask256 compare(Comparison op, float s) { + return super.compareTemplate(FloatMask256.class, op, s); // specialize } @Override @ForceInline - public final Float256Mask compare(Comparison op, long s) { - return super.compareTemplate(Float256Mask.class, op, s); // specialize + public final FloatMask256 compare(Comparison op, long s) { + return super.compareTemplate(FloatMask256.class, op, s); // specialize } @Override @ForceInline - public final Float256Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Float256Mask.class, op, v, (Float256Mask) m); + public final FloatMask256 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(FloatMask256.class, op, v, (FloatMask256) m); } @Override @ForceInline - public Float256Vector blend(Vector v, VectorMask m) { - return (Float256Vector) - super.blendTemplate(Float256Mask.class, - (Float256Vector) v, - (Float256Mask) m); // specialize + public FloatVector256 blend(Vector v, VectorMask m) { + return (FloatVector256) + super.blendTemplate(FloatMask256.class, + (FloatVector256) v, + (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector slice(int origin, Vector v) { - return (Float256Vector) super.sliceTemplate(origin, v); // specialize + public FloatVector256 slice(int origin, Vector v) { + return (FloatVector256) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Float256Vector slice(int origin) { - return (Float256Vector) super.sliceTemplate(origin); // specialize + public FloatVector256 slice(int origin) { + return (FloatVector256) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Float256Vector unslice(int origin, Vector w, int part) { - return (Float256Vector) super.unsliceTemplate(origin, w, part); // specialize + public FloatVector256 unslice(int origin, Vector w, int part) { + return (FloatVector256) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Float256Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Float256Vector) - super.unsliceTemplate(Float256Mask.class, + public FloatVector256 unslice(int origin, Vector w, int part, VectorMask m) { + return (FloatVector256) + super.unsliceTemplate(FloatMask256.class, origin, w, part, - (Float256Mask) m); // specialize + (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector unslice(int origin) { - return (Float256Vector) super.unsliceTemplate(origin); // specialize + public FloatVector256 unslice(int origin) { + return (FloatVector256) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Float256Vector rearrange(VectorShuffle s) { - return (Float256Vector) - super.rearrangeTemplate(Float256Shuffle.class, - (Float256Shuffle) s); // specialize + public FloatVector256 rearrange(VectorShuffle s) { + return (FloatVector256) + super.rearrangeTemplate(FloatShuffle256.class, + (FloatShuffle256) s); // specialize } @Override @ForceInline - public Float256Vector rearrange(VectorShuffle shuffle, + public FloatVector256 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Float256Vector) - super.rearrangeTemplate(Float256Shuffle.class, - Float256Mask.class, - (Float256Shuffle) shuffle, - (Float256Mask) m); // specialize + return (FloatVector256) + super.rearrangeTemplate(FloatShuffle256.class, + FloatMask256.class, + (FloatShuffle256) shuffle, + (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector rearrange(VectorShuffle s, + public FloatVector256 rearrange(VectorShuffle s, Vector v) { - return (Float256Vector) - super.rearrangeTemplate(Float256Shuffle.class, - (Float256Shuffle) s, - (Float256Vector) v); // specialize + return (FloatVector256) + super.rearrangeTemplate(FloatShuffle256.class, + (FloatShuffle256) s, + (FloatVector256) v); // specialize } @Override @ForceInline - public Float256Vector compress(VectorMask m) { - return (Float256Vector) - super.compressTemplate(Float256Mask.class, - (Float256Mask) m); // specialize + public FloatVector256 compress(VectorMask m) { + return (FloatVector256) + super.compressTemplate(FloatMask256.class, + (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector expand(VectorMask m) { - return (Float256Vector) - super.expandTemplate(Float256Mask.class, - (Float256Mask) m); // specialize + public FloatVector256 expand(VectorMask m) { + return (FloatVector256) + super.expandTemplate(FloatMask256.class, + (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector selectFrom(Vector v) { - return (Float256Vector) - super.selectFromTemplate((Float256Vector) v); // specialize + public FloatVector256 selectFrom(Vector v) { + return (FloatVector256) + super.selectFromTemplate((FloatVector256) v); // specialize } @Override @ForceInline - public Float256Vector selectFrom(Vector v, + public FloatVector256 selectFrom(Vector v, VectorMask m) { - return (Float256Vector) - super.selectFromTemplate((Float256Vector) v, - Float256Mask.class, (Float256Mask) m); // specialize + return (FloatVector256) + super.selectFromTemplate((FloatVector256) v, + FloatMask256.class, (FloatMask256) m); // specialize } @Override @ForceInline - public Float256Vector selectFrom(Vector v1, + public FloatVector256 selectFrom(Vector v1, Vector v2) { - return (Float256Vector) - super.selectFromTemplate((Float256Vector) v1, (Float256Vector) v2); // specialize + return (FloatVector256) + super.selectFromTemplate((FloatVector256) v1, (FloatVector256) v2); // specialize } @ForceInline @@ -539,7 +544,7 @@ final class Float256Vector extends FloatVector { @ForceInline @Override - public Float256Vector withLane(int i, float e) { + public FloatVector256 withLane(int i, float e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -554,7 +559,7 @@ final class Float256Vector extends FloatVector { } @ForceInline - public Float256Vector withLaneHelper(int i, float e) { + public FloatVector256 withLaneHelper(int i, float e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Float.floatToRawIntBits(e), @@ -567,19 +572,20 @@ final class Float256Vector extends FloatVector { // Mask - static final class Float256Mask extends AbstractMask { + static final class FloatMask256 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM - Float256Mask(boolean[] bits) { + static final Class CTYPE = float.class; // used by the JVM + + FloatMask256(boolean[] bits) { this(bits, 0); } - Float256Mask(boolean[] bits, int offset) { + FloatMask256(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Float256Mask(boolean val) { + FloatMask256(boolean val) { super(prepare(val)); } @@ -612,31 +618,31 @@ final class Float256Vector extends FloatVector { } @Override - Float256Mask uOp(MUnOp f) { + FloatMask256 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Float256Mask(res); + return new FloatMask256(res); } @Override - Float256Mask bOp(VectorMask m, MBinOp f) { + FloatMask256 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Float256Mask)m).getBits(); + boolean[] mbits = ((FloatMask256)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Float256Mask(res); + return new FloatMask256(res); } @ForceInline @Override public final - Float256Vector toVector() { - return (Float256Vector) super.toVectorTemplate(); // specialize + FloatVector256 toVector() { + return (FloatVector256) super.toVectorTemplate(); // specialize } /** @@ -669,25 +675,25 @@ final class Float256Vector extends FloatVector { @Override @ForceInline /*package-private*/ - Float256Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Float256Mask) VectorSupport.indexPartiallyInUpperRange( - Float256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Float256Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + FloatMask256 indexPartiallyInUpperRange(long offset, long limit) { + return (FloatMask256) VectorSupport.indexPartiallyInUpperRange( + FloatMask256.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (FloatMask256) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Float256Mask not() { + public FloatMask256 not() { return xor(maskAll(true)); } @Override @ForceInline - public Float256Mask compress() { - return (Float256Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Float256Vector.class, Float256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public FloatMask256 compress() { + return (FloatMask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + FloatVector256.class, FloatMask256.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -696,30 +702,30 @@ final class Float256Vector extends FloatVector { @Override @ForceInline - public Float256Mask and(VectorMask mask) { + public FloatMask256 and(VectorMask mask) { Objects.requireNonNull(mask); - Float256Mask m = (Float256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask256 m = (FloatMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Float256Mask or(VectorMask mask) { + public FloatMask256 or(VectorMask mask) { Objects.requireNonNull(mask); - Float256Mask m = (Float256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask256 m = (FloatMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Float256Mask xor(VectorMask mask) { + public FloatMask256 xor(VectorMask mask) { Objects.requireNonNull(mask); - Float256Mask m = (Float256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask256 m = (FloatMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -729,21 +735,21 @@ final class Float256Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -753,7 +759,7 @@ final class Float256Vector extends FloatVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -763,7 +769,7 @@ final class Float256Vector extends FloatVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Float256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(FloatMask256.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -772,48 +778,49 @@ final class Float256Vector extends FloatVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Float256Mask)m).getBits())); + (m, __) -> anyTrueHelper(((FloatMask256)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Float256Mask)m).getBits())); + (m, __) -> allTrueHelper(((FloatMask256)m).getBits())); } @ForceInline /*package-private*/ - static Float256Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Float256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static FloatMask256 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(FloatMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Float256Mask TRUE_MASK = new Float256Mask(true); - private static final Float256Mask FALSE_MASK = new Float256Mask(false); + private static final FloatMask256 TRUE_MASK = new FloatMask256(true); + private static final FloatMask256 FALSE_MASK = new FloatMask256(false); } // Shuffle - static final class Float256Shuffle extends AbstractShuffle { + static final class FloatShuffle256 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Float256Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + FloatShuffle256(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Float256Shuffle(int[] indices, int i) { + FloatShuffle256(int[] indices, int i) { this(prepare(indices, i)); } - Float256Shuffle(IntUnaryOperator fn) { + FloatShuffle256(IntUnaryOperator fn) { this(prepare(fn)); } @@ -833,23 +840,23 @@ final class Float256Vector extends FloatVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Float256Shuffle IOTA = new Float256Shuffle(IDENTITY); + static final FloatShuffle256 IOTA = new FloatShuffle256(IDENTITY); @Override @ForceInline - public Float256Vector toVector() { - return (Float256Vector) toBitsVector().castShape(vspecies(), 0); + public FloatVector256 toVector() { + return (FloatVector256) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Int256Vector toBitsVector() { - return (Int256Vector) super.toBitsVectorTemplate(); + IntVector256 toBitsVector() { + return (IntVector256) super.toBitsVectorTemplate(); } @Override - Int256Vector toBitsVector0() { - return ((Int256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector256 toBitsVector0() { + return ((IntVector256) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -872,30 +879,30 @@ final class Float256Vector extends FloatVector { @Override @ForceInline - public final Float256Mask laneIsValid() { - return (Float256Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final FloatMask256 laneIsValid() { + return (FloatMask256) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Float256Shuffle rearrange(VectorShuffle shuffle) { - Float256Shuffle concreteShuffle = (Float256Shuffle) shuffle; - return (Float256Shuffle) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_256)) + public final FloatShuffle256 rearrange(VectorShuffle shuffle) { + FloatShuffle256 concreteShuffle = (FloatShuffle256) shuffle; + return (FloatShuffle256) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_256)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Float256Shuffle wrapIndexes() { - Int256Vector v = toBitsVector(); + public final FloatShuffle256 wrapIndexes() { + IntVector256 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int256Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector256) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector256) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Float256Shuffle) v.toShuffle(vspecies(), false); + return (FloatShuffle256) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -946,14 +953,14 @@ final class Float256Vector extends FloatVector { @Override final FloatVector fromArray0(float[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Float256Mask.class, a, offset, (Float256Mask) m, offsetInRange); // specialize + return super.fromArray0Template(FloatMask256.class, a, offset, (FloatMask256) m, offsetInRange); // specialize } @ForceInline @Override final FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m); + return super.fromArray0Template(FloatMask256.class, a, offset, indexMap, mapOffset, (FloatMask256) m); } @@ -969,7 +976,7 @@ final class Float256Vector extends FloatVector { @Override final FloatVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Float256Mask.class, ms, offset, (Float256Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(FloatMask256.class, ms, offset, (FloatMask256) m, offsetInRange); // specialize } @ForceInline @@ -983,14 +990,14 @@ final class Float256Vector extends FloatVector { @Override final void intoArray0(float[] a, int offset, VectorMask m) { - super.intoArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); + super.intoArray0Template(FloatMask256.class, a, offset, (FloatMask256) m); } @ForceInline @Override final void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m); + super.intoArray0Template(FloatMask256.class, a, offset, indexMap, mapOffset, (FloatMask256) m); } @@ -998,7 +1005,7 @@ final class Float256Vector extends FloatVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Float256Mask.class, ms, offset, (Float256Mask) m); + super.intoMemorySegment0Template(FloatMask256.class, ms, offset, (FloatMask256) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector512.java similarity index 66% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector512.java index c2fced0fdae..439e26f0d89 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector512.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Float512Vector extends FloatVector { +final class FloatVector512 extends FloatVector { static final FloatSpecies VSPECIES = (FloatSpecies) FloatVector.SPECIES_512; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Float512Vector.class; + static final Class VCLASS = FloatVector512.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = float.class; // carrier type used by the JVM + static final Class ETYPE = float.class; // used by the JVM - Float512Vector(float[] v) { + FloatVector512(float[] v) { super(v); } - // For compatibility as Float512Vector::new, + // For compatibility as FloatVector512::new, // stored into species.vectorFactory. - Float512Vector(Object v) { + FloatVector512(Object v) { this((float[]) v); } - static final Float512Vector ZERO = new Float512Vector(new float[VLENGTH]); - static final Float512Vector IOTA = new Float512Vector(VSPECIES.iotaArray()); + static final FloatVector512 ZERO = new FloatVector512(new float[VLENGTH]); + static final FloatVector512 IOTA = new FloatVector512(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Float512Vector extends FloatVector { @Override public final Class elementType() { return float.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Float.SIZE; } @@ -130,51 +135,51 @@ final class Float512Vector extends FloatVector { @Override @ForceInline - public final Float512Vector broadcast(float e) { - return (Float512Vector) super.broadcastTemplate(e); // specialize + public final FloatVector512 broadcast(float e) { + return (FloatVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Float512Vector broadcast(long e) { - return (Float512Vector) super.broadcastTemplate(e); // specialize + public final FloatVector512 broadcast(long e) { + return (FloatVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Float512Mask maskFromArray(boolean[] bits) { - return new Float512Mask(bits); + FloatMask512 maskFromArray(boolean[] bits) { + return new FloatMask512(bits); } @Override @ForceInline - Float512Shuffle iotaShuffle() { return Float512Shuffle.IOTA; } + FloatShuffle512 iotaShuffle() { return FloatShuffle512.IOTA; } @Override @ForceInline - Float512Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Float512Shuffle) iotaShuffleTemplate(start, step, wrap); + FloatShuffle512 iotaShuffle(int start, int step, boolean wrap) { + return (FloatShuffle512) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float512Shuffle shuffleFromArray(int[] indices, int i) { return new Float512Shuffle(indices, i); } + FloatShuffle512 shuffleFromArray(int[] indices, int i) { return new FloatShuffle512(indices, i); } @Override @ForceInline - Float512Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Float512Shuffle(fn); } + FloatShuffle512 shuffleFromOp(IntUnaryOperator fn) { return new FloatShuffle512(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Float512Vector vectorFactory(float[] vec) { - return new Float512Vector(vec); + FloatVector512 vectorFactory(float[] vec) { + return new FloatVector512(vec); } @ForceInline final @Override - Byte512Vector asByteVectorRaw() { - return (Byte512Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector512 asByteVectorRaw() { + return (ByteVector512) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Float512Vector extends FloatVector { @ForceInline final @Override - Float512Vector uOp(FUnOp f) { - return (Float512Vector) super.uOpTemplate(f); // specialize + FloatVector512 uOp(FUnOp f) { + return (FloatVector512) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Float512Vector uOp(VectorMask m, FUnOp f) { - return (Float512Vector) - super.uOpTemplate((Float512Mask)m, f); // specialize + FloatVector512 uOp(VectorMask m, FUnOp f) { + return (FloatVector512) + super.uOpTemplate((FloatMask512)m, f); // specialize } // Binary operator @ForceInline final @Override - Float512Vector bOp(Vector v, FBinOp f) { - return (Float512Vector) super.bOpTemplate((Float512Vector)v, f); // specialize + FloatVector512 bOp(Vector v, FBinOp f) { + return (FloatVector512) super.bOpTemplate((FloatVector512)v, f); // specialize } @ForceInline final @Override - Float512Vector bOp(Vector v, + FloatVector512 bOp(Vector v, VectorMask m, FBinOp f) { - return (Float512Vector) - super.bOpTemplate((Float512Vector)v, (Float512Mask)m, + return (FloatVector512) + super.bOpTemplate((FloatVector512)v, (FloatMask512)m, f); // specialize } @@ -219,19 +224,19 @@ final class Float512Vector extends FloatVector { @ForceInline final @Override - Float512Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Float512Vector) - super.tOpTemplate((Float512Vector)v1, (Float512Vector)v2, + FloatVector512 tOp(Vector v1, Vector v2, FTriOp f) { + return (FloatVector512) + super.tOpTemplate((FloatVector512)v1, (FloatVector512)v2, f); // specialize } @ForceInline final @Override - Float512Vector tOp(Vector v1, Vector v2, + FloatVector512 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Float512Vector) - super.tOpTemplate((Float512Vector)v1, (Float512Vector)v2, - (Float512Mask)m, f); // specialize + return (FloatVector512) + super.tOpTemplate((FloatVector512)v1, (FloatVector512)v2, + (FloatMask512)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Float512Vector extends FloatVector { @Override @ForceInline - public Float512Vector lanewise(Unary op) { - return (Float512Vector) super.lanewiseTemplate(op); // specialize + public FloatVector512 lanewise(Unary op) { + return (FloatVector512) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Float512Vector lanewise(Unary op, VectorMask m) { - return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, (Float512Mask) m); // specialize + public FloatVector512 lanewise(Unary op, VectorMask m) { + return (FloatVector512) super.lanewiseTemplate(op, FloatMask512.class, (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector lanewise(Binary op, Vector v) { - return (Float512Vector) super.lanewiseTemplate(op, v); // specialize + public FloatVector512 lanewise(Binary op, Vector v) { + return (FloatVector512) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Float512Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, v, (Float512Mask) m); // specialize + public FloatVector512 lanewise(Binary op, Vector v, VectorMask m) { + return (FloatVector512) super.lanewiseTemplate(op, FloatMask512.class, v, (FloatMask512) m); // specialize } @@ -296,24 +301,24 @@ final class Float512Vector extends FloatVector { @Override @ForceInline public final - Float512Vector + FloatVector512 lanewise(Ternary op, Vector v1, Vector v2) { - return (Float512Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (FloatVector512) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Float512Vector + FloatVector512 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, v1, v2, (Float512Mask) m); // specialize + return (FloatVector512) super.lanewiseTemplate(op, FloatMask512.class, v1, v2, (FloatMask512) m); // specialize } @Override @ForceInline public final - Float512Vector addIndex(int scale) { - return (Float512Vector) super.addIndexTemplate(scale); // specialize + FloatVector512 addIndex(int scale) { + return (FloatVector512) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Float512Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized + return super.reduceLanesTemplate(op, FloatMask512.class, (FloatMask512) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Float512Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, FloatMask512.class, (FloatMask512) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Float512Vector extends FloatVector { @Override @ForceInline - public final Float512Shuffle toShuffle() { - return (Float512Shuffle) toShuffle(vspecies(), false); + public final FloatShuffle512 toShuffle() { + return (FloatShuffle512) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Float512Mask test(Test op) { - return super.testTemplate(Float512Mask.class, op); // specialize + public final FloatMask512 test(Test op) { + return super.testTemplate(FloatMask512.class, op); // specialize } @Override @ForceInline - public final Float512Mask test(Test op, VectorMask m) { - return super.testTemplate(Float512Mask.class, op, (Float512Mask) m); // specialize + public final FloatMask512 test(Test op, VectorMask m) { + return super.testTemplate(FloatMask512.class, op, (FloatMask512) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Float512Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Float512Mask.class, op, v); // specialize + public final FloatMask512 compare(Comparison op, Vector v) { + return super.compareTemplate(FloatMask512.class, op, v); // specialize } @Override @ForceInline - public final Float512Mask compare(Comparison op, float s) { - return super.compareTemplate(Float512Mask.class, op, s); // specialize + public final FloatMask512 compare(Comparison op, float s) { + return super.compareTemplate(FloatMask512.class, op, s); // specialize } @Override @ForceInline - public final Float512Mask compare(Comparison op, long s) { - return super.compareTemplate(Float512Mask.class, op, s); // specialize + public final FloatMask512 compare(Comparison op, long s) { + return super.compareTemplate(FloatMask512.class, op, s); // specialize } @Override @ForceInline - public final Float512Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Float512Mask.class, op, v, (Float512Mask) m); + public final FloatMask512 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(FloatMask512.class, op, v, (FloatMask512) m); } @Override @ForceInline - public Float512Vector blend(Vector v, VectorMask m) { - return (Float512Vector) - super.blendTemplate(Float512Mask.class, - (Float512Vector) v, - (Float512Mask) m); // specialize + public FloatVector512 blend(Vector v, VectorMask m) { + return (FloatVector512) + super.blendTemplate(FloatMask512.class, + (FloatVector512) v, + (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector slice(int origin, Vector v) { - return (Float512Vector) super.sliceTemplate(origin, v); // specialize + public FloatVector512 slice(int origin, Vector v) { + return (FloatVector512) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Float512Vector slice(int origin) { - return (Float512Vector) super.sliceTemplate(origin); // specialize + public FloatVector512 slice(int origin) { + return (FloatVector512) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Float512Vector unslice(int origin, Vector w, int part) { - return (Float512Vector) super.unsliceTemplate(origin, w, part); // specialize + public FloatVector512 unslice(int origin, Vector w, int part) { + return (FloatVector512) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Float512Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Float512Vector) - super.unsliceTemplate(Float512Mask.class, + public FloatVector512 unslice(int origin, Vector w, int part, VectorMask m) { + return (FloatVector512) + super.unsliceTemplate(FloatMask512.class, origin, w, part, - (Float512Mask) m); // specialize + (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector unslice(int origin) { - return (Float512Vector) super.unsliceTemplate(origin); // specialize + public FloatVector512 unslice(int origin) { + return (FloatVector512) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Float512Vector rearrange(VectorShuffle s) { - return (Float512Vector) - super.rearrangeTemplate(Float512Shuffle.class, - (Float512Shuffle) s); // specialize + public FloatVector512 rearrange(VectorShuffle s) { + return (FloatVector512) + super.rearrangeTemplate(FloatShuffle512.class, + (FloatShuffle512) s); // specialize } @Override @ForceInline - public Float512Vector rearrange(VectorShuffle shuffle, + public FloatVector512 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Float512Vector) - super.rearrangeTemplate(Float512Shuffle.class, - Float512Mask.class, - (Float512Shuffle) shuffle, - (Float512Mask) m); // specialize + return (FloatVector512) + super.rearrangeTemplate(FloatShuffle512.class, + FloatMask512.class, + (FloatShuffle512) shuffle, + (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector rearrange(VectorShuffle s, + public FloatVector512 rearrange(VectorShuffle s, Vector v) { - return (Float512Vector) - super.rearrangeTemplate(Float512Shuffle.class, - (Float512Shuffle) s, - (Float512Vector) v); // specialize + return (FloatVector512) + super.rearrangeTemplate(FloatShuffle512.class, + (FloatShuffle512) s, + (FloatVector512) v); // specialize } @Override @ForceInline - public Float512Vector compress(VectorMask m) { - return (Float512Vector) - super.compressTemplate(Float512Mask.class, - (Float512Mask) m); // specialize + public FloatVector512 compress(VectorMask m) { + return (FloatVector512) + super.compressTemplate(FloatMask512.class, + (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector expand(VectorMask m) { - return (Float512Vector) - super.expandTemplate(Float512Mask.class, - (Float512Mask) m); // specialize + public FloatVector512 expand(VectorMask m) { + return (FloatVector512) + super.expandTemplate(FloatMask512.class, + (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector selectFrom(Vector v) { - return (Float512Vector) - super.selectFromTemplate((Float512Vector) v); // specialize + public FloatVector512 selectFrom(Vector v) { + return (FloatVector512) + super.selectFromTemplate((FloatVector512) v); // specialize } @Override @ForceInline - public Float512Vector selectFrom(Vector v, + public FloatVector512 selectFrom(Vector v, VectorMask m) { - return (Float512Vector) - super.selectFromTemplate((Float512Vector) v, - Float512Mask.class, (Float512Mask) m); // specialize + return (FloatVector512) + super.selectFromTemplate((FloatVector512) v, + FloatMask512.class, (FloatMask512) m); // specialize } @Override @ForceInline - public Float512Vector selectFrom(Vector v1, + public FloatVector512 selectFrom(Vector v1, Vector v2) { - return (Float512Vector) - super.selectFromTemplate((Float512Vector) v1, (Float512Vector) v2); // specialize + return (FloatVector512) + super.selectFromTemplate((FloatVector512) v1, (FloatVector512) v2); // specialize } @ForceInline @@ -547,7 +552,7 @@ final class Float512Vector extends FloatVector { @ForceInline @Override - public Float512Vector withLane(int i, float e) { + public FloatVector512 withLane(int i, float e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -570,7 +575,7 @@ final class Float512Vector extends FloatVector { } @ForceInline - public Float512Vector withLaneHelper(int i, float e) { + public FloatVector512 withLaneHelper(int i, float e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Float.floatToRawIntBits(e), @@ -583,19 +588,20 @@ final class Float512Vector extends FloatVector { // Mask - static final class Float512Mask extends AbstractMask { + static final class FloatMask512 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM - Float512Mask(boolean[] bits) { + static final Class CTYPE = float.class; // used by the JVM + + FloatMask512(boolean[] bits) { this(bits, 0); } - Float512Mask(boolean[] bits, int offset) { + FloatMask512(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Float512Mask(boolean val) { + FloatMask512(boolean val) { super(prepare(val)); } @@ -628,31 +634,31 @@ final class Float512Vector extends FloatVector { } @Override - Float512Mask uOp(MUnOp f) { + FloatMask512 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Float512Mask(res); + return new FloatMask512(res); } @Override - Float512Mask bOp(VectorMask m, MBinOp f) { + FloatMask512 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Float512Mask)m).getBits(); + boolean[] mbits = ((FloatMask512)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Float512Mask(res); + return new FloatMask512(res); } @ForceInline @Override public final - Float512Vector toVector() { - return (Float512Vector) super.toVectorTemplate(); // specialize + FloatVector512 toVector() { + return (FloatVector512) super.toVectorTemplate(); // specialize } /** @@ -685,25 +691,25 @@ final class Float512Vector extends FloatVector { @Override @ForceInline /*package-private*/ - Float512Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Float512Mask) VectorSupport.indexPartiallyInUpperRange( - Float512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Float512Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + FloatMask512 indexPartiallyInUpperRange(long offset, long limit) { + return (FloatMask512) VectorSupport.indexPartiallyInUpperRange( + FloatMask512.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (FloatMask512) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Float512Mask not() { + public FloatMask512 not() { return xor(maskAll(true)); } @Override @ForceInline - public Float512Mask compress() { - return (Float512Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Float512Vector.class, Float512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public FloatMask512 compress() { + return (FloatMask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + FloatVector512.class, FloatMask512.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -712,30 +718,30 @@ final class Float512Vector extends FloatVector { @Override @ForceInline - public Float512Mask and(VectorMask mask) { + public FloatMask512 and(VectorMask mask) { Objects.requireNonNull(mask); - Float512Mask m = (Float512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask512 m = (FloatMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Float512Mask or(VectorMask mask) { + public FloatMask512 or(VectorMask mask) { Objects.requireNonNull(mask); - Float512Mask m = (Float512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask512 m = (FloatMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Float512Mask xor(VectorMask mask) { + public FloatMask512 xor(VectorMask mask) { Objects.requireNonNull(mask); - Float512Mask m = (Float512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask512 m = (FloatMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -745,21 +751,21 @@ final class Float512Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -769,7 +775,7 @@ final class Float512Vector extends FloatVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -779,7 +785,7 @@ final class Float512Vector extends FloatVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Float512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(FloatMask512.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -788,48 +794,49 @@ final class Float512Vector extends FloatVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Float512Mask)m).getBits())); + (m, __) -> anyTrueHelper(((FloatMask512)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Float512Mask)m).getBits())); + (m, __) -> allTrueHelper(((FloatMask512)m).getBits())); } @ForceInline /*package-private*/ - static Float512Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Float512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static FloatMask512 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(FloatMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Float512Mask TRUE_MASK = new Float512Mask(true); - private static final Float512Mask FALSE_MASK = new Float512Mask(false); + private static final FloatMask512 TRUE_MASK = new FloatMask512(true); + private static final FloatMask512 FALSE_MASK = new FloatMask512(false); } // Shuffle - static final class Float512Shuffle extends AbstractShuffle { + static final class FloatShuffle512 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Float512Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + FloatShuffle512(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Float512Shuffle(int[] indices, int i) { + FloatShuffle512(int[] indices, int i) { this(prepare(indices, i)); } - Float512Shuffle(IntUnaryOperator fn) { + FloatShuffle512(IntUnaryOperator fn) { this(prepare(fn)); } @@ -849,23 +856,23 @@ final class Float512Vector extends FloatVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Float512Shuffle IOTA = new Float512Shuffle(IDENTITY); + static final FloatShuffle512 IOTA = new FloatShuffle512(IDENTITY); @Override @ForceInline - public Float512Vector toVector() { - return (Float512Vector) toBitsVector().castShape(vspecies(), 0); + public FloatVector512 toVector() { + return (FloatVector512) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Int512Vector toBitsVector() { - return (Int512Vector) super.toBitsVectorTemplate(); + IntVector512 toBitsVector() { + return (IntVector512) super.toBitsVectorTemplate(); } @Override - Int512Vector toBitsVector0() { - return ((Int512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector512 toBitsVector0() { + return ((IntVector512) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -888,30 +895,30 @@ final class Float512Vector extends FloatVector { @Override @ForceInline - public final Float512Mask laneIsValid() { - return (Float512Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final FloatMask512 laneIsValid() { + return (FloatMask512) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Float512Shuffle rearrange(VectorShuffle shuffle) { - Float512Shuffle concreteShuffle = (Float512Shuffle) shuffle; - return (Float512Shuffle) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_512)) + public final FloatShuffle512 rearrange(VectorShuffle shuffle) { + FloatShuffle512 concreteShuffle = (FloatShuffle512) shuffle; + return (FloatShuffle512) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_512)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Float512Shuffle wrapIndexes() { - Int512Vector v = toBitsVector(); + public final FloatShuffle512 wrapIndexes() { + IntVector512 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int512Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector512) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector512) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Float512Shuffle) v.toShuffle(vspecies(), false); + return (FloatShuffle512) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -962,14 +969,14 @@ final class Float512Vector extends FloatVector { @Override final FloatVector fromArray0(float[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Float512Mask.class, a, offset, (Float512Mask) m, offsetInRange); // specialize + return super.fromArray0Template(FloatMask512.class, a, offset, (FloatMask512) m, offsetInRange); // specialize } @ForceInline @Override final FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Float512Mask.class, a, offset, indexMap, mapOffset, (Float512Mask) m); + return super.fromArray0Template(FloatMask512.class, a, offset, indexMap, mapOffset, (FloatMask512) m); } @@ -985,7 +992,7 @@ final class Float512Vector extends FloatVector { @Override final FloatVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Float512Mask.class, ms, offset, (Float512Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(FloatMask512.class, ms, offset, (FloatMask512) m, offsetInRange); // specialize } @ForceInline @@ -999,14 +1006,14 @@ final class Float512Vector extends FloatVector { @Override final void intoArray0(float[] a, int offset, VectorMask m) { - super.intoArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); + super.intoArray0Template(FloatMask512.class, a, offset, (FloatMask512) m); } @ForceInline @Override final void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Float512Mask.class, a, offset, indexMap, mapOffset, (Float512Mask) m); + super.intoArray0Template(FloatMask512.class, a, offset, indexMap, mapOffset, (FloatMask512) m); } @@ -1014,7 +1021,7 @@ final class Float512Vector extends FloatVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Float512Mask.class, ms, offset, (Float512Mask) m); + super.intoMemorySegment0Template(FloatMask512.class, ms, offset, (FloatMask512) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector64.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector64.java index 67676c828d6..9e81a52d27b 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector64.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Float64Vector extends FloatVector { +final class FloatVector64 extends FloatVector { static final FloatSpecies VSPECIES = (FloatSpecies) FloatVector.SPECIES_64; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Float64Vector.class; + static final Class VCLASS = FloatVector64.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = float.class; // carrier type used by the JVM + static final Class ETYPE = float.class; // used by the JVM - Float64Vector(float[] v) { + FloatVector64(float[] v) { super(v); } - // For compatibility as Float64Vector::new, + // For compatibility as FloatVector64::new, // stored into species.vectorFactory. - Float64Vector(Object v) { + FloatVector64(Object v) { this((float[]) v); } - static final Float64Vector ZERO = new Float64Vector(new float[VLENGTH]); - static final Float64Vector IOTA = new Float64Vector(VSPECIES.iotaArray()); + static final FloatVector64 ZERO = new FloatVector64(new float[VLENGTH]); + static final FloatVector64 IOTA = new FloatVector64(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Float64Vector extends FloatVector { @Override public final Class elementType() { return float.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Float.SIZE; } @@ -130,51 +135,51 @@ final class Float64Vector extends FloatVector { @Override @ForceInline - public final Float64Vector broadcast(float e) { - return (Float64Vector) super.broadcastTemplate(e); // specialize + public final FloatVector64 broadcast(float e) { + return (FloatVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Float64Vector broadcast(long e) { - return (Float64Vector) super.broadcastTemplate(e); // specialize + public final FloatVector64 broadcast(long e) { + return (FloatVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Float64Mask maskFromArray(boolean[] bits) { - return new Float64Mask(bits); + FloatMask64 maskFromArray(boolean[] bits) { + return new FloatMask64(bits); } @Override @ForceInline - Float64Shuffle iotaShuffle() { return Float64Shuffle.IOTA; } + FloatShuffle64 iotaShuffle() { return FloatShuffle64.IOTA; } @Override @ForceInline - Float64Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Float64Shuffle) iotaShuffleTemplate(start, step, wrap); + FloatShuffle64 iotaShuffle(int start, int step, boolean wrap) { + return (FloatShuffle64) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Float64Shuffle shuffleFromArray(int[] indices, int i) { return new Float64Shuffle(indices, i); } + FloatShuffle64 shuffleFromArray(int[] indices, int i) { return new FloatShuffle64(indices, i); } @Override @ForceInline - Float64Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Float64Shuffle(fn); } + FloatShuffle64 shuffleFromOp(IntUnaryOperator fn) { return new FloatShuffle64(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Float64Vector vectorFactory(float[] vec) { - return new Float64Vector(vec); + FloatVector64 vectorFactory(float[] vec) { + return new FloatVector64(vec); } @ForceInline final @Override - Byte64Vector asByteVectorRaw() { - return (Byte64Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector64 asByteVectorRaw() { + return (ByteVector64) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Float64Vector extends FloatVector { @ForceInline final @Override - Float64Vector uOp(FUnOp f) { - return (Float64Vector) super.uOpTemplate(f); // specialize + FloatVector64 uOp(FUnOp f) { + return (FloatVector64) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Float64Vector uOp(VectorMask m, FUnOp f) { - return (Float64Vector) - super.uOpTemplate((Float64Mask)m, f); // specialize + FloatVector64 uOp(VectorMask m, FUnOp f) { + return (FloatVector64) + super.uOpTemplate((FloatMask64)m, f); // specialize } // Binary operator @ForceInline final @Override - Float64Vector bOp(Vector v, FBinOp f) { - return (Float64Vector) super.bOpTemplate((Float64Vector)v, f); // specialize + FloatVector64 bOp(Vector v, FBinOp f) { + return (FloatVector64) super.bOpTemplate((FloatVector64)v, f); // specialize } @ForceInline final @Override - Float64Vector bOp(Vector v, + FloatVector64 bOp(Vector v, VectorMask m, FBinOp f) { - return (Float64Vector) - super.bOpTemplate((Float64Vector)v, (Float64Mask)m, + return (FloatVector64) + super.bOpTemplate((FloatVector64)v, (FloatMask64)m, f); // specialize } @@ -219,19 +224,19 @@ final class Float64Vector extends FloatVector { @ForceInline final @Override - Float64Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Float64Vector) - super.tOpTemplate((Float64Vector)v1, (Float64Vector)v2, + FloatVector64 tOp(Vector v1, Vector v2, FTriOp f) { + return (FloatVector64) + super.tOpTemplate((FloatVector64)v1, (FloatVector64)v2, f); // specialize } @ForceInline final @Override - Float64Vector tOp(Vector v1, Vector v2, + FloatVector64 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Float64Vector) - super.tOpTemplate((Float64Vector)v1, (Float64Vector)v2, - (Float64Mask)m, f); // specialize + return (FloatVector64) + super.tOpTemplate((FloatVector64)v1, (FloatVector64)v2, + (FloatMask64)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class Float64Vector extends FloatVector { @Override @ForceInline - public Float64Vector lanewise(Unary op) { - return (Float64Vector) super.lanewiseTemplate(op); // specialize + public FloatVector64 lanewise(Unary op) { + return (FloatVector64) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Float64Vector lanewise(Unary op, VectorMask m) { - return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, (Float64Mask) m); // specialize + public FloatVector64 lanewise(Unary op, VectorMask m) { + return (FloatVector64) super.lanewiseTemplate(op, FloatMask64.class, (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector lanewise(Binary op, Vector v) { - return (Float64Vector) super.lanewiseTemplate(op, v); // specialize + public FloatVector64 lanewise(Binary op, Vector v) { + return (FloatVector64) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Float64Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, v, (Float64Mask) m); // specialize + public FloatVector64 lanewise(Binary op, Vector v, VectorMask m) { + return (FloatVector64) super.lanewiseTemplate(op, FloatMask64.class, v, (FloatMask64) m); // specialize } @@ -296,24 +301,24 @@ final class Float64Vector extends FloatVector { @Override @ForceInline public final - Float64Vector + FloatVector64 lanewise(Ternary op, Vector v1, Vector v2) { - return (Float64Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (FloatVector64) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Float64Vector + FloatVector64 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, v1, v2, (Float64Mask) m); // specialize + return (FloatVector64) super.lanewiseTemplate(op, FloatMask64.class, v1, v2, (FloatMask64) m); // specialize } @Override @ForceInline public final - Float64Vector addIndex(int scale) { - return (Float64Vector) super.addIndexTemplate(scale); // specialize + FloatVector64 addIndex(int scale) { + return (FloatVector64) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class Float64Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized + return super.reduceLanesTemplate(op, FloatMask64.class, (FloatMask64) m); // specialized } @Override @@ -341,7 +346,7 @@ final class Float64Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, FloatMask64.class, (FloatMask64) m); // specialized } @Override @@ -352,160 +357,160 @@ final class Float64Vector extends FloatVector { @Override @ForceInline - public final Float64Shuffle toShuffle() { - return (Float64Shuffle) toShuffle(vspecies(), false); + public final FloatShuffle64 toShuffle() { + return (FloatShuffle64) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Float64Mask test(Test op) { - return super.testTemplate(Float64Mask.class, op); // specialize + public final FloatMask64 test(Test op) { + return super.testTemplate(FloatMask64.class, op); // specialize } @Override @ForceInline - public final Float64Mask test(Test op, VectorMask m) { - return super.testTemplate(Float64Mask.class, op, (Float64Mask) m); // specialize + public final FloatMask64 test(Test op, VectorMask m) { + return super.testTemplate(FloatMask64.class, op, (FloatMask64) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Float64Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Float64Mask.class, op, v); // specialize + public final FloatMask64 compare(Comparison op, Vector v) { + return super.compareTemplate(FloatMask64.class, op, v); // specialize } @Override @ForceInline - public final Float64Mask compare(Comparison op, float s) { - return super.compareTemplate(Float64Mask.class, op, s); // specialize + public final FloatMask64 compare(Comparison op, float s) { + return super.compareTemplate(FloatMask64.class, op, s); // specialize } @Override @ForceInline - public final Float64Mask compare(Comparison op, long s) { - return super.compareTemplate(Float64Mask.class, op, s); // specialize + public final FloatMask64 compare(Comparison op, long s) { + return super.compareTemplate(FloatMask64.class, op, s); // specialize } @Override @ForceInline - public final Float64Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Float64Mask.class, op, v, (Float64Mask) m); + public final FloatMask64 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(FloatMask64.class, op, v, (FloatMask64) m); } @Override @ForceInline - public Float64Vector blend(Vector v, VectorMask m) { - return (Float64Vector) - super.blendTemplate(Float64Mask.class, - (Float64Vector) v, - (Float64Mask) m); // specialize + public FloatVector64 blend(Vector v, VectorMask m) { + return (FloatVector64) + super.blendTemplate(FloatMask64.class, + (FloatVector64) v, + (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector slice(int origin, Vector v) { - return (Float64Vector) super.sliceTemplate(origin, v); // specialize + public FloatVector64 slice(int origin, Vector v) { + return (FloatVector64) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Float64Vector slice(int origin) { - return (Float64Vector) super.sliceTemplate(origin); // specialize + public FloatVector64 slice(int origin) { + return (FloatVector64) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Float64Vector unslice(int origin, Vector w, int part) { - return (Float64Vector) super.unsliceTemplate(origin, w, part); // specialize + public FloatVector64 unslice(int origin, Vector w, int part) { + return (FloatVector64) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Float64Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Float64Vector) - super.unsliceTemplate(Float64Mask.class, + public FloatVector64 unslice(int origin, Vector w, int part, VectorMask m) { + return (FloatVector64) + super.unsliceTemplate(FloatMask64.class, origin, w, part, - (Float64Mask) m); // specialize + (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector unslice(int origin) { - return (Float64Vector) super.unsliceTemplate(origin); // specialize + public FloatVector64 unslice(int origin) { + return (FloatVector64) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Float64Vector rearrange(VectorShuffle s) { - return (Float64Vector) - super.rearrangeTemplate(Float64Shuffle.class, - (Float64Shuffle) s); // specialize + public FloatVector64 rearrange(VectorShuffle s) { + return (FloatVector64) + super.rearrangeTemplate(FloatShuffle64.class, + (FloatShuffle64) s); // specialize } @Override @ForceInline - public Float64Vector rearrange(VectorShuffle shuffle, + public FloatVector64 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Float64Vector) - super.rearrangeTemplate(Float64Shuffle.class, - Float64Mask.class, - (Float64Shuffle) shuffle, - (Float64Mask) m); // specialize + return (FloatVector64) + super.rearrangeTemplate(FloatShuffle64.class, + FloatMask64.class, + (FloatShuffle64) shuffle, + (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector rearrange(VectorShuffle s, + public FloatVector64 rearrange(VectorShuffle s, Vector v) { - return (Float64Vector) - super.rearrangeTemplate(Float64Shuffle.class, - (Float64Shuffle) s, - (Float64Vector) v); // specialize + return (FloatVector64) + super.rearrangeTemplate(FloatShuffle64.class, + (FloatShuffle64) s, + (FloatVector64) v); // specialize } @Override @ForceInline - public Float64Vector compress(VectorMask m) { - return (Float64Vector) - super.compressTemplate(Float64Mask.class, - (Float64Mask) m); // specialize + public FloatVector64 compress(VectorMask m) { + return (FloatVector64) + super.compressTemplate(FloatMask64.class, + (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector expand(VectorMask m) { - return (Float64Vector) - super.expandTemplate(Float64Mask.class, - (Float64Mask) m); // specialize + public FloatVector64 expand(VectorMask m) { + return (FloatVector64) + super.expandTemplate(FloatMask64.class, + (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector selectFrom(Vector v) { - return (Float64Vector) - super.selectFromTemplate((Float64Vector) v); // specialize + public FloatVector64 selectFrom(Vector v) { + return (FloatVector64) + super.selectFromTemplate((FloatVector64) v); // specialize } @Override @ForceInline - public Float64Vector selectFrom(Vector v, + public FloatVector64 selectFrom(Vector v, VectorMask m) { - return (Float64Vector) - super.selectFromTemplate((Float64Vector) v, - Float64Mask.class, (Float64Mask) m); // specialize + return (FloatVector64) + super.selectFromTemplate((FloatVector64) v, + FloatMask64.class, (FloatMask64) m); // specialize } @Override @ForceInline - public Float64Vector selectFrom(Vector v1, + public FloatVector64 selectFrom(Vector v1, Vector v2) { - return (Float64Vector) - super.selectFromTemplate((Float64Vector) v1, (Float64Vector) v2); // specialize + return (FloatVector64) + super.selectFromTemplate((FloatVector64) v1, (FloatVector64) v2); // specialize } @ForceInline @@ -533,7 +538,7 @@ final class Float64Vector extends FloatVector { @ForceInline @Override - public Float64Vector withLane(int i, float e) { + public FloatVector64 withLane(int i, float e) { switch(i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -542,7 +547,7 @@ final class Float64Vector extends FloatVector { } @ForceInline - public Float64Vector withLaneHelper(int i, float e) { + public FloatVector64 withLaneHelper(int i, float e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Float.floatToRawIntBits(e), @@ -555,19 +560,20 @@ final class Float64Vector extends FloatVector { // Mask - static final class Float64Mask extends AbstractMask { + static final class FloatMask64 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM - Float64Mask(boolean[] bits) { + static final Class CTYPE = float.class; // used by the JVM + + FloatMask64(boolean[] bits) { this(bits, 0); } - Float64Mask(boolean[] bits, int offset) { + FloatMask64(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Float64Mask(boolean val) { + FloatMask64(boolean val) { super(prepare(val)); } @@ -600,31 +606,31 @@ final class Float64Vector extends FloatVector { } @Override - Float64Mask uOp(MUnOp f) { + FloatMask64 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Float64Mask(res); + return new FloatMask64(res); } @Override - Float64Mask bOp(VectorMask m, MBinOp f) { + FloatMask64 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Float64Mask)m).getBits(); + boolean[] mbits = ((FloatMask64)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Float64Mask(res); + return new FloatMask64(res); } @ForceInline @Override public final - Float64Vector toVector() { - return (Float64Vector) super.toVectorTemplate(); // specialize + FloatVector64 toVector() { + return (FloatVector64) super.toVectorTemplate(); // specialize } /** @@ -657,25 +663,25 @@ final class Float64Vector extends FloatVector { @Override @ForceInline /*package-private*/ - Float64Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Float64Mask) VectorSupport.indexPartiallyInUpperRange( - Float64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Float64Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + FloatMask64 indexPartiallyInUpperRange(long offset, long limit) { + return (FloatMask64) VectorSupport.indexPartiallyInUpperRange( + FloatMask64.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (FloatMask64) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Float64Mask not() { + public FloatMask64 not() { return xor(maskAll(true)); } @Override @ForceInline - public Float64Mask compress() { - return (Float64Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Float64Vector.class, Float64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public FloatMask64 compress() { + return (FloatMask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + FloatVector64.class, FloatMask64.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -684,30 +690,30 @@ final class Float64Vector extends FloatVector { @Override @ForceInline - public Float64Mask and(VectorMask mask) { + public FloatMask64 and(VectorMask mask) { Objects.requireNonNull(mask); - Float64Mask m = (Float64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask64 m = (FloatMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Float64Mask or(VectorMask mask) { + public FloatMask64 or(VectorMask mask) { Objects.requireNonNull(mask); - Float64Mask m = (Float64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask64 m = (FloatMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Float64Mask xor(VectorMask mask) { + public FloatMask64 xor(VectorMask mask) { Objects.requireNonNull(mask); - Float64Mask m = (Float64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMask64 m = (FloatMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -717,21 +723,21 @@ final class Float64Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -741,7 +747,7 @@ final class Float64Vector extends FloatVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -751,7 +757,7 @@ final class Float64Vector extends FloatVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Float64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(FloatMask64.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -760,48 +766,49 @@ final class Float64Vector extends FloatVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Float64Mask)m).getBits())); + (m, __) -> anyTrueHelper(((FloatMask64)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Float64Mask)m).getBits())); + (m, __) -> allTrueHelper(((FloatMask64)m).getBits())); } @ForceInline /*package-private*/ - static Float64Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Float64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static FloatMask64 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(FloatMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Float64Mask TRUE_MASK = new Float64Mask(true); - private static final Float64Mask FALSE_MASK = new Float64Mask(false); + private static final FloatMask64 TRUE_MASK = new FloatMask64(true); + private static final FloatMask64 FALSE_MASK = new FloatMask64(false); } // Shuffle - static final class Float64Shuffle extends AbstractShuffle { + static final class FloatShuffle64 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Float64Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + FloatShuffle64(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Float64Shuffle(int[] indices, int i) { + FloatShuffle64(int[] indices, int i) { this(prepare(indices, i)); } - Float64Shuffle(IntUnaryOperator fn) { + FloatShuffle64(IntUnaryOperator fn) { this(prepare(fn)); } @@ -821,23 +828,23 @@ final class Float64Vector extends FloatVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Float64Shuffle IOTA = new Float64Shuffle(IDENTITY); + static final FloatShuffle64 IOTA = new FloatShuffle64(IDENTITY); @Override @ForceInline - public Float64Vector toVector() { - return (Float64Vector) toBitsVector().castShape(vspecies(), 0); + public FloatVector64 toVector() { + return (FloatVector64) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - Int64Vector toBitsVector() { - return (Int64Vector) super.toBitsVectorTemplate(); + IntVector64 toBitsVector() { + return (IntVector64) super.toBitsVectorTemplate(); } @Override - Int64Vector toBitsVector0() { - return ((Int64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector64 toBitsVector0() { + return ((IntVector64) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -860,30 +867,30 @@ final class Float64Vector extends FloatVector { @Override @ForceInline - public final Float64Mask laneIsValid() { - return (Float64Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final FloatMask64 laneIsValid() { + return (FloatMask64) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Float64Shuffle rearrange(VectorShuffle shuffle) { - Float64Shuffle concreteShuffle = (Float64Shuffle) shuffle; - return (Float64Shuffle) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_64)) + public final FloatShuffle64 rearrange(VectorShuffle shuffle) { + FloatShuffle64 concreteShuffle = (FloatShuffle64) shuffle; + return (FloatShuffle64) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_64)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Float64Shuffle wrapIndexes() { - Int64Vector v = toBitsVector(); + public final FloatShuffle64 wrapIndexes() { + IntVector64 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int64Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector64) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector64) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Float64Shuffle) v.toShuffle(vspecies(), false); + return (FloatShuffle64) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -934,14 +941,14 @@ final class Float64Vector extends FloatVector { @Override final FloatVector fromArray0(float[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Float64Mask.class, a, offset, (Float64Mask) m, offsetInRange); // specialize + return super.fromArray0Template(FloatMask64.class, a, offset, (FloatMask64) m, offsetInRange); // specialize } @ForceInline @Override final FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Float64Mask.class, a, offset, indexMap, mapOffset, (Float64Mask) m); + return super.fromArray0Template(FloatMask64.class, a, offset, indexMap, mapOffset, (FloatMask64) m); } @@ -957,7 +964,7 @@ final class Float64Vector extends FloatVector { @Override final FloatVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Float64Mask.class, ms, offset, (Float64Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(FloatMask64.class, ms, offset, (FloatMask64) m, offsetInRange); // specialize } @ForceInline @@ -971,14 +978,14 @@ final class Float64Vector extends FloatVector { @Override final void intoArray0(float[] a, int offset, VectorMask m) { - super.intoArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); + super.intoArray0Template(FloatMask64.class, a, offset, (FloatMask64) m); } @ForceInline @Override final void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Float64Mask.class, a, offset, indexMap, mapOffset, (Float64Mask) m); + super.intoArray0Template(FloatMask64.class, a, offset, indexMap, mapOffset, (FloatMask64) m); } @@ -986,7 +993,7 @@ final class Float64Vector extends FloatVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Float64Mask.class, ms, offset, (Float64Mask) m); + super.intoMemorySegment0Template(FloatMask64.class, ms, offset, (FloatMask64) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVectorMax.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVectorMax.java index 35e4c83ebde..4813f153544 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVectorMax.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class FloatMaxVector extends FloatVector { +final class FloatVectorMax extends FloatVector { static final FloatSpecies VSPECIES = (FloatSpecies) FloatVector.SPECIES_MAX; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = FloatMaxVector.class; + static final Class VCLASS = FloatVectorMax.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = float.class; // carrier type used by the JVM + static final Class ETYPE = float.class; // used by the JVM - FloatMaxVector(float[] v) { + FloatVectorMax(float[] v) { super(v); } - // For compatibility as FloatMaxVector::new, + // For compatibility as FloatVectorMax::new, // stored into species.vectorFactory. - FloatMaxVector(Object v) { + FloatVectorMax(Object v) { this((float[]) v); } - static final FloatMaxVector ZERO = new FloatMaxVector(new float[VLENGTH]); - static final FloatMaxVector IOTA = new FloatMaxVector(VSPECIES.iotaArray()); + static final FloatVectorMax ZERO = new FloatVectorMax(new float[VLENGTH]); + static final FloatVectorMax IOTA = new FloatVectorMax(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class FloatMaxVector extends FloatVector { @Override public final Class elementType() { return float.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Float.SIZE; } @@ -130,51 +135,51 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline - public final FloatMaxVector broadcast(float e) { - return (FloatMaxVector) super.broadcastTemplate(e); // specialize + public final FloatVectorMax broadcast(float e) { + return (FloatVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final FloatMaxVector broadcast(long e) { - return (FloatMaxVector) super.broadcastTemplate(e); // specialize + public final FloatVectorMax broadcast(long e) { + return (FloatVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - FloatMaxMask maskFromArray(boolean[] bits) { - return new FloatMaxMask(bits); + FloatMaskMax maskFromArray(boolean[] bits) { + return new FloatMaskMax(bits); } @Override @ForceInline - FloatMaxShuffle iotaShuffle() { return FloatMaxShuffle.IOTA; } + FloatShuffleMax iotaShuffle() { return FloatShuffleMax.IOTA; } @Override @ForceInline - FloatMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - return (FloatMaxShuffle) iotaShuffleTemplate(start, step, wrap); + FloatShuffleMax iotaShuffle(int start, int step, boolean wrap) { + return (FloatShuffleMax) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - FloatMaxShuffle shuffleFromArray(int[] indices, int i) { return new FloatMaxShuffle(indices, i); } + FloatShuffleMax shuffleFromArray(int[] indices, int i) { return new FloatShuffleMax(indices, i); } @Override @ForceInline - FloatMaxShuffle shuffleFromOp(IntUnaryOperator fn) { return new FloatMaxShuffle(fn); } + FloatShuffleMax shuffleFromOp(IntUnaryOperator fn) { return new FloatShuffleMax(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - FloatMaxVector vectorFactory(float[] vec) { - return new FloatMaxVector(vec); + FloatVectorMax vectorFactory(float[] vec) { + return new FloatVectorMax(vec); } @ForceInline final @Override - ByteMaxVector asByteVectorRaw() { - return (ByteMaxVector) super.asByteVectorRawTemplate(); // specialize + ByteVectorMax asByteVectorRaw() { + return (ByteVectorMax) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class FloatMaxVector extends FloatVector { @ForceInline final @Override - FloatMaxVector uOp(FUnOp f) { - return (FloatMaxVector) super.uOpTemplate(f); // specialize + FloatVectorMax uOp(FUnOp f) { + return (FloatVectorMax) super.uOpTemplate(f); // specialize } @ForceInline final @Override - FloatMaxVector uOp(VectorMask m, FUnOp f) { - return (FloatMaxVector) - super.uOpTemplate((FloatMaxMask)m, f); // specialize + FloatVectorMax uOp(VectorMask m, FUnOp f) { + return (FloatVectorMax) + super.uOpTemplate((FloatMaskMax)m, f); // specialize } // Binary operator @ForceInline final @Override - FloatMaxVector bOp(Vector v, FBinOp f) { - return (FloatMaxVector) super.bOpTemplate((FloatMaxVector)v, f); // specialize + FloatVectorMax bOp(Vector v, FBinOp f) { + return (FloatVectorMax) super.bOpTemplate((FloatVectorMax)v, f); // specialize } @ForceInline final @Override - FloatMaxVector bOp(Vector v, + FloatVectorMax bOp(Vector v, VectorMask m, FBinOp f) { - return (FloatMaxVector) - super.bOpTemplate((FloatMaxVector)v, (FloatMaxMask)m, + return (FloatVectorMax) + super.bOpTemplate((FloatVectorMax)v, (FloatMaskMax)m, f); // specialize } @@ -219,19 +224,19 @@ final class FloatMaxVector extends FloatVector { @ForceInline final @Override - FloatMaxVector tOp(Vector v1, Vector v2, FTriOp f) { - return (FloatMaxVector) - super.tOpTemplate((FloatMaxVector)v1, (FloatMaxVector)v2, + FloatVectorMax tOp(Vector v1, Vector v2, FTriOp f) { + return (FloatVectorMax) + super.tOpTemplate((FloatVectorMax)v1, (FloatVectorMax)v2, f); // specialize } @ForceInline final @Override - FloatMaxVector tOp(Vector v1, Vector v2, + FloatVectorMax tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (FloatMaxVector) - super.tOpTemplate((FloatMaxVector)v1, (FloatMaxVector)v2, - (FloatMaxMask)m, f); // specialize + return (FloatVectorMax) + super.tOpTemplate((FloatVectorMax)v1, (FloatVectorMax)v2, + (FloatMaskMax)m, f); // specialize } @ForceInline @@ -269,26 +274,26 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline - public FloatMaxVector lanewise(Unary op) { - return (FloatMaxVector) super.lanewiseTemplate(op); // specialize + public FloatVectorMax lanewise(Unary op) { + return (FloatVectorMax) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public FloatMaxVector lanewise(Unary op, VectorMask m) { - return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialize + public FloatVectorMax lanewise(Unary op, VectorMask m) { + return (FloatVectorMax) super.lanewiseTemplate(op, FloatMaskMax.class, (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector lanewise(Binary op, Vector v) { - return (FloatMaxVector) super.lanewiseTemplate(op, v); // specialize + public FloatVectorMax lanewise(Binary op, Vector v) { + return (FloatVectorMax) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public FloatMaxVector lanewise(Binary op, Vector v, VectorMask m) { - return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, v, (FloatMaxMask) m); // specialize + public FloatVectorMax lanewise(Binary op, Vector v, VectorMask m) { + return (FloatVectorMax) super.lanewiseTemplate(op, FloatMaskMax.class, v, (FloatMaskMax) m); // specialize } @@ -296,24 +301,24 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline public final - FloatMaxVector + FloatVectorMax lanewise(Ternary op, Vector v1, Vector v2) { - return (FloatMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize + return (FloatVectorMax) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - FloatMaxVector + FloatVectorMax lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, v1, v2, (FloatMaxMask) m); // specialize + return (FloatVectorMax) super.lanewiseTemplate(op, FloatMaskMax.class, v1, v2, (FloatMaskMax) m); // specialize } @Override @ForceInline public final - FloatMaxVector addIndex(int scale) { - return (FloatMaxVector) super.addIndexTemplate(scale); // specialize + FloatVectorMax addIndex(int scale) { + return (FloatVectorMax) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -328,7 +333,7 @@ final class FloatMaxVector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized + return super.reduceLanesTemplate(op, FloatMaskMax.class, (FloatMaskMax) m); // specialized } @Override @@ -341,7 +346,7 @@ final class FloatMaxVector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized + return (long) super.reduceLanesTemplate(op, FloatMaskMax.class, (FloatMaskMax) m); // specialized } @Override @@ -352,160 +357,160 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline - public final FloatMaxShuffle toShuffle() { - return (FloatMaxShuffle) toShuffle(vspecies(), false); + public final FloatShuffleMax toShuffle() { + return (FloatShuffleMax) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final FloatMaxMask test(Test op) { - return super.testTemplate(FloatMaxMask.class, op); // specialize + public final FloatMaskMax test(Test op) { + return super.testTemplate(FloatMaskMax.class, op); // specialize } @Override @ForceInline - public final FloatMaxMask test(Test op, VectorMask m) { - return super.testTemplate(FloatMaxMask.class, op, (FloatMaxMask) m); // specialize + public final FloatMaskMax test(Test op, VectorMask m) { + return super.testTemplate(FloatMaskMax.class, op, (FloatMaskMax) m); // specialize } // Specialized comparisons @Override @ForceInline - public final FloatMaxMask compare(Comparison op, Vector v) { - return super.compareTemplate(FloatMaxMask.class, op, v); // specialize + public final FloatMaskMax compare(Comparison op, Vector v) { + return super.compareTemplate(FloatMaskMax.class, op, v); // specialize } @Override @ForceInline - public final FloatMaxMask compare(Comparison op, float s) { - return super.compareTemplate(FloatMaxMask.class, op, s); // specialize + public final FloatMaskMax compare(Comparison op, float s) { + return super.compareTemplate(FloatMaskMax.class, op, s); // specialize } @Override @ForceInline - public final FloatMaxMask compare(Comparison op, long s) { - return super.compareTemplate(FloatMaxMask.class, op, s); // specialize + public final FloatMaskMax compare(Comparison op, long s) { + return super.compareTemplate(FloatMaskMax.class, op, s); // specialize } @Override @ForceInline - public final FloatMaxMask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(FloatMaxMask.class, op, v, (FloatMaxMask) m); + public final FloatMaskMax compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(FloatMaskMax.class, op, v, (FloatMaskMax) m); } @Override @ForceInline - public FloatMaxVector blend(Vector v, VectorMask m) { - return (FloatMaxVector) - super.blendTemplate(FloatMaxMask.class, - (FloatMaxVector) v, - (FloatMaxMask) m); // specialize + public FloatVectorMax blend(Vector v, VectorMask m) { + return (FloatVectorMax) + super.blendTemplate(FloatMaskMax.class, + (FloatVectorMax) v, + (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector slice(int origin, Vector v) { - return (FloatMaxVector) super.sliceTemplate(origin, v); // specialize + public FloatVectorMax slice(int origin, Vector v) { + return (FloatVectorMax) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public FloatMaxVector slice(int origin) { - return (FloatMaxVector) super.sliceTemplate(origin); // specialize + public FloatVectorMax slice(int origin) { + return (FloatVectorMax) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public FloatMaxVector unslice(int origin, Vector w, int part) { - return (FloatMaxVector) super.unsliceTemplate(origin, w, part); // specialize + public FloatVectorMax unslice(int origin, Vector w, int part) { + return (FloatVectorMax) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public FloatMaxVector unslice(int origin, Vector w, int part, VectorMask m) { - return (FloatMaxVector) - super.unsliceTemplate(FloatMaxMask.class, + public FloatVectorMax unslice(int origin, Vector w, int part, VectorMask m) { + return (FloatVectorMax) + super.unsliceTemplate(FloatMaskMax.class, origin, w, part, - (FloatMaxMask) m); // specialize + (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector unslice(int origin) { - return (FloatMaxVector) super.unsliceTemplate(origin); // specialize + public FloatVectorMax unslice(int origin) { + return (FloatVectorMax) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public FloatMaxVector rearrange(VectorShuffle s) { - return (FloatMaxVector) - super.rearrangeTemplate(FloatMaxShuffle.class, - (FloatMaxShuffle) s); // specialize + public FloatVectorMax rearrange(VectorShuffle s) { + return (FloatVectorMax) + super.rearrangeTemplate(FloatShuffleMax.class, + (FloatShuffleMax) s); // specialize } @Override @ForceInline - public FloatMaxVector rearrange(VectorShuffle shuffle, + public FloatVectorMax rearrange(VectorShuffle shuffle, VectorMask m) { - return (FloatMaxVector) - super.rearrangeTemplate(FloatMaxShuffle.class, - FloatMaxMask.class, - (FloatMaxShuffle) shuffle, - (FloatMaxMask) m); // specialize + return (FloatVectorMax) + super.rearrangeTemplate(FloatShuffleMax.class, + FloatMaskMax.class, + (FloatShuffleMax) shuffle, + (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector rearrange(VectorShuffle s, + public FloatVectorMax rearrange(VectorShuffle s, Vector v) { - return (FloatMaxVector) - super.rearrangeTemplate(FloatMaxShuffle.class, - (FloatMaxShuffle) s, - (FloatMaxVector) v); // specialize + return (FloatVectorMax) + super.rearrangeTemplate(FloatShuffleMax.class, + (FloatShuffleMax) s, + (FloatVectorMax) v); // specialize } @Override @ForceInline - public FloatMaxVector compress(VectorMask m) { - return (FloatMaxVector) - super.compressTemplate(FloatMaxMask.class, - (FloatMaxMask) m); // specialize + public FloatVectorMax compress(VectorMask m) { + return (FloatVectorMax) + super.compressTemplate(FloatMaskMax.class, + (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector expand(VectorMask m) { - return (FloatMaxVector) - super.expandTemplate(FloatMaxMask.class, - (FloatMaxMask) m); // specialize + public FloatVectorMax expand(VectorMask m) { + return (FloatVectorMax) + super.expandTemplate(FloatMaskMax.class, + (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector selectFrom(Vector v) { - return (FloatMaxVector) - super.selectFromTemplate((FloatMaxVector) v); // specialize + public FloatVectorMax selectFrom(Vector v) { + return (FloatVectorMax) + super.selectFromTemplate((FloatVectorMax) v); // specialize } @Override @ForceInline - public FloatMaxVector selectFrom(Vector v, + public FloatVectorMax selectFrom(Vector v, VectorMask m) { - return (FloatMaxVector) - super.selectFromTemplate((FloatMaxVector) v, - FloatMaxMask.class, (FloatMaxMask) m); // specialize + return (FloatVectorMax) + super.selectFromTemplate((FloatVectorMax) v, + FloatMaskMax.class, (FloatMaskMax) m); // specialize } @Override @ForceInline - public FloatMaxVector selectFrom(Vector v1, + public FloatVectorMax selectFrom(Vector v1, Vector v2) { - return (FloatMaxVector) - super.selectFromTemplate((FloatMaxVector) v1, (FloatMaxVector) v2); // specialize + return (FloatVectorMax) + super.selectFromTemplate((FloatVectorMax) v1, (FloatVectorMax) v2); // specialize } @ForceInline @@ -531,7 +536,7 @@ final class FloatMaxVector extends FloatVector { @ForceInline @Override - public FloatMaxVector withLane(int i, float e) { + public FloatVectorMax withLane(int i, float e) { if (i < 0 || i >= VLENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); } @@ -539,7 +544,7 @@ final class FloatMaxVector extends FloatVector { } @ForceInline - public FloatMaxVector withLaneHelper(int i, float e) { + public FloatVectorMax withLaneHelper(int i, float e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)Float.floatToRawIntBits(e), @@ -552,19 +557,20 @@ final class FloatMaxVector extends FloatVector { // Mask - static final class FloatMaxMask extends AbstractMask { + static final class FloatMaskMax extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = float.class; // used by the JVM - FloatMaxMask(boolean[] bits) { + static final Class CTYPE = float.class; // used by the JVM + + FloatMaskMax(boolean[] bits) { this(bits, 0); } - FloatMaxMask(boolean[] bits, int offset) { + FloatMaskMax(boolean[] bits, int offset) { super(prepare(bits, offset)); } - FloatMaxMask(boolean val) { + FloatMaskMax(boolean val) { super(prepare(val)); } @@ -597,31 +603,31 @@ final class FloatMaxVector extends FloatVector { } @Override - FloatMaxMask uOp(MUnOp f) { + FloatMaskMax uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new FloatMaxMask(res); + return new FloatMaskMax(res); } @Override - FloatMaxMask bOp(VectorMask m, MBinOp f) { + FloatMaskMax bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((FloatMaxMask)m).getBits(); + boolean[] mbits = ((FloatMaskMax)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new FloatMaxMask(res); + return new FloatMaskMax(res); } @ForceInline @Override public final - FloatMaxVector toVector() { - return (FloatMaxVector) super.toVectorTemplate(); // specialize + FloatVectorMax toVector() { + return (FloatVectorMax) super.toVectorTemplate(); // specialize } /** @@ -654,25 +660,25 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline /*package-private*/ - FloatMaxMask indexPartiallyInUpperRange(long offset, long limit) { - return (FloatMaxMask) VectorSupport.indexPartiallyInUpperRange( - FloatMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (FloatMaxMask) TRUE_MASK.indexPartiallyInRange(o, l)); + FloatMaskMax indexPartiallyInUpperRange(long offset, long limit) { + return (FloatMaskMax) VectorSupport.indexPartiallyInUpperRange( + FloatMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (FloatMaskMax) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public FloatMaxMask not() { + public FloatMaskMax not() { return xor(maskAll(true)); } @Override @ForceInline - public FloatMaxMask compress() { - return (FloatMaxMask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - FloatMaxVector.class, FloatMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public FloatMaskMax compress() { + return (FloatMaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + FloatVectorMax.class, FloatMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -681,30 +687,30 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline - public FloatMaxMask and(VectorMask mask) { + public FloatMaskMax and(VectorMask mask) { Objects.requireNonNull(mask); - FloatMaxMask m = (FloatMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMaskMax m = (FloatMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public FloatMaxMask or(VectorMask mask) { + public FloatMaskMax or(VectorMask mask) { Objects.requireNonNull(mask); - FloatMaxMask m = (FloatMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMaskMax m = (FloatMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public FloatMaxMask xor(VectorMask mask) { + public FloatMaskMax xor(VectorMask mask) { Objects.requireNonNull(mask); - FloatMaxMask m = (FloatMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + FloatMaskMax m = (FloatMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -714,21 +720,21 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -738,7 +744,7 @@ final class FloatMaxVector extends FloatVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -748,7 +754,7 @@ final class FloatMaxVector extends FloatVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(FloatMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(FloatMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -757,48 +763,49 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((FloatMaxMask)m).getBits())); + (m, __) -> anyTrueHelper(((FloatMaskMax)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((FloatMaxMask)m).getBits())); + (m, __) -> allTrueHelper(((FloatMaskMax)m).getBits())); } @ForceInline /*package-private*/ - static FloatMaxMask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(FloatMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static FloatMaskMax maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(FloatMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final FloatMaxMask TRUE_MASK = new FloatMaxMask(true); - private static final FloatMaxMask FALSE_MASK = new FloatMaxMask(false); + private static final FloatMaskMax TRUE_MASK = new FloatMaskMax(true); + private static final FloatMaskMax FALSE_MASK = new FloatMaskMax(false); } // Shuffle - static final class FloatMaxShuffle extends AbstractShuffle { + static final class FloatShuffleMax extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - FloatMaxShuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + FloatShuffleMax(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - FloatMaxShuffle(int[] indices, int i) { + FloatShuffleMax(int[] indices, int i) { this(prepare(indices, i)); } - FloatMaxShuffle(IntUnaryOperator fn) { + FloatShuffleMax(IntUnaryOperator fn) { this(prepare(fn)); } @@ -818,23 +825,23 @@ final class FloatMaxVector extends FloatVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final FloatMaxShuffle IOTA = new FloatMaxShuffle(IDENTITY); + static final FloatShuffleMax IOTA = new FloatShuffleMax(IDENTITY); @Override @ForceInline - public FloatMaxVector toVector() { - return (FloatMaxVector) toBitsVector().castShape(vspecies(), 0); + public FloatVectorMax toVector() { + return (FloatVectorMax) toBitsVector().castShape(vspecies(), 0); } @Override @ForceInline - IntMaxVector toBitsVector() { - return (IntMaxVector) super.toBitsVectorTemplate(); + IntVectorMax toBitsVector() { + return (IntVectorMax) super.toBitsVectorTemplate(); } @Override - IntMaxVector toBitsVector0() { - return ((IntMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVectorMax toBitsVector0() { + return ((IntVectorMax) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -857,30 +864,30 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline - public final FloatMaxMask laneIsValid() { - return (FloatMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + public final FloatMaskMax laneIsValid() { + return (FloatMaskMax) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final FloatMaxShuffle rearrange(VectorShuffle shuffle) { - FloatMaxShuffle concreteShuffle = (FloatMaxShuffle) shuffle; - return (FloatMaxShuffle) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_MAX)) + public final FloatShuffleMax rearrange(VectorShuffle shuffle) { + FloatShuffleMax concreteShuffle = (FloatShuffleMax) shuffle; + return (FloatShuffleMax) toBitsVector().rearrange(concreteShuffle.cast(IntVector.SPECIES_MAX)) .toShuffle(vspecies(), false); } @ForceInline @Override - public final FloatMaxShuffle wrapIndexes() { - IntMaxVector v = toBitsVector(); + public final FloatShuffleMax wrapIndexes() { + IntVectorMax v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (IntMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVectorMax) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (IntMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVectorMax) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (FloatMaxShuffle) v.toShuffle(vspecies(), false); + return (FloatShuffleMax) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -931,14 +938,14 @@ final class FloatMaxVector extends FloatVector { @Override final FloatVector fromArray0(float[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m, offsetInRange); // specialize + return super.fromArray0Template(FloatMaskMax.class, a, offset, (FloatMaskMax) m, offsetInRange); // specialize } @ForceInline @Override final FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(FloatMaxMask.class, a, offset, indexMap, mapOffset, (FloatMaxMask) m); + return super.fromArray0Template(FloatMaskMax.class, a, offset, indexMap, mapOffset, (FloatMaskMax) m); } @@ -954,7 +961,7 @@ final class FloatMaxVector extends FloatVector { @Override final FloatVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(FloatMaxMask.class, ms, offset, (FloatMaxMask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(FloatMaskMax.class, ms, offset, (FloatMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -968,14 +975,14 @@ final class FloatMaxVector extends FloatVector { @Override final void intoArray0(float[] a, int offset, VectorMask m) { - super.intoArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); + super.intoArray0Template(FloatMaskMax.class, a, offset, (FloatMaskMax) m); } @ForceInline @Override final void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(FloatMaxMask.class, a, offset, indexMap, mapOffset, (FloatMaxMask) m); + super.intoArray0Template(FloatMaskMax.class, a, offset, indexMap, mapOffset, (FloatMaskMax) m); } @@ -983,7 +990,7 @@ final class FloatMaxVector extends FloatVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(FloatMaxMask.class, ms, offset, (FloatMaxMask) m); + super.intoMemorySegment0Template(FloatMaskMax.class, ms, offset, (FloatMaskMax) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java index 412ac8e59b2..445c4dfb006 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java @@ -84,8 +84,8 @@ public abstract class IntVector extends AbstractVector { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -4084,13 +4084,13 @@ public abstract class IntVector extends AbstractVector { @Override @ForceInline public final IntVector zero() { - if ((Class) vectorType() == IntMaxVector.class) - return IntMaxVector.ZERO; + if ((Class) vectorType() == IntVectorMax.class) + return IntVectorMax.ZERO; switch (vectorBitSize()) { - case 64: return Int64Vector.ZERO; - case 128: return Int128Vector.ZERO; - case 256: return Int256Vector.ZERO; - case 512: return Int512Vector.ZERO; + case 64: return IntVector64.ZERO; + case 128: return IntVector128.ZERO; + case 256: return IntVector256.ZERO; + case 512: return IntVector512.ZERO; } throw new AssertionError(); } @@ -4098,13 +4098,13 @@ public abstract class IntVector extends AbstractVector { @Override @ForceInline public final IntVector iota() { - if ((Class) vectorType() == IntMaxVector.class) - return IntMaxVector.IOTA; + if ((Class) vectorType() == IntVectorMax.class) + return IntVectorMax.IOTA; switch (vectorBitSize()) { - case 64: return Int64Vector.IOTA; - case 128: return Int128Vector.IOTA; - case 256: return Int256Vector.IOTA; - case 512: return Int512Vector.IOTA; + case 64: return IntVector64.IOTA; + case 128: return IntVector128.IOTA; + case 256: return IntVector256.IOTA; + case 512: return IntVector512.IOTA; } throw new AssertionError(); } @@ -4113,13 +4113,13 @@ public abstract class IntVector extends AbstractVector { @Override @ForceInline public final VectorMask maskAll(boolean bit) { - if ((Class) vectorType() == IntMaxVector.class) - return IntMaxVector.IntMaxMask.maskAll(bit); + if ((Class) vectorType() == IntVectorMax.class) + return IntVectorMax.IntMaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return Int64Vector.Int64Mask.maskAll(bit); - case 128: return Int128Vector.Int128Mask.maskAll(bit); - case 256: return Int256Vector.Int256Mask.maskAll(bit); - case 512: return Int512Vector.Int512Mask.maskAll(bit); + case 64: return IntVector64.IntMask64.maskAll(bit); + case 128: return IntVector128.IntMask128.maskAll(bit); + case 256: return IntVector256.IntMask256.maskAll(bit); + case 512: return IntVector512.IntMask512.maskAll(bit); } throw new AssertionError(); } @@ -4147,42 +4147,42 @@ public abstract class IntVector extends AbstractVector { /** Species representing {@link IntVector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies SPECIES_64 = new IntSpecies(VectorShape.S_64_BIT, - Int64Vector.class, - Int64Vector.Int64Mask.class, - Int64Vector.Int64Shuffle.class, - Int64Vector::new); + IntVector64.class, + IntVector64.IntMask64.class, + IntVector64.IntShuffle64.class, + IntVector64::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies SPECIES_128 = new IntSpecies(VectorShape.S_128_BIT, - Int128Vector.class, - Int128Vector.Int128Mask.class, - Int128Vector.Int128Shuffle.class, - Int128Vector::new); + IntVector128.class, + IntVector128.IntMask128.class, + IntVector128.IntShuffle128.class, + IntVector128::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies SPECIES_256 = new IntSpecies(VectorShape.S_256_BIT, - Int256Vector.class, - Int256Vector.Int256Mask.class, - Int256Vector.Int256Shuffle.class, - Int256Vector::new); + IntVector256.class, + IntVector256.IntMask256.class, + IntVector256.IntShuffle256.class, + IntVector256::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies SPECIES_512 = new IntSpecies(VectorShape.S_512_BIT, - Int512Vector.class, - Int512Vector.Int512Mask.class, - Int512Vector.Int512Shuffle.class, - Int512Vector::new); + IntVector512.class, + IntVector512.IntMask512.class, + IntVector512.IntShuffle512.class, + IntVector512::new); /** Species representing {@link IntVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies SPECIES_MAX = new IntSpecies(VectorShape.S_Max_BIT, - IntMaxVector.class, - IntMaxVector.IntMaxMask.class, - IntMaxVector.IntMaxShuffle.class, - IntMaxVector::new); + IntVectorMax.class, + IntVectorMax.IntMaskMax.class, + IntVectorMax.IntShuffleMax.class, + IntVectorMax::new); /** * Preferred species for {@link IntVector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector128.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector128.java index 17e93dbd06a..cc8f31a4bc2 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector128.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Int128Vector extends IntVector { +final class IntVector128 extends IntVector { static final IntSpecies VSPECIES = (IntSpecies) IntVector.SPECIES_128; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Int128Vector.class; + static final Class VCLASS = IntVector128.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = int.class; // carrier type used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Int128Vector(int[] v) { + IntVector128(int[] v) { super(v); } - // For compatibility as Int128Vector::new, + // For compatibility as IntVector128::new, // stored into species.vectorFactory. - Int128Vector(Object v) { + IntVector128(Object v) { this((int[]) v); } - static final Int128Vector ZERO = new Int128Vector(new int[VLENGTH]); - static final Int128Vector IOTA = new Int128Vector(VSPECIES.iotaArray()); + static final IntVector128 ZERO = new IntVector128(new int[VLENGTH]); + static final IntVector128 IOTA = new IntVector128(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Int128Vector extends IntVector { @Override public final Class elementType() { return int.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Integer.SIZE; } @@ -130,51 +135,51 @@ final class Int128Vector extends IntVector { @Override @ForceInline - public final Int128Vector broadcast(int e) { - return (Int128Vector) super.broadcastTemplate(e); // specialize + public final IntVector128 broadcast(int e) { + return (IntVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Int128Vector broadcast(long e) { - return (Int128Vector) super.broadcastTemplate(e); // specialize + public final IntVector128 broadcast(long e) { + return (IntVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Int128Mask maskFromArray(boolean[] bits) { - return new Int128Mask(bits); + IntMask128 maskFromArray(boolean[] bits) { + return new IntMask128(bits); } @Override @ForceInline - Int128Shuffle iotaShuffle() { return Int128Shuffle.IOTA; } + IntShuffle128 iotaShuffle() { return IntShuffle128.IOTA; } @Override @ForceInline - Int128Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Int128Shuffle) iotaShuffleTemplate(start, step, wrap); + IntShuffle128 iotaShuffle(int start, int step, boolean wrap) { + return (IntShuffle128) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int128Shuffle shuffleFromArray(int[] indices, int i) { return new Int128Shuffle(indices, i); } + IntShuffle128 shuffleFromArray(int[] indices, int i) { return new IntShuffle128(indices, i); } @Override @ForceInline - Int128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Int128Shuffle(fn); } + IntShuffle128 shuffleFromOp(IntUnaryOperator fn) { return new IntShuffle128(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Int128Vector vectorFactory(int[] vec) { - return new Int128Vector(vec); + IntVector128 vectorFactory(int[] vec) { + return new IntVector128(vec); } @ForceInline final @Override - Byte128Vector asByteVectorRaw() { - return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector128 asByteVectorRaw() { + return (ByteVector128) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Int128Vector extends IntVector { @ForceInline final @Override - Int128Vector uOp(FUnOp f) { - return (Int128Vector) super.uOpTemplate(f); // specialize + IntVector128 uOp(FUnOp f) { + return (IntVector128) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Int128Vector uOp(VectorMask m, FUnOp f) { - return (Int128Vector) - super.uOpTemplate((Int128Mask)m, f); // specialize + IntVector128 uOp(VectorMask m, FUnOp f) { + return (IntVector128) + super.uOpTemplate((IntMask128)m, f); // specialize } // Binary operator @ForceInline final @Override - Int128Vector bOp(Vector v, FBinOp f) { - return (Int128Vector) super.bOpTemplate((Int128Vector)v, f); // specialize + IntVector128 bOp(Vector v, FBinOp f) { + return (IntVector128) super.bOpTemplate((IntVector128)v, f); // specialize } @ForceInline final @Override - Int128Vector bOp(Vector v, + IntVector128 bOp(Vector v, VectorMask m, FBinOp f) { - return (Int128Vector) - super.bOpTemplate((Int128Vector)v, (Int128Mask)m, + return (IntVector128) + super.bOpTemplate((IntVector128)v, (IntMask128)m, f); // specialize } @@ -219,19 +224,19 @@ final class Int128Vector extends IntVector { @ForceInline final @Override - Int128Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Int128Vector) - super.tOpTemplate((Int128Vector)v1, (Int128Vector)v2, + IntVector128 tOp(Vector v1, Vector v2, FTriOp f) { + return (IntVector128) + super.tOpTemplate((IntVector128)v1, (IntVector128)v2, f); // specialize } @ForceInline final @Override - Int128Vector tOp(Vector v1, Vector v2, + IntVector128 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Int128Vector) - super.tOpTemplate((Int128Vector)v1, (Int128Vector)v2, - (Int128Mask)m, f); // specialize + return (IntVector128) + super.tOpTemplate((IntVector128)v1, (IntVector128)v2, + (IntMask128)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Int128Vector extends IntVector { @Override @ForceInline - public Int128Vector lanewise(Unary op) { - return (Int128Vector) super.lanewiseTemplate(op); // specialize + public IntVector128 lanewise(Unary op) { + return (IntVector128) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Int128Vector lanewise(Unary op, VectorMask m) { - return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, (Int128Mask) m); // specialize + public IntVector128 lanewise(Unary op, VectorMask m) { + return (IntVector128) super.lanewiseTemplate(op, IntMask128.class, (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector lanewise(Binary op, Vector v) { - return (Int128Vector) super.lanewiseTemplate(op, v); // specialize + public IntVector128 lanewise(Binary op, Vector v) { + return (IntVector128) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Int128Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v, (Int128Mask) m); // specialize + public IntVector128 lanewise(Binary op, Vector v, VectorMask m) { + return (IntVector128) super.lanewiseTemplate(op, IntMask128.class, v, (IntMask128) m); // specialize } /*package-private*/ @Override - @ForceInline Int128Vector + @ForceInline IntVector128 lanewiseShift(VectorOperators.Binary op, int e) { - return (Int128Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (IntVector128) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Int128Vector + @ForceInline IntVector128 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Int128Vector) super.lanewiseShiftTemplate(op, Int128Mask.class, e, (Int128Mask) m); // specialize + return (IntVector128) super.lanewiseShiftTemplate(op, IntMask128.class, e, (IntMask128) m); // specialize } /*package-private*/ @Override @ForceInline public final - Int128Vector + IntVector128 lanewise(Ternary op, Vector v1, Vector v2) { - return (Int128Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (IntVector128) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Int128Vector + IntVector128 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v1, v2, (Int128Mask) m); // specialize + return (IntVector128) super.lanewiseTemplate(op, IntMask128.class, v1, v2, (IntMask128) m); // specialize } @Override @ForceInline public final - Int128Vector addIndex(int scale) { - return (Int128Vector) super.addIndexTemplate(scale); // specialize + IntVector128 addIndex(int scale) { + return (IntVector128) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Int128Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized + return super.reduceLanesTemplate(op, IntMask128.class, (IntMask128) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Int128Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, IntMask128.class, (IntMask128) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Int128Vector extends IntVector { @Override @ForceInline - public final Int128Shuffle toShuffle() { - return (Int128Shuffle) toShuffle(vspecies(), false); + public final IntShuffle128 toShuffle() { + return (IntShuffle128) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Int128Mask test(Test op) { - return super.testTemplate(Int128Mask.class, op); // specialize + public final IntMask128 test(Test op) { + return super.testTemplate(IntMask128.class, op); // specialize } @Override @ForceInline - public final Int128Mask test(Test op, VectorMask m) { - return super.testTemplate(Int128Mask.class, op, (Int128Mask) m); // specialize + public final IntMask128 test(Test op, VectorMask m) { + return super.testTemplate(IntMask128.class, op, (IntMask128) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Int128Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Int128Mask.class, op, v); // specialize + public final IntMask128 compare(Comparison op, Vector v) { + return super.compareTemplate(IntMask128.class, op, v); // specialize } @Override @ForceInline - public final Int128Mask compare(Comparison op, int s) { - return super.compareTemplate(Int128Mask.class, op, s); // specialize + public final IntMask128 compare(Comparison op, int s) { + return super.compareTemplate(IntMask128.class, op, s); // specialize } @Override @ForceInline - public final Int128Mask compare(Comparison op, long s) { - return super.compareTemplate(Int128Mask.class, op, s); // specialize + public final IntMask128 compare(Comparison op, long s) { + return super.compareTemplate(IntMask128.class, op, s); // specialize } @Override @ForceInline - public final Int128Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Int128Mask.class, op, v, (Int128Mask) m); + public final IntMask128 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(IntMask128.class, op, v, (IntMask128) m); } @Override @ForceInline - public Int128Vector blend(Vector v, VectorMask m) { - return (Int128Vector) - super.blendTemplate(Int128Mask.class, - (Int128Vector) v, - (Int128Mask) m); // specialize + public IntVector128 blend(Vector v, VectorMask m) { + return (IntVector128) + super.blendTemplate(IntMask128.class, + (IntVector128) v, + (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector slice(int origin, Vector v) { - return (Int128Vector) super.sliceTemplate(origin, v); // specialize + public IntVector128 slice(int origin, Vector v) { + return (IntVector128) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Int128Vector slice(int origin) { - return (Int128Vector) super.sliceTemplate(origin); // specialize + public IntVector128 slice(int origin) { + return (IntVector128) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Int128Vector unslice(int origin, Vector w, int part) { - return (Int128Vector) super.unsliceTemplate(origin, w, part); // specialize + public IntVector128 unslice(int origin, Vector w, int part) { + return (IntVector128) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Int128Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Int128Vector) - super.unsliceTemplate(Int128Mask.class, + public IntVector128 unslice(int origin, Vector w, int part, VectorMask m) { + return (IntVector128) + super.unsliceTemplate(IntMask128.class, origin, w, part, - (Int128Mask) m); // specialize + (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector unslice(int origin) { - return (Int128Vector) super.unsliceTemplate(origin); // specialize + public IntVector128 unslice(int origin) { + return (IntVector128) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Int128Vector rearrange(VectorShuffle s) { - return (Int128Vector) - super.rearrangeTemplate(Int128Shuffle.class, - (Int128Shuffle) s); // specialize + public IntVector128 rearrange(VectorShuffle s) { + return (IntVector128) + super.rearrangeTemplate(IntShuffle128.class, + (IntShuffle128) s); // specialize } @Override @ForceInline - public Int128Vector rearrange(VectorShuffle shuffle, + public IntVector128 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Int128Vector) - super.rearrangeTemplate(Int128Shuffle.class, - Int128Mask.class, - (Int128Shuffle) shuffle, - (Int128Mask) m); // specialize + return (IntVector128) + super.rearrangeTemplate(IntShuffle128.class, + IntMask128.class, + (IntShuffle128) shuffle, + (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector rearrange(VectorShuffle s, + public IntVector128 rearrange(VectorShuffle s, Vector v) { - return (Int128Vector) - super.rearrangeTemplate(Int128Shuffle.class, - (Int128Shuffle) s, - (Int128Vector) v); // specialize + return (IntVector128) + super.rearrangeTemplate(IntShuffle128.class, + (IntShuffle128) s, + (IntVector128) v); // specialize } @Override @ForceInline - public Int128Vector compress(VectorMask m) { - return (Int128Vector) - super.compressTemplate(Int128Mask.class, - (Int128Mask) m); // specialize + public IntVector128 compress(VectorMask m) { + return (IntVector128) + super.compressTemplate(IntMask128.class, + (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector expand(VectorMask m) { - return (Int128Vector) - super.expandTemplate(Int128Mask.class, - (Int128Mask) m); // specialize + public IntVector128 expand(VectorMask m) { + return (IntVector128) + super.expandTemplate(IntMask128.class, + (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector selectFrom(Vector v) { - return (Int128Vector) - super.selectFromTemplate((Int128Vector) v); // specialize + public IntVector128 selectFrom(Vector v) { + return (IntVector128) + super.selectFromTemplate((IntVector128) v); // specialize } @Override @ForceInline - public Int128Vector selectFrom(Vector v, + public IntVector128 selectFrom(Vector v, VectorMask m) { - return (Int128Vector) - super.selectFromTemplate((Int128Vector) v, - Int128Mask.class, (Int128Mask) m); // specialize + return (IntVector128) + super.selectFromTemplate((IntVector128) v, + IntMask128.class, (IntMask128) m); // specialize } @Override @ForceInline - public Int128Vector selectFrom(Vector v1, + public IntVector128 selectFrom(Vector v1, Vector v2) { - return (Int128Vector) - super.selectFromTemplate((Int128Vector) v1, (Int128Vector) v2); // specialize + return (IntVector128) + super.selectFromTemplate((IntVector128) v1, (IntVector128) v2); // specialize } @ForceInline @@ -546,7 +551,7 @@ final class Int128Vector extends IntVector { @ForceInline @Override - public Int128Vector withLane(int i, int e) { + public IntVector128 withLane(int i, int e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -557,7 +562,7 @@ final class Int128Vector extends IntVector { } @ForceInline - public Int128Vector withLaneHelper(int i, int e) { + public IntVector128 withLaneHelper(int i, int e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -570,19 +575,20 @@ final class Int128Vector extends IntVector { // Mask - static final class Int128Mask extends AbstractMask { + static final class IntMask128 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int128Mask(boolean[] bits) { + static final Class CTYPE = int.class; // used by the JVM + + IntMask128(boolean[] bits) { this(bits, 0); } - Int128Mask(boolean[] bits, int offset) { + IntMask128(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Int128Mask(boolean val) { + IntMask128(boolean val) { super(prepare(val)); } @@ -615,31 +621,31 @@ final class Int128Vector extends IntVector { } @Override - Int128Mask uOp(MUnOp f) { + IntMask128 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Int128Mask(res); + return new IntMask128(res); } @Override - Int128Mask bOp(VectorMask m, MBinOp f) { + IntMask128 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Int128Mask)m).getBits(); + boolean[] mbits = ((IntMask128)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Int128Mask(res); + return new IntMask128(res); } @ForceInline @Override public final - Int128Vector toVector() { - return (Int128Vector) super.toVectorTemplate(); // specialize + IntVector128 toVector() { + return (IntVector128) super.toVectorTemplate(); // specialize } /** @@ -672,25 +678,25 @@ final class Int128Vector extends IntVector { @Override @ForceInline /*package-private*/ - Int128Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Int128Mask) VectorSupport.indexPartiallyInUpperRange( - Int128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Int128Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + IntMask128 indexPartiallyInUpperRange(long offset, long limit) { + return (IntMask128) VectorSupport.indexPartiallyInUpperRange( + IntMask128.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (IntMask128) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Int128Mask not() { + public IntMask128 not() { return xor(maskAll(true)); } @Override @ForceInline - public Int128Mask compress() { - return (Int128Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Int128Vector.class, Int128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public IntMask128 compress() { + return (IntMask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + IntVector128.class, IntMask128.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -699,30 +705,30 @@ final class Int128Vector extends IntVector { @Override @ForceInline - public Int128Mask and(VectorMask mask) { + public IntMask128 and(VectorMask mask) { Objects.requireNonNull(mask); - Int128Mask m = (Int128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask128 m = (IntMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, IntMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Int128Mask or(VectorMask mask) { + public IntMask128 or(VectorMask mask) { Objects.requireNonNull(mask); - Int128Mask m = (Int128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask128 m = (IntMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, IntMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Int128Mask xor(VectorMask mask) { + public IntMask128 xor(VectorMask mask) { Objects.requireNonNull(mask); - Int128Mask m = (Int128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask128 m = (IntMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -732,21 +738,21 @@ final class Int128Vector extends IntVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -756,7 +762,7 @@ final class Int128Vector extends IntVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -766,7 +772,7 @@ final class Int128Vector extends IntVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Int128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(IntMask128.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -775,48 +781,49 @@ final class Int128Vector extends IntVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Int128Mask)m).getBits())); + (m, __) -> anyTrueHelper(((IntMask128)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Int128Mask)m).getBits())); + (m, __) -> allTrueHelper(((IntMask128)m).getBits())); } @ForceInline /*package-private*/ - static Int128Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Int128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static IntMask128 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(IntMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Int128Mask TRUE_MASK = new Int128Mask(true); - private static final Int128Mask FALSE_MASK = new Int128Mask(false); + private static final IntMask128 TRUE_MASK = new IntMask128(true); + private static final IntMask128 FALSE_MASK = new IntMask128(false); } // Shuffle - static final class Int128Shuffle extends AbstractShuffle { + static final class IntShuffle128 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int128Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + IntShuffle128(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Int128Shuffle(int[] indices, int i) { + IntShuffle128(int[] indices, int i) { this(prepare(indices, i)); } - Int128Shuffle(IntUnaryOperator fn) { + IntShuffle128(IntUnaryOperator fn) { this(prepare(fn)); } @@ -836,23 +843,23 @@ final class Int128Vector extends IntVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Int128Shuffle IOTA = new Int128Shuffle(IDENTITY); + static final IntShuffle128 IOTA = new IntShuffle128(IDENTITY); @Override @ForceInline - public Int128Vector toVector() { + public IntVector128 toVector() { return toBitsVector(); } @Override @ForceInline - Int128Vector toBitsVector() { - return (Int128Vector) super.toBitsVectorTemplate(); + IntVector128 toBitsVector() { + return (IntVector128) super.toBitsVectorTemplate(); } @Override - Int128Vector toBitsVector0() { - return ((Int128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector128 toBitsVector0() { + return ((IntVector128) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -875,30 +882,30 @@ final class Int128Vector extends IntVector { @Override @ForceInline - public final Int128Mask laneIsValid() { - return (Int128Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final IntMask128 laneIsValid() { + return (IntMask128) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Int128Shuffle rearrange(VectorShuffle shuffle) { - Int128Shuffle concreteShuffle = (Int128Shuffle) shuffle; - return (Int128Shuffle) toBitsVector().rearrange(concreteShuffle) + public final IntShuffle128 rearrange(VectorShuffle shuffle) { + IntShuffle128 concreteShuffle = (IntShuffle128) shuffle; + return (IntShuffle128) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Int128Shuffle wrapIndexes() { - Int128Vector v = toBitsVector(); + public final IntShuffle128 wrapIndexes() { + IntVector128 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int128Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector128) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector128) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Int128Shuffle) v.toShuffle(vspecies(), false); + return (IntShuffle128) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -949,14 +956,14 @@ final class Int128Vector extends IntVector { @Override final IntVector fromArray0(int[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Int128Mask.class, a, offset, (Int128Mask) m, offsetInRange); // specialize + return super.fromArray0Template(IntMask128.class, a, offset, (IntMask128) m, offsetInRange); // specialize } @ForceInline @Override final IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m); + return super.fromArray0Template(IntMask128.class, a, offset, indexMap, mapOffset, (IntMask128) m); } @@ -972,7 +979,7 @@ final class Int128Vector extends IntVector { @Override final IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Int128Mask.class, ms, offset, (Int128Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(IntMask128.class, ms, offset, (IntMask128) m, offsetInRange); // specialize } @ForceInline @@ -986,14 +993,14 @@ final class Int128Vector extends IntVector { @Override final void intoArray0(int[] a, int offset, VectorMask m) { - super.intoArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); + super.intoArray0Template(IntMask128.class, a, offset, (IntMask128) m); } @ForceInline @Override final void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m); + super.intoArray0Template(IntMask128.class, a, offset, indexMap, mapOffset, (IntMask128) m); } @@ -1001,7 +1008,7 @@ final class Int128Vector extends IntVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Int128Mask.class, ms, offset, (Int128Mask) m); + super.intoMemorySegment0Template(IntMask128.class, ms, offset, (IntMask128) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector256.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector256.java index f9700fbfd71..0630cd958f2 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector256.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Int256Vector extends IntVector { +final class IntVector256 extends IntVector { static final IntSpecies VSPECIES = (IntSpecies) IntVector.SPECIES_256; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Int256Vector.class; + static final Class VCLASS = IntVector256.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = int.class; // carrier type used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Int256Vector(int[] v) { + IntVector256(int[] v) { super(v); } - // For compatibility as Int256Vector::new, + // For compatibility as IntVector256::new, // stored into species.vectorFactory. - Int256Vector(Object v) { + IntVector256(Object v) { this((int[]) v); } - static final Int256Vector ZERO = new Int256Vector(new int[VLENGTH]); - static final Int256Vector IOTA = new Int256Vector(VSPECIES.iotaArray()); + static final IntVector256 ZERO = new IntVector256(new int[VLENGTH]); + static final IntVector256 IOTA = new IntVector256(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Int256Vector extends IntVector { @Override public final Class elementType() { return int.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Integer.SIZE; } @@ -130,51 +135,51 @@ final class Int256Vector extends IntVector { @Override @ForceInline - public final Int256Vector broadcast(int e) { - return (Int256Vector) super.broadcastTemplate(e); // specialize + public final IntVector256 broadcast(int e) { + return (IntVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Int256Vector broadcast(long e) { - return (Int256Vector) super.broadcastTemplate(e); // specialize + public final IntVector256 broadcast(long e) { + return (IntVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Int256Mask maskFromArray(boolean[] bits) { - return new Int256Mask(bits); + IntMask256 maskFromArray(boolean[] bits) { + return new IntMask256(bits); } @Override @ForceInline - Int256Shuffle iotaShuffle() { return Int256Shuffle.IOTA; } + IntShuffle256 iotaShuffle() { return IntShuffle256.IOTA; } @Override @ForceInline - Int256Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Int256Shuffle) iotaShuffleTemplate(start, step, wrap); + IntShuffle256 iotaShuffle(int start, int step, boolean wrap) { + return (IntShuffle256) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int256Shuffle shuffleFromArray(int[] indices, int i) { return new Int256Shuffle(indices, i); } + IntShuffle256 shuffleFromArray(int[] indices, int i) { return new IntShuffle256(indices, i); } @Override @ForceInline - Int256Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Int256Shuffle(fn); } + IntShuffle256 shuffleFromOp(IntUnaryOperator fn) { return new IntShuffle256(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Int256Vector vectorFactory(int[] vec) { - return new Int256Vector(vec); + IntVector256 vectorFactory(int[] vec) { + return new IntVector256(vec); } @ForceInline final @Override - Byte256Vector asByteVectorRaw() { - return (Byte256Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector256 asByteVectorRaw() { + return (ByteVector256) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Int256Vector extends IntVector { @ForceInline final @Override - Int256Vector uOp(FUnOp f) { - return (Int256Vector) super.uOpTemplate(f); // specialize + IntVector256 uOp(FUnOp f) { + return (IntVector256) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Int256Vector uOp(VectorMask m, FUnOp f) { - return (Int256Vector) - super.uOpTemplate((Int256Mask)m, f); // specialize + IntVector256 uOp(VectorMask m, FUnOp f) { + return (IntVector256) + super.uOpTemplate((IntMask256)m, f); // specialize } // Binary operator @ForceInline final @Override - Int256Vector bOp(Vector v, FBinOp f) { - return (Int256Vector) super.bOpTemplate((Int256Vector)v, f); // specialize + IntVector256 bOp(Vector v, FBinOp f) { + return (IntVector256) super.bOpTemplate((IntVector256)v, f); // specialize } @ForceInline final @Override - Int256Vector bOp(Vector v, + IntVector256 bOp(Vector v, VectorMask m, FBinOp f) { - return (Int256Vector) - super.bOpTemplate((Int256Vector)v, (Int256Mask)m, + return (IntVector256) + super.bOpTemplate((IntVector256)v, (IntMask256)m, f); // specialize } @@ -219,19 +224,19 @@ final class Int256Vector extends IntVector { @ForceInline final @Override - Int256Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Int256Vector) - super.tOpTemplate((Int256Vector)v1, (Int256Vector)v2, + IntVector256 tOp(Vector v1, Vector v2, FTriOp f) { + return (IntVector256) + super.tOpTemplate((IntVector256)v1, (IntVector256)v2, f); // specialize } @ForceInline final @Override - Int256Vector tOp(Vector v1, Vector v2, + IntVector256 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Int256Vector) - super.tOpTemplate((Int256Vector)v1, (Int256Vector)v2, - (Int256Mask)m, f); // specialize + return (IntVector256) + super.tOpTemplate((IntVector256)v1, (IntVector256)v2, + (IntMask256)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Int256Vector extends IntVector { @Override @ForceInline - public Int256Vector lanewise(Unary op) { - return (Int256Vector) super.lanewiseTemplate(op); // specialize + public IntVector256 lanewise(Unary op) { + return (IntVector256) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Int256Vector lanewise(Unary op, VectorMask m) { - return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, (Int256Mask) m); // specialize + public IntVector256 lanewise(Unary op, VectorMask m) { + return (IntVector256) super.lanewiseTemplate(op, IntMask256.class, (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector lanewise(Binary op, Vector v) { - return (Int256Vector) super.lanewiseTemplate(op, v); // specialize + public IntVector256 lanewise(Binary op, Vector v) { + return (IntVector256) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Int256Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, v, (Int256Mask) m); // specialize + public IntVector256 lanewise(Binary op, Vector v, VectorMask m) { + return (IntVector256) super.lanewiseTemplate(op, IntMask256.class, v, (IntMask256) m); // specialize } /*package-private*/ @Override - @ForceInline Int256Vector + @ForceInline IntVector256 lanewiseShift(VectorOperators.Binary op, int e) { - return (Int256Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (IntVector256) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Int256Vector + @ForceInline IntVector256 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Int256Vector) super.lanewiseShiftTemplate(op, Int256Mask.class, e, (Int256Mask) m); // specialize + return (IntVector256) super.lanewiseShiftTemplate(op, IntMask256.class, e, (IntMask256) m); // specialize } /*package-private*/ @Override @ForceInline public final - Int256Vector + IntVector256 lanewise(Ternary op, Vector v1, Vector v2) { - return (Int256Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (IntVector256) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Int256Vector + IntVector256 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, v1, v2, (Int256Mask) m); // specialize + return (IntVector256) super.lanewiseTemplate(op, IntMask256.class, v1, v2, (IntMask256) m); // specialize } @Override @ForceInline public final - Int256Vector addIndex(int scale) { - return (Int256Vector) super.addIndexTemplate(scale); // specialize + IntVector256 addIndex(int scale) { + return (IntVector256) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Int256Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized + return super.reduceLanesTemplate(op, IntMask256.class, (IntMask256) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Int256Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, IntMask256.class, (IntMask256) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Int256Vector extends IntVector { @Override @ForceInline - public final Int256Shuffle toShuffle() { - return (Int256Shuffle) toShuffle(vspecies(), false); + public final IntShuffle256 toShuffle() { + return (IntShuffle256) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Int256Mask test(Test op) { - return super.testTemplate(Int256Mask.class, op); // specialize + public final IntMask256 test(Test op) { + return super.testTemplate(IntMask256.class, op); // specialize } @Override @ForceInline - public final Int256Mask test(Test op, VectorMask m) { - return super.testTemplate(Int256Mask.class, op, (Int256Mask) m); // specialize + public final IntMask256 test(Test op, VectorMask m) { + return super.testTemplate(IntMask256.class, op, (IntMask256) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Int256Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Int256Mask.class, op, v); // specialize + public final IntMask256 compare(Comparison op, Vector v) { + return super.compareTemplate(IntMask256.class, op, v); // specialize } @Override @ForceInline - public final Int256Mask compare(Comparison op, int s) { - return super.compareTemplate(Int256Mask.class, op, s); // specialize + public final IntMask256 compare(Comparison op, int s) { + return super.compareTemplate(IntMask256.class, op, s); // specialize } @Override @ForceInline - public final Int256Mask compare(Comparison op, long s) { - return super.compareTemplate(Int256Mask.class, op, s); // specialize + public final IntMask256 compare(Comparison op, long s) { + return super.compareTemplate(IntMask256.class, op, s); // specialize } @Override @ForceInline - public final Int256Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Int256Mask.class, op, v, (Int256Mask) m); + public final IntMask256 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(IntMask256.class, op, v, (IntMask256) m); } @Override @ForceInline - public Int256Vector blend(Vector v, VectorMask m) { - return (Int256Vector) - super.blendTemplate(Int256Mask.class, - (Int256Vector) v, - (Int256Mask) m); // specialize + public IntVector256 blend(Vector v, VectorMask m) { + return (IntVector256) + super.blendTemplate(IntMask256.class, + (IntVector256) v, + (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector slice(int origin, Vector v) { - return (Int256Vector) super.sliceTemplate(origin, v); // specialize + public IntVector256 slice(int origin, Vector v) { + return (IntVector256) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Int256Vector slice(int origin) { - return (Int256Vector) super.sliceTemplate(origin); // specialize + public IntVector256 slice(int origin) { + return (IntVector256) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Int256Vector unslice(int origin, Vector w, int part) { - return (Int256Vector) super.unsliceTemplate(origin, w, part); // specialize + public IntVector256 unslice(int origin, Vector w, int part) { + return (IntVector256) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Int256Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Int256Vector) - super.unsliceTemplate(Int256Mask.class, + public IntVector256 unslice(int origin, Vector w, int part, VectorMask m) { + return (IntVector256) + super.unsliceTemplate(IntMask256.class, origin, w, part, - (Int256Mask) m); // specialize + (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector unslice(int origin) { - return (Int256Vector) super.unsliceTemplate(origin); // specialize + public IntVector256 unslice(int origin) { + return (IntVector256) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Int256Vector rearrange(VectorShuffle s) { - return (Int256Vector) - super.rearrangeTemplate(Int256Shuffle.class, - (Int256Shuffle) s); // specialize + public IntVector256 rearrange(VectorShuffle s) { + return (IntVector256) + super.rearrangeTemplate(IntShuffle256.class, + (IntShuffle256) s); // specialize } @Override @ForceInline - public Int256Vector rearrange(VectorShuffle shuffle, + public IntVector256 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Int256Vector) - super.rearrangeTemplate(Int256Shuffle.class, - Int256Mask.class, - (Int256Shuffle) shuffle, - (Int256Mask) m); // specialize + return (IntVector256) + super.rearrangeTemplate(IntShuffle256.class, + IntMask256.class, + (IntShuffle256) shuffle, + (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector rearrange(VectorShuffle s, + public IntVector256 rearrange(VectorShuffle s, Vector v) { - return (Int256Vector) - super.rearrangeTemplate(Int256Shuffle.class, - (Int256Shuffle) s, - (Int256Vector) v); // specialize + return (IntVector256) + super.rearrangeTemplate(IntShuffle256.class, + (IntShuffle256) s, + (IntVector256) v); // specialize } @Override @ForceInline - public Int256Vector compress(VectorMask m) { - return (Int256Vector) - super.compressTemplate(Int256Mask.class, - (Int256Mask) m); // specialize + public IntVector256 compress(VectorMask m) { + return (IntVector256) + super.compressTemplate(IntMask256.class, + (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector expand(VectorMask m) { - return (Int256Vector) - super.expandTemplate(Int256Mask.class, - (Int256Mask) m); // specialize + public IntVector256 expand(VectorMask m) { + return (IntVector256) + super.expandTemplate(IntMask256.class, + (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector selectFrom(Vector v) { - return (Int256Vector) - super.selectFromTemplate((Int256Vector) v); // specialize + public IntVector256 selectFrom(Vector v) { + return (IntVector256) + super.selectFromTemplate((IntVector256) v); // specialize } @Override @ForceInline - public Int256Vector selectFrom(Vector v, + public IntVector256 selectFrom(Vector v, VectorMask m) { - return (Int256Vector) - super.selectFromTemplate((Int256Vector) v, - Int256Mask.class, (Int256Mask) m); // specialize + return (IntVector256) + super.selectFromTemplate((IntVector256) v, + IntMask256.class, (IntMask256) m); // specialize } @Override @ForceInline - public Int256Vector selectFrom(Vector v1, + public IntVector256 selectFrom(Vector v1, Vector v2) { - return (Int256Vector) - super.selectFromTemplate((Int256Vector) v1, (Int256Vector) v2); // specialize + return (IntVector256) + super.selectFromTemplate((IntVector256) v1, (IntVector256) v2); // specialize } @ForceInline @@ -550,7 +555,7 @@ final class Int256Vector extends IntVector { @ForceInline @Override - public Int256Vector withLane(int i, int e) { + public IntVector256 withLane(int i, int e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -565,7 +570,7 @@ final class Int256Vector extends IntVector { } @ForceInline - public Int256Vector withLaneHelper(int i, int e) { + public IntVector256 withLaneHelper(int i, int e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -578,19 +583,20 @@ final class Int256Vector extends IntVector { // Mask - static final class Int256Mask extends AbstractMask { + static final class IntMask256 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int256Mask(boolean[] bits) { + static final Class CTYPE = int.class; // used by the JVM + + IntMask256(boolean[] bits) { this(bits, 0); } - Int256Mask(boolean[] bits, int offset) { + IntMask256(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Int256Mask(boolean val) { + IntMask256(boolean val) { super(prepare(val)); } @@ -623,31 +629,31 @@ final class Int256Vector extends IntVector { } @Override - Int256Mask uOp(MUnOp f) { + IntMask256 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Int256Mask(res); + return new IntMask256(res); } @Override - Int256Mask bOp(VectorMask m, MBinOp f) { + IntMask256 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Int256Mask)m).getBits(); + boolean[] mbits = ((IntMask256)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Int256Mask(res); + return new IntMask256(res); } @ForceInline @Override public final - Int256Vector toVector() { - return (Int256Vector) super.toVectorTemplate(); // specialize + IntVector256 toVector() { + return (IntVector256) super.toVectorTemplate(); // specialize } /** @@ -680,25 +686,25 @@ final class Int256Vector extends IntVector { @Override @ForceInline /*package-private*/ - Int256Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Int256Mask) VectorSupport.indexPartiallyInUpperRange( - Int256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Int256Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + IntMask256 indexPartiallyInUpperRange(long offset, long limit) { + return (IntMask256) VectorSupport.indexPartiallyInUpperRange( + IntMask256.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (IntMask256) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Int256Mask not() { + public IntMask256 not() { return xor(maskAll(true)); } @Override @ForceInline - public Int256Mask compress() { - return (Int256Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Int256Vector.class, Int256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public IntMask256 compress() { + return (IntMask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + IntVector256.class, IntMask256.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -707,30 +713,30 @@ final class Int256Vector extends IntVector { @Override @ForceInline - public Int256Mask and(VectorMask mask) { + public IntMask256 and(VectorMask mask) { Objects.requireNonNull(mask); - Int256Mask m = (Int256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask256 m = (IntMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, IntMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Int256Mask or(VectorMask mask) { + public IntMask256 or(VectorMask mask) { Objects.requireNonNull(mask); - Int256Mask m = (Int256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask256 m = (IntMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, IntMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Int256Mask xor(VectorMask mask) { + public IntMask256 xor(VectorMask mask) { Objects.requireNonNull(mask); - Int256Mask m = (Int256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask256 m = (IntMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -740,21 +746,21 @@ final class Int256Vector extends IntVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -764,7 +770,7 @@ final class Int256Vector extends IntVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -774,7 +780,7 @@ final class Int256Vector extends IntVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Int256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(IntMask256.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -783,48 +789,49 @@ final class Int256Vector extends IntVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Int256Mask)m).getBits())); + (m, __) -> anyTrueHelper(((IntMask256)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Int256Mask)m).getBits())); + (m, __) -> allTrueHelper(((IntMask256)m).getBits())); } @ForceInline /*package-private*/ - static Int256Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Int256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static IntMask256 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(IntMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Int256Mask TRUE_MASK = new Int256Mask(true); - private static final Int256Mask FALSE_MASK = new Int256Mask(false); + private static final IntMask256 TRUE_MASK = new IntMask256(true); + private static final IntMask256 FALSE_MASK = new IntMask256(false); } // Shuffle - static final class Int256Shuffle extends AbstractShuffle { + static final class IntShuffle256 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int256Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + IntShuffle256(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Int256Shuffle(int[] indices, int i) { + IntShuffle256(int[] indices, int i) { this(prepare(indices, i)); } - Int256Shuffle(IntUnaryOperator fn) { + IntShuffle256(IntUnaryOperator fn) { this(prepare(fn)); } @@ -844,23 +851,23 @@ final class Int256Vector extends IntVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Int256Shuffle IOTA = new Int256Shuffle(IDENTITY); + static final IntShuffle256 IOTA = new IntShuffle256(IDENTITY); @Override @ForceInline - public Int256Vector toVector() { + public IntVector256 toVector() { return toBitsVector(); } @Override @ForceInline - Int256Vector toBitsVector() { - return (Int256Vector) super.toBitsVectorTemplate(); + IntVector256 toBitsVector() { + return (IntVector256) super.toBitsVectorTemplate(); } @Override - Int256Vector toBitsVector0() { - return ((Int256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector256 toBitsVector0() { + return ((IntVector256) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -883,30 +890,30 @@ final class Int256Vector extends IntVector { @Override @ForceInline - public final Int256Mask laneIsValid() { - return (Int256Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final IntMask256 laneIsValid() { + return (IntMask256) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Int256Shuffle rearrange(VectorShuffle shuffle) { - Int256Shuffle concreteShuffle = (Int256Shuffle) shuffle; - return (Int256Shuffle) toBitsVector().rearrange(concreteShuffle) + public final IntShuffle256 rearrange(VectorShuffle shuffle) { + IntShuffle256 concreteShuffle = (IntShuffle256) shuffle; + return (IntShuffle256) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Int256Shuffle wrapIndexes() { - Int256Vector v = toBitsVector(); + public final IntShuffle256 wrapIndexes() { + IntVector256 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int256Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector256) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector256) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Int256Shuffle) v.toShuffle(vspecies(), false); + return (IntShuffle256) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -957,14 +964,14 @@ final class Int256Vector extends IntVector { @Override final IntVector fromArray0(int[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Int256Mask.class, a, offset, (Int256Mask) m, offsetInRange); // specialize + return super.fromArray0Template(IntMask256.class, a, offset, (IntMask256) m, offsetInRange); // specialize } @ForceInline @Override final IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Int256Mask.class, a, offset, indexMap, mapOffset, (Int256Mask) m); + return super.fromArray0Template(IntMask256.class, a, offset, indexMap, mapOffset, (IntMask256) m); } @@ -980,7 +987,7 @@ final class Int256Vector extends IntVector { @Override final IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Int256Mask.class, ms, offset, (Int256Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(IntMask256.class, ms, offset, (IntMask256) m, offsetInRange); // specialize } @ForceInline @@ -994,14 +1001,14 @@ final class Int256Vector extends IntVector { @Override final void intoArray0(int[] a, int offset, VectorMask m) { - super.intoArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); + super.intoArray0Template(IntMask256.class, a, offset, (IntMask256) m); } @ForceInline @Override final void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Int256Mask.class, a, offset, indexMap, mapOffset, (Int256Mask) m); + super.intoArray0Template(IntMask256.class, a, offset, indexMap, mapOffset, (IntMask256) m); } @@ -1009,7 +1016,7 @@ final class Int256Vector extends IntVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Int256Mask.class, ms, offset, (Int256Mask) m); + super.intoMemorySegment0Template(IntMask256.class, ms, offset, (IntMask256) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector512.java similarity index 66% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector512.java index 2e2ee7eac05..92eb5a0f2d2 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector512.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Int512Vector extends IntVector { +final class IntVector512 extends IntVector { static final IntSpecies VSPECIES = (IntSpecies) IntVector.SPECIES_512; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Int512Vector.class; + static final Class VCLASS = IntVector512.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = int.class; // carrier type used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Int512Vector(int[] v) { + IntVector512(int[] v) { super(v); } - // For compatibility as Int512Vector::new, + // For compatibility as IntVector512::new, // stored into species.vectorFactory. - Int512Vector(Object v) { + IntVector512(Object v) { this((int[]) v); } - static final Int512Vector ZERO = new Int512Vector(new int[VLENGTH]); - static final Int512Vector IOTA = new Int512Vector(VSPECIES.iotaArray()); + static final IntVector512 ZERO = new IntVector512(new int[VLENGTH]); + static final IntVector512 IOTA = new IntVector512(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Int512Vector extends IntVector { @Override public final Class elementType() { return int.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Integer.SIZE; } @@ -130,51 +135,51 @@ final class Int512Vector extends IntVector { @Override @ForceInline - public final Int512Vector broadcast(int e) { - return (Int512Vector) super.broadcastTemplate(e); // specialize + public final IntVector512 broadcast(int e) { + return (IntVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Int512Vector broadcast(long e) { - return (Int512Vector) super.broadcastTemplate(e); // specialize + public final IntVector512 broadcast(long e) { + return (IntVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Int512Mask maskFromArray(boolean[] bits) { - return new Int512Mask(bits); + IntMask512 maskFromArray(boolean[] bits) { + return new IntMask512(bits); } @Override @ForceInline - Int512Shuffle iotaShuffle() { return Int512Shuffle.IOTA; } + IntShuffle512 iotaShuffle() { return IntShuffle512.IOTA; } @Override @ForceInline - Int512Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Int512Shuffle) iotaShuffleTemplate(start, step, wrap); + IntShuffle512 iotaShuffle(int start, int step, boolean wrap) { + return (IntShuffle512) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int512Shuffle shuffleFromArray(int[] indices, int i) { return new Int512Shuffle(indices, i); } + IntShuffle512 shuffleFromArray(int[] indices, int i) { return new IntShuffle512(indices, i); } @Override @ForceInline - Int512Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Int512Shuffle(fn); } + IntShuffle512 shuffleFromOp(IntUnaryOperator fn) { return new IntShuffle512(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Int512Vector vectorFactory(int[] vec) { - return new Int512Vector(vec); + IntVector512 vectorFactory(int[] vec) { + return new IntVector512(vec); } @ForceInline final @Override - Byte512Vector asByteVectorRaw() { - return (Byte512Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector512 asByteVectorRaw() { + return (ByteVector512) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Int512Vector extends IntVector { @ForceInline final @Override - Int512Vector uOp(FUnOp f) { - return (Int512Vector) super.uOpTemplate(f); // specialize + IntVector512 uOp(FUnOp f) { + return (IntVector512) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Int512Vector uOp(VectorMask m, FUnOp f) { - return (Int512Vector) - super.uOpTemplate((Int512Mask)m, f); // specialize + IntVector512 uOp(VectorMask m, FUnOp f) { + return (IntVector512) + super.uOpTemplate((IntMask512)m, f); // specialize } // Binary operator @ForceInline final @Override - Int512Vector bOp(Vector v, FBinOp f) { - return (Int512Vector) super.bOpTemplate((Int512Vector)v, f); // specialize + IntVector512 bOp(Vector v, FBinOp f) { + return (IntVector512) super.bOpTemplate((IntVector512)v, f); // specialize } @ForceInline final @Override - Int512Vector bOp(Vector v, + IntVector512 bOp(Vector v, VectorMask m, FBinOp f) { - return (Int512Vector) - super.bOpTemplate((Int512Vector)v, (Int512Mask)m, + return (IntVector512) + super.bOpTemplate((IntVector512)v, (IntMask512)m, f); // specialize } @@ -219,19 +224,19 @@ final class Int512Vector extends IntVector { @ForceInline final @Override - Int512Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Int512Vector) - super.tOpTemplate((Int512Vector)v1, (Int512Vector)v2, + IntVector512 tOp(Vector v1, Vector v2, FTriOp f) { + return (IntVector512) + super.tOpTemplate((IntVector512)v1, (IntVector512)v2, f); // specialize } @ForceInline final @Override - Int512Vector tOp(Vector v1, Vector v2, + IntVector512 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Int512Vector) - super.tOpTemplate((Int512Vector)v1, (Int512Vector)v2, - (Int512Mask)m, f); // specialize + return (IntVector512) + super.tOpTemplate((IntVector512)v1, (IntVector512)v2, + (IntMask512)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Int512Vector extends IntVector { @Override @ForceInline - public Int512Vector lanewise(Unary op) { - return (Int512Vector) super.lanewiseTemplate(op); // specialize + public IntVector512 lanewise(Unary op) { + return (IntVector512) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Int512Vector lanewise(Unary op, VectorMask m) { - return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, (Int512Mask) m); // specialize + public IntVector512 lanewise(Unary op, VectorMask m) { + return (IntVector512) super.lanewiseTemplate(op, IntMask512.class, (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector lanewise(Binary op, Vector v) { - return (Int512Vector) super.lanewiseTemplate(op, v); // specialize + public IntVector512 lanewise(Binary op, Vector v) { + return (IntVector512) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Int512Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, v, (Int512Mask) m); // specialize + public IntVector512 lanewise(Binary op, Vector v, VectorMask m) { + return (IntVector512) super.lanewiseTemplate(op, IntMask512.class, v, (IntMask512) m); // specialize } /*package-private*/ @Override - @ForceInline Int512Vector + @ForceInline IntVector512 lanewiseShift(VectorOperators.Binary op, int e) { - return (Int512Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (IntVector512) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Int512Vector + @ForceInline IntVector512 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Int512Vector) super.lanewiseShiftTemplate(op, Int512Mask.class, e, (Int512Mask) m); // specialize + return (IntVector512) super.lanewiseShiftTemplate(op, IntMask512.class, e, (IntMask512) m); // specialize } /*package-private*/ @Override @ForceInline public final - Int512Vector + IntVector512 lanewise(Ternary op, Vector v1, Vector v2) { - return (Int512Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (IntVector512) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Int512Vector + IntVector512 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, v1, v2, (Int512Mask) m); // specialize + return (IntVector512) super.lanewiseTemplate(op, IntMask512.class, v1, v2, (IntMask512) m); // specialize } @Override @ForceInline public final - Int512Vector addIndex(int scale) { - return (Int512Vector) super.addIndexTemplate(scale); // specialize + IntVector512 addIndex(int scale) { + return (IntVector512) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Int512Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized + return super.reduceLanesTemplate(op, IntMask512.class, (IntMask512) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Int512Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, IntMask512.class, (IntMask512) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Int512Vector extends IntVector { @Override @ForceInline - public final Int512Shuffle toShuffle() { - return (Int512Shuffle) toShuffle(vspecies(), false); + public final IntShuffle512 toShuffle() { + return (IntShuffle512) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Int512Mask test(Test op) { - return super.testTemplate(Int512Mask.class, op); // specialize + public final IntMask512 test(Test op) { + return super.testTemplate(IntMask512.class, op); // specialize } @Override @ForceInline - public final Int512Mask test(Test op, VectorMask m) { - return super.testTemplate(Int512Mask.class, op, (Int512Mask) m); // specialize + public final IntMask512 test(Test op, VectorMask m) { + return super.testTemplate(IntMask512.class, op, (IntMask512) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Int512Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Int512Mask.class, op, v); // specialize + public final IntMask512 compare(Comparison op, Vector v) { + return super.compareTemplate(IntMask512.class, op, v); // specialize } @Override @ForceInline - public final Int512Mask compare(Comparison op, int s) { - return super.compareTemplate(Int512Mask.class, op, s); // specialize + public final IntMask512 compare(Comparison op, int s) { + return super.compareTemplate(IntMask512.class, op, s); // specialize } @Override @ForceInline - public final Int512Mask compare(Comparison op, long s) { - return super.compareTemplate(Int512Mask.class, op, s); // specialize + public final IntMask512 compare(Comparison op, long s) { + return super.compareTemplate(IntMask512.class, op, s); // specialize } @Override @ForceInline - public final Int512Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Int512Mask.class, op, v, (Int512Mask) m); + public final IntMask512 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(IntMask512.class, op, v, (IntMask512) m); } @Override @ForceInline - public Int512Vector blend(Vector v, VectorMask m) { - return (Int512Vector) - super.blendTemplate(Int512Mask.class, - (Int512Vector) v, - (Int512Mask) m); // specialize + public IntVector512 blend(Vector v, VectorMask m) { + return (IntVector512) + super.blendTemplate(IntMask512.class, + (IntVector512) v, + (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector slice(int origin, Vector v) { - return (Int512Vector) super.sliceTemplate(origin, v); // specialize + public IntVector512 slice(int origin, Vector v) { + return (IntVector512) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Int512Vector slice(int origin) { - return (Int512Vector) super.sliceTemplate(origin); // specialize + public IntVector512 slice(int origin) { + return (IntVector512) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Int512Vector unslice(int origin, Vector w, int part) { - return (Int512Vector) super.unsliceTemplate(origin, w, part); // specialize + public IntVector512 unslice(int origin, Vector w, int part) { + return (IntVector512) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Int512Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Int512Vector) - super.unsliceTemplate(Int512Mask.class, + public IntVector512 unslice(int origin, Vector w, int part, VectorMask m) { + return (IntVector512) + super.unsliceTemplate(IntMask512.class, origin, w, part, - (Int512Mask) m); // specialize + (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector unslice(int origin) { - return (Int512Vector) super.unsliceTemplate(origin); // specialize + public IntVector512 unslice(int origin) { + return (IntVector512) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Int512Vector rearrange(VectorShuffle s) { - return (Int512Vector) - super.rearrangeTemplate(Int512Shuffle.class, - (Int512Shuffle) s); // specialize + public IntVector512 rearrange(VectorShuffle s) { + return (IntVector512) + super.rearrangeTemplate(IntShuffle512.class, + (IntShuffle512) s); // specialize } @Override @ForceInline - public Int512Vector rearrange(VectorShuffle shuffle, + public IntVector512 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Int512Vector) - super.rearrangeTemplate(Int512Shuffle.class, - Int512Mask.class, - (Int512Shuffle) shuffle, - (Int512Mask) m); // specialize + return (IntVector512) + super.rearrangeTemplate(IntShuffle512.class, + IntMask512.class, + (IntShuffle512) shuffle, + (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector rearrange(VectorShuffle s, + public IntVector512 rearrange(VectorShuffle s, Vector v) { - return (Int512Vector) - super.rearrangeTemplate(Int512Shuffle.class, - (Int512Shuffle) s, - (Int512Vector) v); // specialize + return (IntVector512) + super.rearrangeTemplate(IntShuffle512.class, + (IntShuffle512) s, + (IntVector512) v); // specialize } @Override @ForceInline - public Int512Vector compress(VectorMask m) { - return (Int512Vector) - super.compressTemplate(Int512Mask.class, - (Int512Mask) m); // specialize + public IntVector512 compress(VectorMask m) { + return (IntVector512) + super.compressTemplate(IntMask512.class, + (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector expand(VectorMask m) { - return (Int512Vector) - super.expandTemplate(Int512Mask.class, - (Int512Mask) m); // specialize + public IntVector512 expand(VectorMask m) { + return (IntVector512) + super.expandTemplate(IntMask512.class, + (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector selectFrom(Vector v) { - return (Int512Vector) - super.selectFromTemplate((Int512Vector) v); // specialize + public IntVector512 selectFrom(Vector v) { + return (IntVector512) + super.selectFromTemplate((IntVector512) v); // specialize } @Override @ForceInline - public Int512Vector selectFrom(Vector v, + public IntVector512 selectFrom(Vector v, VectorMask m) { - return (Int512Vector) - super.selectFromTemplate((Int512Vector) v, - Int512Mask.class, (Int512Mask) m); // specialize + return (IntVector512) + super.selectFromTemplate((IntVector512) v, + IntMask512.class, (IntMask512) m); // specialize } @Override @ForceInline - public Int512Vector selectFrom(Vector v1, + public IntVector512 selectFrom(Vector v1, Vector v2) { - return (Int512Vector) - super.selectFromTemplate((Int512Vector) v1, (Int512Vector) v2); // specialize + return (IntVector512) + super.selectFromTemplate((IntVector512) v1, (IntVector512) v2); // specialize } @ForceInline @@ -558,7 +563,7 @@ final class Int512Vector extends IntVector { @ForceInline @Override - public Int512Vector withLane(int i, int e) { + public IntVector512 withLane(int i, int e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -581,7 +586,7 @@ final class Int512Vector extends IntVector { } @ForceInline - public Int512Vector withLaneHelper(int i, int e) { + public IntVector512 withLaneHelper(int i, int e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -594,19 +599,20 @@ final class Int512Vector extends IntVector { // Mask - static final class Int512Mask extends AbstractMask { + static final class IntMask512 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int512Mask(boolean[] bits) { + static final Class CTYPE = int.class; // used by the JVM + + IntMask512(boolean[] bits) { this(bits, 0); } - Int512Mask(boolean[] bits, int offset) { + IntMask512(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Int512Mask(boolean val) { + IntMask512(boolean val) { super(prepare(val)); } @@ -639,31 +645,31 @@ final class Int512Vector extends IntVector { } @Override - Int512Mask uOp(MUnOp f) { + IntMask512 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Int512Mask(res); + return new IntMask512(res); } @Override - Int512Mask bOp(VectorMask m, MBinOp f) { + IntMask512 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Int512Mask)m).getBits(); + boolean[] mbits = ((IntMask512)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Int512Mask(res); + return new IntMask512(res); } @ForceInline @Override public final - Int512Vector toVector() { - return (Int512Vector) super.toVectorTemplate(); // specialize + IntVector512 toVector() { + return (IntVector512) super.toVectorTemplate(); // specialize } /** @@ -696,25 +702,25 @@ final class Int512Vector extends IntVector { @Override @ForceInline /*package-private*/ - Int512Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Int512Mask) VectorSupport.indexPartiallyInUpperRange( - Int512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Int512Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + IntMask512 indexPartiallyInUpperRange(long offset, long limit) { + return (IntMask512) VectorSupport.indexPartiallyInUpperRange( + IntMask512.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (IntMask512) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Int512Mask not() { + public IntMask512 not() { return xor(maskAll(true)); } @Override @ForceInline - public Int512Mask compress() { - return (Int512Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Int512Vector.class, Int512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public IntMask512 compress() { + return (IntMask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + IntVector512.class, IntMask512.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -723,30 +729,30 @@ final class Int512Vector extends IntVector { @Override @ForceInline - public Int512Mask and(VectorMask mask) { + public IntMask512 and(VectorMask mask) { Objects.requireNonNull(mask); - Int512Mask m = (Int512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask512 m = (IntMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, IntMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Int512Mask or(VectorMask mask) { + public IntMask512 or(VectorMask mask) { Objects.requireNonNull(mask); - Int512Mask m = (Int512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask512 m = (IntMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, IntMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Int512Mask xor(VectorMask mask) { + public IntMask512 xor(VectorMask mask) { Objects.requireNonNull(mask); - Int512Mask m = (Int512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask512 m = (IntMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -756,21 +762,21 @@ final class Int512Vector extends IntVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -780,7 +786,7 @@ final class Int512Vector extends IntVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -790,7 +796,7 @@ final class Int512Vector extends IntVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Int512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(IntMask512.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -799,48 +805,49 @@ final class Int512Vector extends IntVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Int512Mask)m).getBits())); + (m, __) -> anyTrueHelper(((IntMask512)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Int512Mask)m).getBits())); + (m, __) -> allTrueHelper(((IntMask512)m).getBits())); } @ForceInline /*package-private*/ - static Int512Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Int512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static IntMask512 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(IntMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Int512Mask TRUE_MASK = new Int512Mask(true); - private static final Int512Mask FALSE_MASK = new Int512Mask(false); + private static final IntMask512 TRUE_MASK = new IntMask512(true); + private static final IntMask512 FALSE_MASK = new IntMask512(false); } // Shuffle - static final class Int512Shuffle extends AbstractShuffle { + static final class IntShuffle512 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int512Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + IntShuffle512(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Int512Shuffle(int[] indices, int i) { + IntShuffle512(int[] indices, int i) { this(prepare(indices, i)); } - Int512Shuffle(IntUnaryOperator fn) { + IntShuffle512(IntUnaryOperator fn) { this(prepare(fn)); } @@ -860,23 +867,23 @@ final class Int512Vector extends IntVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Int512Shuffle IOTA = new Int512Shuffle(IDENTITY); + static final IntShuffle512 IOTA = new IntShuffle512(IDENTITY); @Override @ForceInline - public Int512Vector toVector() { + public IntVector512 toVector() { return toBitsVector(); } @Override @ForceInline - Int512Vector toBitsVector() { - return (Int512Vector) super.toBitsVectorTemplate(); + IntVector512 toBitsVector() { + return (IntVector512) super.toBitsVectorTemplate(); } @Override - Int512Vector toBitsVector0() { - return ((Int512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector512 toBitsVector0() { + return ((IntVector512) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -899,30 +906,30 @@ final class Int512Vector extends IntVector { @Override @ForceInline - public final Int512Mask laneIsValid() { - return (Int512Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final IntMask512 laneIsValid() { + return (IntMask512) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Int512Shuffle rearrange(VectorShuffle shuffle) { - Int512Shuffle concreteShuffle = (Int512Shuffle) shuffle; - return (Int512Shuffle) toBitsVector().rearrange(concreteShuffle) + public final IntShuffle512 rearrange(VectorShuffle shuffle) { + IntShuffle512 concreteShuffle = (IntShuffle512) shuffle; + return (IntShuffle512) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Int512Shuffle wrapIndexes() { - Int512Vector v = toBitsVector(); + public final IntShuffle512 wrapIndexes() { + IntVector512 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int512Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector512) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector512) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Int512Shuffle) v.toShuffle(vspecies(), false); + return (IntShuffle512) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -973,14 +980,14 @@ final class Int512Vector extends IntVector { @Override final IntVector fromArray0(int[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Int512Mask.class, a, offset, (Int512Mask) m, offsetInRange); // specialize + return super.fromArray0Template(IntMask512.class, a, offset, (IntMask512) m, offsetInRange); // specialize } @ForceInline @Override final IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Int512Mask.class, a, offset, indexMap, mapOffset, (Int512Mask) m); + return super.fromArray0Template(IntMask512.class, a, offset, indexMap, mapOffset, (IntMask512) m); } @@ -996,7 +1003,7 @@ final class Int512Vector extends IntVector { @Override final IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Int512Mask.class, ms, offset, (Int512Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(IntMask512.class, ms, offset, (IntMask512) m, offsetInRange); // specialize } @ForceInline @@ -1010,14 +1017,14 @@ final class Int512Vector extends IntVector { @Override final void intoArray0(int[] a, int offset, VectorMask m) { - super.intoArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); + super.intoArray0Template(IntMask512.class, a, offset, (IntMask512) m); } @ForceInline @Override final void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Int512Mask.class, a, offset, indexMap, mapOffset, (Int512Mask) m); + super.intoArray0Template(IntMask512.class, a, offset, indexMap, mapOffset, (IntMask512) m); } @@ -1025,7 +1032,7 @@ final class Int512Vector extends IntVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Int512Mask.class, ms, offset, (Int512Mask) m); + super.intoMemorySegment0Template(IntMask512.class, ms, offset, (IntMask512) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector64.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector64.java index 8338799c61a..c3f92285034 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector64.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Int64Vector extends IntVector { +final class IntVector64 extends IntVector { static final IntSpecies VSPECIES = (IntSpecies) IntVector.SPECIES_64; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Int64Vector.class; + static final Class VCLASS = IntVector64.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = int.class; // carrier type used by the JVM + static final Class ETYPE = int.class; // used by the JVM - Int64Vector(int[] v) { + IntVector64(int[] v) { super(v); } - // For compatibility as Int64Vector::new, + // For compatibility as IntVector64::new, // stored into species.vectorFactory. - Int64Vector(Object v) { + IntVector64(Object v) { this((int[]) v); } - static final Int64Vector ZERO = new Int64Vector(new int[VLENGTH]); - static final Int64Vector IOTA = new Int64Vector(VSPECIES.iotaArray()); + static final IntVector64 ZERO = new IntVector64(new int[VLENGTH]); + static final IntVector64 IOTA = new IntVector64(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Int64Vector extends IntVector { @Override public final Class elementType() { return int.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Integer.SIZE; } @@ -130,51 +135,51 @@ final class Int64Vector extends IntVector { @Override @ForceInline - public final Int64Vector broadcast(int e) { - return (Int64Vector) super.broadcastTemplate(e); // specialize + public final IntVector64 broadcast(int e) { + return (IntVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Int64Vector broadcast(long e) { - return (Int64Vector) super.broadcastTemplate(e); // specialize + public final IntVector64 broadcast(long e) { + return (IntVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Int64Mask maskFromArray(boolean[] bits) { - return new Int64Mask(bits); + IntMask64 maskFromArray(boolean[] bits) { + return new IntMask64(bits); } @Override @ForceInline - Int64Shuffle iotaShuffle() { return Int64Shuffle.IOTA; } + IntShuffle64 iotaShuffle() { return IntShuffle64.IOTA; } @Override @ForceInline - Int64Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Int64Shuffle) iotaShuffleTemplate(start, step, wrap); + IntShuffle64 iotaShuffle(int start, int step, boolean wrap) { + return (IntShuffle64) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Int64Shuffle shuffleFromArray(int[] indices, int i) { return new Int64Shuffle(indices, i); } + IntShuffle64 shuffleFromArray(int[] indices, int i) { return new IntShuffle64(indices, i); } @Override @ForceInline - Int64Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Int64Shuffle(fn); } + IntShuffle64 shuffleFromOp(IntUnaryOperator fn) { return new IntShuffle64(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Int64Vector vectorFactory(int[] vec) { - return new Int64Vector(vec); + IntVector64 vectorFactory(int[] vec) { + return new IntVector64(vec); } @ForceInline final @Override - Byte64Vector asByteVectorRaw() { - return (Byte64Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector64 asByteVectorRaw() { + return (ByteVector64) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Int64Vector extends IntVector { @ForceInline final @Override - Int64Vector uOp(FUnOp f) { - return (Int64Vector) super.uOpTemplate(f); // specialize + IntVector64 uOp(FUnOp f) { + return (IntVector64) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Int64Vector uOp(VectorMask m, FUnOp f) { - return (Int64Vector) - super.uOpTemplate((Int64Mask)m, f); // specialize + IntVector64 uOp(VectorMask m, FUnOp f) { + return (IntVector64) + super.uOpTemplate((IntMask64)m, f); // specialize } // Binary operator @ForceInline final @Override - Int64Vector bOp(Vector v, FBinOp f) { - return (Int64Vector) super.bOpTemplate((Int64Vector)v, f); // specialize + IntVector64 bOp(Vector v, FBinOp f) { + return (IntVector64) super.bOpTemplate((IntVector64)v, f); // specialize } @ForceInline final @Override - Int64Vector bOp(Vector v, + IntVector64 bOp(Vector v, VectorMask m, FBinOp f) { - return (Int64Vector) - super.bOpTemplate((Int64Vector)v, (Int64Mask)m, + return (IntVector64) + super.bOpTemplate((IntVector64)v, (IntMask64)m, f); // specialize } @@ -219,19 +224,19 @@ final class Int64Vector extends IntVector { @ForceInline final @Override - Int64Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Int64Vector) - super.tOpTemplate((Int64Vector)v1, (Int64Vector)v2, + IntVector64 tOp(Vector v1, Vector v2, FTriOp f) { + return (IntVector64) + super.tOpTemplate((IntVector64)v1, (IntVector64)v2, f); // specialize } @ForceInline final @Override - Int64Vector tOp(Vector v1, Vector v2, + IntVector64 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Int64Vector) - super.tOpTemplate((Int64Vector)v1, (Int64Vector)v2, - (Int64Mask)m, f); // specialize + return (IntVector64) + super.tOpTemplate((IntVector64)v1, (IntVector64)v2, + (IntMask64)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Int64Vector extends IntVector { @Override @ForceInline - public Int64Vector lanewise(Unary op) { - return (Int64Vector) super.lanewiseTemplate(op); // specialize + public IntVector64 lanewise(Unary op) { + return (IntVector64) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Int64Vector lanewise(Unary op, VectorMask m) { - return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, (Int64Mask) m); // specialize + public IntVector64 lanewise(Unary op, VectorMask m) { + return (IntVector64) super.lanewiseTemplate(op, IntMask64.class, (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector lanewise(Binary op, Vector v) { - return (Int64Vector) super.lanewiseTemplate(op, v); // specialize + public IntVector64 lanewise(Binary op, Vector v) { + return (IntVector64) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Int64Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, v, (Int64Mask) m); // specialize + public IntVector64 lanewise(Binary op, Vector v, VectorMask m) { + return (IntVector64) super.lanewiseTemplate(op, IntMask64.class, v, (IntMask64) m); // specialize } /*package-private*/ @Override - @ForceInline Int64Vector + @ForceInline IntVector64 lanewiseShift(VectorOperators.Binary op, int e) { - return (Int64Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (IntVector64) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Int64Vector + @ForceInline IntVector64 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Int64Vector) super.lanewiseShiftTemplate(op, Int64Mask.class, e, (Int64Mask) m); // specialize + return (IntVector64) super.lanewiseShiftTemplate(op, IntMask64.class, e, (IntMask64) m); // specialize } /*package-private*/ @Override @ForceInline public final - Int64Vector + IntVector64 lanewise(Ternary op, Vector v1, Vector v2) { - return (Int64Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (IntVector64) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Int64Vector + IntVector64 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, v1, v2, (Int64Mask) m); // specialize + return (IntVector64) super.lanewiseTemplate(op, IntMask64.class, v1, v2, (IntMask64) m); // specialize } @Override @ForceInline public final - Int64Vector addIndex(int scale) { - return (Int64Vector) super.addIndexTemplate(scale); // specialize + IntVector64 addIndex(int scale) { + return (IntVector64) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Int64Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized + return super.reduceLanesTemplate(op, IntMask64.class, (IntMask64) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Int64Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, IntMask64.class, (IntMask64) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Int64Vector extends IntVector { @Override @ForceInline - public final Int64Shuffle toShuffle() { - return (Int64Shuffle) toShuffle(vspecies(), false); + public final IntShuffle64 toShuffle() { + return (IntShuffle64) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Int64Mask test(Test op) { - return super.testTemplate(Int64Mask.class, op); // specialize + public final IntMask64 test(Test op) { + return super.testTemplate(IntMask64.class, op); // specialize } @Override @ForceInline - public final Int64Mask test(Test op, VectorMask m) { - return super.testTemplate(Int64Mask.class, op, (Int64Mask) m); // specialize + public final IntMask64 test(Test op, VectorMask m) { + return super.testTemplate(IntMask64.class, op, (IntMask64) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Int64Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Int64Mask.class, op, v); // specialize + public final IntMask64 compare(Comparison op, Vector v) { + return super.compareTemplate(IntMask64.class, op, v); // specialize } @Override @ForceInline - public final Int64Mask compare(Comparison op, int s) { - return super.compareTemplate(Int64Mask.class, op, s); // specialize + public final IntMask64 compare(Comparison op, int s) { + return super.compareTemplate(IntMask64.class, op, s); // specialize } @Override @ForceInline - public final Int64Mask compare(Comparison op, long s) { - return super.compareTemplate(Int64Mask.class, op, s); // specialize + public final IntMask64 compare(Comparison op, long s) { + return super.compareTemplate(IntMask64.class, op, s); // specialize } @Override @ForceInline - public final Int64Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Int64Mask.class, op, v, (Int64Mask) m); + public final IntMask64 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(IntMask64.class, op, v, (IntMask64) m); } @Override @ForceInline - public Int64Vector blend(Vector v, VectorMask m) { - return (Int64Vector) - super.blendTemplate(Int64Mask.class, - (Int64Vector) v, - (Int64Mask) m); // specialize + public IntVector64 blend(Vector v, VectorMask m) { + return (IntVector64) + super.blendTemplate(IntMask64.class, + (IntVector64) v, + (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector slice(int origin, Vector v) { - return (Int64Vector) super.sliceTemplate(origin, v); // specialize + public IntVector64 slice(int origin, Vector v) { + return (IntVector64) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Int64Vector slice(int origin) { - return (Int64Vector) super.sliceTemplate(origin); // specialize + public IntVector64 slice(int origin) { + return (IntVector64) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Int64Vector unslice(int origin, Vector w, int part) { - return (Int64Vector) super.unsliceTemplate(origin, w, part); // specialize + public IntVector64 unslice(int origin, Vector w, int part) { + return (IntVector64) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Int64Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Int64Vector) - super.unsliceTemplate(Int64Mask.class, + public IntVector64 unslice(int origin, Vector w, int part, VectorMask m) { + return (IntVector64) + super.unsliceTemplate(IntMask64.class, origin, w, part, - (Int64Mask) m); // specialize + (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector unslice(int origin) { - return (Int64Vector) super.unsliceTemplate(origin); // specialize + public IntVector64 unslice(int origin) { + return (IntVector64) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Int64Vector rearrange(VectorShuffle s) { - return (Int64Vector) - super.rearrangeTemplate(Int64Shuffle.class, - (Int64Shuffle) s); // specialize + public IntVector64 rearrange(VectorShuffle s) { + return (IntVector64) + super.rearrangeTemplate(IntShuffle64.class, + (IntShuffle64) s); // specialize } @Override @ForceInline - public Int64Vector rearrange(VectorShuffle shuffle, + public IntVector64 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Int64Vector) - super.rearrangeTemplate(Int64Shuffle.class, - Int64Mask.class, - (Int64Shuffle) shuffle, - (Int64Mask) m); // specialize + return (IntVector64) + super.rearrangeTemplate(IntShuffle64.class, + IntMask64.class, + (IntShuffle64) shuffle, + (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector rearrange(VectorShuffle s, + public IntVector64 rearrange(VectorShuffle s, Vector v) { - return (Int64Vector) - super.rearrangeTemplate(Int64Shuffle.class, - (Int64Shuffle) s, - (Int64Vector) v); // specialize + return (IntVector64) + super.rearrangeTemplate(IntShuffle64.class, + (IntShuffle64) s, + (IntVector64) v); // specialize } @Override @ForceInline - public Int64Vector compress(VectorMask m) { - return (Int64Vector) - super.compressTemplate(Int64Mask.class, - (Int64Mask) m); // specialize + public IntVector64 compress(VectorMask m) { + return (IntVector64) + super.compressTemplate(IntMask64.class, + (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector expand(VectorMask m) { - return (Int64Vector) - super.expandTemplate(Int64Mask.class, - (Int64Mask) m); // specialize + public IntVector64 expand(VectorMask m) { + return (IntVector64) + super.expandTemplate(IntMask64.class, + (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector selectFrom(Vector v) { - return (Int64Vector) - super.selectFromTemplate((Int64Vector) v); // specialize + public IntVector64 selectFrom(Vector v) { + return (IntVector64) + super.selectFromTemplate((IntVector64) v); // specialize } @Override @ForceInline - public Int64Vector selectFrom(Vector v, + public IntVector64 selectFrom(Vector v, VectorMask m) { - return (Int64Vector) - super.selectFromTemplate((Int64Vector) v, - Int64Mask.class, (Int64Mask) m); // specialize + return (IntVector64) + super.selectFromTemplate((IntVector64) v, + IntMask64.class, (IntMask64) m); // specialize } @Override @ForceInline - public Int64Vector selectFrom(Vector v1, + public IntVector64 selectFrom(Vector v1, Vector v2) { - return (Int64Vector) - super.selectFromTemplate((Int64Vector) v1, (Int64Vector) v2); // specialize + return (IntVector64) + super.selectFromTemplate((IntVector64) v1, (IntVector64) v2); // specialize } @ForceInline @@ -544,7 +549,7 @@ final class Int64Vector extends IntVector { @ForceInline @Override - public Int64Vector withLane(int i, int e) { + public IntVector64 withLane(int i, int e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -553,7 +558,7 @@ final class Int64Vector extends IntVector { } @ForceInline - public Int64Vector withLaneHelper(int i, int e) { + public IntVector64 withLaneHelper(int i, int e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -566,19 +571,20 @@ final class Int64Vector extends IntVector { // Mask - static final class Int64Mask extends AbstractMask { + static final class IntMask64 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int64Mask(boolean[] bits) { + static final Class CTYPE = int.class; // used by the JVM + + IntMask64(boolean[] bits) { this(bits, 0); } - Int64Mask(boolean[] bits, int offset) { + IntMask64(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Int64Mask(boolean val) { + IntMask64(boolean val) { super(prepare(val)); } @@ -611,31 +617,31 @@ final class Int64Vector extends IntVector { } @Override - Int64Mask uOp(MUnOp f) { + IntMask64 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Int64Mask(res); + return new IntMask64(res); } @Override - Int64Mask bOp(VectorMask m, MBinOp f) { + IntMask64 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Int64Mask)m).getBits(); + boolean[] mbits = ((IntMask64)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Int64Mask(res); + return new IntMask64(res); } @ForceInline @Override public final - Int64Vector toVector() { - return (Int64Vector) super.toVectorTemplate(); // specialize + IntVector64 toVector() { + return (IntVector64) super.toVectorTemplate(); // specialize } /** @@ -668,25 +674,25 @@ final class Int64Vector extends IntVector { @Override @ForceInline /*package-private*/ - Int64Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Int64Mask) VectorSupport.indexPartiallyInUpperRange( - Int64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Int64Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + IntMask64 indexPartiallyInUpperRange(long offset, long limit) { + return (IntMask64) VectorSupport.indexPartiallyInUpperRange( + IntMask64.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (IntMask64) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Int64Mask not() { + public IntMask64 not() { return xor(maskAll(true)); } @Override @ForceInline - public Int64Mask compress() { - return (Int64Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Int64Vector.class, Int64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public IntMask64 compress() { + return (IntMask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + IntVector64.class, IntMask64.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -695,30 +701,30 @@ final class Int64Vector extends IntVector { @Override @ForceInline - public Int64Mask and(VectorMask mask) { + public IntMask64 and(VectorMask mask) { Objects.requireNonNull(mask); - Int64Mask m = (Int64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask64 m = (IntMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, IntMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Int64Mask or(VectorMask mask) { + public IntMask64 or(VectorMask mask) { Objects.requireNonNull(mask); - Int64Mask m = (Int64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask64 m = (IntMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, IntMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Int64Mask xor(VectorMask mask) { + public IntMask64 xor(VectorMask mask) { Objects.requireNonNull(mask); - Int64Mask m = (Int64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMask64 m = (IntMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -728,21 +734,21 @@ final class Int64Vector extends IntVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -752,7 +758,7 @@ final class Int64Vector extends IntVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -762,7 +768,7 @@ final class Int64Vector extends IntVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Int64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(IntMask64.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -771,48 +777,49 @@ final class Int64Vector extends IntVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Int64Mask)m).getBits())); + (m, __) -> anyTrueHelper(((IntMask64)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Int64Mask)m).getBits())); + (m, __) -> allTrueHelper(((IntMask64)m).getBits())); } @ForceInline /*package-private*/ - static Int64Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Int64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static IntMask64 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(IntMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Int64Mask TRUE_MASK = new Int64Mask(true); - private static final Int64Mask FALSE_MASK = new Int64Mask(false); + private static final IntMask64 TRUE_MASK = new IntMask64(true); + private static final IntMask64 FALSE_MASK = new IntMask64(false); } // Shuffle - static final class Int64Shuffle extends AbstractShuffle { + static final class IntShuffle64 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - Int64Shuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + IntShuffle64(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Int64Shuffle(int[] indices, int i) { + IntShuffle64(int[] indices, int i) { this(prepare(indices, i)); } - Int64Shuffle(IntUnaryOperator fn) { + IntShuffle64(IntUnaryOperator fn) { this(prepare(fn)); } @@ -832,23 +839,23 @@ final class Int64Vector extends IntVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final Int64Shuffle IOTA = new Int64Shuffle(IDENTITY); + static final IntShuffle64 IOTA = new IntShuffle64(IDENTITY); @Override @ForceInline - public Int64Vector toVector() { + public IntVector64 toVector() { return toBitsVector(); } @Override @ForceInline - Int64Vector toBitsVector() { - return (Int64Vector) super.toBitsVectorTemplate(); + IntVector64 toBitsVector() { + return (IntVector64) super.toBitsVectorTemplate(); } @Override - Int64Vector toBitsVector0() { - return ((Int64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVector64 toBitsVector0() { + return ((IntVector64) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -871,30 +878,30 @@ final class Int64Vector extends IntVector { @Override @ForceInline - public final Int64Mask laneIsValid() { - return (Int64Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final IntMask64 laneIsValid() { + return (IntMask64) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Int64Shuffle rearrange(VectorShuffle shuffle) { - Int64Shuffle concreteShuffle = (Int64Shuffle) shuffle; - return (Int64Shuffle) toBitsVector().rearrange(concreteShuffle) + public final IntShuffle64 rearrange(VectorShuffle shuffle) { + IntShuffle64 concreteShuffle = (IntShuffle64) shuffle; + return (IntShuffle64) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Int64Shuffle wrapIndexes() { - Int64Vector v = toBitsVector(); + public final IntShuffle64 wrapIndexes() { + IntVector64 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Int64Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVector64) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Int64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVector64) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Int64Shuffle) v.toShuffle(vspecies(), false); + return (IntShuffle64) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -945,14 +952,14 @@ final class Int64Vector extends IntVector { @Override final IntVector fromArray0(int[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Int64Mask.class, a, offset, (Int64Mask) m, offsetInRange); // specialize + return super.fromArray0Template(IntMask64.class, a, offset, (IntMask64) m, offsetInRange); // specialize } @ForceInline @Override final IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Int64Mask.class, a, offset, indexMap, mapOffset, (Int64Mask) m); + return super.fromArray0Template(IntMask64.class, a, offset, indexMap, mapOffset, (IntMask64) m); } @@ -968,7 +975,7 @@ final class Int64Vector extends IntVector { @Override final IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Int64Mask.class, ms, offset, (Int64Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(IntMask64.class, ms, offset, (IntMask64) m, offsetInRange); // specialize } @ForceInline @@ -982,14 +989,14 @@ final class Int64Vector extends IntVector { @Override final void intoArray0(int[] a, int offset, VectorMask m) { - super.intoArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); + super.intoArray0Template(IntMask64.class, a, offset, (IntMask64) m); } @ForceInline @Override final void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Int64Mask.class, a, offset, indexMap, mapOffset, (Int64Mask) m); + super.intoArray0Template(IntMask64.class, a, offset, indexMap, mapOffset, (IntMask64) m); } @@ -997,7 +1004,7 @@ final class Int64Vector extends IntVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Int64Mask.class, ms, offset, (Int64Mask) m); + super.intoMemorySegment0Template(IntMask64.class, ms, offset, (IntMask64) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVectorMax.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVectorMax.java index 177890e765c..8d3c251536c 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVectorMax.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class IntMaxVector extends IntVector { +final class IntVectorMax extends IntVector { static final IntSpecies VSPECIES = (IntSpecies) IntVector.SPECIES_MAX; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = IntMaxVector.class; + static final Class VCLASS = IntVectorMax.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = int.class; // carrier type used by the JVM + static final Class ETYPE = int.class; // used by the JVM - IntMaxVector(int[] v) { + IntVectorMax(int[] v) { super(v); } - // For compatibility as IntMaxVector::new, + // For compatibility as IntVectorMax::new, // stored into species.vectorFactory. - IntMaxVector(Object v) { + IntVectorMax(Object v) { this((int[]) v); } - static final IntMaxVector ZERO = new IntMaxVector(new int[VLENGTH]); - static final IntMaxVector IOTA = new IntMaxVector(VSPECIES.iotaArray()); + static final IntVectorMax ZERO = new IntVectorMax(new int[VLENGTH]); + static final IntVectorMax IOTA = new IntVectorMax(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class IntMaxVector extends IntVector { @Override public final Class elementType() { return int.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Integer.SIZE; } @@ -130,51 +135,51 @@ final class IntMaxVector extends IntVector { @Override @ForceInline - public final IntMaxVector broadcast(int e) { - return (IntMaxVector) super.broadcastTemplate(e); // specialize + public final IntVectorMax broadcast(int e) { + return (IntVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final IntMaxVector broadcast(long e) { - return (IntMaxVector) super.broadcastTemplate(e); // specialize + public final IntVectorMax broadcast(long e) { + return (IntVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - IntMaxMask maskFromArray(boolean[] bits) { - return new IntMaxMask(bits); + IntMaskMax maskFromArray(boolean[] bits) { + return new IntMaskMax(bits); } @Override @ForceInline - IntMaxShuffle iotaShuffle() { return IntMaxShuffle.IOTA; } + IntShuffleMax iotaShuffle() { return IntShuffleMax.IOTA; } @Override @ForceInline - IntMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - return (IntMaxShuffle) iotaShuffleTemplate(start, step, wrap); + IntShuffleMax iotaShuffle(int start, int step, boolean wrap) { + return (IntShuffleMax) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - IntMaxShuffle shuffleFromArray(int[] indices, int i) { return new IntMaxShuffle(indices, i); } + IntShuffleMax shuffleFromArray(int[] indices, int i) { return new IntShuffleMax(indices, i); } @Override @ForceInline - IntMaxShuffle shuffleFromOp(IntUnaryOperator fn) { return new IntMaxShuffle(fn); } + IntShuffleMax shuffleFromOp(IntUnaryOperator fn) { return new IntShuffleMax(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - IntMaxVector vectorFactory(int[] vec) { - return new IntMaxVector(vec); + IntVectorMax vectorFactory(int[] vec) { + return new IntVectorMax(vec); } @ForceInline final @Override - ByteMaxVector asByteVectorRaw() { - return (ByteMaxVector) super.asByteVectorRawTemplate(); // specialize + ByteVectorMax asByteVectorRaw() { + return (ByteVectorMax) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class IntMaxVector extends IntVector { @ForceInline final @Override - IntMaxVector uOp(FUnOp f) { - return (IntMaxVector) super.uOpTemplate(f); // specialize + IntVectorMax uOp(FUnOp f) { + return (IntVectorMax) super.uOpTemplate(f); // specialize } @ForceInline final @Override - IntMaxVector uOp(VectorMask m, FUnOp f) { - return (IntMaxVector) - super.uOpTemplate((IntMaxMask)m, f); // specialize + IntVectorMax uOp(VectorMask m, FUnOp f) { + return (IntVectorMax) + super.uOpTemplate((IntMaskMax)m, f); // specialize } // Binary operator @ForceInline final @Override - IntMaxVector bOp(Vector v, FBinOp f) { - return (IntMaxVector) super.bOpTemplate((IntMaxVector)v, f); // specialize + IntVectorMax bOp(Vector v, FBinOp f) { + return (IntVectorMax) super.bOpTemplate((IntVectorMax)v, f); // specialize } @ForceInline final @Override - IntMaxVector bOp(Vector v, + IntVectorMax bOp(Vector v, VectorMask m, FBinOp f) { - return (IntMaxVector) - super.bOpTemplate((IntMaxVector)v, (IntMaxMask)m, + return (IntVectorMax) + super.bOpTemplate((IntVectorMax)v, (IntMaskMax)m, f); // specialize } @@ -219,19 +224,19 @@ final class IntMaxVector extends IntVector { @ForceInline final @Override - IntMaxVector tOp(Vector v1, Vector v2, FTriOp f) { - return (IntMaxVector) - super.tOpTemplate((IntMaxVector)v1, (IntMaxVector)v2, + IntVectorMax tOp(Vector v1, Vector v2, FTriOp f) { + return (IntVectorMax) + super.tOpTemplate((IntVectorMax)v1, (IntVectorMax)v2, f); // specialize } @ForceInline final @Override - IntMaxVector tOp(Vector v1, Vector v2, + IntVectorMax tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (IntMaxVector) - super.tOpTemplate((IntMaxVector)v1, (IntMaxVector)v2, - (IntMaxMask)m, f); // specialize + return (IntVectorMax) + super.tOpTemplate((IntVectorMax)v1, (IntVectorMax)v2, + (IntMaskMax)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class IntMaxVector extends IntVector { @Override @ForceInline - public IntMaxVector lanewise(Unary op) { - return (IntMaxVector) super.lanewiseTemplate(op); // specialize + public IntVectorMax lanewise(Unary op) { + return (IntVectorMax) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public IntMaxVector lanewise(Unary op, VectorMask m) { - return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialize + public IntVectorMax lanewise(Unary op, VectorMask m) { + return (IntVectorMax) super.lanewiseTemplate(op, IntMaskMax.class, (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector lanewise(Binary op, Vector v) { - return (IntMaxVector) super.lanewiseTemplate(op, v); // specialize + public IntVectorMax lanewise(Binary op, Vector v) { + return (IntVectorMax) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public IntMaxVector lanewise(Binary op, Vector v, VectorMask m) { - return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, v, (IntMaxMask) m); // specialize + public IntVectorMax lanewise(Binary op, Vector v, VectorMask m) { + return (IntVectorMax) super.lanewiseTemplate(op, IntMaskMax.class, v, (IntMaskMax) m); // specialize } /*package-private*/ @Override - @ForceInline IntMaxVector + @ForceInline IntVectorMax lanewiseShift(VectorOperators.Binary op, int e) { - return (IntMaxVector) super.lanewiseShiftTemplate(op, e); // specialize + return (IntVectorMax) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline IntMaxVector + @ForceInline IntVectorMax lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (IntMaxVector) super.lanewiseShiftTemplate(op, IntMaxMask.class, e, (IntMaxMask) m); // specialize + return (IntVectorMax) super.lanewiseShiftTemplate(op, IntMaskMax.class, e, (IntMaskMax) m); // specialize } /*package-private*/ @Override @ForceInline public final - IntMaxVector + IntVectorMax lanewise(Ternary op, Vector v1, Vector v2) { - return (IntMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize + return (IntVectorMax) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - IntMaxVector + IntVectorMax lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, v1, v2, (IntMaxMask) m); // specialize + return (IntVectorMax) super.lanewiseTemplate(op, IntMaskMax.class, v1, v2, (IntMaskMax) m); // specialize } @Override @ForceInline public final - IntMaxVector addIndex(int scale) { - return (IntMaxVector) super.addIndexTemplate(scale); // specialize + IntVectorMax addIndex(int scale) { + return (IntVectorMax) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class IntMaxVector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized + return super.reduceLanesTemplate(op, IntMaskMax.class, (IntMaskMax) m); // specialized } @Override @@ -354,7 +359,7 @@ final class IntMaxVector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized + return (long) super.reduceLanesTemplate(op, IntMaskMax.class, (IntMaskMax) m); // specialized } @Override @@ -365,160 +370,160 @@ final class IntMaxVector extends IntVector { @Override @ForceInline - public final IntMaxShuffle toShuffle() { - return (IntMaxShuffle) toShuffle(vspecies(), false); + public final IntShuffleMax toShuffle() { + return (IntShuffleMax) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final IntMaxMask test(Test op) { - return super.testTemplate(IntMaxMask.class, op); // specialize + public final IntMaskMax test(Test op) { + return super.testTemplate(IntMaskMax.class, op); // specialize } @Override @ForceInline - public final IntMaxMask test(Test op, VectorMask m) { - return super.testTemplate(IntMaxMask.class, op, (IntMaxMask) m); // specialize + public final IntMaskMax test(Test op, VectorMask m) { + return super.testTemplate(IntMaskMax.class, op, (IntMaskMax) m); // specialize } // Specialized comparisons @Override @ForceInline - public final IntMaxMask compare(Comparison op, Vector v) { - return super.compareTemplate(IntMaxMask.class, op, v); // specialize + public final IntMaskMax compare(Comparison op, Vector v) { + return super.compareTemplate(IntMaskMax.class, op, v); // specialize } @Override @ForceInline - public final IntMaxMask compare(Comparison op, int s) { - return super.compareTemplate(IntMaxMask.class, op, s); // specialize + public final IntMaskMax compare(Comparison op, int s) { + return super.compareTemplate(IntMaskMax.class, op, s); // specialize } @Override @ForceInline - public final IntMaxMask compare(Comparison op, long s) { - return super.compareTemplate(IntMaxMask.class, op, s); // specialize + public final IntMaskMax compare(Comparison op, long s) { + return super.compareTemplate(IntMaskMax.class, op, s); // specialize } @Override @ForceInline - public final IntMaxMask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(IntMaxMask.class, op, v, (IntMaxMask) m); + public final IntMaskMax compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(IntMaskMax.class, op, v, (IntMaskMax) m); } @Override @ForceInline - public IntMaxVector blend(Vector v, VectorMask m) { - return (IntMaxVector) - super.blendTemplate(IntMaxMask.class, - (IntMaxVector) v, - (IntMaxMask) m); // specialize + public IntVectorMax blend(Vector v, VectorMask m) { + return (IntVectorMax) + super.blendTemplate(IntMaskMax.class, + (IntVectorMax) v, + (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector slice(int origin, Vector v) { - return (IntMaxVector) super.sliceTemplate(origin, v); // specialize + public IntVectorMax slice(int origin, Vector v) { + return (IntVectorMax) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public IntMaxVector slice(int origin) { - return (IntMaxVector) super.sliceTemplate(origin); // specialize + public IntVectorMax slice(int origin) { + return (IntVectorMax) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public IntMaxVector unslice(int origin, Vector w, int part) { - return (IntMaxVector) super.unsliceTemplate(origin, w, part); // specialize + public IntVectorMax unslice(int origin, Vector w, int part) { + return (IntVectorMax) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public IntMaxVector unslice(int origin, Vector w, int part, VectorMask m) { - return (IntMaxVector) - super.unsliceTemplate(IntMaxMask.class, + public IntVectorMax unslice(int origin, Vector w, int part, VectorMask m) { + return (IntVectorMax) + super.unsliceTemplate(IntMaskMax.class, origin, w, part, - (IntMaxMask) m); // specialize + (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector unslice(int origin) { - return (IntMaxVector) super.unsliceTemplate(origin); // specialize + public IntVectorMax unslice(int origin) { + return (IntVectorMax) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public IntMaxVector rearrange(VectorShuffle s) { - return (IntMaxVector) - super.rearrangeTemplate(IntMaxShuffle.class, - (IntMaxShuffle) s); // specialize + public IntVectorMax rearrange(VectorShuffle s) { + return (IntVectorMax) + super.rearrangeTemplate(IntShuffleMax.class, + (IntShuffleMax) s); // specialize } @Override @ForceInline - public IntMaxVector rearrange(VectorShuffle shuffle, + public IntVectorMax rearrange(VectorShuffle shuffle, VectorMask m) { - return (IntMaxVector) - super.rearrangeTemplate(IntMaxShuffle.class, - IntMaxMask.class, - (IntMaxShuffle) shuffle, - (IntMaxMask) m); // specialize + return (IntVectorMax) + super.rearrangeTemplate(IntShuffleMax.class, + IntMaskMax.class, + (IntShuffleMax) shuffle, + (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector rearrange(VectorShuffle s, + public IntVectorMax rearrange(VectorShuffle s, Vector v) { - return (IntMaxVector) - super.rearrangeTemplate(IntMaxShuffle.class, - (IntMaxShuffle) s, - (IntMaxVector) v); // specialize + return (IntVectorMax) + super.rearrangeTemplate(IntShuffleMax.class, + (IntShuffleMax) s, + (IntVectorMax) v); // specialize } @Override @ForceInline - public IntMaxVector compress(VectorMask m) { - return (IntMaxVector) - super.compressTemplate(IntMaxMask.class, - (IntMaxMask) m); // specialize + public IntVectorMax compress(VectorMask m) { + return (IntVectorMax) + super.compressTemplate(IntMaskMax.class, + (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector expand(VectorMask m) { - return (IntMaxVector) - super.expandTemplate(IntMaxMask.class, - (IntMaxMask) m); // specialize + public IntVectorMax expand(VectorMask m) { + return (IntVectorMax) + super.expandTemplate(IntMaskMax.class, + (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector selectFrom(Vector v) { - return (IntMaxVector) - super.selectFromTemplate((IntMaxVector) v); // specialize + public IntVectorMax selectFrom(Vector v) { + return (IntVectorMax) + super.selectFromTemplate((IntVectorMax) v); // specialize } @Override @ForceInline - public IntMaxVector selectFrom(Vector v, + public IntVectorMax selectFrom(Vector v, VectorMask m) { - return (IntMaxVector) - super.selectFromTemplate((IntMaxVector) v, - IntMaxMask.class, (IntMaxMask) m); // specialize + return (IntVectorMax) + super.selectFromTemplate((IntVectorMax) v, + IntMaskMax.class, (IntMaskMax) m); // specialize } @Override @ForceInline - public IntMaxVector selectFrom(Vector v1, + public IntVectorMax selectFrom(Vector v1, Vector v2) { - return (IntMaxVector) - super.selectFromTemplate((IntMaxVector) v1, (IntMaxVector) v2); // specialize + return (IntVectorMax) + super.selectFromTemplate((IntVectorMax) v1, (IntVectorMax) v2); // specialize } @ForceInline @@ -543,7 +548,7 @@ final class IntMaxVector extends IntVector { @ForceInline @Override - public IntMaxVector withLane(int i, int e) { + public IntVectorMax withLane(int i, int e) { if (i < 0 || i >= VLENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); } @@ -551,7 +556,7 @@ final class IntMaxVector extends IntVector { } @ForceInline - public IntMaxVector withLaneHelper(int i, int e) { + public IntVectorMax withLaneHelper(int i, int e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -564,19 +569,20 @@ final class IntMaxVector extends IntVector { // Mask - static final class IntMaxMask extends AbstractMask { + static final class IntMaskMax extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - IntMaxMask(boolean[] bits) { + static final Class CTYPE = int.class; // used by the JVM + + IntMaskMax(boolean[] bits) { this(bits, 0); } - IntMaxMask(boolean[] bits, int offset) { + IntMaskMax(boolean[] bits, int offset) { super(prepare(bits, offset)); } - IntMaxMask(boolean val) { + IntMaskMax(boolean val) { super(prepare(val)); } @@ -609,31 +615,31 @@ final class IntMaxVector extends IntVector { } @Override - IntMaxMask uOp(MUnOp f) { + IntMaskMax uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new IntMaxMask(res); + return new IntMaskMax(res); } @Override - IntMaxMask bOp(VectorMask m, MBinOp f) { + IntMaskMax bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((IntMaxMask)m).getBits(); + boolean[] mbits = ((IntMaskMax)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new IntMaxMask(res); + return new IntMaskMax(res); } @ForceInline @Override public final - IntMaxVector toVector() { - return (IntMaxVector) super.toVectorTemplate(); // specialize + IntVectorMax toVector() { + return (IntVectorMax) super.toVectorTemplate(); // specialize } /** @@ -666,25 +672,25 @@ final class IntMaxVector extends IntVector { @Override @ForceInline /*package-private*/ - IntMaxMask indexPartiallyInUpperRange(long offset, long limit) { - return (IntMaxMask) VectorSupport.indexPartiallyInUpperRange( - IntMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (IntMaxMask) TRUE_MASK.indexPartiallyInRange(o, l)); + IntMaskMax indexPartiallyInUpperRange(long offset, long limit) { + return (IntMaskMax) VectorSupport.indexPartiallyInUpperRange( + IntMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (IntMaskMax) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public IntMaxMask not() { + public IntMaskMax not() { return xor(maskAll(true)); } @Override @ForceInline - public IntMaxMask compress() { - return (IntMaxMask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - IntMaxVector.class, IntMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public IntMaskMax compress() { + return (IntMaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + IntVectorMax.class, IntMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -693,30 +699,30 @@ final class IntMaxVector extends IntVector { @Override @ForceInline - public IntMaxMask and(VectorMask mask) { + public IntMaskMax and(VectorMask mask) { Objects.requireNonNull(mask); - IntMaxMask m = (IntMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, IntMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMaskMax m = (IntMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, IntMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public IntMaxMask or(VectorMask mask) { + public IntMaskMax or(VectorMask mask) { Objects.requireNonNull(mask); - IntMaxMask m = (IntMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, IntMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMaskMax m = (IntMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, IntMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public IntMaxMask xor(VectorMask mask) { + public IntMaskMax xor(VectorMask mask) { Objects.requireNonNull(mask); - IntMaxMask m = (IntMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + IntMaskMax m = (IntMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -726,21 +732,21 @@ final class IntMaxVector extends IntVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -750,7 +756,7 @@ final class IntMaxVector extends IntVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -760,7 +766,7 @@ final class IntMaxVector extends IntVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(IntMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(IntMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -769,28 +775,28 @@ final class IntMaxVector extends IntVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((IntMaxMask)m).getBits())); + (m, __) -> anyTrueHelper(((IntMaskMax)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((IntMaxMask)m).getBits())); + (m, __) -> allTrueHelper(((IntMaskMax)m).getBits())); } @ForceInline /*package-private*/ - static IntMaxMask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(IntMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static IntMaskMax maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(IntMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final IntMaxMask TRUE_MASK = new IntMaxMask(true); - private static final IntMaxMask FALSE_MASK = new IntMaxMask(false); + private static final IntMaskMax TRUE_MASK = new IntMaskMax(true); + private static final IntMaskMax FALSE_MASK = new IntMaskMax(false); static boolean[] maskLowerHalf() { @@ -802,26 +808,27 @@ final class IntMaxVector extends IntVector { return a; } - static final IntMaxMask LOWER_HALF_TRUE_MASK = new IntMaxMask(maskLowerHalf()); + static final IntMaskMax LOWER_HALF_TRUE_MASK = new IntMaskMax(maskLowerHalf()); } // Shuffle - static final class IntMaxShuffle extends AbstractShuffle { + static final class IntShuffleMax extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = int.class; // used by the JVM - IntMaxShuffle(int[] indices) { + static final Class CTYPE = int.class; // used by the JVM + + IntShuffleMax(int[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - IntMaxShuffle(int[] indices, int i) { + IntShuffleMax(int[] indices, int i) { this(prepare(indices, i)); } - IntMaxShuffle(IntUnaryOperator fn) { + IntShuffleMax(IntUnaryOperator fn) { this(prepare(fn)); } @@ -841,23 +848,23 @@ final class IntMaxVector extends IntVector { assert(VLENGTH < Integer.MAX_VALUE); assert(Integer.MIN_VALUE <= -VLENGTH); } - static final IntMaxShuffle IOTA = new IntMaxShuffle(IDENTITY); + static final IntShuffleMax IOTA = new IntShuffleMax(IDENTITY); @Override @ForceInline - public IntMaxVector toVector() { + public IntVectorMax toVector() { return toBitsVector(); } @Override @ForceInline - IntMaxVector toBitsVector() { - return (IntMaxVector) super.toBitsVectorTemplate(); + IntVectorMax toBitsVector() { + return (IntVectorMax) super.toBitsVectorTemplate(); } @Override - IntMaxVector toBitsVector0() { - return ((IntMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + IntVectorMax toBitsVector0() { + return ((IntVectorMax) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -880,30 +887,30 @@ final class IntMaxVector extends IntVector { @Override @ForceInline - public final IntMaxMask laneIsValid() { - return (IntMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + public final IntMaskMax laneIsValid() { + return (IntMaskMax) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final IntMaxShuffle rearrange(VectorShuffle shuffle) { - IntMaxShuffle concreteShuffle = (IntMaxShuffle) shuffle; - return (IntMaxShuffle) toBitsVector().rearrange(concreteShuffle) + public final IntShuffleMax rearrange(VectorShuffle shuffle) { + IntShuffleMax concreteShuffle = (IntShuffleMax) shuffle; + return (IntShuffleMax) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final IntMaxShuffle wrapIndexes() { - IntMaxVector v = toBitsVector(); + public final IntShuffleMax wrapIndexes() { + IntVectorMax v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (IntMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + v = (IntVectorMax) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (IntMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (IntVectorMax) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (IntMaxShuffle) v.toShuffle(vspecies(), false); + return (IntShuffleMax) v.toShuffle(vspecies(), false); } private static int[] prepare(int[] indices, int offset) { @@ -954,14 +961,14 @@ final class IntMaxVector extends IntVector { @Override final IntVector fromArray0(int[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m, offsetInRange); // specialize + return super.fromArray0Template(IntMaskMax.class, a, offset, (IntMaskMax) m, offsetInRange); // specialize } @ForceInline @Override final IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(IntMaxMask.class, a, offset, indexMap, mapOffset, (IntMaxMask) m); + return super.fromArray0Template(IntMaskMax.class, a, offset, indexMap, mapOffset, (IntMaskMax) m); } @@ -977,7 +984,7 @@ final class IntMaxVector extends IntVector { @Override final IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(IntMaxMask.class, ms, offset, (IntMaxMask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(IntMaskMax.class, ms, offset, (IntMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -991,14 +998,14 @@ final class IntMaxVector extends IntVector { @Override final void intoArray0(int[] a, int offset, VectorMask m) { - super.intoArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); + super.intoArray0Template(IntMaskMax.class, a, offset, (IntMaskMax) m); } @ForceInline @Override final void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(IntMaxMask.class, a, offset, indexMap, mapOffset, (IntMaxMask) m); + super.intoArray0Template(IntMaskMax.class, a, offset, indexMap, mapOffset, (IntMaskMax) m); } @@ -1006,7 +1013,7 @@ final class IntMaxVector extends IntVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(IntMaxMask.class, ms, offset, (IntMaxMask) m); + super.intoMemorySegment0Template(IntMaskMax.class, ms, offset, (IntMaskMax) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LaneType.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LaneType.java index 59844eabb57..c18bbce1f34 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LaneType.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LaneType.java @@ -35,19 +35,20 @@ import static jdk.incubator.vector.VectorIntrinsics.*; * It caches all sorts of goodies that we can't put on java.lang.Class. */ enum LaneType { - FLOAT(float.class, Float.class, float[].class, 'F', 24, Float.SIZE), - DOUBLE(double.class, Double.class, double[].class, 'F', 53, Double.SIZE), - BYTE(byte.class, Byte.class, byte[].class, 'I', -1, Byte.SIZE), - SHORT(short.class, Short.class, short[].class, 'I', -1, Short.SIZE), - INT(int.class, Integer.class, int[].class, 'I', -1, Integer.SIZE), - LONG(long.class, Long.class, long[].class, 'I', -1, Long.SIZE); + FLOAT(float.class, Float.class, float[].class, 'F', 24, Float.SIZE, float.class), + DOUBLE(double.class, Double.class, double[].class, 'F', 53, Double.SIZE, double.class), + BYTE(byte.class, Byte.class, byte[].class, 'I', -1, Byte.SIZE, byte.class), + SHORT(short.class, Short.class, short[].class, 'I', -1, Short.SIZE, short.class), + INT(int.class, Integer.class, int[].class, 'I', -1, Integer.SIZE, int.class), + LONG(long.class, Long.class, long[].class, 'I', -1, Long.SIZE, long.class); LaneType(Class elementType, Class genericElementType, Class arrayType, char elementKind, int elementPrecision, - int elementSize) { + int elementSize, + Class carrierType) { if (elementPrecision <= 0) elementPrecision += elementSize; this.elementType = elementType; @@ -66,6 +67,9 @@ enum LaneType { // report that condition also. this.typeChar = genericElementType.getSimpleName().charAt(0); assert("FDBSIL".indexOf(typeChar) == ordinal()) : this; + this.carrierType = carrierType; + assert(carrierType.isPrimitive()); + } final Class elementType; @@ -78,6 +82,7 @@ enum LaneType { final int switchKey; // 1+ordinal(), which is non-zero final String printName; final char typeChar; // one of "BSILFD" + final Class carrierType; private @Stable LaneType asIntegral; private @Stable LaneType asFloating; diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java index 5657bbec0a6..7ba0af6c139 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java @@ -84,8 +84,8 @@ public abstract class LongVector extends AbstractVector { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -2964,7 +2964,7 @@ public abstract class LongVector extends AbstractVector { // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For LongMaxVector, if vector length is non-power-of-two or + // For LongVectorMax, if vector length is non-power-of-two or // 2048 bits, indexShape of Long species is S_MAX_BIT. // Assume that vector length is 2048, then the lane count of Long // vector is 32. When converting Long species to int species, @@ -2972,7 +2972,7 @@ public abstract class LongVector extends AbstractVector { // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3255,14 +3255,14 @@ public abstract class LongVector extends AbstractVector { // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For LongMaxVector, if vector length is 2048 bits, indexShape + // For LongVectorMax, if vector length is 2048 bits, indexShape // of Long species is S_MAX_BIT. and the lane count of Long // vector is 32. When converting Long species to int species, // indexShape is still S_MAX_BIT, but the lane count of int vector // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3449,7 +3449,7 @@ public abstract class LongVector extends AbstractVector { // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For LongMaxVector, if vector length is non-power-of-two or + // For LongVectorMax, if vector length is non-power-of-two or // 2048 bits, indexShape of Long species is S_MAX_BIT. // Assume that vector length is 2048, then the lane count of Long // vector is 32. When converting Long species to int species, @@ -3457,7 +3457,7 @@ public abstract class LongVector extends AbstractVector { // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -3565,14 +3565,14 @@ public abstract class LongVector extends AbstractVector { // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For LongMaxVector, if vector length is 2048 bits, indexShape + // For LongVectorMax, if vector length is 2048 bits, indexShape // of Long species is S_MAX_BIT. and the lane count of Long // vector is 32. When converting Long species to int species, // indexShape is still S_MAX_BIT, but the lane count of int vector // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -4010,13 +4010,13 @@ public abstract class LongVector extends AbstractVector { @Override @ForceInline public final LongVector zero() { - if ((Class) vectorType() == LongMaxVector.class) - return LongMaxVector.ZERO; + if ((Class) vectorType() == LongVectorMax.class) + return LongVectorMax.ZERO; switch (vectorBitSize()) { - case 64: return Long64Vector.ZERO; - case 128: return Long128Vector.ZERO; - case 256: return Long256Vector.ZERO; - case 512: return Long512Vector.ZERO; + case 64: return LongVector64.ZERO; + case 128: return LongVector128.ZERO; + case 256: return LongVector256.ZERO; + case 512: return LongVector512.ZERO; } throw new AssertionError(); } @@ -4024,13 +4024,13 @@ public abstract class LongVector extends AbstractVector { @Override @ForceInline public final LongVector iota() { - if ((Class) vectorType() == LongMaxVector.class) - return LongMaxVector.IOTA; + if ((Class) vectorType() == LongVectorMax.class) + return LongVectorMax.IOTA; switch (vectorBitSize()) { - case 64: return Long64Vector.IOTA; - case 128: return Long128Vector.IOTA; - case 256: return Long256Vector.IOTA; - case 512: return Long512Vector.IOTA; + case 64: return LongVector64.IOTA; + case 128: return LongVector128.IOTA; + case 256: return LongVector256.IOTA; + case 512: return LongVector512.IOTA; } throw new AssertionError(); } @@ -4039,13 +4039,13 @@ public abstract class LongVector extends AbstractVector { @Override @ForceInline public final VectorMask maskAll(boolean bit) { - if ((Class) vectorType() == LongMaxVector.class) - return LongMaxVector.LongMaxMask.maskAll(bit); + if ((Class) vectorType() == LongVectorMax.class) + return LongVectorMax.LongMaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return Long64Vector.Long64Mask.maskAll(bit); - case 128: return Long128Vector.Long128Mask.maskAll(bit); - case 256: return Long256Vector.Long256Mask.maskAll(bit); - case 512: return Long512Vector.Long512Mask.maskAll(bit); + case 64: return LongVector64.LongMask64.maskAll(bit); + case 128: return LongVector128.LongMask128.maskAll(bit); + case 256: return LongVector256.LongMask256.maskAll(bit); + case 512: return LongVector512.LongMask512.maskAll(bit); } throw new AssertionError(); } @@ -4073,42 +4073,42 @@ public abstract class LongVector extends AbstractVector { /** Species representing {@link LongVector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies SPECIES_64 = new LongSpecies(VectorShape.S_64_BIT, - Long64Vector.class, - Long64Vector.Long64Mask.class, - Long64Vector.Long64Shuffle.class, - Long64Vector::new); + LongVector64.class, + LongVector64.LongMask64.class, + LongVector64.LongShuffle64.class, + LongVector64::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies SPECIES_128 = new LongSpecies(VectorShape.S_128_BIT, - Long128Vector.class, - Long128Vector.Long128Mask.class, - Long128Vector.Long128Shuffle.class, - Long128Vector::new); + LongVector128.class, + LongVector128.LongMask128.class, + LongVector128.LongShuffle128.class, + LongVector128::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies SPECIES_256 = new LongSpecies(VectorShape.S_256_BIT, - Long256Vector.class, - Long256Vector.Long256Mask.class, - Long256Vector.Long256Shuffle.class, - Long256Vector::new); + LongVector256.class, + LongVector256.LongMask256.class, + LongVector256.LongShuffle256.class, + LongVector256::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies SPECIES_512 = new LongSpecies(VectorShape.S_512_BIT, - Long512Vector.class, - Long512Vector.Long512Mask.class, - Long512Vector.Long512Shuffle.class, - Long512Vector::new); + LongVector512.class, + LongVector512.LongMask512.class, + LongVector512.LongShuffle512.class, + LongVector512::new); /** Species representing {@link LongVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies SPECIES_MAX = new LongSpecies(VectorShape.S_Max_BIT, - LongMaxVector.class, - LongMaxVector.LongMaxMask.class, - LongMaxVector.LongMaxShuffle.class, - LongMaxVector::new); + LongVectorMax.class, + LongVectorMax.LongMaskMax.class, + LongVectorMax.LongShuffleMax.class, + LongVectorMax::new); /** * Preferred species for {@link LongVector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector128.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector128.java index 01d721f64fc..f8dad12ff89 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector128.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Long128Vector extends LongVector { +final class LongVector128 extends LongVector { static final LongSpecies VSPECIES = (LongSpecies) LongVector.SPECIES_128; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Long128Vector.class; + static final Class VCLASS = LongVector128.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = long.class; // carrier type used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Long128Vector(long[] v) { + LongVector128(long[] v) { super(v); } - // For compatibility as Long128Vector::new, + // For compatibility as LongVector128::new, // stored into species.vectorFactory. - Long128Vector(Object v) { + LongVector128(Object v) { this((long[]) v); } - static final Long128Vector ZERO = new Long128Vector(new long[VLENGTH]); - static final Long128Vector IOTA = new Long128Vector(VSPECIES.iotaArray()); + static final LongVector128 ZERO = new LongVector128(new long[VLENGTH]); + static final LongVector128 IOTA = new LongVector128(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Long128Vector extends LongVector { @Override public final Class elementType() { return long.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Long.SIZE; } @@ -130,46 +135,46 @@ final class Long128Vector extends LongVector { @Override @ForceInline - public final Long128Vector broadcast(long e) { - return (Long128Vector) super.broadcastTemplate(e); // specialize + public final LongVector128 broadcast(long e) { + return (LongVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Long128Mask maskFromArray(boolean[] bits) { - return new Long128Mask(bits); + LongMask128 maskFromArray(boolean[] bits) { + return new LongMask128(bits); } @Override @ForceInline - Long128Shuffle iotaShuffle() { return Long128Shuffle.IOTA; } + LongShuffle128 iotaShuffle() { return LongShuffle128.IOTA; } @Override @ForceInline - Long128Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Long128Shuffle) iotaShuffleTemplate(start, step, wrap); + LongShuffle128 iotaShuffle(int start, int step, boolean wrap) { + return (LongShuffle128) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long128Shuffle shuffleFromArray(int[] indices, int i) { return new Long128Shuffle(indices, i); } + LongShuffle128 shuffleFromArray(int[] indices, int i) { return new LongShuffle128(indices, i); } @Override @ForceInline - Long128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Long128Shuffle(fn); } + LongShuffle128 shuffleFromOp(IntUnaryOperator fn) { return new LongShuffle128(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Long128Vector vectorFactory(long[] vec) { - return new Long128Vector(vec); + LongVector128 vectorFactory(long[] vec) { + return new LongVector128(vec); } @ForceInline final @Override - Byte128Vector asByteVectorRaw() { - return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector128 asByteVectorRaw() { + return (ByteVector128) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -182,31 +187,31 @@ final class Long128Vector extends LongVector { @ForceInline final @Override - Long128Vector uOp(FUnOp f) { - return (Long128Vector) super.uOpTemplate(f); // specialize + LongVector128 uOp(FUnOp f) { + return (LongVector128) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Long128Vector uOp(VectorMask m, FUnOp f) { - return (Long128Vector) - super.uOpTemplate((Long128Mask)m, f); // specialize + LongVector128 uOp(VectorMask m, FUnOp f) { + return (LongVector128) + super.uOpTemplate((LongMask128)m, f); // specialize } // Binary operator @ForceInline final @Override - Long128Vector bOp(Vector v, FBinOp f) { - return (Long128Vector) super.bOpTemplate((Long128Vector)v, f); // specialize + LongVector128 bOp(Vector v, FBinOp f) { + return (LongVector128) super.bOpTemplate((LongVector128)v, f); // specialize } @ForceInline final @Override - Long128Vector bOp(Vector v, + LongVector128 bOp(Vector v, VectorMask m, FBinOp f) { - return (Long128Vector) - super.bOpTemplate((Long128Vector)v, (Long128Mask)m, + return (LongVector128) + super.bOpTemplate((LongVector128)v, (LongMask128)m, f); // specialize } @@ -214,19 +219,19 @@ final class Long128Vector extends LongVector { @ForceInline final @Override - Long128Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Long128Vector) - super.tOpTemplate((Long128Vector)v1, (Long128Vector)v2, + LongVector128 tOp(Vector v1, Vector v2, FTriOp f) { + return (LongVector128) + super.tOpTemplate((LongVector128)v1, (LongVector128)v2, f); // specialize } @ForceInline final @Override - Long128Vector tOp(Vector v1, Vector v2, + LongVector128 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Long128Vector) - super.tOpTemplate((Long128Vector)v1, (Long128Vector)v2, - (Long128Mask)m, f); // specialize + return (LongVector128) + super.tOpTemplate((LongVector128)v1, (LongVector128)v2, + (LongMask128)m, f); // specialize } @ForceInline @@ -264,64 +269,64 @@ final class Long128Vector extends LongVector { @Override @ForceInline - public Long128Vector lanewise(Unary op) { - return (Long128Vector) super.lanewiseTemplate(op); // specialize + public LongVector128 lanewise(Unary op) { + return (LongVector128) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Long128Vector lanewise(Unary op, VectorMask m) { - return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, (Long128Mask) m); // specialize + public LongVector128 lanewise(Unary op, VectorMask m) { + return (LongVector128) super.lanewiseTemplate(op, LongMask128.class, (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector lanewise(Binary op, Vector v) { - return (Long128Vector) super.lanewiseTemplate(op, v); // specialize + public LongVector128 lanewise(Binary op, Vector v) { + return (LongVector128) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Long128Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, v, (Long128Mask) m); // specialize + public LongVector128 lanewise(Binary op, Vector v, VectorMask m) { + return (LongVector128) super.lanewiseTemplate(op, LongMask128.class, v, (LongMask128) m); // specialize } /*package-private*/ @Override - @ForceInline Long128Vector + @ForceInline LongVector128 lanewiseShift(VectorOperators.Binary op, int e) { - return (Long128Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (LongVector128) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Long128Vector + @ForceInline LongVector128 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Long128Vector) super.lanewiseShiftTemplate(op, Long128Mask.class, e, (Long128Mask) m); // specialize + return (LongVector128) super.lanewiseShiftTemplate(op, LongMask128.class, e, (LongMask128) m); // specialize } /*package-private*/ @Override @ForceInline public final - Long128Vector + LongVector128 lanewise(Ternary op, Vector v1, Vector v2) { - return (Long128Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (LongVector128) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Long128Vector + LongVector128 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, v1, v2, (Long128Mask) m); // specialize + return (LongVector128) super.lanewiseTemplate(op, LongMask128.class, v1, v2, (LongMask128) m); // specialize } @Override @ForceInline public final - Long128Vector addIndex(int scale) { - return (Long128Vector) super.addIndexTemplate(scale); // specialize + LongVector128 addIndex(int scale) { + return (LongVector128) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -336,7 +341,7 @@ final class Long128Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized + return super.reduceLanesTemplate(op, LongMask128.class, (LongMask128) m); // specialized } @Override @@ -349,7 +354,7 @@ final class Long128Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, LongMask128.class, (LongMask128) m); // specialized } @Override @@ -360,155 +365,155 @@ final class Long128Vector extends LongVector { @Override @ForceInline - public final Long128Shuffle toShuffle() { - return (Long128Shuffle) toShuffle(vspecies(), false); + public final LongShuffle128 toShuffle() { + return (LongShuffle128) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Long128Mask test(Test op) { - return super.testTemplate(Long128Mask.class, op); // specialize + public final LongMask128 test(Test op) { + return super.testTemplate(LongMask128.class, op); // specialize } @Override @ForceInline - public final Long128Mask test(Test op, VectorMask m) { - return super.testTemplate(Long128Mask.class, op, (Long128Mask) m); // specialize + public final LongMask128 test(Test op, VectorMask m) { + return super.testTemplate(LongMask128.class, op, (LongMask128) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Long128Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Long128Mask.class, op, v); // specialize + public final LongMask128 compare(Comparison op, Vector v) { + return super.compareTemplate(LongMask128.class, op, v); // specialize } @Override @ForceInline - public final Long128Mask compare(Comparison op, long s) { - return super.compareTemplate(Long128Mask.class, op, s); // specialize + public final LongMask128 compare(Comparison op, long s) { + return super.compareTemplate(LongMask128.class, op, s); // specialize } @Override @ForceInline - public final Long128Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Long128Mask.class, op, v, (Long128Mask) m); + public final LongMask128 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(LongMask128.class, op, v, (LongMask128) m); } @Override @ForceInline - public Long128Vector blend(Vector v, VectorMask m) { - return (Long128Vector) - super.blendTemplate(Long128Mask.class, - (Long128Vector) v, - (Long128Mask) m); // specialize + public LongVector128 blend(Vector v, VectorMask m) { + return (LongVector128) + super.blendTemplate(LongMask128.class, + (LongVector128) v, + (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector slice(int origin, Vector v) { - return (Long128Vector) super.sliceTemplate(origin, v); // specialize + public LongVector128 slice(int origin, Vector v) { + return (LongVector128) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Long128Vector slice(int origin) { - return (Long128Vector) super.sliceTemplate(origin); // specialize + public LongVector128 slice(int origin) { + return (LongVector128) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Long128Vector unslice(int origin, Vector w, int part) { - return (Long128Vector) super.unsliceTemplate(origin, w, part); // specialize + public LongVector128 unslice(int origin, Vector w, int part) { + return (LongVector128) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Long128Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Long128Vector) - super.unsliceTemplate(Long128Mask.class, + public LongVector128 unslice(int origin, Vector w, int part, VectorMask m) { + return (LongVector128) + super.unsliceTemplate(LongMask128.class, origin, w, part, - (Long128Mask) m); // specialize + (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector unslice(int origin) { - return (Long128Vector) super.unsliceTemplate(origin); // specialize + public LongVector128 unslice(int origin) { + return (LongVector128) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Long128Vector rearrange(VectorShuffle s) { - return (Long128Vector) - super.rearrangeTemplate(Long128Shuffle.class, - (Long128Shuffle) s); // specialize + public LongVector128 rearrange(VectorShuffle s) { + return (LongVector128) + super.rearrangeTemplate(LongShuffle128.class, + (LongShuffle128) s); // specialize } @Override @ForceInline - public Long128Vector rearrange(VectorShuffle shuffle, + public LongVector128 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Long128Vector) - super.rearrangeTemplate(Long128Shuffle.class, - Long128Mask.class, - (Long128Shuffle) shuffle, - (Long128Mask) m); // specialize + return (LongVector128) + super.rearrangeTemplate(LongShuffle128.class, + LongMask128.class, + (LongShuffle128) shuffle, + (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector rearrange(VectorShuffle s, + public LongVector128 rearrange(VectorShuffle s, Vector v) { - return (Long128Vector) - super.rearrangeTemplate(Long128Shuffle.class, - (Long128Shuffle) s, - (Long128Vector) v); // specialize + return (LongVector128) + super.rearrangeTemplate(LongShuffle128.class, + (LongShuffle128) s, + (LongVector128) v); // specialize } @Override @ForceInline - public Long128Vector compress(VectorMask m) { - return (Long128Vector) - super.compressTemplate(Long128Mask.class, - (Long128Mask) m); // specialize + public LongVector128 compress(VectorMask m) { + return (LongVector128) + super.compressTemplate(LongMask128.class, + (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector expand(VectorMask m) { - return (Long128Vector) - super.expandTemplate(Long128Mask.class, - (Long128Mask) m); // specialize + public LongVector128 expand(VectorMask m) { + return (LongVector128) + super.expandTemplate(LongMask128.class, + (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector selectFrom(Vector v) { - return (Long128Vector) - super.selectFromTemplate((Long128Vector) v); // specialize + public LongVector128 selectFrom(Vector v) { + return (LongVector128) + super.selectFromTemplate((LongVector128) v); // specialize } @Override @ForceInline - public Long128Vector selectFrom(Vector v, + public LongVector128 selectFrom(Vector v, VectorMask m) { - return (Long128Vector) - super.selectFromTemplate((Long128Vector) v, - Long128Mask.class, (Long128Mask) m); // specialize + return (LongVector128) + super.selectFromTemplate((LongVector128) v, + LongMask128.class, (LongMask128) m); // specialize } @Override @ForceInline - public Long128Vector selectFrom(Vector v1, + public LongVector128 selectFrom(Vector v1, Vector v2) { - return (Long128Vector) - super.selectFromTemplate((Long128Vector) v1, (Long128Vector) v2); // specialize + return (LongVector128) + super.selectFromTemplate((LongVector128) v1, (LongVector128) v2); // specialize } @ForceInline @@ -534,7 +539,7 @@ final class Long128Vector extends LongVector { @ForceInline @Override - public Long128Vector withLane(int i, long e) { + public LongVector128 withLane(int i, long e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -543,7 +548,7 @@ final class Long128Vector extends LongVector { } @ForceInline - public Long128Vector withLaneHelper(int i, long e) { + public LongVector128 withLaneHelper(int i, long e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -556,19 +561,20 @@ final class Long128Vector extends LongVector { // Mask - static final class Long128Mask extends AbstractMask { + static final class LongMask128 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long128Mask(boolean[] bits) { + static final Class CTYPE = long.class; // used by the JVM + + LongMask128(boolean[] bits) { this(bits, 0); } - Long128Mask(boolean[] bits, int offset) { + LongMask128(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Long128Mask(boolean val) { + LongMask128(boolean val) { super(prepare(val)); } @@ -601,31 +607,31 @@ final class Long128Vector extends LongVector { } @Override - Long128Mask uOp(MUnOp f) { + LongMask128 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Long128Mask(res); + return new LongMask128(res); } @Override - Long128Mask bOp(VectorMask m, MBinOp f) { + LongMask128 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Long128Mask)m).getBits(); + boolean[] mbits = ((LongMask128)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Long128Mask(res); + return new LongMask128(res); } @ForceInline @Override public final - Long128Vector toVector() { - return (Long128Vector) super.toVectorTemplate(); // specialize + LongVector128 toVector() { + return (LongVector128) super.toVectorTemplate(); // specialize } /** @@ -658,25 +664,25 @@ final class Long128Vector extends LongVector { @Override @ForceInline /*package-private*/ - Long128Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Long128Mask) VectorSupport.indexPartiallyInUpperRange( - Long128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Long128Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + LongMask128 indexPartiallyInUpperRange(long offset, long limit) { + return (LongMask128) VectorSupport.indexPartiallyInUpperRange( + LongMask128.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (LongMask128) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Long128Mask not() { + public LongMask128 not() { return xor(maskAll(true)); } @Override @ForceInline - public Long128Mask compress() { - return (Long128Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Long128Vector.class, Long128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public LongMask128 compress() { + return (LongMask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + LongVector128.class, LongMask128.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -685,30 +691,30 @@ final class Long128Vector extends LongVector { @Override @ForceInline - public Long128Mask and(VectorMask mask) { + public LongMask128 and(VectorMask mask) { Objects.requireNonNull(mask); - Long128Mask m = (Long128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask128 m = (LongMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, LongMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Long128Mask or(VectorMask mask) { + public LongMask128 or(VectorMask mask) { Objects.requireNonNull(mask); - Long128Mask m = (Long128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask128 m = (LongMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, LongMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Long128Mask xor(VectorMask mask) { + public LongMask128 xor(VectorMask mask) { Objects.requireNonNull(mask); - Long128Mask m = (Long128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask128 m = (LongMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -718,21 +724,21 @@ final class Long128Vector extends LongVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -742,7 +748,7 @@ final class Long128Vector extends LongVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -752,7 +758,7 @@ final class Long128Vector extends LongVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Long128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(LongMask128.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -761,48 +767,49 @@ final class Long128Vector extends LongVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Long128Mask)m).getBits())); + (m, __) -> anyTrueHelper(((LongMask128)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Long128Mask)m).getBits())); + (m, __) -> allTrueHelper(((LongMask128)m).getBits())); } @ForceInline /*package-private*/ - static Long128Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Long128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static LongMask128 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(LongMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Long128Mask TRUE_MASK = new Long128Mask(true); - private static final Long128Mask FALSE_MASK = new Long128Mask(false); + private static final LongMask128 TRUE_MASK = new LongMask128(true); + private static final LongMask128 FALSE_MASK = new LongMask128(false); } // Shuffle - static final class Long128Shuffle extends AbstractShuffle { + static final class LongShuffle128 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long128Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + LongShuffle128(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Long128Shuffle(int[] indices, int i) { + LongShuffle128(int[] indices, int i) { this(prepare(indices, i)); } - Long128Shuffle(IntUnaryOperator fn) { + LongShuffle128(IntUnaryOperator fn) { this(prepare(fn)); } @@ -822,23 +829,23 @@ final class Long128Vector extends LongVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Long128Shuffle IOTA = new Long128Shuffle(IDENTITY); + static final LongShuffle128 IOTA = new LongShuffle128(IDENTITY); @Override @ForceInline - public Long128Vector toVector() { + public LongVector128 toVector() { return toBitsVector(); } @Override @ForceInline - Long128Vector toBitsVector() { - return (Long128Vector) super.toBitsVectorTemplate(); + LongVector128 toBitsVector() { + return (LongVector128) super.toBitsVectorTemplate(); } @Override - Long128Vector toBitsVector0() { - return ((Long128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector128 toBitsVector0() { + return ((LongVector128) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -910,30 +917,30 @@ final class Long128Vector extends LongVector { @Override @ForceInline - public final Long128Mask laneIsValid() { - return (Long128Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final LongMask128 laneIsValid() { + return (LongMask128) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Long128Shuffle rearrange(VectorShuffle shuffle) { - Long128Shuffle concreteShuffle = (Long128Shuffle) shuffle; - return (Long128Shuffle) toBitsVector().rearrange(concreteShuffle) + public final LongShuffle128 rearrange(VectorShuffle shuffle) { + LongShuffle128 concreteShuffle = (LongShuffle128) shuffle; + return (LongShuffle128) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Long128Shuffle wrapIndexes() { - Long128Vector v = toBitsVector(); + public final LongShuffle128 wrapIndexes() { + LongVector128 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long128Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector128) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector128) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Long128Shuffle) v.toShuffle(vspecies(), false); + return (LongShuffle128) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -984,14 +991,14 @@ final class Long128Vector extends LongVector { @Override final LongVector fromArray0(long[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Long128Mask.class, a, offset, (Long128Mask) m, offsetInRange); // specialize + return super.fromArray0Template(LongMask128.class, a, offset, (LongMask128) m, offsetInRange); // specialize } @ForceInline @Override final LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m); + return super.fromArray0Template(LongMask128.class, a, offset, indexMap, mapOffset, (LongMask128) m); } @@ -1007,7 +1014,7 @@ final class Long128Vector extends LongVector { @Override final LongVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Long128Mask.class, ms, offset, (Long128Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(LongMask128.class, ms, offset, (LongMask128) m, offsetInRange); // specialize } @ForceInline @@ -1021,14 +1028,14 @@ final class Long128Vector extends LongVector { @Override final void intoArray0(long[] a, int offset, VectorMask m) { - super.intoArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); + super.intoArray0Template(LongMask128.class, a, offset, (LongMask128) m); } @ForceInline @Override final void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m); + super.intoArray0Template(LongMask128.class, a, offset, indexMap, mapOffset, (LongMask128) m); } @@ -1036,7 +1043,7 @@ final class Long128Vector extends LongVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Long128Mask.class, ms, offset, (Long128Mask) m); + super.intoMemorySegment0Template(LongMask128.class, ms, offset, (LongMask128) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector256.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector256.java index b3e7022771c..144e2c1c64d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector256.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Long256Vector extends LongVector { +final class LongVector256 extends LongVector { static final LongSpecies VSPECIES = (LongSpecies) LongVector.SPECIES_256; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Long256Vector.class; + static final Class VCLASS = LongVector256.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = long.class; // carrier type used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Long256Vector(long[] v) { + LongVector256(long[] v) { super(v); } - // For compatibility as Long256Vector::new, + // For compatibility as LongVector256::new, // stored into species.vectorFactory. - Long256Vector(Object v) { + LongVector256(Object v) { this((long[]) v); } - static final Long256Vector ZERO = new Long256Vector(new long[VLENGTH]); - static final Long256Vector IOTA = new Long256Vector(VSPECIES.iotaArray()); + static final LongVector256 ZERO = new LongVector256(new long[VLENGTH]); + static final LongVector256 IOTA = new LongVector256(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Long256Vector extends LongVector { @Override public final Class elementType() { return long.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Long.SIZE; } @@ -130,46 +135,46 @@ final class Long256Vector extends LongVector { @Override @ForceInline - public final Long256Vector broadcast(long e) { - return (Long256Vector) super.broadcastTemplate(e); // specialize + public final LongVector256 broadcast(long e) { + return (LongVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Long256Mask maskFromArray(boolean[] bits) { - return new Long256Mask(bits); + LongMask256 maskFromArray(boolean[] bits) { + return new LongMask256(bits); } @Override @ForceInline - Long256Shuffle iotaShuffle() { return Long256Shuffle.IOTA; } + LongShuffle256 iotaShuffle() { return LongShuffle256.IOTA; } @Override @ForceInline - Long256Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Long256Shuffle) iotaShuffleTemplate(start, step, wrap); + LongShuffle256 iotaShuffle(int start, int step, boolean wrap) { + return (LongShuffle256) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long256Shuffle shuffleFromArray(int[] indices, int i) { return new Long256Shuffle(indices, i); } + LongShuffle256 shuffleFromArray(int[] indices, int i) { return new LongShuffle256(indices, i); } @Override @ForceInline - Long256Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Long256Shuffle(fn); } + LongShuffle256 shuffleFromOp(IntUnaryOperator fn) { return new LongShuffle256(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Long256Vector vectorFactory(long[] vec) { - return new Long256Vector(vec); + LongVector256 vectorFactory(long[] vec) { + return new LongVector256(vec); } @ForceInline final @Override - Byte256Vector asByteVectorRaw() { - return (Byte256Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector256 asByteVectorRaw() { + return (ByteVector256) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -182,31 +187,31 @@ final class Long256Vector extends LongVector { @ForceInline final @Override - Long256Vector uOp(FUnOp f) { - return (Long256Vector) super.uOpTemplate(f); // specialize + LongVector256 uOp(FUnOp f) { + return (LongVector256) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Long256Vector uOp(VectorMask m, FUnOp f) { - return (Long256Vector) - super.uOpTemplate((Long256Mask)m, f); // specialize + LongVector256 uOp(VectorMask m, FUnOp f) { + return (LongVector256) + super.uOpTemplate((LongMask256)m, f); // specialize } // Binary operator @ForceInline final @Override - Long256Vector bOp(Vector v, FBinOp f) { - return (Long256Vector) super.bOpTemplate((Long256Vector)v, f); // specialize + LongVector256 bOp(Vector v, FBinOp f) { + return (LongVector256) super.bOpTemplate((LongVector256)v, f); // specialize } @ForceInline final @Override - Long256Vector bOp(Vector v, + LongVector256 bOp(Vector v, VectorMask m, FBinOp f) { - return (Long256Vector) - super.bOpTemplate((Long256Vector)v, (Long256Mask)m, + return (LongVector256) + super.bOpTemplate((LongVector256)v, (LongMask256)m, f); // specialize } @@ -214,19 +219,19 @@ final class Long256Vector extends LongVector { @ForceInline final @Override - Long256Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Long256Vector) - super.tOpTemplate((Long256Vector)v1, (Long256Vector)v2, + LongVector256 tOp(Vector v1, Vector v2, FTriOp f) { + return (LongVector256) + super.tOpTemplate((LongVector256)v1, (LongVector256)v2, f); // specialize } @ForceInline final @Override - Long256Vector tOp(Vector v1, Vector v2, + LongVector256 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Long256Vector) - super.tOpTemplate((Long256Vector)v1, (Long256Vector)v2, - (Long256Mask)m, f); // specialize + return (LongVector256) + super.tOpTemplate((LongVector256)v1, (LongVector256)v2, + (LongMask256)m, f); // specialize } @ForceInline @@ -264,64 +269,64 @@ final class Long256Vector extends LongVector { @Override @ForceInline - public Long256Vector lanewise(Unary op) { - return (Long256Vector) super.lanewiseTemplate(op); // specialize + public LongVector256 lanewise(Unary op) { + return (LongVector256) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Long256Vector lanewise(Unary op, VectorMask m) { - return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, (Long256Mask) m); // specialize + public LongVector256 lanewise(Unary op, VectorMask m) { + return (LongVector256) super.lanewiseTemplate(op, LongMask256.class, (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector lanewise(Binary op, Vector v) { - return (Long256Vector) super.lanewiseTemplate(op, v); // specialize + public LongVector256 lanewise(Binary op, Vector v) { + return (LongVector256) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Long256Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, v, (Long256Mask) m); // specialize + public LongVector256 lanewise(Binary op, Vector v, VectorMask m) { + return (LongVector256) super.lanewiseTemplate(op, LongMask256.class, v, (LongMask256) m); // specialize } /*package-private*/ @Override - @ForceInline Long256Vector + @ForceInline LongVector256 lanewiseShift(VectorOperators.Binary op, int e) { - return (Long256Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (LongVector256) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Long256Vector + @ForceInline LongVector256 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Long256Vector) super.lanewiseShiftTemplate(op, Long256Mask.class, e, (Long256Mask) m); // specialize + return (LongVector256) super.lanewiseShiftTemplate(op, LongMask256.class, e, (LongMask256) m); // specialize } /*package-private*/ @Override @ForceInline public final - Long256Vector + LongVector256 lanewise(Ternary op, Vector v1, Vector v2) { - return (Long256Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (LongVector256) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Long256Vector + LongVector256 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, v1, v2, (Long256Mask) m); // specialize + return (LongVector256) super.lanewiseTemplate(op, LongMask256.class, v1, v2, (LongMask256) m); // specialize } @Override @ForceInline public final - Long256Vector addIndex(int scale) { - return (Long256Vector) super.addIndexTemplate(scale); // specialize + LongVector256 addIndex(int scale) { + return (LongVector256) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -336,7 +341,7 @@ final class Long256Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized + return super.reduceLanesTemplate(op, LongMask256.class, (LongMask256) m); // specialized } @Override @@ -349,7 +354,7 @@ final class Long256Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, LongMask256.class, (LongMask256) m); // specialized } @Override @@ -360,155 +365,155 @@ final class Long256Vector extends LongVector { @Override @ForceInline - public final Long256Shuffle toShuffle() { - return (Long256Shuffle) toShuffle(vspecies(), false); + public final LongShuffle256 toShuffle() { + return (LongShuffle256) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Long256Mask test(Test op) { - return super.testTemplate(Long256Mask.class, op); // specialize + public final LongMask256 test(Test op) { + return super.testTemplate(LongMask256.class, op); // specialize } @Override @ForceInline - public final Long256Mask test(Test op, VectorMask m) { - return super.testTemplate(Long256Mask.class, op, (Long256Mask) m); // specialize + public final LongMask256 test(Test op, VectorMask m) { + return super.testTemplate(LongMask256.class, op, (LongMask256) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Long256Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Long256Mask.class, op, v); // specialize + public final LongMask256 compare(Comparison op, Vector v) { + return super.compareTemplate(LongMask256.class, op, v); // specialize } @Override @ForceInline - public final Long256Mask compare(Comparison op, long s) { - return super.compareTemplate(Long256Mask.class, op, s); // specialize + public final LongMask256 compare(Comparison op, long s) { + return super.compareTemplate(LongMask256.class, op, s); // specialize } @Override @ForceInline - public final Long256Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Long256Mask.class, op, v, (Long256Mask) m); + public final LongMask256 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(LongMask256.class, op, v, (LongMask256) m); } @Override @ForceInline - public Long256Vector blend(Vector v, VectorMask m) { - return (Long256Vector) - super.blendTemplate(Long256Mask.class, - (Long256Vector) v, - (Long256Mask) m); // specialize + public LongVector256 blend(Vector v, VectorMask m) { + return (LongVector256) + super.blendTemplate(LongMask256.class, + (LongVector256) v, + (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector slice(int origin, Vector v) { - return (Long256Vector) super.sliceTemplate(origin, v); // specialize + public LongVector256 slice(int origin, Vector v) { + return (LongVector256) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Long256Vector slice(int origin) { - return (Long256Vector) super.sliceTemplate(origin); // specialize + public LongVector256 slice(int origin) { + return (LongVector256) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Long256Vector unslice(int origin, Vector w, int part) { - return (Long256Vector) super.unsliceTemplate(origin, w, part); // specialize + public LongVector256 unslice(int origin, Vector w, int part) { + return (LongVector256) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Long256Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Long256Vector) - super.unsliceTemplate(Long256Mask.class, + public LongVector256 unslice(int origin, Vector w, int part, VectorMask m) { + return (LongVector256) + super.unsliceTemplate(LongMask256.class, origin, w, part, - (Long256Mask) m); // specialize + (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector unslice(int origin) { - return (Long256Vector) super.unsliceTemplate(origin); // specialize + public LongVector256 unslice(int origin) { + return (LongVector256) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Long256Vector rearrange(VectorShuffle s) { - return (Long256Vector) - super.rearrangeTemplate(Long256Shuffle.class, - (Long256Shuffle) s); // specialize + public LongVector256 rearrange(VectorShuffle s) { + return (LongVector256) + super.rearrangeTemplate(LongShuffle256.class, + (LongShuffle256) s); // specialize } @Override @ForceInline - public Long256Vector rearrange(VectorShuffle shuffle, + public LongVector256 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Long256Vector) - super.rearrangeTemplate(Long256Shuffle.class, - Long256Mask.class, - (Long256Shuffle) shuffle, - (Long256Mask) m); // specialize + return (LongVector256) + super.rearrangeTemplate(LongShuffle256.class, + LongMask256.class, + (LongShuffle256) shuffle, + (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector rearrange(VectorShuffle s, + public LongVector256 rearrange(VectorShuffle s, Vector v) { - return (Long256Vector) - super.rearrangeTemplate(Long256Shuffle.class, - (Long256Shuffle) s, - (Long256Vector) v); // specialize + return (LongVector256) + super.rearrangeTemplate(LongShuffle256.class, + (LongShuffle256) s, + (LongVector256) v); // specialize } @Override @ForceInline - public Long256Vector compress(VectorMask m) { - return (Long256Vector) - super.compressTemplate(Long256Mask.class, - (Long256Mask) m); // specialize + public LongVector256 compress(VectorMask m) { + return (LongVector256) + super.compressTemplate(LongMask256.class, + (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector expand(VectorMask m) { - return (Long256Vector) - super.expandTemplate(Long256Mask.class, - (Long256Mask) m); // specialize + public LongVector256 expand(VectorMask m) { + return (LongVector256) + super.expandTemplate(LongMask256.class, + (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector selectFrom(Vector v) { - return (Long256Vector) - super.selectFromTemplate((Long256Vector) v); // specialize + public LongVector256 selectFrom(Vector v) { + return (LongVector256) + super.selectFromTemplate((LongVector256) v); // specialize } @Override @ForceInline - public Long256Vector selectFrom(Vector v, + public LongVector256 selectFrom(Vector v, VectorMask m) { - return (Long256Vector) - super.selectFromTemplate((Long256Vector) v, - Long256Mask.class, (Long256Mask) m); // specialize + return (LongVector256) + super.selectFromTemplate((LongVector256) v, + LongMask256.class, (LongMask256) m); // specialize } @Override @ForceInline - public Long256Vector selectFrom(Vector v1, + public LongVector256 selectFrom(Vector v1, Vector v2) { - return (Long256Vector) - super.selectFromTemplate((Long256Vector) v1, (Long256Vector) v2); // specialize + return (LongVector256) + super.selectFromTemplate((LongVector256) v1, (LongVector256) v2); // specialize } @ForceInline @@ -536,7 +541,7 @@ final class Long256Vector extends LongVector { @ForceInline @Override - public Long256Vector withLane(int i, long e) { + public LongVector256 withLane(int i, long e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -547,7 +552,7 @@ final class Long256Vector extends LongVector { } @ForceInline - public Long256Vector withLaneHelper(int i, long e) { + public LongVector256 withLaneHelper(int i, long e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -560,19 +565,20 @@ final class Long256Vector extends LongVector { // Mask - static final class Long256Mask extends AbstractMask { + static final class LongMask256 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long256Mask(boolean[] bits) { + static final Class CTYPE = long.class; // used by the JVM + + LongMask256(boolean[] bits) { this(bits, 0); } - Long256Mask(boolean[] bits, int offset) { + LongMask256(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Long256Mask(boolean val) { + LongMask256(boolean val) { super(prepare(val)); } @@ -605,31 +611,31 @@ final class Long256Vector extends LongVector { } @Override - Long256Mask uOp(MUnOp f) { + LongMask256 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Long256Mask(res); + return new LongMask256(res); } @Override - Long256Mask bOp(VectorMask m, MBinOp f) { + LongMask256 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Long256Mask)m).getBits(); + boolean[] mbits = ((LongMask256)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Long256Mask(res); + return new LongMask256(res); } @ForceInline @Override public final - Long256Vector toVector() { - return (Long256Vector) super.toVectorTemplate(); // specialize + LongVector256 toVector() { + return (LongVector256) super.toVectorTemplate(); // specialize } /** @@ -662,25 +668,25 @@ final class Long256Vector extends LongVector { @Override @ForceInline /*package-private*/ - Long256Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Long256Mask) VectorSupport.indexPartiallyInUpperRange( - Long256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Long256Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + LongMask256 indexPartiallyInUpperRange(long offset, long limit) { + return (LongMask256) VectorSupport.indexPartiallyInUpperRange( + LongMask256.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (LongMask256) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Long256Mask not() { + public LongMask256 not() { return xor(maskAll(true)); } @Override @ForceInline - public Long256Mask compress() { - return (Long256Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Long256Vector.class, Long256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public LongMask256 compress() { + return (LongMask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + LongVector256.class, LongMask256.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -689,30 +695,30 @@ final class Long256Vector extends LongVector { @Override @ForceInline - public Long256Mask and(VectorMask mask) { + public LongMask256 and(VectorMask mask) { Objects.requireNonNull(mask); - Long256Mask m = (Long256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask256 m = (LongMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, LongMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Long256Mask or(VectorMask mask) { + public LongMask256 or(VectorMask mask) { Objects.requireNonNull(mask); - Long256Mask m = (Long256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask256 m = (LongMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, LongMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Long256Mask xor(VectorMask mask) { + public LongMask256 xor(VectorMask mask) { Objects.requireNonNull(mask); - Long256Mask m = (Long256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask256 m = (LongMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -722,21 +728,21 @@ final class Long256Vector extends LongVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -746,7 +752,7 @@ final class Long256Vector extends LongVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -756,7 +762,7 @@ final class Long256Vector extends LongVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Long256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(LongMask256.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -765,48 +771,49 @@ final class Long256Vector extends LongVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Long256Mask)m).getBits())); + (m, __) -> anyTrueHelper(((LongMask256)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Long256Mask)m).getBits())); + (m, __) -> allTrueHelper(((LongMask256)m).getBits())); } @ForceInline /*package-private*/ - static Long256Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Long256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static LongMask256 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(LongMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Long256Mask TRUE_MASK = new Long256Mask(true); - private static final Long256Mask FALSE_MASK = new Long256Mask(false); + private static final LongMask256 TRUE_MASK = new LongMask256(true); + private static final LongMask256 FALSE_MASK = new LongMask256(false); } // Shuffle - static final class Long256Shuffle extends AbstractShuffle { + static final class LongShuffle256 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long256Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + LongShuffle256(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Long256Shuffle(int[] indices, int i) { + LongShuffle256(int[] indices, int i) { this(prepare(indices, i)); } - Long256Shuffle(IntUnaryOperator fn) { + LongShuffle256(IntUnaryOperator fn) { this(prepare(fn)); } @@ -826,23 +833,23 @@ final class Long256Vector extends LongVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Long256Shuffle IOTA = new Long256Shuffle(IDENTITY); + static final LongShuffle256 IOTA = new LongShuffle256(IDENTITY); @Override @ForceInline - public Long256Vector toVector() { + public LongVector256 toVector() { return toBitsVector(); } @Override @ForceInline - Long256Vector toBitsVector() { - return (Long256Vector) super.toBitsVectorTemplate(); + LongVector256 toBitsVector() { + return (LongVector256) super.toBitsVectorTemplate(); } @Override - Long256Vector toBitsVector0() { - return ((Long256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector256 toBitsVector0() { + return ((LongVector256) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -914,30 +921,30 @@ final class Long256Vector extends LongVector { @Override @ForceInline - public final Long256Mask laneIsValid() { - return (Long256Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final LongMask256 laneIsValid() { + return (LongMask256) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Long256Shuffle rearrange(VectorShuffle shuffle) { - Long256Shuffle concreteShuffle = (Long256Shuffle) shuffle; - return (Long256Shuffle) toBitsVector().rearrange(concreteShuffle) + public final LongShuffle256 rearrange(VectorShuffle shuffle) { + LongShuffle256 concreteShuffle = (LongShuffle256) shuffle; + return (LongShuffle256) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Long256Shuffle wrapIndexes() { - Long256Vector v = toBitsVector(); + public final LongShuffle256 wrapIndexes() { + LongVector256 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long256Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector256) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector256) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Long256Shuffle) v.toShuffle(vspecies(), false); + return (LongShuffle256) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -988,14 +995,14 @@ final class Long256Vector extends LongVector { @Override final LongVector fromArray0(long[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Long256Mask.class, a, offset, (Long256Mask) m, offsetInRange); // specialize + return super.fromArray0Template(LongMask256.class, a, offset, (LongMask256) m, offsetInRange); // specialize } @ForceInline @Override final LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Long256Mask.class, a, offset, indexMap, mapOffset, (Long256Mask) m); + return super.fromArray0Template(LongMask256.class, a, offset, indexMap, mapOffset, (LongMask256) m); } @@ -1011,7 +1018,7 @@ final class Long256Vector extends LongVector { @Override final LongVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Long256Mask.class, ms, offset, (Long256Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(LongMask256.class, ms, offset, (LongMask256) m, offsetInRange); // specialize } @ForceInline @@ -1025,14 +1032,14 @@ final class Long256Vector extends LongVector { @Override final void intoArray0(long[] a, int offset, VectorMask m) { - super.intoArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); + super.intoArray0Template(LongMask256.class, a, offset, (LongMask256) m); } @ForceInline @Override final void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Long256Mask.class, a, offset, indexMap, mapOffset, (Long256Mask) m); + super.intoArray0Template(LongMask256.class, a, offset, indexMap, mapOffset, (LongMask256) m); } @@ -1040,7 +1047,7 @@ final class Long256Vector extends LongVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Long256Mask.class, ms, offset, (Long256Mask) m); + super.intoMemorySegment0Template(LongMask256.class, ms, offset, (LongMask256) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector512.java similarity index 68% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector512.java index 169664bc242..b49d0c7c147 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector512.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Long512Vector extends LongVector { +final class LongVector512 extends LongVector { static final LongSpecies VSPECIES = (LongSpecies) LongVector.SPECIES_512; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Long512Vector.class; + static final Class VCLASS = LongVector512.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = long.class; // carrier type used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Long512Vector(long[] v) { + LongVector512(long[] v) { super(v); } - // For compatibility as Long512Vector::new, + // For compatibility as LongVector512::new, // stored into species.vectorFactory. - Long512Vector(Object v) { + LongVector512(Object v) { this((long[]) v); } - static final Long512Vector ZERO = new Long512Vector(new long[VLENGTH]); - static final Long512Vector IOTA = new Long512Vector(VSPECIES.iotaArray()); + static final LongVector512 ZERO = new LongVector512(new long[VLENGTH]); + static final LongVector512 IOTA = new LongVector512(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Long512Vector extends LongVector { @Override public final Class elementType() { return long.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Long.SIZE; } @@ -130,46 +135,46 @@ final class Long512Vector extends LongVector { @Override @ForceInline - public final Long512Vector broadcast(long e) { - return (Long512Vector) super.broadcastTemplate(e); // specialize + public final LongVector512 broadcast(long e) { + return (LongVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Long512Mask maskFromArray(boolean[] bits) { - return new Long512Mask(bits); + LongMask512 maskFromArray(boolean[] bits) { + return new LongMask512(bits); } @Override @ForceInline - Long512Shuffle iotaShuffle() { return Long512Shuffle.IOTA; } + LongShuffle512 iotaShuffle() { return LongShuffle512.IOTA; } @Override @ForceInline - Long512Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Long512Shuffle) iotaShuffleTemplate(start, step, wrap); + LongShuffle512 iotaShuffle(int start, int step, boolean wrap) { + return (LongShuffle512) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long512Shuffle shuffleFromArray(int[] indices, int i) { return new Long512Shuffle(indices, i); } + LongShuffle512 shuffleFromArray(int[] indices, int i) { return new LongShuffle512(indices, i); } @Override @ForceInline - Long512Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Long512Shuffle(fn); } + LongShuffle512 shuffleFromOp(IntUnaryOperator fn) { return new LongShuffle512(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Long512Vector vectorFactory(long[] vec) { - return new Long512Vector(vec); + LongVector512 vectorFactory(long[] vec) { + return new LongVector512(vec); } @ForceInline final @Override - Byte512Vector asByteVectorRaw() { - return (Byte512Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector512 asByteVectorRaw() { + return (ByteVector512) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -182,31 +187,31 @@ final class Long512Vector extends LongVector { @ForceInline final @Override - Long512Vector uOp(FUnOp f) { - return (Long512Vector) super.uOpTemplate(f); // specialize + LongVector512 uOp(FUnOp f) { + return (LongVector512) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Long512Vector uOp(VectorMask m, FUnOp f) { - return (Long512Vector) - super.uOpTemplate((Long512Mask)m, f); // specialize + LongVector512 uOp(VectorMask m, FUnOp f) { + return (LongVector512) + super.uOpTemplate((LongMask512)m, f); // specialize } // Binary operator @ForceInline final @Override - Long512Vector bOp(Vector v, FBinOp f) { - return (Long512Vector) super.bOpTemplate((Long512Vector)v, f); // specialize + LongVector512 bOp(Vector v, FBinOp f) { + return (LongVector512) super.bOpTemplate((LongVector512)v, f); // specialize } @ForceInline final @Override - Long512Vector bOp(Vector v, + LongVector512 bOp(Vector v, VectorMask m, FBinOp f) { - return (Long512Vector) - super.bOpTemplate((Long512Vector)v, (Long512Mask)m, + return (LongVector512) + super.bOpTemplate((LongVector512)v, (LongMask512)m, f); // specialize } @@ -214,19 +219,19 @@ final class Long512Vector extends LongVector { @ForceInline final @Override - Long512Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Long512Vector) - super.tOpTemplate((Long512Vector)v1, (Long512Vector)v2, + LongVector512 tOp(Vector v1, Vector v2, FTriOp f) { + return (LongVector512) + super.tOpTemplate((LongVector512)v1, (LongVector512)v2, f); // specialize } @ForceInline final @Override - Long512Vector tOp(Vector v1, Vector v2, + LongVector512 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Long512Vector) - super.tOpTemplate((Long512Vector)v1, (Long512Vector)v2, - (Long512Mask)m, f); // specialize + return (LongVector512) + super.tOpTemplate((LongVector512)v1, (LongVector512)v2, + (LongMask512)m, f); // specialize } @ForceInline @@ -264,64 +269,64 @@ final class Long512Vector extends LongVector { @Override @ForceInline - public Long512Vector lanewise(Unary op) { - return (Long512Vector) super.lanewiseTemplate(op); // specialize + public LongVector512 lanewise(Unary op) { + return (LongVector512) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Long512Vector lanewise(Unary op, VectorMask m) { - return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, (Long512Mask) m); // specialize + public LongVector512 lanewise(Unary op, VectorMask m) { + return (LongVector512) super.lanewiseTemplate(op, LongMask512.class, (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector lanewise(Binary op, Vector v) { - return (Long512Vector) super.lanewiseTemplate(op, v); // specialize + public LongVector512 lanewise(Binary op, Vector v) { + return (LongVector512) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Long512Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, v, (Long512Mask) m); // specialize + public LongVector512 lanewise(Binary op, Vector v, VectorMask m) { + return (LongVector512) super.lanewiseTemplate(op, LongMask512.class, v, (LongMask512) m); // specialize } /*package-private*/ @Override - @ForceInline Long512Vector + @ForceInline LongVector512 lanewiseShift(VectorOperators.Binary op, int e) { - return (Long512Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (LongVector512) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Long512Vector + @ForceInline LongVector512 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Long512Vector) super.lanewiseShiftTemplate(op, Long512Mask.class, e, (Long512Mask) m); // specialize + return (LongVector512) super.lanewiseShiftTemplate(op, LongMask512.class, e, (LongMask512) m); // specialize } /*package-private*/ @Override @ForceInline public final - Long512Vector + LongVector512 lanewise(Ternary op, Vector v1, Vector v2) { - return (Long512Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (LongVector512) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Long512Vector + LongVector512 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, v1, v2, (Long512Mask) m); // specialize + return (LongVector512) super.lanewiseTemplate(op, LongMask512.class, v1, v2, (LongMask512) m); // specialize } @Override @ForceInline public final - Long512Vector addIndex(int scale) { - return (Long512Vector) super.addIndexTemplate(scale); // specialize + LongVector512 addIndex(int scale) { + return (LongVector512) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -336,7 +341,7 @@ final class Long512Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized + return super.reduceLanesTemplate(op, LongMask512.class, (LongMask512) m); // specialized } @Override @@ -349,7 +354,7 @@ final class Long512Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, LongMask512.class, (LongMask512) m); // specialized } @Override @@ -360,155 +365,155 @@ final class Long512Vector extends LongVector { @Override @ForceInline - public final Long512Shuffle toShuffle() { - return (Long512Shuffle) toShuffle(vspecies(), false); + public final LongShuffle512 toShuffle() { + return (LongShuffle512) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Long512Mask test(Test op) { - return super.testTemplate(Long512Mask.class, op); // specialize + public final LongMask512 test(Test op) { + return super.testTemplate(LongMask512.class, op); // specialize } @Override @ForceInline - public final Long512Mask test(Test op, VectorMask m) { - return super.testTemplate(Long512Mask.class, op, (Long512Mask) m); // specialize + public final LongMask512 test(Test op, VectorMask m) { + return super.testTemplate(LongMask512.class, op, (LongMask512) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Long512Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Long512Mask.class, op, v); // specialize + public final LongMask512 compare(Comparison op, Vector v) { + return super.compareTemplate(LongMask512.class, op, v); // specialize } @Override @ForceInline - public final Long512Mask compare(Comparison op, long s) { - return super.compareTemplate(Long512Mask.class, op, s); // specialize + public final LongMask512 compare(Comparison op, long s) { + return super.compareTemplate(LongMask512.class, op, s); // specialize } @Override @ForceInline - public final Long512Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Long512Mask.class, op, v, (Long512Mask) m); + public final LongMask512 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(LongMask512.class, op, v, (LongMask512) m); } @Override @ForceInline - public Long512Vector blend(Vector v, VectorMask m) { - return (Long512Vector) - super.blendTemplate(Long512Mask.class, - (Long512Vector) v, - (Long512Mask) m); // specialize + public LongVector512 blend(Vector v, VectorMask m) { + return (LongVector512) + super.blendTemplate(LongMask512.class, + (LongVector512) v, + (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector slice(int origin, Vector v) { - return (Long512Vector) super.sliceTemplate(origin, v); // specialize + public LongVector512 slice(int origin, Vector v) { + return (LongVector512) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Long512Vector slice(int origin) { - return (Long512Vector) super.sliceTemplate(origin); // specialize + public LongVector512 slice(int origin) { + return (LongVector512) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Long512Vector unslice(int origin, Vector w, int part) { - return (Long512Vector) super.unsliceTemplate(origin, w, part); // specialize + public LongVector512 unslice(int origin, Vector w, int part) { + return (LongVector512) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Long512Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Long512Vector) - super.unsliceTemplate(Long512Mask.class, + public LongVector512 unslice(int origin, Vector w, int part, VectorMask m) { + return (LongVector512) + super.unsliceTemplate(LongMask512.class, origin, w, part, - (Long512Mask) m); // specialize + (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector unslice(int origin) { - return (Long512Vector) super.unsliceTemplate(origin); // specialize + public LongVector512 unslice(int origin) { + return (LongVector512) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Long512Vector rearrange(VectorShuffle s) { - return (Long512Vector) - super.rearrangeTemplate(Long512Shuffle.class, - (Long512Shuffle) s); // specialize + public LongVector512 rearrange(VectorShuffle s) { + return (LongVector512) + super.rearrangeTemplate(LongShuffle512.class, + (LongShuffle512) s); // specialize } @Override @ForceInline - public Long512Vector rearrange(VectorShuffle shuffle, + public LongVector512 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Long512Vector) - super.rearrangeTemplate(Long512Shuffle.class, - Long512Mask.class, - (Long512Shuffle) shuffle, - (Long512Mask) m); // specialize + return (LongVector512) + super.rearrangeTemplate(LongShuffle512.class, + LongMask512.class, + (LongShuffle512) shuffle, + (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector rearrange(VectorShuffle s, + public LongVector512 rearrange(VectorShuffle s, Vector v) { - return (Long512Vector) - super.rearrangeTemplate(Long512Shuffle.class, - (Long512Shuffle) s, - (Long512Vector) v); // specialize + return (LongVector512) + super.rearrangeTemplate(LongShuffle512.class, + (LongShuffle512) s, + (LongVector512) v); // specialize } @Override @ForceInline - public Long512Vector compress(VectorMask m) { - return (Long512Vector) - super.compressTemplate(Long512Mask.class, - (Long512Mask) m); // specialize + public LongVector512 compress(VectorMask m) { + return (LongVector512) + super.compressTemplate(LongMask512.class, + (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector expand(VectorMask m) { - return (Long512Vector) - super.expandTemplate(Long512Mask.class, - (Long512Mask) m); // specialize + public LongVector512 expand(VectorMask m) { + return (LongVector512) + super.expandTemplate(LongMask512.class, + (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector selectFrom(Vector v) { - return (Long512Vector) - super.selectFromTemplate((Long512Vector) v); // specialize + public LongVector512 selectFrom(Vector v) { + return (LongVector512) + super.selectFromTemplate((LongVector512) v); // specialize } @Override @ForceInline - public Long512Vector selectFrom(Vector v, + public LongVector512 selectFrom(Vector v, VectorMask m) { - return (Long512Vector) - super.selectFromTemplate((Long512Vector) v, - Long512Mask.class, (Long512Mask) m); // specialize + return (LongVector512) + super.selectFromTemplate((LongVector512) v, + LongMask512.class, (LongMask512) m); // specialize } @Override @ForceInline - public Long512Vector selectFrom(Vector v1, + public LongVector512 selectFrom(Vector v1, Vector v2) { - return (Long512Vector) - super.selectFromTemplate((Long512Vector) v1, (Long512Vector) v2); // specialize + return (LongVector512) + super.selectFromTemplate((LongVector512) v1, (LongVector512) v2); // specialize } @ForceInline @@ -540,7 +545,7 @@ final class Long512Vector extends LongVector { @ForceInline @Override - public Long512Vector withLane(int i, long e) { + public LongVector512 withLane(int i, long e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -555,7 +560,7 @@ final class Long512Vector extends LongVector { } @ForceInline - public Long512Vector withLaneHelper(int i, long e) { + public LongVector512 withLaneHelper(int i, long e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -568,19 +573,20 @@ final class Long512Vector extends LongVector { // Mask - static final class Long512Mask extends AbstractMask { + static final class LongMask512 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long512Mask(boolean[] bits) { + static final Class CTYPE = long.class; // used by the JVM + + LongMask512(boolean[] bits) { this(bits, 0); } - Long512Mask(boolean[] bits, int offset) { + LongMask512(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Long512Mask(boolean val) { + LongMask512(boolean val) { super(prepare(val)); } @@ -613,31 +619,31 @@ final class Long512Vector extends LongVector { } @Override - Long512Mask uOp(MUnOp f) { + LongMask512 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Long512Mask(res); + return new LongMask512(res); } @Override - Long512Mask bOp(VectorMask m, MBinOp f) { + LongMask512 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Long512Mask)m).getBits(); + boolean[] mbits = ((LongMask512)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Long512Mask(res); + return new LongMask512(res); } @ForceInline @Override public final - Long512Vector toVector() { - return (Long512Vector) super.toVectorTemplate(); // specialize + LongVector512 toVector() { + return (LongVector512) super.toVectorTemplate(); // specialize } /** @@ -670,25 +676,25 @@ final class Long512Vector extends LongVector { @Override @ForceInline /*package-private*/ - Long512Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Long512Mask) VectorSupport.indexPartiallyInUpperRange( - Long512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Long512Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + LongMask512 indexPartiallyInUpperRange(long offset, long limit) { + return (LongMask512) VectorSupport.indexPartiallyInUpperRange( + LongMask512.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (LongMask512) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Long512Mask not() { + public LongMask512 not() { return xor(maskAll(true)); } @Override @ForceInline - public Long512Mask compress() { - return (Long512Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Long512Vector.class, Long512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public LongMask512 compress() { + return (LongMask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + LongVector512.class, LongMask512.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -697,30 +703,30 @@ final class Long512Vector extends LongVector { @Override @ForceInline - public Long512Mask and(VectorMask mask) { + public LongMask512 and(VectorMask mask) { Objects.requireNonNull(mask); - Long512Mask m = (Long512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask512 m = (LongMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, LongMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Long512Mask or(VectorMask mask) { + public LongMask512 or(VectorMask mask) { Objects.requireNonNull(mask); - Long512Mask m = (Long512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask512 m = (LongMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, LongMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Long512Mask xor(VectorMask mask) { + public LongMask512 xor(VectorMask mask) { Objects.requireNonNull(mask); - Long512Mask m = (Long512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask512 m = (LongMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -730,21 +736,21 @@ final class Long512Vector extends LongVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -754,7 +760,7 @@ final class Long512Vector extends LongVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -764,7 +770,7 @@ final class Long512Vector extends LongVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Long512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(LongMask512.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -773,48 +779,49 @@ final class Long512Vector extends LongVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Long512Mask)m).getBits())); + (m, __) -> anyTrueHelper(((LongMask512)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Long512Mask)m).getBits())); + (m, __) -> allTrueHelper(((LongMask512)m).getBits())); } @ForceInline /*package-private*/ - static Long512Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Long512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static LongMask512 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(LongMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Long512Mask TRUE_MASK = new Long512Mask(true); - private static final Long512Mask FALSE_MASK = new Long512Mask(false); + private static final LongMask512 TRUE_MASK = new LongMask512(true); + private static final LongMask512 FALSE_MASK = new LongMask512(false); } // Shuffle - static final class Long512Shuffle extends AbstractShuffle { + static final class LongShuffle512 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long512Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + LongShuffle512(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Long512Shuffle(int[] indices, int i) { + LongShuffle512(int[] indices, int i) { this(prepare(indices, i)); } - Long512Shuffle(IntUnaryOperator fn) { + LongShuffle512(IntUnaryOperator fn) { this(prepare(fn)); } @@ -834,23 +841,23 @@ final class Long512Vector extends LongVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Long512Shuffle IOTA = new Long512Shuffle(IDENTITY); + static final LongShuffle512 IOTA = new LongShuffle512(IDENTITY); @Override @ForceInline - public Long512Vector toVector() { + public LongVector512 toVector() { return toBitsVector(); } @Override @ForceInline - Long512Vector toBitsVector() { - return (Long512Vector) super.toBitsVectorTemplate(); + LongVector512 toBitsVector() { + return (LongVector512) super.toBitsVectorTemplate(); } @Override - Long512Vector toBitsVector0() { - return ((Long512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector512 toBitsVector0() { + return ((LongVector512) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -922,30 +929,30 @@ final class Long512Vector extends LongVector { @Override @ForceInline - public final Long512Mask laneIsValid() { - return (Long512Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final LongMask512 laneIsValid() { + return (LongMask512) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Long512Shuffle rearrange(VectorShuffle shuffle) { - Long512Shuffle concreteShuffle = (Long512Shuffle) shuffle; - return (Long512Shuffle) toBitsVector().rearrange(concreteShuffle) + public final LongShuffle512 rearrange(VectorShuffle shuffle) { + LongShuffle512 concreteShuffle = (LongShuffle512) shuffle; + return (LongShuffle512) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Long512Shuffle wrapIndexes() { - Long512Vector v = toBitsVector(); + public final LongShuffle512 wrapIndexes() { + LongVector512 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long512Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector512) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector512) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Long512Shuffle) v.toShuffle(vspecies(), false); + return (LongShuffle512) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -996,14 +1003,14 @@ final class Long512Vector extends LongVector { @Override final LongVector fromArray0(long[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Long512Mask.class, a, offset, (Long512Mask) m, offsetInRange); // specialize + return super.fromArray0Template(LongMask512.class, a, offset, (LongMask512) m, offsetInRange); // specialize } @ForceInline @Override final LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Long512Mask.class, a, offset, indexMap, mapOffset, (Long512Mask) m); + return super.fromArray0Template(LongMask512.class, a, offset, indexMap, mapOffset, (LongMask512) m); } @@ -1019,7 +1026,7 @@ final class Long512Vector extends LongVector { @Override final LongVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Long512Mask.class, ms, offset, (Long512Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(LongMask512.class, ms, offset, (LongMask512) m, offsetInRange); // specialize } @ForceInline @@ -1033,14 +1040,14 @@ final class Long512Vector extends LongVector { @Override final void intoArray0(long[] a, int offset, VectorMask m) { - super.intoArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); + super.intoArray0Template(LongMask512.class, a, offset, (LongMask512) m); } @ForceInline @Override final void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Long512Mask.class, a, offset, indexMap, mapOffset, (Long512Mask) m); + super.intoArray0Template(LongMask512.class, a, offset, indexMap, mapOffset, (LongMask512) m); } @@ -1048,7 +1055,7 @@ final class Long512Vector extends LongVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Long512Mask.class, ms, offset, (Long512Mask) m); + super.intoMemorySegment0Template(LongMask512.class, ms, offset, (LongMask512) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector64.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector64.java index 66c84fde56f..5e8451695bc 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector64.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Long64Vector extends LongVector { +final class LongVector64 extends LongVector { static final LongSpecies VSPECIES = (LongSpecies) LongVector.SPECIES_64; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Long64Vector.class; + static final Class VCLASS = LongVector64.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = long.class; // carrier type used by the JVM + static final Class ETYPE = long.class; // used by the JVM - Long64Vector(long[] v) { + LongVector64(long[] v) { super(v); } - // For compatibility as Long64Vector::new, + // For compatibility as LongVector64::new, // stored into species.vectorFactory. - Long64Vector(Object v) { + LongVector64(Object v) { this((long[]) v); } - static final Long64Vector ZERO = new Long64Vector(new long[VLENGTH]); - static final Long64Vector IOTA = new Long64Vector(VSPECIES.iotaArray()); + static final LongVector64 ZERO = new LongVector64(new long[VLENGTH]); + static final LongVector64 IOTA = new LongVector64(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Long64Vector extends LongVector { @Override public final Class elementType() { return long.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Long.SIZE; } @@ -130,46 +135,46 @@ final class Long64Vector extends LongVector { @Override @ForceInline - public final Long64Vector broadcast(long e) { - return (Long64Vector) super.broadcastTemplate(e); // specialize + public final LongVector64 broadcast(long e) { + return (LongVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Long64Mask maskFromArray(boolean[] bits) { - return new Long64Mask(bits); + LongMask64 maskFromArray(boolean[] bits) { + return new LongMask64(bits); } @Override @ForceInline - Long64Shuffle iotaShuffle() { return Long64Shuffle.IOTA; } + LongShuffle64 iotaShuffle() { return LongShuffle64.IOTA; } @Override @ForceInline - Long64Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Long64Shuffle) iotaShuffleTemplate(start, step, wrap); + LongShuffle64 iotaShuffle(int start, int step, boolean wrap) { + return (LongShuffle64) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - Long64Shuffle shuffleFromArray(int[] indices, int i) { return new Long64Shuffle(indices, i); } + LongShuffle64 shuffleFromArray(int[] indices, int i) { return new LongShuffle64(indices, i); } @Override @ForceInline - Long64Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Long64Shuffle(fn); } + LongShuffle64 shuffleFromOp(IntUnaryOperator fn) { return new LongShuffle64(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Long64Vector vectorFactory(long[] vec) { - return new Long64Vector(vec); + LongVector64 vectorFactory(long[] vec) { + return new LongVector64(vec); } @ForceInline final @Override - Byte64Vector asByteVectorRaw() { - return (Byte64Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector64 asByteVectorRaw() { + return (ByteVector64) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -182,31 +187,31 @@ final class Long64Vector extends LongVector { @ForceInline final @Override - Long64Vector uOp(FUnOp f) { - return (Long64Vector) super.uOpTemplate(f); // specialize + LongVector64 uOp(FUnOp f) { + return (LongVector64) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Long64Vector uOp(VectorMask m, FUnOp f) { - return (Long64Vector) - super.uOpTemplate((Long64Mask)m, f); // specialize + LongVector64 uOp(VectorMask m, FUnOp f) { + return (LongVector64) + super.uOpTemplate((LongMask64)m, f); // specialize } // Binary operator @ForceInline final @Override - Long64Vector bOp(Vector v, FBinOp f) { - return (Long64Vector) super.bOpTemplate((Long64Vector)v, f); // specialize + LongVector64 bOp(Vector v, FBinOp f) { + return (LongVector64) super.bOpTemplate((LongVector64)v, f); // specialize } @ForceInline final @Override - Long64Vector bOp(Vector v, + LongVector64 bOp(Vector v, VectorMask m, FBinOp f) { - return (Long64Vector) - super.bOpTemplate((Long64Vector)v, (Long64Mask)m, + return (LongVector64) + super.bOpTemplate((LongVector64)v, (LongMask64)m, f); // specialize } @@ -214,19 +219,19 @@ final class Long64Vector extends LongVector { @ForceInline final @Override - Long64Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Long64Vector) - super.tOpTemplate((Long64Vector)v1, (Long64Vector)v2, + LongVector64 tOp(Vector v1, Vector v2, FTriOp f) { + return (LongVector64) + super.tOpTemplate((LongVector64)v1, (LongVector64)v2, f); // specialize } @ForceInline final @Override - Long64Vector tOp(Vector v1, Vector v2, + LongVector64 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Long64Vector) - super.tOpTemplate((Long64Vector)v1, (Long64Vector)v2, - (Long64Mask)m, f); // specialize + return (LongVector64) + super.tOpTemplate((LongVector64)v1, (LongVector64)v2, + (LongMask64)m, f); // specialize } @ForceInline @@ -264,64 +269,64 @@ final class Long64Vector extends LongVector { @Override @ForceInline - public Long64Vector lanewise(Unary op) { - return (Long64Vector) super.lanewiseTemplate(op); // specialize + public LongVector64 lanewise(Unary op) { + return (LongVector64) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Long64Vector lanewise(Unary op, VectorMask m) { - return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, (Long64Mask) m); // specialize + public LongVector64 lanewise(Unary op, VectorMask m) { + return (LongVector64) super.lanewiseTemplate(op, LongMask64.class, (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector lanewise(Binary op, Vector v) { - return (Long64Vector) super.lanewiseTemplate(op, v); // specialize + public LongVector64 lanewise(Binary op, Vector v) { + return (LongVector64) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Long64Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, v, (Long64Mask) m); // specialize + public LongVector64 lanewise(Binary op, Vector v, VectorMask m) { + return (LongVector64) super.lanewiseTemplate(op, LongMask64.class, v, (LongMask64) m); // specialize } /*package-private*/ @Override - @ForceInline Long64Vector + @ForceInline LongVector64 lanewiseShift(VectorOperators.Binary op, int e) { - return (Long64Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (LongVector64) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Long64Vector + @ForceInline LongVector64 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Long64Vector) super.lanewiseShiftTemplate(op, Long64Mask.class, e, (Long64Mask) m); // specialize + return (LongVector64) super.lanewiseShiftTemplate(op, LongMask64.class, e, (LongMask64) m); // specialize } /*package-private*/ @Override @ForceInline public final - Long64Vector + LongVector64 lanewise(Ternary op, Vector v1, Vector v2) { - return (Long64Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (LongVector64) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Long64Vector + LongVector64 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, v1, v2, (Long64Mask) m); // specialize + return (LongVector64) super.lanewiseTemplate(op, LongMask64.class, v1, v2, (LongMask64) m); // specialize } @Override @ForceInline public final - Long64Vector addIndex(int scale) { - return (Long64Vector) super.addIndexTemplate(scale); // specialize + LongVector64 addIndex(int scale) { + return (LongVector64) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -336,7 +341,7 @@ final class Long64Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized + return super.reduceLanesTemplate(op, LongMask64.class, (LongMask64) m); // specialized } @Override @@ -349,7 +354,7 @@ final class Long64Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, LongMask64.class, (LongMask64) m); // specialized } @Override @@ -360,155 +365,155 @@ final class Long64Vector extends LongVector { @Override @ForceInline - public final Long64Shuffle toShuffle() { - return (Long64Shuffle) toShuffle(vspecies(), false); + public final LongShuffle64 toShuffle() { + return (LongShuffle64) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Long64Mask test(Test op) { - return super.testTemplate(Long64Mask.class, op); // specialize + public final LongMask64 test(Test op) { + return super.testTemplate(LongMask64.class, op); // specialize } @Override @ForceInline - public final Long64Mask test(Test op, VectorMask m) { - return super.testTemplate(Long64Mask.class, op, (Long64Mask) m); // specialize + public final LongMask64 test(Test op, VectorMask m) { + return super.testTemplate(LongMask64.class, op, (LongMask64) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Long64Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Long64Mask.class, op, v); // specialize + public final LongMask64 compare(Comparison op, Vector v) { + return super.compareTemplate(LongMask64.class, op, v); // specialize } @Override @ForceInline - public final Long64Mask compare(Comparison op, long s) { - return super.compareTemplate(Long64Mask.class, op, s); // specialize + public final LongMask64 compare(Comparison op, long s) { + return super.compareTemplate(LongMask64.class, op, s); // specialize } @Override @ForceInline - public final Long64Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Long64Mask.class, op, v, (Long64Mask) m); + public final LongMask64 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(LongMask64.class, op, v, (LongMask64) m); } @Override @ForceInline - public Long64Vector blend(Vector v, VectorMask m) { - return (Long64Vector) - super.blendTemplate(Long64Mask.class, - (Long64Vector) v, - (Long64Mask) m); // specialize + public LongVector64 blend(Vector v, VectorMask m) { + return (LongVector64) + super.blendTemplate(LongMask64.class, + (LongVector64) v, + (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector slice(int origin, Vector v) { - return (Long64Vector) super.sliceTemplate(origin, v); // specialize + public LongVector64 slice(int origin, Vector v) { + return (LongVector64) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Long64Vector slice(int origin) { - return (Long64Vector) super.sliceTemplate(origin); // specialize + public LongVector64 slice(int origin) { + return (LongVector64) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Long64Vector unslice(int origin, Vector w, int part) { - return (Long64Vector) super.unsliceTemplate(origin, w, part); // specialize + public LongVector64 unslice(int origin, Vector w, int part) { + return (LongVector64) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Long64Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Long64Vector) - super.unsliceTemplate(Long64Mask.class, + public LongVector64 unslice(int origin, Vector w, int part, VectorMask m) { + return (LongVector64) + super.unsliceTemplate(LongMask64.class, origin, w, part, - (Long64Mask) m); // specialize + (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector unslice(int origin) { - return (Long64Vector) super.unsliceTemplate(origin); // specialize + public LongVector64 unslice(int origin) { + return (LongVector64) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Long64Vector rearrange(VectorShuffle s) { - return (Long64Vector) - super.rearrangeTemplate(Long64Shuffle.class, - (Long64Shuffle) s); // specialize + public LongVector64 rearrange(VectorShuffle s) { + return (LongVector64) + super.rearrangeTemplate(LongShuffle64.class, + (LongShuffle64) s); // specialize } @Override @ForceInline - public Long64Vector rearrange(VectorShuffle shuffle, + public LongVector64 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Long64Vector) - super.rearrangeTemplate(Long64Shuffle.class, - Long64Mask.class, - (Long64Shuffle) shuffle, - (Long64Mask) m); // specialize + return (LongVector64) + super.rearrangeTemplate(LongShuffle64.class, + LongMask64.class, + (LongShuffle64) shuffle, + (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector rearrange(VectorShuffle s, + public LongVector64 rearrange(VectorShuffle s, Vector v) { - return (Long64Vector) - super.rearrangeTemplate(Long64Shuffle.class, - (Long64Shuffle) s, - (Long64Vector) v); // specialize + return (LongVector64) + super.rearrangeTemplate(LongShuffle64.class, + (LongShuffle64) s, + (LongVector64) v); // specialize } @Override @ForceInline - public Long64Vector compress(VectorMask m) { - return (Long64Vector) - super.compressTemplate(Long64Mask.class, - (Long64Mask) m); // specialize + public LongVector64 compress(VectorMask m) { + return (LongVector64) + super.compressTemplate(LongMask64.class, + (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector expand(VectorMask m) { - return (Long64Vector) - super.expandTemplate(Long64Mask.class, - (Long64Mask) m); // specialize + public LongVector64 expand(VectorMask m) { + return (LongVector64) + super.expandTemplate(LongMask64.class, + (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector selectFrom(Vector v) { - return (Long64Vector) - super.selectFromTemplate((Long64Vector) v); // specialize + public LongVector64 selectFrom(Vector v) { + return (LongVector64) + super.selectFromTemplate((LongVector64) v); // specialize } @Override @ForceInline - public Long64Vector selectFrom(Vector v, + public LongVector64 selectFrom(Vector v, VectorMask m) { - return (Long64Vector) - super.selectFromTemplate((Long64Vector) v, - Long64Mask.class, (Long64Mask) m); // specialize + return (LongVector64) + super.selectFromTemplate((LongVector64) v, + LongMask64.class, (LongMask64) m); // specialize } @Override @ForceInline - public Long64Vector selectFrom(Vector v1, + public LongVector64 selectFrom(Vector v1, Vector v2) { - return (Long64Vector) - super.selectFromTemplate((Long64Vector) v1, (Long64Vector) v2); // specialize + return (LongVector64) + super.selectFromTemplate((LongVector64) v1, (LongVector64) v2); // specialize } @ForceInline @@ -533,7 +538,7 @@ final class Long64Vector extends LongVector { @ForceInline @Override - public Long64Vector withLane(int i, long e) { + public LongVector64 withLane(int i, long e) { switch (i) { case 0: return withLaneHelper(0, e); default: throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); @@ -541,7 +546,7 @@ final class Long64Vector extends LongVector { } @ForceInline - public Long64Vector withLaneHelper(int i, long e) { + public LongVector64 withLaneHelper(int i, long e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -554,19 +559,20 @@ final class Long64Vector extends LongVector { // Mask - static final class Long64Mask extends AbstractMask { + static final class LongMask64 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long64Mask(boolean[] bits) { + static final Class CTYPE = long.class; // used by the JVM + + LongMask64(boolean[] bits) { this(bits, 0); } - Long64Mask(boolean[] bits, int offset) { + LongMask64(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Long64Mask(boolean val) { + LongMask64(boolean val) { super(prepare(val)); } @@ -599,31 +605,31 @@ final class Long64Vector extends LongVector { } @Override - Long64Mask uOp(MUnOp f) { + LongMask64 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Long64Mask(res); + return new LongMask64(res); } @Override - Long64Mask bOp(VectorMask m, MBinOp f) { + LongMask64 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Long64Mask)m).getBits(); + boolean[] mbits = ((LongMask64)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Long64Mask(res); + return new LongMask64(res); } @ForceInline @Override public final - Long64Vector toVector() { - return (Long64Vector) super.toVectorTemplate(); // specialize + LongVector64 toVector() { + return (LongVector64) super.toVectorTemplate(); // specialize } /** @@ -656,25 +662,25 @@ final class Long64Vector extends LongVector { @Override @ForceInline /*package-private*/ - Long64Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Long64Mask) VectorSupport.indexPartiallyInUpperRange( - Long64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Long64Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + LongMask64 indexPartiallyInUpperRange(long offset, long limit) { + return (LongMask64) VectorSupport.indexPartiallyInUpperRange( + LongMask64.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (LongMask64) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Long64Mask not() { + public LongMask64 not() { return xor(maskAll(true)); } @Override @ForceInline - public Long64Mask compress() { - return (Long64Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Long64Vector.class, Long64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public LongMask64 compress() { + return (LongMask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + LongVector64.class, LongMask64.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -683,30 +689,30 @@ final class Long64Vector extends LongVector { @Override @ForceInline - public Long64Mask and(VectorMask mask) { + public LongMask64 and(VectorMask mask) { Objects.requireNonNull(mask); - Long64Mask m = (Long64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask64 m = (LongMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, LongMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Long64Mask or(VectorMask mask) { + public LongMask64 or(VectorMask mask) { Objects.requireNonNull(mask); - Long64Mask m = (Long64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask64 m = (LongMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, LongMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Long64Mask xor(VectorMask mask) { + public LongMask64 xor(VectorMask mask) { Objects.requireNonNull(mask); - Long64Mask m = (Long64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMask64 m = (LongMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -716,21 +722,21 @@ final class Long64Vector extends LongVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -740,7 +746,7 @@ final class Long64Vector extends LongVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -750,7 +756,7 @@ final class Long64Vector extends LongVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Long64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(LongMask64.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -759,48 +765,49 @@ final class Long64Vector extends LongVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Long64Mask)m).getBits())); + (m, __) -> anyTrueHelper(((LongMask64)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Long64Mask)m).getBits())); + (m, __) -> allTrueHelper(((LongMask64)m).getBits())); } @ForceInline /*package-private*/ - static Long64Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Long64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static LongMask64 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(LongMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Long64Mask TRUE_MASK = new Long64Mask(true); - private static final Long64Mask FALSE_MASK = new Long64Mask(false); + private static final LongMask64 TRUE_MASK = new LongMask64(true); + private static final LongMask64 FALSE_MASK = new LongMask64(false); } // Shuffle - static final class Long64Shuffle extends AbstractShuffle { + static final class LongShuffle64 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - Long64Shuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + LongShuffle64(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Long64Shuffle(int[] indices, int i) { + LongShuffle64(int[] indices, int i) { this(prepare(indices, i)); } - Long64Shuffle(IntUnaryOperator fn) { + LongShuffle64(IntUnaryOperator fn) { this(prepare(fn)); } @@ -820,23 +827,23 @@ final class Long64Vector extends LongVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final Long64Shuffle IOTA = new Long64Shuffle(IDENTITY); + static final LongShuffle64 IOTA = new LongShuffle64(IDENTITY); @Override @ForceInline - public Long64Vector toVector() { + public LongVector64 toVector() { return toBitsVector(); } @Override @ForceInline - Long64Vector toBitsVector() { - return (Long64Vector) super.toBitsVectorTemplate(); + LongVector64 toBitsVector() { + return (LongVector64) super.toBitsVectorTemplate(); } @Override - Long64Vector toBitsVector0() { - return ((Long64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVector64 toBitsVector0() { + return ((LongVector64) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -908,30 +915,30 @@ final class Long64Vector extends LongVector { @Override @ForceInline - public final Long64Mask laneIsValid() { - return (Long64Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final LongMask64 laneIsValid() { + return (LongMask64) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Long64Shuffle rearrange(VectorShuffle shuffle) { - Long64Shuffle concreteShuffle = (Long64Shuffle) shuffle; - return (Long64Shuffle) toBitsVector().rearrange(concreteShuffle) + public final LongShuffle64 rearrange(VectorShuffle shuffle) { + LongShuffle64 concreteShuffle = (LongShuffle64) shuffle; + return (LongShuffle64) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Long64Shuffle wrapIndexes() { - Long64Vector v = toBitsVector(); + public final LongShuffle64 wrapIndexes() { + LongVector64 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Long64Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVector64) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Long64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVector64) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Long64Shuffle) v.toShuffle(vspecies(), false); + return (LongShuffle64) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -982,14 +989,14 @@ final class Long64Vector extends LongVector { @Override final LongVector fromArray0(long[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Long64Mask.class, a, offset, (Long64Mask) m, offsetInRange); // specialize + return super.fromArray0Template(LongMask64.class, a, offset, (LongMask64) m, offsetInRange); // specialize } @ForceInline @Override final LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Long64Mask.class, a, offset, indexMap, mapOffset, (Long64Mask) m); + return super.fromArray0Template(LongMask64.class, a, offset, indexMap, mapOffset, (LongMask64) m); } @@ -1005,7 +1012,7 @@ final class Long64Vector extends LongVector { @Override final LongVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Long64Mask.class, ms, offset, (Long64Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(LongMask64.class, ms, offset, (LongMask64) m, offsetInRange); // specialize } @ForceInline @@ -1019,14 +1026,14 @@ final class Long64Vector extends LongVector { @Override final void intoArray0(long[] a, int offset, VectorMask m) { - super.intoArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); + super.intoArray0Template(LongMask64.class, a, offset, (LongMask64) m); } @ForceInline @Override final void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(Long64Mask.class, a, offset, indexMap, mapOffset, (Long64Mask) m); + super.intoArray0Template(LongMask64.class, a, offset, indexMap, mapOffset, (LongMask64) m); } @@ -1034,7 +1041,7 @@ final class Long64Vector extends LongVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Long64Mask.class, ms, offset, (Long64Mask) m); + super.intoMemorySegment0Template(LongMask64.class, ms, offset, (LongMask64) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVectorMax.java similarity index 67% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVectorMax.java index c95db0c4482..3469da8f2f4 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVectorMax.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class LongMaxVector extends LongVector { +final class LongVectorMax extends LongVector { static final LongSpecies VSPECIES = (LongSpecies) LongVector.SPECIES_MAX; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = LongMaxVector.class; + static final Class VCLASS = LongVectorMax.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = long.class; // carrier type used by the JVM + static final Class ETYPE = long.class; // used by the JVM - LongMaxVector(long[] v) { + LongVectorMax(long[] v) { super(v); } - // For compatibility as LongMaxVector::new, + // For compatibility as LongVectorMax::new, // stored into species.vectorFactory. - LongMaxVector(Object v) { + LongVectorMax(Object v) { this((long[]) v); } - static final LongMaxVector ZERO = new LongMaxVector(new long[VLENGTH]); - static final LongMaxVector IOTA = new LongMaxVector(VSPECIES.iotaArray()); + static final LongVectorMax ZERO = new LongVectorMax(new long[VLENGTH]); + static final LongVectorMax IOTA = new LongVectorMax(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class LongMaxVector extends LongVector { @Override public final Class elementType() { return long.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Long.SIZE; } @@ -130,46 +135,46 @@ final class LongMaxVector extends LongVector { @Override @ForceInline - public final LongMaxVector broadcast(long e) { - return (LongMaxVector) super.broadcastTemplate(e); // specialize + public final LongVectorMax broadcast(long e) { + return (LongVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - LongMaxMask maskFromArray(boolean[] bits) { - return new LongMaxMask(bits); + LongMaskMax maskFromArray(boolean[] bits) { + return new LongMaskMax(bits); } @Override @ForceInline - LongMaxShuffle iotaShuffle() { return LongMaxShuffle.IOTA; } + LongShuffleMax iotaShuffle() { return LongShuffleMax.IOTA; } @Override @ForceInline - LongMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - return (LongMaxShuffle) iotaShuffleTemplate(start, step, wrap); + LongShuffleMax iotaShuffle(int start, int step, boolean wrap) { + return (LongShuffleMax) iotaShuffleTemplate(start, step, wrap); } @Override @ForceInline - LongMaxShuffle shuffleFromArray(int[] indices, int i) { return new LongMaxShuffle(indices, i); } + LongShuffleMax shuffleFromArray(int[] indices, int i) { return new LongShuffleMax(indices, i); } @Override @ForceInline - LongMaxShuffle shuffleFromOp(IntUnaryOperator fn) { return new LongMaxShuffle(fn); } + LongShuffleMax shuffleFromOp(IntUnaryOperator fn) { return new LongShuffleMax(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - LongMaxVector vectorFactory(long[] vec) { - return new LongMaxVector(vec); + LongVectorMax vectorFactory(long[] vec) { + return new LongVectorMax(vec); } @ForceInline final @Override - ByteMaxVector asByteVectorRaw() { - return (ByteMaxVector) super.asByteVectorRawTemplate(); // specialize + ByteVectorMax asByteVectorRaw() { + return (ByteVectorMax) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -182,31 +187,31 @@ final class LongMaxVector extends LongVector { @ForceInline final @Override - LongMaxVector uOp(FUnOp f) { - return (LongMaxVector) super.uOpTemplate(f); // specialize + LongVectorMax uOp(FUnOp f) { + return (LongVectorMax) super.uOpTemplate(f); // specialize } @ForceInline final @Override - LongMaxVector uOp(VectorMask m, FUnOp f) { - return (LongMaxVector) - super.uOpTemplate((LongMaxMask)m, f); // specialize + LongVectorMax uOp(VectorMask m, FUnOp f) { + return (LongVectorMax) + super.uOpTemplate((LongMaskMax)m, f); // specialize } // Binary operator @ForceInline final @Override - LongMaxVector bOp(Vector v, FBinOp f) { - return (LongMaxVector) super.bOpTemplate((LongMaxVector)v, f); // specialize + LongVectorMax bOp(Vector v, FBinOp f) { + return (LongVectorMax) super.bOpTemplate((LongVectorMax)v, f); // specialize } @ForceInline final @Override - LongMaxVector bOp(Vector v, + LongVectorMax bOp(Vector v, VectorMask m, FBinOp f) { - return (LongMaxVector) - super.bOpTemplate((LongMaxVector)v, (LongMaxMask)m, + return (LongVectorMax) + super.bOpTemplate((LongVectorMax)v, (LongMaskMax)m, f); // specialize } @@ -214,19 +219,19 @@ final class LongMaxVector extends LongVector { @ForceInline final @Override - LongMaxVector tOp(Vector v1, Vector v2, FTriOp f) { - return (LongMaxVector) - super.tOpTemplate((LongMaxVector)v1, (LongMaxVector)v2, + LongVectorMax tOp(Vector v1, Vector v2, FTriOp f) { + return (LongVectorMax) + super.tOpTemplate((LongVectorMax)v1, (LongVectorMax)v2, f); // specialize } @ForceInline final @Override - LongMaxVector tOp(Vector v1, Vector v2, + LongVectorMax tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (LongMaxVector) - super.tOpTemplate((LongMaxVector)v1, (LongMaxVector)v2, - (LongMaxMask)m, f); // specialize + return (LongVectorMax) + super.tOpTemplate((LongVectorMax)v1, (LongVectorMax)v2, + (LongMaskMax)m, f); // specialize } @ForceInline @@ -264,64 +269,64 @@ final class LongMaxVector extends LongVector { @Override @ForceInline - public LongMaxVector lanewise(Unary op) { - return (LongMaxVector) super.lanewiseTemplate(op); // specialize + public LongVectorMax lanewise(Unary op) { + return (LongVectorMax) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public LongMaxVector lanewise(Unary op, VectorMask m) { - return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialize + public LongVectorMax lanewise(Unary op, VectorMask m) { + return (LongVectorMax) super.lanewiseTemplate(op, LongMaskMax.class, (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector lanewise(Binary op, Vector v) { - return (LongMaxVector) super.lanewiseTemplate(op, v); // specialize + public LongVectorMax lanewise(Binary op, Vector v) { + return (LongVectorMax) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public LongMaxVector lanewise(Binary op, Vector v, VectorMask m) { - return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, v, (LongMaxMask) m); // specialize + public LongVectorMax lanewise(Binary op, Vector v, VectorMask m) { + return (LongVectorMax) super.lanewiseTemplate(op, LongMaskMax.class, v, (LongMaskMax) m); // specialize } /*package-private*/ @Override - @ForceInline LongMaxVector + @ForceInline LongVectorMax lanewiseShift(VectorOperators.Binary op, int e) { - return (LongMaxVector) super.lanewiseShiftTemplate(op, e); // specialize + return (LongVectorMax) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline LongMaxVector + @ForceInline LongVectorMax lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (LongMaxVector) super.lanewiseShiftTemplate(op, LongMaxMask.class, e, (LongMaxMask) m); // specialize + return (LongVectorMax) super.lanewiseShiftTemplate(op, LongMaskMax.class, e, (LongMaskMax) m); // specialize } /*package-private*/ @Override @ForceInline public final - LongMaxVector + LongVectorMax lanewise(Ternary op, Vector v1, Vector v2) { - return (LongMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize + return (LongVectorMax) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - LongMaxVector + LongVectorMax lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, v1, v2, (LongMaxMask) m); // specialize + return (LongVectorMax) super.lanewiseTemplate(op, LongMaskMax.class, v1, v2, (LongMaskMax) m); // specialize } @Override @ForceInline public final - LongMaxVector addIndex(int scale) { - return (LongMaxVector) super.addIndexTemplate(scale); // specialize + LongVectorMax addIndex(int scale) { + return (LongVectorMax) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -336,7 +341,7 @@ final class LongMaxVector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized + return super.reduceLanesTemplate(op, LongMaskMax.class, (LongMaskMax) m); // specialized } @Override @@ -349,7 +354,7 @@ final class LongMaxVector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized + return (long) super.reduceLanesTemplate(op, LongMaskMax.class, (LongMaskMax) m); // specialized } @Override @@ -360,155 +365,155 @@ final class LongMaxVector extends LongVector { @Override @ForceInline - public final LongMaxShuffle toShuffle() { - return (LongMaxShuffle) toShuffle(vspecies(), false); + public final LongShuffleMax toShuffle() { + return (LongShuffleMax) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final LongMaxMask test(Test op) { - return super.testTemplate(LongMaxMask.class, op); // specialize + public final LongMaskMax test(Test op) { + return super.testTemplate(LongMaskMax.class, op); // specialize } @Override @ForceInline - public final LongMaxMask test(Test op, VectorMask m) { - return super.testTemplate(LongMaxMask.class, op, (LongMaxMask) m); // specialize + public final LongMaskMax test(Test op, VectorMask m) { + return super.testTemplate(LongMaskMax.class, op, (LongMaskMax) m); // specialize } // Specialized comparisons @Override @ForceInline - public final LongMaxMask compare(Comparison op, Vector v) { - return super.compareTemplate(LongMaxMask.class, op, v); // specialize + public final LongMaskMax compare(Comparison op, Vector v) { + return super.compareTemplate(LongMaskMax.class, op, v); // specialize } @Override @ForceInline - public final LongMaxMask compare(Comparison op, long s) { - return super.compareTemplate(LongMaxMask.class, op, s); // specialize + public final LongMaskMax compare(Comparison op, long s) { + return super.compareTemplate(LongMaskMax.class, op, s); // specialize } @Override @ForceInline - public final LongMaxMask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(LongMaxMask.class, op, v, (LongMaxMask) m); + public final LongMaskMax compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(LongMaskMax.class, op, v, (LongMaskMax) m); } @Override @ForceInline - public LongMaxVector blend(Vector v, VectorMask m) { - return (LongMaxVector) - super.blendTemplate(LongMaxMask.class, - (LongMaxVector) v, - (LongMaxMask) m); // specialize + public LongVectorMax blend(Vector v, VectorMask m) { + return (LongVectorMax) + super.blendTemplate(LongMaskMax.class, + (LongVectorMax) v, + (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector slice(int origin, Vector v) { - return (LongMaxVector) super.sliceTemplate(origin, v); // specialize + public LongVectorMax slice(int origin, Vector v) { + return (LongVectorMax) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public LongMaxVector slice(int origin) { - return (LongMaxVector) super.sliceTemplate(origin); // specialize + public LongVectorMax slice(int origin) { + return (LongVectorMax) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public LongMaxVector unslice(int origin, Vector w, int part) { - return (LongMaxVector) super.unsliceTemplate(origin, w, part); // specialize + public LongVectorMax unslice(int origin, Vector w, int part) { + return (LongVectorMax) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public LongMaxVector unslice(int origin, Vector w, int part, VectorMask m) { - return (LongMaxVector) - super.unsliceTemplate(LongMaxMask.class, + public LongVectorMax unslice(int origin, Vector w, int part, VectorMask m) { + return (LongVectorMax) + super.unsliceTemplate(LongMaskMax.class, origin, w, part, - (LongMaxMask) m); // specialize + (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector unslice(int origin) { - return (LongMaxVector) super.unsliceTemplate(origin); // specialize + public LongVectorMax unslice(int origin) { + return (LongVectorMax) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public LongMaxVector rearrange(VectorShuffle s) { - return (LongMaxVector) - super.rearrangeTemplate(LongMaxShuffle.class, - (LongMaxShuffle) s); // specialize + public LongVectorMax rearrange(VectorShuffle s) { + return (LongVectorMax) + super.rearrangeTemplate(LongShuffleMax.class, + (LongShuffleMax) s); // specialize } @Override @ForceInline - public LongMaxVector rearrange(VectorShuffle shuffle, + public LongVectorMax rearrange(VectorShuffle shuffle, VectorMask m) { - return (LongMaxVector) - super.rearrangeTemplate(LongMaxShuffle.class, - LongMaxMask.class, - (LongMaxShuffle) shuffle, - (LongMaxMask) m); // specialize + return (LongVectorMax) + super.rearrangeTemplate(LongShuffleMax.class, + LongMaskMax.class, + (LongShuffleMax) shuffle, + (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector rearrange(VectorShuffle s, + public LongVectorMax rearrange(VectorShuffle s, Vector v) { - return (LongMaxVector) - super.rearrangeTemplate(LongMaxShuffle.class, - (LongMaxShuffle) s, - (LongMaxVector) v); // specialize + return (LongVectorMax) + super.rearrangeTemplate(LongShuffleMax.class, + (LongShuffleMax) s, + (LongVectorMax) v); // specialize } @Override @ForceInline - public LongMaxVector compress(VectorMask m) { - return (LongMaxVector) - super.compressTemplate(LongMaxMask.class, - (LongMaxMask) m); // specialize + public LongVectorMax compress(VectorMask m) { + return (LongVectorMax) + super.compressTemplate(LongMaskMax.class, + (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector expand(VectorMask m) { - return (LongMaxVector) - super.expandTemplate(LongMaxMask.class, - (LongMaxMask) m); // specialize + public LongVectorMax expand(VectorMask m) { + return (LongVectorMax) + super.expandTemplate(LongMaskMax.class, + (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector selectFrom(Vector v) { - return (LongMaxVector) - super.selectFromTemplate((LongMaxVector) v); // specialize + public LongVectorMax selectFrom(Vector v) { + return (LongVectorMax) + super.selectFromTemplate((LongVectorMax) v); // specialize } @Override @ForceInline - public LongMaxVector selectFrom(Vector v, + public LongVectorMax selectFrom(Vector v, VectorMask m) { - return (LongMaxVector) - super.selectFromTemplate((LongMaxVector) v, - LongMaxMask.class, (LongMaxMask) m); // specialize + return (LongVectorMax) + super.selectFromTemplate((LongVectorMax) v, + LongMaskMax.class, (LongMaskMax) m); // specialize } @Override @ForceInline - public LongMaxVector selectFrom(Vector v1, + public LongVectorMax selectFrom(Vector v1, Vector v2) { - return (LongMaxVector) - super.selectFromTemplate((LongMaxVector) v1, (LongMaxVector) v2); // specialize + return (LongVectorMax) + super.selectFromTemplate((LongVectorMax) v1, (LongVectorMax) v2); // specialize } @ForceInline @@ -533,7 +538,7 @@ final class LongMaxVector extends LongVector { @ForceInline @Override - public LongMaxVector withLane(int i, long e) { + public LongVectorMax withLane(int i, long e) { if (i < 0 || i >= VLENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); } @@ -541,7 +546,7 @@ final class LongMaxVector extends LongVector { } @ForceInline - public LongMaxVector withLaneHelper(int i, long e) { + public LongVectorMax withLaneHelper(int i, long e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -554,19 +559,20 @@ final class LongMaxVector extends LongVector { // Mask - static final class LongMaxMask extends AbstractMask { + static final class LongMaskMax extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - LongMaxMask(boolean[] bits) { + static final Class CTYPE = long.class; // used by the JVM + + LongMaskMax(boolean[] bits) { this(bits, 0); } - LongMaxMask(boolean[] bits, int offset) { + LongMaskMax(boolean[] bits, int offset) { super(prepare(bits, offset)); } - LongMaxMask(boolean val) { + LongMaskMax(boolean val) { super(prepare(val)); } @@ -599,31 +605,31 @@ final class LongMaxVector extends LongVector { } @Override - LongMaxMask uOp(MUnOp f) { + LongMaskMax uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new LongMaxMask(res); + return new LongMaskMax(res); } @Override - LongMaxMask bOp(VectorMask m, MBinOp f) { + LongMaskMax bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((LongMaxMask)m).getBits(); + boolean[] mbits = ((LongMaskMax)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new LongMaxMask(res); + return new LongMaskMax(res); } @ForceInline @Override public final - LongMaxVector toVector() { - return (LongMaxVector) super.toVectorTemplate(); // specialize + LongVectorMax toVector() { + return (LongVectorMax) super.toVectorTemplate(); // specialize } /** @@ -656,25 +662,25 @@ final class LongMaxVector extends LongVector { @Override @ForceInline /*package-private*/ - LongMaxMask indexPartiallyInUpperRange(long offset, long limit) { - return (LongMaxMask) VectorSupport.indexPartiallyInUpperRange( - LongMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (LongMaxMask) TRUE_MASK.indexPartiallyInRange(o, l)); + LongMaskMax indexPartiallyInUpperRange(long offset, long limit) { + return (LongMaskMax) VectorSupport.indexPartiallyInUpperRange( + LongMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (LongMaskMax) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public LongMaxMask not() { + public LongMaskMax not() { return xor(maskAll(true)); } @Override @ForceInline - public LongMaxMask compress() { - return (LongMaxMask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - LongMaxVector.class, LongMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public LongMaskMax compress() { + return (LongMaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + LongVectorMax.class, LongMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -683,30 +689,30 @@ final class LongMaxVector extends LongVector { @Override @ForceInline - public LongMaxMask and(VectorMask mask) { + public LongMaskMax and(VectorMask mask) { Objects.requireNonNull(mask); - LongMaxMask m = (LongMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, LongMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMaskMax m = (LongMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, LongMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public LongMaxMask or(VectorMask mask) { + public LongMaskMax or(VectorMask mask) { Objects.requireNonNull(mask); - LongMaxMask m = (LongMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, LongMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMaskMax m = (LongMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, LongMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public LongMaxMask xor(VectorMask mask) { + public LongMaskMax xor(VectorMask mask) { Objects.requireNonNull(mask); - LongMaxMask m = (LongMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + LongMaskMax m = (LongMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -716,21 +722,21 @@ final class LongMaxVector extends LongVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -740,7 +746,7 @@ final class LongMaxVector extends LongVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -750,7 +756,7 @@ final class LongMaxVector extends LongVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(LongMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(LongMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -759,48 +765,49 @@ final class LongMaxVector extends LongVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((LongMaxMask)m).getBits())); + (m, __) -> anyTrueHelper(((LongMaskMax)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((LongMaxMask)m).getBits())); + (m, __) -> allTrueHelper(((LongMaskMax)m).getBits())); } @ForceInline /*package-private*/ - static LongMaxMask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(LongMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static LongMaskMax maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(LongMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final LongMaxMask TRUE_MASK = new LongMaxMask(true); - private static final LongMaxMask FALSE_MASK = new LongMaxMask(false); + private static final LongMaskMax TRUE_MASK = new LongMaskMax(true); + private static final LongMaskMax FALSE_MASK = new LongMaskMax(false); } // Shuffle - static final class LongMaxShuffle extends AbstractShuffle { + static final class LongShuffleMax extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = long.class; // used by the JVM - LongMaxShuffle(long[] indices) { + static final Class CTYPE = long.class; // used by the JVM + + LongShuffleMax(long[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - LongMaxShuffle(int[] indices, int i) { + LongShuffleMax(int[] indices, int i) { this(prepare(indices, i)); } - LongMaxShuffle(IntUnaryOperator fn) { + LongShuffleMax(IntUnaryOperator fn) { this(prepare(fn)); } @@ -820,23 +827,23 @@ final class LongMaxVector extends LongVector { assert(VLENGTH < Long.MAX_VALUE); assert(Long.MIN_VALUE <= -VLENGTH); } - static final LongMaxShuffle IOTA = new LongMaxShuffle(IDENTITY); + static final LongShuffleMax IOTA = new LongShuffleMax(IDENTITY); @Override @ForceInline - public LongMaxVector toVector() { + public LongVectorMax toVector() { return toBitsVector(); } @Override @ForceInline - LongMaxVector toBitsVector() { - return (LongMaxVector) super.toBitsVectorTemplate(); + LongVectorMax toBitsVector() { + return (LongVectorMax) super.toBitsVectorTemplate(); } @Override - LongMaxVector toBitsVector0() { - return ((LongMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + LongVectorMax toBitsVector0() { + return ((LongVectorMax) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -908,30 +915,30 @@ final class LongMaxVector extends LongVector { @Override @ForceInline - public final LongMaxMask laneIsValid() { - return (LongMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + public final LongMaskMax laneIsValid() { + return (LongMaskMax) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final LongMaxShuffle rearrange(VectorShuffle shuffle) { - LongMaxShuffle concreteShuffle = (LongMaxShuffle) shuffle; - return (LongMaxShuffle) toBitsVector().rearrange(concreteShuffle) + public final LongShuffleMax rearrange(VectorShuffle shuffle) { + LongShuffleMax concreteShuffle = (LongShuffleMax) shuffle; + return (LongShuffleMax) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final LongMaxShuffle wrapIndexes() { - LongMaxVector v = toBitsVector(); + public final LongShuffleMax wrapIndexes() { + LongVectorMax v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (LongMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + v = (LongVectorMax) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (LongMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (LongVectorMax) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (LongMaxShuffle) v.toShuffle(vspecies(), false); + return (LongShuffleMax) v.toShuffle(vspecies(), false); } private static long[] prepare(int[] indices, int offset) { @@ -982,14 +989,14 @@ final class LongMaxVector extends LongVector { @Override final LongVector fromArray0(long[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m, offsetInRange); // specialize + return super.fromArray0Template(LongMaskMax.class, a, offset, (LongMaskMax) m, offsetInRange); // specialize } @ForceInline @Override final LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(LongMaxMask.class, a, offset, indexMap, mapOffset, (LongMaxMask) m); + return super.fromArray0Template(LongMaskMax.class, a, offset, indexMap, mapOffset, (LongMaskMax) m); } @@ -1005,7 +1012,7 @@ final class LongMaxVector extends LongVector { @Override final LongVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(LongMaxMask.class, ms, offset, (LongMaxMask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(LongMaskMax.class, ms, offset, (LongMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -1019,14 +1026,14 @@ final class LongMaxVector extends LongVector { @Override final void intoArray0(long[] a, int offset, VectorMask m) { - super.intoArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); + super.intoArray0Template(LongMaskMax.class, a, offset, (LongMaskMax) m); } @ForceInline @Override final void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - super.intoArray0Template(LongMaxMask.class, a, offset, indexMap, mapOffset, (LongMaxMask) m); + super.intoArray0Template(LongMaskMax.class, a, offset, indexMap, mapOffset, (LongMaskMax) m); } @@ -1034,7 +1041,7 @@ final class LongMaxVector extends LongVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(LongMaxMask.class, ms, offset, (LongMaxMask) m); + super.intoMemorySegment0Template(LongMaskMax.class, ms, offset, (LongMaskMax) m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java index 03b7bb030b9..7ba465706e8 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java @@ -84,8 +84,8 @@ public abstract class ShortVector extends AbstractVector { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -4455,13 +4455,13 @@ public abstract class ShortVector extends AbstractVector { @Override @ForceInline public final ShortVector zero() { - if ((Class) vectorType() == ShortMaxVector.class) - return ShortMaxVector.ZERO; + if ((Class) vectorType() == ShortVectorMax.class) + return ShortVectorMax.ZERO; switch (vectorBitSize()) { - case 64: return Short64Vector.ZERO; - case 128: return Short128Vector.ZERO; - case 256: return Short256Vector.ZERO; - case 512: return Short512Vector.ZERO; + case 64: return ShortVector64.ZERO; + case 128: return ShortVector128.ZERO; + case 256: return ShortVector256.ZERO; + case 512: return ShortVector512.ZERO; } throw new AssertionError(); } @@ -4469,13 +4469,13 @@ public abstract class ShortVector extends AbstractVector { @Override @ForceInline public final ShortVector iota() { - if ((Class) vectorType() == ShortMaxVector.class) - return ShortMaxVector.IOTA; + if ((Class) vectorType() == ShortVectorMax.class) + return ShortVectorMax.IOTA; switch (vectorBitSize()) { - case 64: return Short64Vector.IOTA; - case 128: return Short128Vector.IOTA; - case 256: return Short256Vector.IOTA; - case 512: return Short512Vector.IOTA; + case 64: return ShortVector64.IOTA; + case 128: return ShortVector128.IOTA; + case 256: return ShortVector256.IOTA; + case 512: return ShortVector512.IOTA; } throw new AssertionError(); } @@ -4484,13 +4484,13 @@ public abstract class ShortVector extends AbstractVector { @Override @ForceInline public final VectorMask maskAll(boolean bit) { - if ((Class) vectorType() == ShortMaxVector.class) - return ShortMaxVector.ShortMaxMask.maskAll(bit); + if ((Class) vectorType() == ShortVectorMax.class) + return ShortVectorMax.ShortMaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return Short64Vector.Short64Mask.maskAll(bit); - case 128: return Short128Vector.Short128Mask.maskAll(bit); - case 256: return Short256Vector.Short256Mask.maskAll(bit); - case 512: return Short512Vector.Short512Mask.maskAll(bit); + case 64: return ShortVector64.ShortMask64.maskAll(bit); + case 128: return ShortVector128.ShortMask128.maskAll(bit); + case 256: return ShortVector256.ShortMask256.maskAll(bit); + case 512: return ShortVector512.ShortMask512.maskAll(bit); } throw new AssertionError(); } @@ -4518,42 +4518,42 @@ public abstract class ShortVector extends AbstractVector { /** Species representing {@link ShortVector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies SPECIES_64 = new ShortSpecies(VectorShape.S_64_BIT, - Short64Vector.class, - Short64Vector.Short64Mask.class, - Short64Vector.Short64Shuffle.class, - Short64Vector::new); + ShortVector64.class, + ShortVector64.ShortMask64.class, + ShortVector64.ShortShuffle64.class, + ShortVector64::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies SPECIES_128 = new ShortSpecies(VectorShape.S_128_BIT, - Short128Vector.class, - Short128Vector.Short128Mask.class, - Short128Vector.Short128Shuffle.class, - Short128Vector::new); + ShortVector128.class, + ShortVector128.ShortMask128.class, + ShortVector128.ShortShuffle128.class, + ShortVector128::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies SPECIES_256 = new ShortSpecies(VectorShape.S_256_BIT, - Short256Vector.class, - Short256Vector.Short256Mask.class, - Short256Vector.Short256Shuffle.class, - Short256Vector::new); + ShortVector256.class, + ShortVector256.ShortMask256.class, + ShortVector256.ShortShuffle256.class, + ShortVector256::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies SPECIES_512 = new ShortSpecies(VectorShape.S_512_BIT, - Short512Vector.class, - Short512Vector.Short512Mask.class, - Short512Vector.Short512Shuffle.class, - Short512Vector::new); + ShortVector512.class, + ShortVector512.ShortMask512.class, + ShortVector512.ShortShuffle512.class, + ShortVector512::new); /** Species representing {@link ShortVector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies SPECIES_MAX = new ShortSpecies(VectorShape.S_Max_BIT, - ShortMaxVector.class, - ShortMaxVector.ShortMaxMask.class, - ShortMaxVector.ShortMaxShuffle.class, - ShortMaxVector::new); + ShortVectorMax.class, + ShortVectorMax.ShortMaskMax.class, + ShortVectorMax.ShortShuffleMax.class, + ShortVectorMax::new); /** * Preferred species for {@link ShortVector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector128.java similarity index 66% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector128.java index cc35a1ea069..e989cdbdbea 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector128.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Short128Vector extends ShortVector { +final class ShortVector128 extends ShortVector { static final ShortSpecies VSPECIES = (ShortSpecies) ShortVector.SPECIES_128; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Short128Vector.class; + static final Class VCLASS = ShortVector128.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = short.class; // carrier type used by the JVM + static final Class ETYPE = short.class; // used by the JVM - Short128Vector(short[] v) { + ShortVector128(short[] v) { super(v); } - // For compatibility as Short128Vector::new, + // For compatibility as ShortVector128::new, // stored into species.vectorFactory. - Short128Vector(Object v) { + ShortVector128(Object v) { this((short[]) v); } - static final Short128Vector ZERO = new Short128Vector(new short[VLENGTH]); - static final Short128Vector IOTA = new Short128Vector(VSPECIES.iotaArray()); + static final ShortVector128 ZERO = new ShortVector128(new short[VLENGTH]); + static final ShortVector128 IOTA = new ShortVector128(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Short128Vector extends ShortVector { @Override public final Class elementType() { return short.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Short.SIZE; } @@ -130,51 +135,51 @@ final class Short128Vector extends ShortVector { @Override @ForceInline - public final Short128Vector broadcast(short e) { - return (Short128Vector) super.broadcastTemplate(e); // specialize + public final ShortVector128 broadcast(short e) { + return (ShortVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Short128Vector broadcast(long e) { - return (Short128Vector) super.broadcastTemplate(e); // specialize + public final ShortVector128 broadcast(long e) { + return (ShortVector128) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Short128Mask maskFromArray(boolean[] bits) { - return new Short128Mask(bits); + ShortMask128 maskFromArray(boolean[] bits) { + return new ShortMask128(bits); } @Override @ForceInline - Short128Shuffle iotaShuffle() { return Short128Shuffle.IOTA; } + ShortShuffle128 iotaShuffle() { return ShortShuffle128.IOTA; } @Override @ForceInline - Short128Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Short128Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); + ShortShuffle128 iotaShuffle(int start, int step, boolean wrap) { + return (ShortShuffle128) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short128Shuffle shuffleFromArray(int[] indices, int i) { return new Short128Shuffle(indices, i); } + ShortShuffle128 shuffleFromArray(int[] indices, int i) { return new ShortShuffle128(indices, i); } @Override @ForceInline - Short128Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Short128Shuffle(fn); } + ShortShuffle128 shuffleFromOp(IntUnaryOperator fn) { return new ShortShuffle128(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Short128Vector vectorFactory(short[] vec) { - return new Short128Vector(vec); + ShortVector128 vectorFactory(short[] vec) { + return new ShortVector128(vec); } @ForceInline final @Override - Byte128Vector asByteVectorRaw() { - return (Byte128Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector128 asByteVectorRaw() { + return (ByteVector128) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Short128Vector extends ShortVector { @ForceInline final @Override - Short128Vector uOp(FUnOp f) { - return (Short128Vector) super.uOpTemplate(f); // specialize + ShortVector128 uOp(FUnOp f) { + return (ShortVector128) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Short128Vector uOp(VectorMask m, FUnOp f) { - return (Short128Vector) - super.uOpTemplate((Short128Mask)m, f); // specialize + ShortVector128 uOp(VectorMask m, FUnOp f) { + return (ShortVector128) + super.uOpTemplate((ShortMask128)m, f); // specialize } // Binary operator @ForceInline final @Override - Short128Vector bOp(Vector v, FBinOp f) { - return (Short128Vector) super.bOpTemplate((Short128Vector)v, f); // specialize + ShortVector128 bOp(Vector v, FBinOp f) { + return (ShortVector128) super.bOpTemplate((ShortVector128)v, f); // specialize } @ForceInline final @Override - Short128Vector bOp(Vector v, + ShortVector128 bOp(Vector v, VectorMask m, FBinOp f) { - return (Short128Vector) - super.bOpTemplate((Short128Vector)v, (Short128Mask)m, + return (ShortVector128) + super.bOpTemplate((ShortVector128)v, (ShortMask128)m, f); // specialize } @@ -219,19 +224,19 @@ final class Short128Vector extends ShortVector { @ForceInline final @Override - Short128Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Short128Vector) - super.tOpTemplate((Short128Vector)v1, (Short128Vector)v2, + ShortVector128 tOp(Vector v1, Vector v2, FTriOp f) { + return (ShortVector128) + super.tOpTemplate((ShortVector128)v1, (ShortVector128)v2, f); // specialize } @ForceInline final @Override - Short128Vector tOp(Vector v1, Vector v2, + ShortVector128 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Short128Vector) - super.tOpTemplate((Short128Vector)v1, (Short128Vector)v2, - (Short128Mask)m, f); // specialize + return (ShortVector128) + super.tOpTemplate((ShortVector128)v1, (ShortVector128)v2, + (ShortMask128)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Short128Vector extends ShortVector { @Override @ForceInline - public Short128Vector lanewise(Unary op) { - return (Short128Vector) super.lanewiseTemplate(op); // specialize + public ShortVector128 lanewise(Unary op) { + return (ShortVector128) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Short128Vector lanewise(Unary op, VectorMask m) { - return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, (Short128Mask) m); // specialize + public ShortVector128 lanewise(Unary op, VectorMask m) { + return (ShortVector128) super.lanewiseTemplate(op, ShortMask128.class, (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector lanewise(Binary op, Vector v) { - return (Short128Vector) super.lanewiseTemplate(op, v); // specialize + public ShortVector128 lanewise(Binary op, Vector v) { + return (ShortVector128) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Short128Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v, (Short128Mask) m); // specialize + public ShortVector128 lanewise(Binary op, Vector v, VectorMask m) { + return (ShortVector128) super.lanewiseTemplate(op, ShortMask128.class, v, (ShortMask128) m); // specialize } /*package-private*/ @Override - @ForceInline Short128Vector + @ForceInline ShortVector128 lanewiseShift(VectorOperators.Binary op, int e) { - return (Short128Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ShortVector128) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Short128Vector + @ForceInline ShortVector128 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Short128Vector) super.lanewiseShiftTemplate(op, Short128Mask.class, e, (Short128Mask) m); // specialize + return (ShortVector128) super.lanewiseShiftTemplate(op, ShortMask128.class, e, (ShortMask128) m); // specialize } /*package-private*/ @Override @ForceInline public final - Short128Vector + ShortVector128 lanewise(Ternary op, Vector v1, Vector v2) { - return (Short128Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ShortVector128) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Short128Vector + ShortVector128 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v1, v2, (Short128Mask) m); // specialize + return (ShortVector128) super.lanewiseTemplate(op, ShortMask128.class, v1, v2, (ShortMask128) m); // specialize } @Override @ForceInline public final - Short128Vector addIndex(int scale) { - return (Short128Vector) super.addIndexTemplate(scale); // specialize + ShortVector128 addIndex(int scale) { + return (ShortVector128) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Short128Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized + return super.reduceLanesTemplate(op, ShortMask128.class, (ShortMask128) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Short128Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ShortMask128.class, (ShortMask128) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Short128Vector extends ShortVector { @Override @ForceInline - public final Short128Shuffle toShuffle() { - return (Short128Shuffle) toShuffle(vspecies(), false); + public final ShortShuffle128 toShuffle() { + return (ShortShuffle128) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Short128Mask test(Test op) { - return super.testTemplate(Short128Mask.class, op); // specialize + public final ShortMask128 test(Test op) { + return super.testTemplate(ShortMask128.class, op); // specialize } @Override @ForceInline - public final Short128Mask test(Test op, VectorMask m) { - return super.testTemplate(Short128Mask.class, op, (Short128Mask) m); // specialize + public final ShortMask128 test(Test op, VectorMask m) { + return super.testTemplate(ShortMask128.class, op, (ShortMask128) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Short128Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Short128Mask.class, op, v); // specialize + public final ShortMask128 compare(Comparison op, Vector v) { + return super.compareTemplate(ShortMask128.class, op, v); // specialize } @Override @ForceInline - public final Short128Mask compare(Comparison op, short s) { - return super.compareTemplate(Short128Mask.class, op, s); // specialize + public final ShortMask128 compare(Comparison op, short s) { + return super.compareTemplate(ShortMask128.class, op, s); // specialize } @Override @ForceInline - public final Short128Mask compare(Comparison op, long s) { - return super.compareTemplate(Short128Mask.class, op, s); // specialize + public final ShortMask128 compare(Comparison op, long s) { + return super.compareTemplate(ShortMask128.class, op, s); // specialize } @Override @ForceInline - public final Short128Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Short128Mask.class, op, v, (Short128Mask) m); + public final ShortMask128 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ShortMask128.class, op, v, (ShortMask128) m); } @Override @ForceInline - public Short128Vector blend(Vector v, VectorMask m) { - return (Short128Vector) - super.blendTemplate(Short128Mask.class, - (Short128Vector) v, - (Short128Mask) m); // specialize + public ShortVector128 blend(Vector v, VectorMask m) { + return (ShortVector128) + super.blendTemplate(ShortMask128.class, + (ShortVector128) v, + (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector slice(int origin, Vector v) { - return (Short128Vector) super.sliceTemplate(origin, v); // specialize + public ShortVector128 slice(int origin, Vector v) { + return (ShortVector128) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Short128Vector slice(int origin) { - return (Short128Vector) super.sliceTemplate(origin); // specialize + public ShortVector128 slice(int origin) { + return (ShortVector128) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Short128Vector unslice(int origin, Vector w, int part) { - return (Short128Vector) super.unsliceTemplate(origin, w, part); // specialize + public ShortVector128 unslice(int origin, Vector w, int part) { + return (ShortVector128) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Short128Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Short128Vector) - super.unsliceTemplate(Short128Mask.class, + public ShortVector128 unslice(int origin, Vector w, int part, VectorMask m) { + return (ShortVector128) + super.unsliceTemplate(ShortMask128.class, origin, w, part, - (Short128Mask) m); // specialize + (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector unslice(int origin) { - return (Short128Vector) super.unsliceTemplate(origin); // specialize + public ShortVector128 unslice(int origin) { + return (ShortVector128) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Short128Vector rearrange(VectorShuffle s) { - return (Short128Vector) - super.rearrangeTemplate(Short128Shuffle.class, - (Short128Shuffle) s); // specialize + public ShortVector128 rearrange(VectorShuffle s) { + return (ShortVector128) + super.rearrangeTemplate(ShortShuffle128.class, + (ShortShuffle128) s); // specialize } @Override @ForceInline - public Short128Vector rearrange(VectorShuffle shuffle, + public ShortVector128 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Short128Vector) - super.rearrangeTemplate(Short128Shuffle.class, - Short128Mask.class, - (Short128Shuffle) shuffle, - (Short128Mask) m); // specialize + return (ShortVector128) + super.rearrangeTemplate(ShortShuffle128.class, + ShortMask128.class, + (ShortShuffle128) shuffle, + (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector rearrange(VectorShuffle s, + public ShortVector128 rearrange(VectorShuffle s, Vector v) { - return (Short128Vector) - super.rearrangeTemplate(Short128Shuffle.class, - (Short128Shuffle) s, - (Short128Vector) v); // specialize + return (ShortVector128) + super.rearrangeTemplate(ShortShuffle128.class, + (ShortShuffle128) s, + (ShortVector128) v); // specialize } @Override @ForceInline - public Short128Vector compress(VectorMask m) { - return (Short128Vector) - super.compressTemplate(Short128Mask.class, - (Short128Mask) m); // specialize + public ShortVector128 compress(VectorMask m) { + return (ShortVector128) + super.compressTemplate(ShortMask128.class, + (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector expand(VectorMask m) { - return (Short128Vector) - super.expandTemplate(Short128Mask.class, - (Short128Mask) m); // specialize + public ShortVector128 expand(VectorMask m) { + return (ShortVector128) + super.expandTemplate(ShortMask128.class, + (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector selectFrom(Vector v) { - return (Short128Vector) - super.selectFromTemplate((Short128Vector) v); // specialize + public ShortVector128 selectFrom(Vector v) { + return (ShortVector128) + super.selectFromTemplate((ShortVector128) v); // specialize } @Override @ForceInline - public Short128Vector selectFrom(Vector v, + public ShortVector128 selectFrom(Vector v, VectorMask m) { - return (Short128Vector) - super.selectFromTemplate((Short128Vector) v, - Short128Mask.class, (Short128Mask) m); // specialize + return (ShortVector128) + super.selectFromTemplate((ShortVector128) v, + ShortMask128.class, (ShortMask128) m); // specialize } @Override @ForceInline - public Short128Vector selectFrom(Vector v1, + public ShortVector128 selectFrom(Vector v1, Vector v2) { - return (Short128Vector) - super.selectFromTemplate((Short128Vector) v1, (Short128Vector) v2); // specialize + return (ShortVector128) + super.selectFromTemplate((ShortVector128) v1, (ShortVector128) v2); // specialize } @ForceInline @@ -550,7 +555,7 @@ final class Short128Vector extends ShortVector { @ForceInline @Override - public Short128Vector withLane(int i, short e) { + public ShortVector128 withLane(int i, short e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -565,7 +570,7 @@ final class Short128Vector extends ShortVector { } @ForceInline - public Short128Vector withLaneHelper(int i, short e) { + public ShortVector128 withLaneHelper(int i, short e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -578,19 +583,20 @@ final class Short128Vector extends ShortVector { // Mask - static final class Short128Mask extends AbstractMask { + static final class ShortMask128 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short128Mask(boolean[] bits) { + static final Class CTYPE = short.class; // used by the JVM + + ShortMask128(boolean[] bits) { this(bits, 0); } - Short128Mask(boolean[] bits, int offset) { + ShortMask128(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Short128Mask(boolean val) { + ShortMask128(boolean val) { super(prepare(val)); } @@ -623,31 +629,31 @@ final class Short128Vector extends ShortVector { } @Override - Short128Mask uOp(MUnOp f) { + ShortMask128 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Short128Mask(res); + return new ShortMask128(res); } @Override - Short128Mask bOp(VectorMask m, MBinOp f) { + ShortMask128 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Short128Mask)m).getBits(); + boolean[] mbits = ((ShortMask128)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Short128Mask(res); + return new ShortMask128(res); } @ForceInline @Override public final - Short128Vector toVector() { - return (Short128Vector) super.toVectorTemplate(); // specialize + ShortVector128 toVector() { + return (ShortVector128) super.toVectorTemplate(); // specialize } /** @@ -680,25 +686,25 @@ final class Short128Vector extends ShortVector { @Override @ForceInline /*package-private*/ - Short128Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Short128Mask) VectorSupport.indexPartiallyInUpperRange( - Short128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Short128Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ShortMask128 indexPartiallyInUpperRange(long offset, long limit) { + return (ShortMask128) VectorSupport.indexPartiallyInUpperRange( + ShortMask128.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ShortMask128) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Short128Mask not() { + public ShortMask128 not() { return xor(maskAll(true)); } @Override @ForceInline - public Short128Mask compress() { - return (Short128Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Short128Vector.class, Short128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ShortMask128 compress() { + return (ShortMask128)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ShortVector128.class, ShortMask128.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -707,30 +713,30 @@ final class Short128Vector extends ShortVector { @Override @ForceInline - public Short128Mask and(VectorMask mask) { + public ShortMask128 and(VectorMask mask) { Objects.requireNonNull(mask); - Short128Mask m = (Short128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask128 m = (ShortMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Short128Mask or(VectorMask mask) { + public ShortMask128 or(VectorMask mask) { Objects.requireNonNull(mask); - Short128Mask m = (Short128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask128 m = (ShortMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Short128Mask xor(VectorMask mask) { + public ShortMask128 xor(VectorMask mask) { Objects.requireNonNull(mask); - Short128Mask m = (Short128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short128Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask128 m = (ShortMask128)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMask128.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -740,21 +746,21 @@ final class Short128Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -764,7 +770,7 @@ final class Short128Vector extends ShortVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -774,7 +780,7 @@ final class Short128Vector extends ShortVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Short128Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ShortMask128.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -783,48 +789,49 @@ final class Short128Vector extends ShortVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Short128Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ShortMask128)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Short128Mask)m).getBits())); + (m, __) -> allTrueHelper(((ShortMask128)m).getBits())); } @ForceInline /*package-private*/ - static Short128Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Short128Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ShortMask128 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ShortMask128.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Short128Mask TRUE_MASK = new Short128Mask(true); - private static final Short128Mask FALSE_MASK = new Short128Mask(false); + private static final ShortMask128 TRUE_MASK = new ShortMask128(true); + private static final ShortMask128 FALSE_MASK = new ShortMask128(false); } // Shuffle - static final class Short128Shuffle extends AbstractShuffle { + static final class ShortShuffle128 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short128Shuffle(short[] indices) { + static final Class CTYPE = short.class; // used by the JVM + + ShortShuffle128(short[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Short128Shuffle(int[] indices, int i) { + ShortShuffle128(int[] indices, int i) { this(prepare(indices, i)); } - Short128Shuffle(IntUnaryOperator fn) { + ShortShuffle128(IntUnaryOperator fn) { this(prepare(fn)); } @@ -844,23 +851,23 @@ final class Short128Vector extends ShortVector { assert(VLENGTH < Short.MAX_VALUE); assert(Short.MIN_VALUE <= -VLENGTH); } - static final Short128Shuffle IOTA = new Short128Shuffle(IDENTITY); + static final ShortShuffle128 IOTA = new ShortShuffle128(IDENTITY); @Override @ForceInline - public Short128Vector toVector() { + public ShortVector128 toVector() { return toBitsVector(); } @Override @ForceInline - Short128Vector toBitsVector() { - return (Short128Vector) super.toBitsVectorTemplate(); + ShortVector128 toBitsVector() { + return (ShortVector128) super.toBitsVectorTemplate(); } @Override - Short128Vector toBitsVector0() { - return ((Short128Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ShortVector128 toBitsVector0() { + return ((ShortVector128) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -897,30 +904,30 @@ final class Short128Vector extends ShortVector { @Override @ForceInline - public final Short128Mask laneIsValid() { - return (Short128Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ShortMask128 laneIsValid() { + return (ShortMask128) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Short128Shuffle rearrange(VectorShuffle shuffle) { - Short128Shuffle concreteShuffle = (Short128Shuffle) shuffle; - return (Short128Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ShortShuffle128 rearrange(VectorShuffle shuffle) { + ShortShuffle128 concreteShuffle = (ShortShuffle128) shuffle; + return (ShortShuffle128) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Short128Shuffle wrapIndexes() { - Short128Vector v = toBitsVector(); + public final ShortShuffle128 wrapIndexes() { + ShortVector128 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Short128Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ShortVector128) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Short128Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ShortVector128) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Short128Shuffle) v.toShuffle(vspecies(), false); + return (ShortShuffle128) v.toShuffle(vspecies(), false); } private static short[] prepare(int[] indices, int offset) { @@ -971,14 +978,14 @@ final class Short128Vector extends ShortVector { @Override final ShortVector fromArray0(short[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Short128Mask.class, a, offset, (Short128Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ShortMask128.class, a, offset, (ShortMask128) m, offsetInRange); // specialize } @ForceInline @Override final ShortVector fromArray0(short[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Short128Mask.class, a, offset, indexMap, mapOffset, (Short128Mask) m); + return super.fromArray0Template(ShortMask128.class, a, offset, indexMap, mapOffset, (ShortMask128) m); } @ForceInline @@ -992,7 +999,7 @@ final class Short128Vector extends ShortVector { @Override final ShortVector fromCharArray0(char[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m, offsetInRange); // specialize + return super.fromCharArray0Template(ShortMask128.class, a, offset, (ShortMask128) m, offsetInRange); // specialize } @@ -1007,7 +1014,7 @@ final class Short128Vector extends ShortVector { @Override final ShortVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Short128Mask.class, ms, offset, (Short128Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ShortMask128.class, ms, offset, (ShortMask128) m, offsetInRange); // specialize } @ForceInline @@ -1021,7 +1028,7 @@ final class Short128Vector extends ShortVector { @Override final void intoArray0(short[] a, int offset, VectorMask m) { - super.intoArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); + super.intoArray0Template(ShortMask128.class, a, offset, (ShortMask128) m); } @@ -1030,14 +1037,14 @@ final class Short128Vector extends ShortVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Short128Mask.class, ms, offset, (Short128Mask) m); + super.intoMemorySegment0Template(ShortMask128.class, ms, offset, (ShortMask128) m); } @ForceInline @Override final void intoCharArray0(char[] a, int offset, VectorMask m) { - super.intoCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); + super.intoCharArray0Template(ShortMask128.class, a, offset, (ShortMask128) m); } // End of specialized low-level memory operations. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector256.java similarity index 66% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector256.java index a3841eb63dc..c74188e22f5 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector256.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Short256Vector extends ShortVector { +final class ShortVector256 extends ShortVector { static final ShortSpecies VSPECIES = (ShortSpecies) ShortVector.SPECIES_256; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Short256Vector.class; + static final Class VCLASS = ShortVector256.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = short.class; // carrier type used by the JVM + static final Class ETYPE = short.class; // used by the JVM - Short256Vector(short[] v) { + ShortVector256(short[] v) { super(v); } - // For compatibility as Short256Vector::new, + // For compatibility as ShortVector256::new, // stored into species.vectorFactory. - Short256Vector(Object v) { + ShortVector256(Object v) { this((short[]) v); } - static final Short256Vector ZERO = new Short256Vector(new short[VLENGTH]); - static final Short256Vector IOTA = new Short256Vector(VSPECIES.iotaArray()); + static final ShortVector256 ZERO = new ShortVector256(new short[VLENGTH]); + static final ShortVector256 IOTA = new ShortVector256(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Short256Vector extends ShortVector { @Override public final Class elementType() { return short.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Short.SIZE; } @@ -130,51 +135,51 @@ final class Short256Vector extends ShortVector { @Override @ForceInline - public final Short256Vector broadcast(short e) { - return (Short256Vector) super.broadcastTemplate(e); // specialize + public final ShortVector256 broadcast(short e) { + return (ShortVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Short256Vector broadcast(long e) { - return (Short256Vector) super.broadcastTemplate(e); // specialize + public final ShortVector256 broadcast(long e) { + return (ShortVector256) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Short256Mask maskFromArray(boolean[] bits) { - return new Short256Mask(bits); + ShortMask256 maskFromArray(boolean[] bits) { + return new ShortMask256(bits); } @Override @ForceInline - Short256Shuffle iotaShuffle() { return Short256Shuffle.IOTA; } + ShortShuffle256 iotaShuffle() { return ShortShuffle256.IOTA; } @Override @ForceInline - Short256Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Short256Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); + ShortShuffle256 iotaShuffle(int start, int step, boolean wrap) { + return (ShortShuffle256) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short256Shuffle shuffleFromArray(int[] indices, int i) { return new Short256Shuffle(indices, i); } + ShortShuffle256 shuffleFromArray(int[] indices, int i) { return new ShortShuffle256(indices, i); } @Override @ForceInline - Short256Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Short256Shuffle(fn); } + ShortShuffle256 shuffleFromOp(IntUnaryOperator fn) { return new ShortShuffle256(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Short256Vector vectorFactory(short[] vec) { - return new Short256Vector(vec); + ShortVector256 vectorFactory(short[] vec) { + return new ShortVector256(vec); } @ForceInline final @Override - Byte256Vector asByteVectorRaw() { - return (Byte256Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector256 asByteVectorRaw() { + return (ByteVector256) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Short256Vector extends ShortVector { @ForceInline final @Override - Short256Vector uOp(FUnOp f) { - return (Short256Vector) super.uOpTemplate(f); // specialize + ShortVector256 uOp(FUnOp f) { + return (ShortVector256) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Short256Vector uOp(VectorMask m, FUnOp f) { - return (Short256Vector) - super.uOpTemplate((Short256Mask)m, f); // specialize + ShortVector256 uOp(VectorMask m, FUnOp f) { + return (ShortVector256) + super.uOpTemplate((ShortMask256)m, f); // specialize } // Binary operator @ForceInline final @Override - Short256Vector bOp(Vector v, FBinOp f) { - return (Short256Vector) super.bOpTemplate((Short256Vector)v, f); // specialize + ShortVector256 bOp(Vector v, FBinOp f) { + return (ShortVector256) super.bOpTemplate((ShortVector256)v, f); // specialize } @ForceInline final @Override - Short256Vector bOp(Vector v, + ShortVector256 bOp(Vector v, VectorMask m, FBinOp f) { - return (Short256Vector) - super.bOpTemplate((Short256Vector)v, (Short256Mask)m, + return (ShortVector256) + super.bOpTemplate((ShortVector256)v, (ShortMask256)m, f); // specialize } @@ -219,19 +224,19 @@ final class Short256Vector extends ShortVector { @ForceInline final @Override - Short256Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Short256Vector) - super.tOpTemplate((Short256Vector)v1, (Short256Vector)v2, + ShortVector256 tOp(Vector v1, Vector v2, FTriOp f) { + return (ShortVector256) + super.tOpTemplate((ShortVector256)v1, (ShortVector256)v2, f); // specialize } @ForceInline final @Override - Short256Vector tOp(Vector v1, Vector v2, + ShortVector256 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Short256Vector) - super.tOpTemplate((Short256Vector)v1, (Short256Vector)v2, - (Short256Mask)m, f); // specialize + return (ShortVector256) + super.tOpTemplate((ShortVector256)v1, (ShortVector256)v2, + (ShortMask256)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Short256Vector extends ShortVector { @Override @ForceInline - public Short256Vector lanewise(Unary op) { - return (Short256Vector) super.lanewiseTemplate(op); // specialize + public ShortVector256 lanewise(Unary op) { + return (ShortVector256) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Short256Vector lanewise(Unary op, VectorMask m) { - return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, (Short256Mask) m); // specialize + public ShortVector256 lanewise(Unary op, VectorMask m) { + return (ShortVector256) super.lanewiseTemplate(op, ShortMask256.class, (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector lanewise(Binary op, Vector v) { - return (Short256Vector) super.lanewiseTemplate(op, v); // specialize + public ShortVector256 lanewise(Binary op, Vector v) { + return (ShortVector256) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Short256Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, v, (Short256Mask) m); // specialize + public ShortVector256 lanewise(Binary op, Vector v, VectorMask m) { + return (ShortVector256) super.lanewiseTemplate(op, ShortMask256.class, v, (ShortMask256) m); // specialize } /*package-private*/ @Override - @ForceInline Short256Vector + @ForceInline ShortVector256 lanewiseShift(VectorOperators.Binary op, int e) { - return (Short256Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ShortVector256) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Short256Vector + @ForceInline ShortVector256 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Short256Vector) super.lanewiseShiftTemplate(op, Short256Mask.class, e, (Short256Mask) m); // specialize + return (ShortVector256) super.lanewiseShiftTemplate(op, ShortMask256.class, e, (ShortMask256) m); // specialize } /*package-private*/ @Override @ForceInline public final - Short256Vector + ShortVector256 lanewise(Ternary op, Vector v1, Vector v2) { - return (Short256Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ShortVector256) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Short256Vector + ShortVector256 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, v1, v2, (Short256Mask) m); // specialize + return (ShortVector256) super.lanewiseTemplate(op, ShortMask256.class, v1, v2, (ShortMask256) m); // specialize } @Override @ForceInline public final - Short256Vector addIndex(int scale) { - return (Short256Vector) super.addIndexTemplate(scale); // specialize + ShortVector256 addIndex(int scale) { + return (ShortVector256) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Short256Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized + return super.reduceLanesTemplate(op, ShortMask256.class, (ShortMask256) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Short256Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ShortMask256.class, (ShortMask256) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Short256Vector extends ShortVector { @Override @ForceInline - public final Short256Shuffle toShuffle() { - return (Short256Shuffle) toShuffle(vspecies(), false); + public final ShortShuffle256 toShuffle() { + return (ShortShuffle256) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Short256Mask test(Test op) { - return super.testTemplate(Short256Mask.class, op); // specialize + public final ShortMask256 test(Test op) { + return super.testTemplate(ShortMask256.class, op); // specialize } @Override @ForceInline - public final Short256Mask test(Test op, VectorMask m) { - return super.testTemplate(Short256Mask.class, op, (Short256Mask) m); // specialize + public final ShortMask256 test(Test op, VectorMask m) { + return super.testTemplate(ShortMask256.class, op, (ShortMask256) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Short256Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Short256Mask.class, op, v); // specialize + public final ShortMask256 compare(Comparison op, Vector v) { + return super.compareTemplate(ShortMask256.class, op, v); // specialize } @Override @ForceInline - public final Short256Mask compare(Comparison op, short s) { - return super.compareTemplate(Short256Mask.class, op, s); // specialize + public final ShortMask256 compare(Comparison op, short s) { + return super.compareTemplate(ShortMask256.class, op, s); // specialize } @Override @ForceInline - public final Short256Mask compare(Comparison op, long s) { - return super.compareTemplate(Short256Mask.class, op, s); // specialize + public final ShortMask256 compare(Comparison op, long s) { + return super.compareTemplate(ShortMask256.class, op, s); // specialize } @Override @ForceInline - public final Short256Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Short256Mask.class, op, v, (Short256Mask) m); + public final ShortMask256 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ShortMask256.class, op, v, (ShortMask256) m); } @Override @ForceInline - public Short256Vector blend(Vector v, VectorMask m) { - return (Short256Vector) - super.blendTemplate(Short256Mask.class, - (Short256Vector) v, - (Short256Mask) m); // specialize + public ShortVector256 blend(Vector v, VectorMask m) { + return (ShortVector256) + super.blendTemplate(ShortMask256.class, + (ShortVector256) v, + (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector slice(int origin, Vector v) { - return (Short256Vector) super.sliceTemplate(origin, v); // specialize + public ShortVector256 slice(int origin, Vector v) { + return (ShortVector256) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Short256Vector slice(int origin) { - return (Short256Vector) super.sliceTemplate(origin); // specialize + public ShortVector256 slice(int origin) { + return (ShortVector256) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Short256Vector unslice(int origin, Vector w, int part) { - return (Short256Vector) super.unsliceTemplate(origin, w, part); // specialize + public ShortVector256 unslice(int origin, Vector w, int part) { + return (ShortVector256) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Short256Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Short256Vector) - super.unsliceTemplate(Short256Mask.class, + public ShortVector256 unslice(int origin, Vector w, int part, VectorMask m) { + return (ShortVector256) + super.unsliceTemplate(ShortMask256.class, origin, w, part, - (Short256Mask) m); // specialize + (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector unslice(int origin) { - return (Short256Vector) super.unsliceTemplate(origin); // specialize + public ShortVector256 unslice(int origin) { + return (ShortVector256) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Short256Vector rearrange(VectorShuffle s) { - return (Short256Vector) - super.rearrangeTemplate(Short256Shuffle.class, - (Short256Shuffle) s); // specialize + public ShortVector256 rearrange(VectorShuffle s) { + return (ShortVector256) + super.rearrangeTemplate(ShortShuffle256.class, + (ShortShuffle256) s); // specialize } @Override @ForceInline - public Short256Vector rearrange(VectorShuffle shuffle, + public ShortVector256 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Short256Vector) - super.rearrangeTemplate(Short256Shuffle.class, - Short256Mask.class, - (Short256Shuffle) shuffle, - (Short256Mask) m); // specialize + return (ShortVector256) + super.rearrangeTemplate(ShortShuffle256.class, + ShortMask256.class, + (ShortShuffle256) shuffle, + (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector rearrange(VectorShuffle s, + public ShortVector256 rearrange(VectorShuffle s, Vector v) { - return (Short256Vector) - super.rearrangeTemplate(Short256Shuffle.class, - (Short256Shuffle) s, - (Short256Vector) v); // specialize + return (ShortVector256) + super.rearrangeTemplate(ShortShuffle256.class, + (ShortShuffle256) s, + (ShortVector256) v); // specialize } @Override @ForceInline - public Short256Vector compress(VectorMask m) { - return (Short256Vector) - super.compressTemplate(Short256Mask.class, - (Short256Mask) m); // specialize + public ShortVector256 compress(VectorMask m) { + return (ShortVector256) + super.compressTemplate(ShortMask256.class, + (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector expand(VectorMask m) { - return (Short256Vector) - super.expandTemplate(Short256Mask.class, - (Short256Mask) m); // specialize + public ShortVector256 expand(VectorMask m) { + return (ShortVector256) + super.expandTemplate(ShortMask256.class, + (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector selectFrom(Vector v) { - return (Short256Vector) - super.selectFromTemplate((Short256Vector) v); // specialize + public ShortVector256 selectFrom(Vector v) { + return (ShortVector256) + super.selectFromTemplate((ShortVector256) v); // specialize } @Override @ForceInline - public Short256Vector selectFrom(Vector v, + public ShortVector256 selectFrom(Vector v, VectorMask m) { - return (Short256Vector) - super.selectFromTemplate((Short256Vector) v, - Short256Mask.class, (Short256Mask) m); // specialize + return (ShortVector256) + super.selectFromTemplate((ShortVector256) v, + ShortMask256.class, (ShortMask256) m); // specialize } @Override @ForceInline - public Short256Vector selectFrom(Vector v1, + public ShortVector256 selectFrom(Vector v1, Vector v2) { - return (Short256Vector) - super.selectFromTemplate((Short256Vector) v1, (Short256Vector) v2); // specialize + return (ShortVector256) + super.selectFromTemplate((ShortVector256) v1, (ShortVector256) v2); // specialize } @ForceInline @@ -558,7 +563,7 @@ final class Short256Vector extends ShortVector { @ForceInline @Override - public Short256Vector withLane(int i, short e) { + public ShortVector256 withLane(int i, short e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -581,7 +586,7 @@ final class Short256Vector extends ShortVector { } @ForceInline - public Short256Vector withLaneHelper(int i, short e) { + public ShortVector256 withLaneHelper(int i, short e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -594,19 +599,20 @@ final class Short256Vector extends ShortVector { // Mask - static final class Short256Mask extends AbstractMask { + static final class ShortMask256 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short256Mask(boolean[] bits) { + static final Class CTYPE = short.class; // used by the JVM + + ShortMask256(boolean[] bits) { this(bits, 0); } - Short256Mask(boolean[] bits, int offset) { + ShortMask256(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Short256Mask(boolean val) { + ShortMask256(boolean val) { super(prepare(val)); } @@ -639,31 +645,31 @@ final class Short256Vector extends ShortVector { } @Override - Short256Mask uOp(MUnOp f) { + ShortMask256 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Short256Mask(res); + return new ShortMask256(res); } @Override - Short256Mask bOp(VectorMask m, MBinOp f) { + ShortMask256 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Short256Mask)m).getBits(); + boolean[] mbits = ((ShortMask256)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Short256Mask(res); + return new ShortMask256(res); } @ForceInline @Override public final - Short256Vector toVector() { - return (Short256Vector) super.toVectorTemplate(); // specialize + ShortVector256 toVector() { + return (ShortVector256) super.toVectorTemplate(); // specialize } /** @@ -696,25 +702,25 @@ final class Short256Vector extends ShortVector { @Override @ForceInline /*package-private*/ - Short256Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Short256Mask) VectorSupport.indexPartiallyInUpperRange( - Short256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Short256Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ShortMask256 indexPartiallyInUpperRange(long offset, long limit) { + return (ShortMask256) VectorSupport.indexPartiallyInUpperRange( + ShortMask256.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ShortMask256) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Short256Mask not() { + public ShortMask256 not() { return xor(maskAll(true)); } @Override @ForceInline - public Short256Mask compress() { - return (Short256Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Short256Vector.class, Short256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ShortMask256 compress() { + return (ShortMask256)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ShortVector256.class, ShortMask256.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -723,30 +729,30 @@ final class Short256Vector extends ShortVector { @Override @ForceInline - public Short256Mask and(VectorMask mask) { + public ShortMask256 and(VectorMask mask) { Objects.requireNonNull(mask); - Short256Mask m = (Short256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask256 m = (ShortMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Short256Mask or(VectorMask mask) { + public ShortMask256 or(VectorMask mask) { Objects.requireNonNull(mask); - Short256Mask m = (Short256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask256 m = (ShortMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Short256Mask xor(VectorMask mask) { + public ShortMask256 xor(VectorMask mask) { Objects.requireNonNull(mask); - Short256Mask m = (Short256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short256Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask256 m = (ShortMask256)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMask256.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -756,21 +762,21 @@ final class Short256Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -780,7 +786,7 @@ final class Short256Vector extends ShortVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -790,7 +796,7 @@ final class Short256Vector extends ShortVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Short256Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ShortMask256.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -799,48 +805,49 @@ final class Short256Vector extends ShortVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Short256Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ShortMask256)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Short256Mask)m).getBits())); + (m, __) -> allTrueHelper(((ShortMask256)m).getBits())); } @ForceInline /*package-private*/ - static Short256Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Short256Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ShortMask256 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ShortMask256.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Short256Mask TRUE_MASK = new Short256Mask(true); - private static final Short256Mask FALSE_MASK = new Short256Mask(false); + private static final ShortMask256 TRUE_MASK = new ShortMask256(true); + private static final ShortMask256 FALSE_MASK = new ShortMask256(false); } // Shuffle - static final class Short256Shuffle extends AbstractShuffle { + static final class ShortShuffle256 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short256Shuffle(short[] indices) { + static final Class CTYPE = short.class; // used by the JVM + + ShortShuffle256(short[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Short256Shuffle(int[] indices, int i) { + ShortShuffle256(int[] indices, int i) { this(prepare(indices, i)); } - Short256Shuffle(IntUnaryOperator fn) { + ShortShuffle256(IntUnaryOperator fn) { this(prepare(fn)); } @@ -860,23 +867,23 @@ final class Short256Vector extends ShortVector { assert(VLENGTH < Short.MAX_VALUE); assert(Short.MIN_VALUE <= -VLENGTH); } - static final Short256Shuffle IOTA = new Short256Shuffle(IDENTITY); + static final ShortShuffle256 IOTA = new ShortShuffle256(IDENTITY); @Override @ForceInline - public Short256Vector toVector() { + public ShortVector256 toVector() { return toBitsVector(); } @Override @ForceInline - Short256Vector toBitsVector() { - return (Short256Vector) super.toBitsVectorTemplate(); + ShortVector256 toBitsVector() { + return (ShortVector256) super.toBitsVectorTemplate(); } @Override - Short256Vector toBitsVector0() { - return ((Short256Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ShortVector256 toBitsVector0() { + return ((ShortVector256) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -913,30 +920,30 @@ final class Short256Vector extends ShortVector { @Override @ForceInline - public final Short256Mask laneIsValid() { - return (Short256Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ShortMask256 laneIsValid() { + return (ShortMask256) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Short256Shuffle rearrange(VectorShuffle shuffle) { - Short256Shuffle concreteShuffle = (Short256Shuffle) shuffle; - return (Short256Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ShortShuffle256 rearrange(VectorShuffle shuffle) { + ShortShuffle256 concreteShuffle = (ShortShuffle256) shuffle; + return (ShortShuffle256) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Short256Shuffle wrapIndexes() { - Short256Vector v = toBitsVector(); + public final ShortShuffle256 wrapIndexes() { + ShortVector256 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Short256Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ShortVector256) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Short256Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ShortVector256) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Short256Shuffle) v.toShuffle(vspecies(), false); + return (ShortShuffle256) v.toShuffle(vspecies(), false); } private static short[] prepare(int[] indices, int offset) { @@ -987,14 +994,14 @@ final class Short256Vector extends ShortVector { @Override final ShortVector fromArray0(short[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Short256Mask.class, a, offset, (Short256Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ShortMask256.class, a, offset, (ShortMask256) m, offsetInRange); // specialize } @ForceInline @Override final ShortVector fromArray0(short[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Short256Mask.class, a, offset, indexMap, mapOffset, (Short256Mask) m); + return super.fromArray0Template(ShortMask256.class, a, offset, indexMap, mapOffset, (ShortMask256) m); } @ForceInline @@ -1008,7 +1015,7 @@ final class Short256Vector extends ShortVector { @Override final ShortVector fromCharArray0(char[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromCharArray0Template(Short256Mask.class, a, offset, (Short256Mask) m, offsetInRange); // specialize + return super.fromCharArray0Template(ShortMask256.class, a, offset, (ShortMask256) m, offsetInRange); // specialize } @@ -1023,7 +1030,7 @@ final class Short256Vector extends ShortVector { @Override final ShortVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Short256Mask.class, ms, offset, (Short256Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ShortMask256.class, ms, offset, (ShortMask256) m, offsetInRange); // specialize } @ForceInline @@ -1037,7 +1044,7 @@ final class Short256Vector extends ShortVector { @Override final void intoArray0(short[] a, int offset, VectorMask m) { - super.intoArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); + super.intoArray0Template(ShortMask256.class, a, offset, (ShortMask256) m); } @@ -1046,14 +1053,14 @@ final class Short256Vector extends ShortVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Short256Mask.class, ms, offset, (Short256Mask) m); + super.intoMemorySegment0Template(ShortMask256.class, ms, offset, (ShortMask256) m); } @ForceInline @Override final void intoCharArray0(char[] a, int offset, VectorMask m) { - super.intoCharArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); + super.intoCharArray0Template(ShortMask256.class, a, offset, (ShortMask256) m); } // End of specialized low-level memory operations. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector512.java similarity index 68% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector512.java index 3da20257a8d..46b5d652200 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector512.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Short512Vector extends ShortVector { +final class ShortVector512 extends ShortVector { static final ShortSpecies VSPECIES = (ShortSpecies) ShortVector.SPECIES_512; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Short512Vector.class; + static final Class VCLASS = ShortVector512.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = short.class; // carrier type used by the JVM + static final Class ETYPE = short.class; // used by the JVM - Short512Vector(short[] v) { + ShortVector512(short[] v) { super(v); } - // For compatibility as Short512Vector::new, + // For compatibility as ShortVector512::new, // stored into species.vectorFactory. - Short512Vector(Object v) { + ShortVector512(Object v) { this((short[]) v); } - static final Short512Vector ZERO = new Short512Vector(new short[VLENGTH]); - static final Short512Vector IOTA = new Short512Vector(VSPECIES.iotaArray()); + static final ShortVector512 ZERO = new ShortVector512(new short[VLENGTH]); + static final ShortVector512 IOTA = new ShortVector512(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Short512Vector extends ShortVector { @Override public final Class elementType() { return short.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Short.SIZE; } @@ -130,51 +135,51 @@ final class Short512Vector extends ShortVector { @Override @ForceInline - public final Short512Vector broadcast(short e) { - return (Short512Vector) super.broadcastTemplate(e); // specialize + public final ShortVector512 broadcast(short e) { + return (ShortVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Short512Vector broadcast(long e) { - return (Short512Vector) super.broadcastTemplate(e); // specialize + public final ShortVector512 broadcast(long e) { + return (ShortVector512) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Short512Mask maskFromArray(boolean[] bits) { - return new Short512Mask(bits); + ShortMask512 maskFromArray(boolean[] bits) { + return new ShortMask512(bits); } @Override @ForceInline - Short512Shuffle iotaShuffle() { return Short512Shuffle.IOTA; } + ShortShuffle512 iotaShuffle() { return ShortShuffle512.IOTA; } @Override @ForceInline - Short512Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Short512Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); + ShortShuffle512 iotaShuffle(int start, int step, boolean wrap) { + return (ShortShuffle512) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short512Shuffle shuffleFromArray(int[] indices, int i) { return new Short512Shuffle(indices, i); } + ShortShuffle512 shuffleFromArray(int[] indices, int i) { return new ShortShuffle512(indices, i); } @Override @ForceInline - Short512Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Short512Shuffle(fn); } + ShortShuffle512 shuffleFromOp(IntUnaryOperator fn) { return new ShortShuffle512(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Short512Vector vectorFactory(short[] vec) { - return new Short512Vector(vec); + ShortVector512 vectorFactory(short[] vec) { + return new ShortVector512(vec); } @ForceInline final @Override - Byte512Vector asByteVectorRaw() { - return (Byte512Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector512 asByteVectorRaw() { + return (ByteVector512) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Short512Vector extends ShortVector { @ForceInline final @Override - Short512Vector uOp(FUnOp f) { - return (Short512Vector) super.uOpTemplate(f); // specialize + ShortVector512 uOp(FUnOp f) { + return (ShortVector512) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Short512Vector uOp(VectorMask m, FUnOp f) { - return (Short512Vector) - super.uOpTemplate((Short512Mask)m, f); // specialize + ShortVector512 uOp(VectorMask m, FUnOp f) { + return (ShortVector512) + super.uOpTemplate((ShortMask512)m, f); // specialize } // Binary operator @ForceInline final @Override - Short512Vector bOp(Vector v, FBinOp f) { - return (Short512Vector) super.bOpTemplate((Short512Vector)v, f); // specialize + ShortVector512 bOp(Vector v, FBinOp f) { + return (ShortVector512) super.bOpTemplate((ShortVector512)v, f); // specialize } @ForceInline final @Override - Short512Vector bOp(Vector v, + ShortVector512 bOp(Vector v, VectorMask m, FBinOp f) { - return (Short512Vector) - super.bOpTemplate((Short512Vector)v, (Short512Mask)m, + return (ShortVector512) + super.bOpTemplate((ShortVector512)v, (ShortMask512)m, f); // specialize } @@ -219,19 +224,19 @@ final class Short512Vector extends ShortVector { @ForceInline final @Override - Short512Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Short512Vector) - super.tOpTemplate((Short512Vector)v1, (Short512Vector)v2, + ShortVector512 tOp(Vector v1, Vector v2, FTriOp f) { + return (ShortVector512) + super.tOpTemplate((ShortVector512)v1, (ShortVector512)v2, f); // specialize } @ForceInline final @Override - Short512Vector tOp(Vector v1, Vector v2, + ShortVector512 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Short512Vector) - super.tOpTemplate((Short512Vector)v1, (Short512Vector)v2, - (Short512Mask)m, f); // specialize + return (ShortVector512) + super.tOpTemplate((ShortVector512)v1, (ShortVector512)v2, + (ShortMask512)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Short512Vector extends ShortVector { @Override @ForceInline - public Short512Vector lanewise(Unary op) { - return (Short512Vector) super.lanewiseTemplate(op); // specialize + public ShortVector512 lanewise(Unary op) { + return (ShortVector512) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Short512Vector lanewise(Unary op, VectorMask m) { - return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, (Short512Mask) m); // specialize + public ShortVector512 lanewise(Unary op, VectorMask m) { + return (ShortVector512) super.lanewiseTemplate(op, ShortMask512.class, (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector lanewise(Binary op, Vector v) { - return (Short512Vector) super.lanewiseTemplate(op, v); // specialize + public ShortVector512 lanewise(Binary op, Vector v) { + return (ShortVector512) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Short512Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, v, (Short512Mask) m); // specialize + public ShortVector512 lanewise(Binary op, Vector v, VectorMask m) { + return (ShortVector512) super.lanewiseTemplate(op, ShortMask512.class, v, (ShortMask512) m); // specialize } /*package-private*/ @Override - @ForceInline Short512Vector + @ForceInline ShortVector512 lanewiseShift(VectorOperators.Binary op, int e) { - return (Short512Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ShortVector512) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Short512Vector + @ForceInline ShortVector512 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Short512Vector) super.lanewiseShiftTemplate(op, Short512Mask.class, e, (Short512Mask) m); // specialize + return (ShortVector512) super.lanewiseShiftTemplate(op, ShortMask512.class, e, (ShortMask512) m); // specialize } /*package-private*/ @Override @ForceInline public final - Short512Vector + ShortVector512 lanewise(Ternary op, Vector v1, Vector v2) { - return (Short512Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ShortVector512) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Short512Vector + ShortVector512 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, v1, v2, (Short512Mask) m); // specialize + return (ShortVector512) super.lanewiseTemplate(op, ShortMask512.class, v1, v2, (ShortMask512) m); // specialize } @Override @ForceInline public final - Short512Vector addIndex(int scale) { - return (Short512Vector) super.addIndexTemplate(scale); // specialize + ShortVector512 addIndex(int scale) { + return (ShortVector512) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Short512Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized + return super.reduceLanesTemplate(op, ShortMask512.class, (ShortMask512) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Short512Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ShortMask512.class, (ShortMask512) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Short512Vector extends ShortVector { @Override @ForceInline - public final Short512Shuffle toShuffle() { - return (Short512Shuffle) toShuffle(vspecies(), false); + public final ShortShuffle512 toShuffle() { + return (ShortShuffle512) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Short512Mask test(Test op) { - return super.testTemplate(Short512Mask.class, op); // specialize + public final ShortMask512 test(Test op) { + return super.testTemplate(ShortMask512.class, op); // specialize } @Override @ForceInline - public final Short512Mask test(Test op, VectorMask m) { - return super.testTemplate(Short512Mask.class, op, (Short512Mask) m); // specialize + public final ShortMask512 test(Test op, VectorMask m) { + return super.testTemplate(ShortMask512.class, op, (ShortMask512) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Short512Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Short512Mask.class, op, v); // specialize + public final ShortMask512 compare(Comparison op, Vector v) { + return super.compareTemplate(ShortMask512.class, op, v); // specialize } @Override @ForceInline - public final Short512Mask compare(Comparison op, short s) { - return super.compareTemplate(Short512Mask.class, op, s); // specialize + public final ShortMask512 compare(Comparison op, short s) { + return super.compareTemplate(ShortMask512.class, op, s); // specialize } @Override @ForceInline - public final Short512Mask compare(Comparison op, long s) { - return super.compareTemplate(Short512Mask.class, op, s); // specialize + public final ShortMask512 compare(Comparison op, long s) { + return super.compareTemplate(ShortMask512.class, op, s); // specialize } @Override @ForceInline - public final Short512Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Short512Mask.class, op, v, (Short512Mask) m); + public final ShortMask512 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ShortMask512.class, op, v, (ShortMask512) m); } @Override @ForceInline - public Short512Vector blend(Vector v, VectorMask m) { - return (Short512Vector) - super.blendTemplate(Short512Mask.class, - (Short512Vector) v, - (Short512Mask) m); // specialize + public ShortVector512 blend(Vector v, VectorMask m) { + return (ShortVector512) + super.blendTemplate(ShortMask512.class, + (ShortVector512) v, + (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector slice(int origin, Vector v) { - return (Short512Vector) super.sliceTemplate(origin, v); // specialize + public ShortVector512 slice(int origin, Vector v) { + return (ShortVector512) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Short512Vector slice(int origin) { - return (Short512Vector) super.sliceTemplate(origin); // specialize + public ShortVector512 slice(int origin) { + return (ShortVector512) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Short512Vector unslice(int origin, Vector w, int part) { - return (Short512Vector) super.unsliceTemplate(origin, w, part); // specialize + public ShortVector512 unslice(int origin, Vector w, int part) { + return (ShortVector512) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Short512Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Short512Vector) - super.unsliceTemplate(Short512Mask.class, + public ShortVector512 unslice(int origin, Vector w, int part, VectorMask m) { + return (ShortVector512) + super.unsliceTemplate(ShortMask512.class, origin, w, part, - (Short512Mask) m); // specialize + (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector unslice(int origin) { - return (Short512Vector) super.unsliceTemplate(origin); // specialize + public ShortVector512 unslice(int origin) { + return (ShortVector512) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Short512Vector rearrange(VectorShuffle s) { - return (Short512Vector) - super.rearrangeTemplate(Short512Shuffle.class, - (Short512Shuffle) s); // specialize + public ShortVector512 rearrange(VectorShuffle s) { + return (ShortVector512) + super.rearrangeTemplate(ShortShuffle512.class, + (ShortShuffle512) s); // specialize } @Override @ForceInline - public Short512Vector rearrange(VectorShuffle shuffle, + public ShortVector512 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Short512Vector) - super.rearrangeTemplate(Short512Shuffle.class, - Short512Mask.class, - (Short512Shuffle) shuffle, - (Short512Mask) m); // specialize + return (ShortVector512) + super.rearrangeTemplate(ShortShuffle512.class, + ShortMask512.class, + (ShortShuffle512) shuffle, + (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector rearrange(VectorShuffle s, + public ShortVector512 rearrange(VectorShuffle s, Vector v) { - return (Short512Vector) - super.rearrangeTemplate(Short512Shuffle.class, - (Short512Shuffle) s, - (Short512Vector) v); // specialize + return (ShortVector512) + super.rearrangeTemplate(ShortShuffle512.class, + (ShortShuffle512) s, + (ShortVector512) v); // specialize } @Override @ForceInline - public Short512Vector compress(VectorMask m) { - return (Short512Vector) - super.compressTemplate(Short512Mask.class, - (Short512Mask) m); // specialize + public ShortVector512 compress(VectorMask m) { + return (ShortVector512) + super.compressTemplate(ShortMask512.class, + (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector expand(VectorMask m) { - return (Short512Vector) - super.expandTemplate(Short512Mask.class, - (Short512Mask) m); // specialize + public ShortVector512 expand(VectorMask m) { + return (ShortVector512) + super.expandTemplate(ShortMask512.class, + (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector selectFrom(Vector v) { - return (Short512Vector) - super.selectFromTemplate((Short512Vector) v); // specialize + public ShortVector512 selectFrom(Vector v) { + return (ShortVector512) + super.selectFromTemplate((ShortVector512) v); // specialize } @Override @ForceInline - public Short512Vector selectFrom(Vector v, + public ShortVector512 selectFrom(Vector v, VectorMask m) { - return (Short512Vector) - super.selectFromTemplate((Short512Vector) v, - Short512Mask.class, (Short512Mask) m); // specialize + return (ShortVector512) + super.selectFromTemplate((ShortVector512) v, + ShortMask512.class, (ShortMask512) m); // specialize } @Override @ForceInline - public Short512Vector selectFrom(Vector v1, + public ShortVector512 selectFrom(Vector v1, Vector v2) { - return (Short512Vector) - super.selectFromTemplate((Short512Vector) v1, (Short512Vector) v2); // specialize + return (ShortVector512) + super.selectFromTemplate((ShortVector512) v1, (ShortVector512) v2); // specialize } @ForceInline @@ -574,7 +579,7 @@ final class Short512Vector extends ShortVector { @ForceInline @Override - public Short512Vector withLane(int i, short e) { + public ShortVector512 withLane(int i, short e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -613,7 +618,7 @@ final class Short512Vector extends ShortVector { } @ForceInline - public Short512Vector withLaneHelper(int i, short e) { + public ShortVector512 withLaneHelper(int i, short e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -626,19 +631,20 @@ final class Short512Vector extends ShortVector { // Mask - static final class Short512Mask extends AbstractMask { + static final class ShortMask512 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short512Mask(boolean[] bits) { + static final Class CTYPE = short.class; // used by the JVM + + ShortMask512(boolean[] bits) { this(bits, 0); } - Short512Mask(boolean[] bits, int offset) { + ShortMask512(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Short512Mask(boolean val) { + ShortMask512(boolean val) { super(prepare(val)); } @@ -671,31 +677,31 @@ final class Short512Vector extends ShortVector { } @Override - Short512Mask uOp(MUnOp f) { + ShortMask512 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Short512Mask(res); + return new ShortMask512(res); } @Override - Short512Mask bOp(VectorMask m, MBinOp f) { + ShortMask512 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Short512Mask)m).getBits(); + boolean[] mbits = ((ShortMask512)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Short512Mask(res); + return new ShortMask512(res); } @ForceInline @Override public final - Short512Vector toVector() { - return (Short512Vector) super.toVectorTemplate(); // specialize + ShortVector512 toVector() { + return (ShortVector512) super.toVectorTemplate(); // specialize } /** @@ -728,25 +734,25 @@ final class Short512Vector extends ShortVector { @Override @ForceInline /*package-private*/ - Short512Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Short512Mask) VectorSupport.indexPartiallyInUpperRange( - Short512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Short512Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ShortMask512 indexPartiallyInUpperRange(long offset, long limit) { + return (ShortMask512) VectorSupport.indexPartiallyInUpperRange( + ShortMask512.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ShortMask512) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Short512Mask not() { + public ShortMask512 not() { return xor(maskAll(true)); } @Override @ForceInline - public Short512Mask compress() { - return (Short512Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Short512Vector.class, Short512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ShortMask512 compress() { + return (ShortMask512)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ShortVector512.class, ShortMask512.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -755,30 +761,30 @@ final class Short512Vector extends ShortVector { @Override @ForceInline - public Short512Mask and(VectorMask mask) { + public ShortMask512 and(VectorMask mask) { Objects.requireNonNull(mask); - Short512Mask m = (Short512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask512 m = (ShortMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Short512Mask or(VectorMask mask) { + public ShortMask512 or(VectorMask mask) { Objects.requireNonNull(mask); - Short512Mask m = (Short512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask512 m = (ShortMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Short512Mask xor(VectorMask mask) { + public ShortMask512 xor(VectorMask mask) { Objects.requireNonNull(mask); - Short512Mask m = (Short512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask512 m = (ShortMask512)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMask512.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -788,21 +794,21 @@ final class Short512Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -812,7 +818,7 @@ final class Short512Vector extends ShortVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -822,7 +828,7 @@ final class Short512Vector extends ShortVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Short512Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ShortMask512.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -831,48 +837,49 @@ final class Short512Vector extends ShortVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Short512Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ShortMask512)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Short512Mask)m).getBits())); + (m, __) -> allTrueHelper(((ShortMask512)m).getBits())); } @ForceInline /*package-private*/ - static Short512Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Short512Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ShortMask512 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ShortMask512.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Short512Mask TRUE_MASK = new Short512Mask(true); - private static final Short512Mask FALSE_MASK = new Short512Mask(false); + private static final ShortMask512 TRUE_MASK = new ShortMask512(true); + private static final ShortMask512 FALSE_MASK = new ShortMask512(false); } // Shuffle - static final class Short512Shuffle extends AbstractShuffle { + static final class ShortShuffle512 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short512Shuffle(short[] indices) { + static final Class CTYPE = short.class; // used by the JVM + + ShortShuffle512(short[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Short512Shuffle(int[] indices, int i) { + ShortShuffle512(int[] indices, int i) { this(prepare(indices, i)); } - Short512Shuffle(IntUnaryOperator fn) { + ShortShuffle512(IntUnaryOperator fn) { this(prepare(fn)); } @@ -892,23 +899,23 @@ final class Short512Vector extends ShortVector { assert(VLENGTH < Short.MAX_VALUE); assert(Short.MIN_VALUE <= -VLENGTH); } - static final Short512Shuffle IOTA = new Short512Shuffle(IDENTITY); + static final ShortShuffle512 IOTA = new ShortShuffle512(IDENTITY); @Override @ForceInline - public Short512Vector toVector() { + public ShortVector512 toVector() { return toBitsVector(); } @Override @ForceInline - Short512Vector toBitsVector() { - return (Short512Vector) super.toBitsVectorTemplate(); + ShortVector512 toBitsVector() { + return (ShortVector512) super.toBitsVectorTemplate(); } @Override - Short512Vector toBitsVector0() { - return ((Short512Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ShortVector512 toBitsVector0() { + return ((ShortVector512) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -945,30 +952,30 @@ final class Short512Vector extends ShortVector { @Override @ForceInline - public final Short512Mask laneIsValid() { - return (Short512Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ShortMask512 laneIsValid() { + return (ShortMask512) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Short512Shuffle rearrange(VectorShuffle shuffle) { - Short512Shuffle concreteShuffle = (Short512Shuffle) shuffle; - return (Short512Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ShortShuffle512 rearrange(VectorShuffle shuffle) { + ShortShuffle512 concreteShuffle = (ShortShuffle512) shuffle; + return (ShortShuffle512) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Short512Shuffle wrapIndexes() { - Short512Vector v = toBitsVector(); + public final ShortShuffle512 wrapIndexes() { + ShortVector512 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Short512Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ShortVector512) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Short512Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ShortVector512) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Short512Shuffle) v.toShuffle(vspecies(), false); + return (ShortShuffle512) v.toShuffle(vspecies(), false); } private static short[] prepare(int[] indices, int offset) { @@ -1019,14 +1026,14 @@ final class Short512Vector extends ShortVector { @Override final ShortVector fromArray0(short[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Short512Mask.class, a, offset, (Short512Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ShortMask512.class, a, offset, (ShortMask512) m, offsetInRange); // specialize } @ForceInline @Override final ShortVector fromArray0(short[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Short512Mask.class, a, offset, indexMap, mapOffset, (Short512Mask) m); + return super.fromArray0Template(ShortMask512.class, a, offset, indexMap, mapOffset, (ShortMask512) m); } @ForceInline @@ -1040,7 +1047,7 @@ final class Short512Vector extends ShortVector { @Override final ShortVector fromCharArray0(char[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m, offsetInRange); // specialize + return super.fromCharArray0Template(ShortMask512.class, a, offset, (ShortMask512) m, offsetInRange); // specialize } @@ -1055,7 +1062,7 @@ final class Short512Vector extends ShortVector { @Override final ShortVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Short512Mask.class, ms, offset, (Short512Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ShortMask512.class, ms, offset, (ShortMask512) m, offsetInRange); // specialize } @ForceInline @@ -1069,7 +1076,7 @@ final class Short512Vector extends ShortVector { @Override final void intoArray0(short[] a, int offset, VectorMask m) { - super.intoArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); + super.intoArray0Template(ShortMask512.class, a, offset, (ShortMask512) m); } @@ -1078,14 +1085,14 @@ final class Short512Vector extends ShortVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Short512Mask.class, ms, offset, (Short512Mask) m); + super.intoMemorySegment0Template(ShortMask512.class, ms, offset, (ShortMask512) m); } @ForceInline @Override final void intoCharArray0(char[] a, int offset, VectorMask m) { - super.intoCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); + super.intoCharArray0Template(ShortMask512.class, a, offset, (ShortMask512) m); } // End of specialized low-level memory operations. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector64.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector64.java index 8b3246996f3..66ff3efe522 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector64.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class Short64Vector extends ShortVector { +final class ShortVector64 extends ShortVector { static final ShortSpecies VSPECIES = (ShortSpecies) ShortVector.SPECIES_64; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = Short64Vector.class; + static final Class VCLASS = ShortVector64.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = short.class; // carrier type used by the JVM + static final Class ETYPE = short.class; // used by the JVM - Short64Vector(short[] v) { + ShortVector64(short[] v) { super(v); } - // For compatibility as Short64Vector::new, + // For compatibility as ShortVector64::new, // stored into species.vectorFactory. - Short64Vector(Object v) { + ShortVector64(Object v) { this((short[]) v); } - static final Short64Vector ZERO = new Short64Vector(new short[VLENGTH]); - static final Short64Vector IOTA = new Short64Vector(VSPECIES.iotaArray()); + static final ShortVector64 ZERO = new ShortVector64(new short[VLENGTH]); + static final ShortVector64 IOTA = new ShortVector64(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class Short64Vector extends ShortVector { @Override public final Class elementType() { return short.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Short.SIZE; } @@ -130,51 +135,51 @@ final class Short64Vector extends ShortVector { @Override @ForceInline - public final Short64Vector broadcast(short e) { - return (Short64Vector) super.broadcastTemplate(e); // specialize + public final ShortVector64 broadcast(short e) { + return (ShortVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final Short64Vector broadcast(long e) { - return (Short64Vector) super.broadcastTemplate(e); // specialize + public final ShortVector64 broadcast(long e) { + return (ShortVector64) super.broadcastTemplate(e); // specialize } @Override @ForceInline - Short64Mask maskFromArray(boolean[] bits) { - return new Short64Mask(bits); + ShortMask64 maskFromArray(boolean[] bits) { + return new ShortMask64(bits); } @Override @ForceInline - Short64Shuffle iotaShuffle() { return Short64Shuffle.IOTA; } + ShortShuffle64 iotaShuffle() { return ShortShuffle64.IOTA; } @Override @ForceInline - Short64Shuffle iotaShuffle(int start, int step, boolean wrap) { - return (Short64Shuffle) iotaShuffleTemplate((short) start, (short) step, wrap); + ShortShuffle64 iotaShuffle(int start, int step, boolean wrap) { + return (ShortShuffle64) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - Short64Shuffle shuffleFromArray(int[] indices, int i) { return new Short64Shuffle(indices, i); } + ShortShuffle64 shuffleFromArray(int[] indices, int i) { return new ShortShuffle64(indices, i); } @Override @ForceInline - Short64Shuffle shuffleFromOp(IntUnaryOperator fn) { return new Short64Shuffle(fn); } + ShortShuffle64 shuffleFromOp(IntUnaryOperator fn) { return new ShortShuffle64(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - Short64Vector vectorFactory(short[] vec) { - return new Short64Vector(vec); + ShortVector64 vectorFactory(short[] vec) { + return new ShortVector64(vec); } @ForceInline final @Override - Byte64Vector asByteVectorRaw() { - return (Byte64Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector64 asByteVectorRaw() { + return (ByteVector64) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class Short64Vector extends ShortVector { @ForceInline final @Override - Short64Vector uOp(FUnOp f) { - return (Short64Vector) super.uOpTemplate(f); // specialize + ShortVector64 uOp(FUnOp f) { + return (ShortVector64) super.uOpTemplate(f); // specialize } @ForceInline final @Override - Short64Vector uOp(VectorMask m, FUnOp f) { - return (Short64Vector) - super.uOpTemplate((Short64Mask)m, f); // specialize + ShortVector64 uOp(VectorMask m, FUnOp f) { + return (ShortVector64) + super.uOpTemplate((ShortMask64)m, f); // specialize } // Binary operator @ForceInline final @Override - Short64Vector bOp(Vector v, FBinOp f) { - return (Short64Vector) super.bOpTemplate((Short64Vector)v, f); // specialize + ShortVector64 bOp(Vector v, FBinOp f) { + return (ShortVector64) super.bOpTemplate((ShortVector64)v, f); // specialize } @ForceInline final @Override - Short64Vector bOp(Vector v, + ShortVector64 bOp(Vector v, VectorMask m, FBinOp f) { - return (Short64Vector) - super.bOpTemplate((Short64Vector)v, (Short64Mask)m, + return (ShortVector64) + super.bOpTemplate((ShortVector64)v, (ShortMask64)m, f); // specialize } @@ -219,19 +224,19 @@ final class Short64Vector extends ShortVector { @ForceInline final @Override - Short64Vector tOp(Vector v1, Vector v2, FTriOp f) { - return (Short64Vector) - super.tOpTemplate((Short64Vector)v1, (Short64Vector)v2, + ShortVector64 tOp(Vector v1, Vector v2, FTriOp f) { + return (ShortVector64) + super.tOpTemplate((ShortVector64)v1, (ShortVector64)v2, f); // specialize } @ForceInline final @Override - Short64Vector tOp(Vector v1, Vector v2, + ShortVector64 tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (Short64Vector) - super.tOpTemplate((Short64Vector)v1, (Short64Vector)v2, - (Short64Mask)m, f); // specialize + return (ShortVector64) + super.tOpTemplate((ShortVector64)v1, (ShortVector64)v2, + (ShortMask64)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class Short64Vector extends ShortVector { @Override @ForceInline - public Short64Vector lanewise(Unary op) { - return (Short64Vector) super.lanewiseTemplate(op); // specialize + public ShortVector64 lanewise(Unary op) { + return (ShortVector64) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public Short64Vector lanewise(Unary op, VectorMask m) { - return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, (Short64Mask) m); // specialize + public ShortVector64 lanewise(Unary op, VectorMask m) { + return (ShortVector64) super.lanewiseTemplate(op, ShortMask64.class, (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector lanewise(Binary op, Vector v) { - return (Short64Vector) super.lanewiseTemplate(op, v); // specialize + public ShortVector64 lanewise(Binary op, Vector v) { + return (ShortVector64) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public Short64Vector lanewise(Binary op, Vector v, VectorMask m) { - return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, v, (Short64Mask) m); // specialize + public ShortVector64 lanewise(Binary op, Vector v, VectorMask m) { + return (ShortVector64) super.lanewiseTemplate(op, ShortMask64.class, v, (ShortMask64) m); // specialize } /*package-private*/ @Override - @ForceInline Short64Vector + @ForceInline ShortVector64 lanewiseShift(VectorOperators.Binary op, int e) { - return (Short64Vector) super.lanewiseShiftTemplate(op, e); // specialize + return (ShortVector64) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline Short64Vector + @ForceInline ShortVector64 lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (Short64Vector) super.lanewiseShiftTemplate(op, Short64Mask.class, e, (Short64Mask) m); // specialize + return (ShortVector64) super.lanewiseShiftTemplate(op, ShortMask64.class, e, (ShortMask64) m); // specialize } /*package-private*/ @Override @ForceInline public final - Short64Vector + ShortVector64 lanewise(Ternary op, Vector v1, Vector v2) { - return (Short64Vector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ShortVector64) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - Short64Vector + ShortVector64 lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, v1, v2, (Short64Mask) m); // specialize + return (ShortVector64) super.lanewiseTemplate(op, ShortMask64.class, v1, v2, (ShortMask64) m); // specialize } @Override @ForceInline public final - Short64Vector addIndex(int scale) { - return (Short64Vector) super.addIndexTemplate(scale); // specialize + ShortVector64 addIndex(int scale) { + return (ShortVector64) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class Short64Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized + return super.reduceLanesTemplate(op, ShortMask64.class, (ShortMask64) m); // specialized } @Override @@ -354,7 +359,7 @@ final class Short64Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized + return (long) super.reduceLanesTemplate(op, ShortMask64.class, (ShortMask64) m); // specialized } @Override @@ -365,160 +370,160 @@ final class Short64Vector extends ShortVector { @Override @ForceInline - public final Short64Shuffle toShuffle() { - return (Short64Shuffle) toShuffle(vspecies(), false); + public final ShortShuffle64 toShuffle() { + return (ShortShuffle64) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final Short64Mask test(Test op) { - return super.testTemplate(Short64Mask.class, op); // specialize + public final ShortMask64 test(Test op) { + return super.testTemplate(ShortMask64.class, op); // specialize } @Override @ForceInline - public final Short64Mask test(Test op, VectorMask m) { - return super.testTemplate(Short64Mask.class, op, (Short64Mask) m); // specialize + public final ShortMask64 test(Test op, VectorMask m) { + return super.testTemplate(ShortMask64.class, op, (ShortMask64) m); // specialize } // Specialized comparisons @Override @ForceInline - public final Short64Mask compare(Comparison op, Vector v) { - return super.compareTemplate(Short64Mask.class, op, v); // specialize + public final ShortMask64 compare(Comparison op, Vector v) { + return super.compareTemplate(ShortMask64.class, op, v); // specialize } @Override @ForceInline - public final Short64Mask compare(Comparison op, short s) { - return super.compareTemplate(Short64Mask.class, op, s); // specialize + public final ShortMask64 compare(Comparison op, short s) { + return super.compareTemplate(ShortMask64.class, op, s); // specialize } @Override @ForceInline - public final Short64Mask compare(Comparison op, long s) { - return super.compareTemplate(Short64Mask.class, op, s); // specialize + public final ShortMask64 compare(Comparison op, long s) { + return super.compareTemplate(ShortMask64.class, op, s); // specialize } @Override @ForceInline - public final Short64Mask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(Short64Mask.class, op, v, (Short64Mask) m); + public final ShortMask64 compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ShortMask64.class, op, v, (ShortMask64) m); } @Override @ForceInline - public Short64Vector blend(Vector v, VectorMask m) { - return (Short64Vector) - super.blendTemplate(Short64Mask.class, - (Short64Vector) v, - (Short64Mask) m); // specialize + public ShortVector64 blend(Vector v, VectorMask m) { + return (ShortVector64) + super.blendTemplate(ShortMask64.class, + (ShortVector64) v, + (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector slice(int origin, Vector v) { - return (Short64Vector) super.sliceTemplate(origin, v); // specialize + public ShortVector64 slice(int origin, Vector v) { + return (ShortVector64) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public Short64Vector slice(int origin) { - return (Short64Vector) super.sliceTemplate(origin); // specialize + public ShortVector64 slice(int origin) { + return (ShortVector64) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public Short64Vector unslice(int origin, Vector w, int part) { - return (Short64Vector) super.unsliceTemplate(origin, w, part); // specialize + public ShortVector64 unslice(int origin, Vector w, int part) { + return (ShortVector64) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public Short64Vector unslice(int origin, Vector w, int part, VectorMask m) { - return (Short64Vector) - super.unsliceTemplate(Short64Mask.class, + public ShortVector64 unslice(int origin, Vector w, int part, VectorMask m) { + return (ShortVector64) + super.unsliceTemplate(ShortMask64.class, origin, w, part, - (Short64Mask) m); // specialize + (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector unslice(int origin) { - return (Short64Vector) super.unsliceTemplate(origin); // specialize + public ShortVector64 unslice(int origin) { + return (ShortVector64) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public Short64Vector rearrange(VectorShuffle s) { - return (Short64Vector) - super.rearrangeTemplate(Short64Shuffle.class, - (Short64Shuffle) s); // specialize + public ShortVector64 rearrange(VectorShuffle s) { + return (ShortVector64) + super.rearrangeTemplate(ShortShuffle64.class, + (ShortShuffle64) s); // specialize } @Override @ForceInline - public Short64Vector rearrange(VectorShuffle shuffle, + public ShortVector64 rearrange(VectorShuffle shuffle, VectorMask m) { - return (Short64Vector) - super.rearrangeTemplate(Short64Shuffle.class, - Short64Mask.class, - (Short64Shuffle) shuffle, - (Short64Mask) m); // specialize + return (ShortVector64) + super.rearrangeTemplate(ShortShuffle64.class, + ShortMask64.class, + (ShortShuffle64) shuffle, + (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector rearrange(VectorShuffle s, + public ShortVector64 rearrange(VectorShuffle s, Vector v) { - return (Short64Vector) - super.rearrangeTemplate(Short64Shuffle.class, - (Short64Shuffle) s, - (Short64Vector) v); // specialize + return (ShortVector64) + super.rearrangeTemplate(ShortShuffle64.class, + (ShortShuffle64) s, + (ShortVector64) v); // specialize } @Override @ForceInline - public Short64Vector compress(VectorMask m) { - return (Short64Vector) - super.compressTemplate(Short64Mask.class, - (Short64Mask) m); // specialize + public ShortVector64 compress(VectorMask m) { + return (ShortVector64) + super.compressTemplate(ShortMask64.class, + (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector expand(VectorMask m) { - return (Short64Vector) - super.expandTemplate(Short64Mask.class, - (Short64Mask) m); // specialize + public ShortVector64 expand(VectorMask m) { + return (ShortVector64) + super.expandTemplate(ShortMask64.class, + (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector selectFrom(Vector v) { - return (Short64Vector) - super.selectFromTemplate((Short64Vector) v); // specialize + public ShortVector64 selectFrom(Vector v) { + return (ShortVector64) + super.selectFromTemplate((ShortVector64) v); // specialize } @Override @ForceInline - public Short64Vector selectFrom(Vector v, + public ShortVector64 selectFrom(Vector v, VectorMask m) { - return (Short64Vector) - super.selectFromTemplate((Short64Vector) v, - Short64Mask.class, (Short64Mask) m); // specialize + return (ShortVector64) + super.selectFromTemplate((ShortVector64) v, + ShortMask64.class, (ShortMask64) m); // specialize } @Override @ForceInline - public Short64Vector selectFrom(Vector v1, + public ShortVector64 selectFrom(Vector v1, Vector v2) { - return (Short64Vector) - super.selectFromTemplate((Short64Vector) v1, (Short64Vector) v2); // specialize + return (ShortVector64) + super.selectFromTemplate((ShortVector64) v1, (ShortVector64) v2); // specialize } @ForceInline @@ -546,7 +551,7 @@ final class Short64Vector extends ShortVector { @ForceInline @Override - public Short64Vector withLane(int i, short e) { + public ShortVector64 withLane(int i, short e) { switch (i) { case 0: return withLaneHelper(0, e); case 1: return withLaneHelper(1, e); @@ -557,7 +562,7 @@ final class Short64Vector extends ShortVector { } @ForceInline - public Short64Vector withLaneHelper(int i, short e) { + public ShortVector64 withLaneHelper(int i, short e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -570,19 +575,20 @@ final class Short64Vector extends ShortVector { // Mask - static final class Short64Mask extends AbstractMask { + static final class ShortMask64 extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short64Mask(boolean[] bits) { + static final Class CTYPE = short.class; // used by the JVM + + ShortMask64(boolean[] bits) { this(bits, 0); } - Short64Mask(boolean[] bits, int offset) { + ShortMask64(boolean[] bits, int offset) { super(prepare(bits, offset)); } - Short64Mask(boolean val) { + ShortMask64(boolean val) { super(prepare(val)); } @@ -615,31 +621,31 @@ final class Short64Vector extends ShortVector { } @Override - Short64Mask uOp(MUnOp f) { + ShortMask64 uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new Short64Mask(res); + return new ShortMask64(res); } @Override - Short64Mask bOp(VectorMask m, MBinOp f) { + ShortMask64 bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((Short64Mask)m).getBits(); + boolean[] mbits = ((ShortMask64)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new Short64Mask(res); + return new ShortMask64(res); } @ForceInline @Override public final - Short64Vector toVector() { - return (Short64Vector) super.toVectorTemplate(); // specialize + ShortVector64 toVector() { + return (ShortVector64) super.toVectorTemplate(); // specialize } /** @@ -672,25 +678,25 @@ final class Short64Vector extends ShortVector { @Override @ForceInline /*package-private*/ - Short64Mask indexPartiallyInUpperRange(long offset, long limit) { - return (Short64Mask) VectorSupport.indexPartiallyInUpperRange( - Short64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (Short64Mask) TRUE_MASK.indexPartiallyInRange(o, l)); + ShortMask64 indexPartiallyInUpperRange(long offset, long limit) { + return (ShortMask64) VectorSupport.indexPartiallyInUpperRange( + ShortMask64.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ShortMask64) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public Short64Mask not() { + public ShortMask64 not() { return xor(maskAll(true)); } @Override @ForceInline - public Short64Mask compress() { - return (Short64Mask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - Short64Vector.class, Short64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ShortMask64 compress() { + return (ShortMask64)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ShortVector64.class, ShortMask64.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -699,30 +705,30 @@ final class Short64Vector extends ShortVector { @Override @ForceInline - public Short64Mask and(VectorMask mask) { + public ShortMask64 and(VectorMask mask) { Objects.requireNonNull(mask); - Short64Mask m = (Short64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask64 m = (ShortMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public Short64Mask or(VectorMask mask) { + public ShortMask64 or(VectorMask mask) { Objects.requireNonNull(mask); - Short64Mask m = (Short64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask64 m = (ShortMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public Short64Mask xor(VectorMask mask) { + public ShortMask64 xor(VectorMask mask) { Objects.requireNonNull(mask); - Short64Mask m = (Short64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMask64 m = (ShortMask64)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMask64.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -732,21 +738,21 @@ final class Short64Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -756,7 +762,7 @@ final class Short64Vector extends ShortVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -766,7 +772,7 @@ final class Short64Vector extends ShortVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(Short64Mask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ShortMask64.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -775,48 +781,49 @@ final class Short64Vector extends ShortVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((Short64Mask)m).getBits())); + (m, __) -> anyTrueHelper(((ShortMask64)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((Short64Mask)m).getBits())); + (m, __) -> allTrueHelper(((ShortMask64)m).getBits())); } @ForceInline /*package-private*/ - static Short64Mask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(Short64Mask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ShortMask64 maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ShortMask64.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final Short64Mask TRUE_MASK = new Short64Mask(true); - private static final Short64Mask FALSE_MASK = new Short64Mask(false); + private static final ShortMask64 TRUE_MASK = new ShortMask64(true); + private static final ShortMask64 FALSE_MASK = new ShortMask64(false); } // Shuffle - static final class Short64Shuffle extends AbstractShuffle { + static final class ShortShuffle64 extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - Short64Shuffle(short[] indices) { + static final Class CTYPE = short.class; // used by the JVM + + ShortShuffle64(short[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - Short64Shuffle(int[] indices, int i) { + ShortShuffle64(int[] indices, int i) { this(prepare(indices, i)); } - Short64Shuffle(IntUnaryOperator fn) { + ShortShuffle64(IntUnaryOperator fn) { this(prepare(fn)); } @@ -836,23 +843,23 @@ final class Short64Vector extends ShortVector { assert(VLENGTH < Short.MAX_VALUE); assert(Short.MIN_VALUE <= -VLENGTH); } - static final Short64Shuffle IOTA = new Short64Shuffle(IDENTITY); + static final ShortShuffle64 IOTA = new ShortShuffle64(IDENTITY); @Override @ForceInline - public Short64Vector toVector() { + public ShortVector64 toVector() { return toBitsVector(); } @Override @ForceInline - Short64Vector toBitsVector() { - return (Short64Vector) super.toBitsVectorTemplate(); + ShortVector64 toBitsVector() { + return (ShortVector64) super.toBitsVectorTemplate(); } @Override - Short64Vector toBitsVector0() { - return ((Short64Vector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ShortVector64 toBitsVector0() { + return ((ShortVector64) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -889,30 +896,30 @@ final class Short64Vector extends ShortVector { @Override @ForceInline - public final Short64Mask laneIsValid() { - return (Short64Mask) toBitsVector().compare(VectorOperators.GE, 0) + public final ShortMask64 laneIsValid() { + return (ShortMask64) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final Short64Shuffle rearrange(VectorShuffle shuffle) { - Short64Shuffle concreteShuffle = (Short64Shuffle) shuffle; - return (Short64Shuffle) toBitsVector().rearrange(concreteShuffle) + public final ShortShuffle64 rearrange(VectorShuffle shuffle) { + ShortShuffle64 concreteShuffle = (ShortShuffle64) shuffle; + return (ShortShuffle64) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final Short64Shuffle wrapIndexes() { - Short64Vector v = toBitsVector(); + public final ShortShuffle64 wrapIndexes() { + ShortVector64 v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (Short64Vector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ShortVector64) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (Short64Vector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ShortVector64) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (Short64Shuffle) v.toShuffle(vspecies(), false); + return (ShortShuffle64) v.toShuffle(vspecies(), false); } private static short[] prepare(int[] indices, int offset) { @@ -963,14 +970,14 @@ final class Short64Vector extends ShortVector { @Override final ShortVector fromArray0(short[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(Short64Mask.class, a, offset, (Short64Mask) m, offsetInRange); // specialize + return super.fromArray0Template(ShortMask64.class, a, offset, (ShortMask64) m, offsetInRange); // specialize } @ForceInline @Override final ShortVector fromArray0(short[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(Short64Mask.class, a, offset, indexMap, mapOffset, (Short64Mask) m); + return super.fromArray0Template(ShortMask64.class, a, offset, indexMap, mapOffset, (ShortMask64) m); } @ForceInline @@ -984,7 +991,7 @@ final class Short64Vector extends ShortVector { @Override final ShortVector fromCharArray0(char[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m, offsetInRange); // specialize + return super.fromCharArray0Template(ShortMask64.class, a, offset, (ShortMask64) m, offsetInRange); // specialize } @@ -999,7 +1006,7 @@ final class Short64Vector extends ShortVector { @Override final ShortVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(Short64Mask.class, ms, offset, (Short64Mask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ShortMask64.class, ms, offset, (ShortMask64) m, offsetInRange); // specialize } @ForceInline @@ -1013,7 +1020,7 @@ final class Short64Vector extends ShortVector { @Override final void intoArray0(short[] a, int offset, VectorMask m) { - super.intoArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); + super.intoArray0Template(ShortMask64.class, a, offset, (ShortMask64) m); } @@ -1022,14 +1029,14 @@ final class Short64Vector extends ShortVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(Short64Mask.class, ms, offset, (Short64Mask) m); + super.intoMemorySegment0Template(ShortMask64.class, ms, offset, (ShortMask64) m); } @ForceInline @Override final void intoCharArray0(char[] a, int offset, VectorMask m) { - super.intoCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); + super.intoCharArray0Template(ShortMask64.class, a, offset, (ShortMask64) m); } // End of specialized low-level memory operations. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVectorMax.java similarity index 65% rename from src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java rename to src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVectorMax.java index bf9b13c6606..b9a9b85126b 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVectorMax.java @@ -41,33 +41,35 @@ import static jdk.incubator.vector.VectorOperators.*; // -- This file was mechanically generated: Do not edit! -- // @SuppressWarnings("cast") // warning: redundant cast -final class ShortMaxVector extends ShortVector { +final class ShortVectorMax extends ShortVector { static final ShortSpecies VSPECIES = (ShortSpecies) ShortVector.SPECIES_MAX; static final VectorShape VSHAPE = VSPECIES.vectorShape(); - static final Class VCLASS = ShortMaxVector.class; + static final Class VCLASS = ShortVectorMax.class; static final int VSIZE = VSPECIES.vectorBitSize(); static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class CTYPE = short.class; // carrier type used by the JVM + static final Class ETYPE = short.class; // used by the JVM - ShortMaxVector(short[] v) { + ShortVectorMax(short[] v) { super(v); } - // For compatibility as ShortMaxVector::new, + // For compatibility as ShortVectorMax::new, // stored into species.vectorFactory. - ShortMaxVector(Object v) { + ShortVectorMax(Object v) { this((short[]) v); } - static final ShortMaxVector ZERO = new ShortMaxVector(new short[VLENGTH]); - static final ShortMaxVector IOTA = new ShortMaxVector(VSPECIES.iotaArray()); + static final ShortVectorMax ZERO = new ShortVectorMax(new short[VLENGTH]); + static final ShortVectorMax IOTA = new ShortVectorMax(VSPECIES.iotaArray()); static { // Warm up a few species caches. @@ -92,6 +94,9 @@ final class ShortMaxVector extends ShortVector { @Override public final Class elementType() { return short.class; } + @ForceInline + final Class carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return Short.SIZE; } @@ -130,51 +135,51 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline - public final ShortMaxVector broadcast(short e) { - return (ShortMaxVector) super.broadcastTemplate(e); // specialize + public final ShortVectorMax broadcast(short e) { + return (ShortVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - public final ShortMaxVector broadcast(long e) { - return (ShortMaxVector) super.broadcastTemplate(e); // specialize + public final ShortVectorMax broadcast(long e) { + return (ShortVectorMax) super.broadcastTemplate(e); // specialize } @Override @ForceInline - ShortMaxMask maskFromArray(boolean[] bits) { - return new ShortMaxMask(bits); + ShortMaskMax maskFromArray(boolean[] bits) { + return new ShortMaskMax(bits); } @Override @ForceInline - ShortMaxShuffle iotaShuffle() { return ShortMaxShuffle.IOTA; } + ShortShuffleMax iotaShuffle() { return ShortShuffleMax.IOTA; } @Override @ForceInline - ShortMaxShuffle iotaShuffle(int start, int step, boolean wrap) { - return (ShortMaxShuffle) iotaShuffleTemplate((short) start, (short) step, wrap); + ShortShuffleMax iotaShuffle(int start, int step, boolean wrap) { + return (ShortShuffleMax) iotaShuffleTemplate((short) start, (short) step, wrap); } @Override @ForceInline - ShortMaxShuffle shuffleFromArray(int[] indices, int i) { return new ShortMaxShuffle(indices, i); } + ShortShuffleMax shuffleFromArray(int[] indices, int i) { return new ShortShuffleMax(indices, i); } @Override @ForceInline - ShortMaxShuffle shuffleFromOp(IntUnaryOperator fn) { return new ShortMaxShuffle(fn); } + ShortShuffleMax shuffleFromOp(IntUnaryOperator fn) { return new ShortShuffleMax(fn); } // Make a vector of the same species but the given elements: @ForceInline final @Override - ShortMaxVector vectorFactory(short[] vec) { - return new ShortMaxVector(vec); + ShortVectorMax vectorFactory(short[] vec) { + return new ShortVectorMax(vec); } @ForceInline final @Override - ByteMaxVector asByteVectorRaw() { - return (ByteMaxVector) super.asByteVectorRawTemplate(); // specialize + ByteVectorMax asByteVectorRaw() { + return (ByteVectorMax) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -187,31 +192,31 @@ final class ShortMaxVector extends ShortVector { @ForceInline final @Override - ShortMaxVector uOp(FUnOp f) { - return (ShortMaxVector) super.uOpTemplate(f); // specialize + ShortVectorMax uOp(FUnOp f) { + return (ShortVectorMax) super.uOpTemplate(f); // specialize } @ForceInline final @Override - ShortMaxVector uOp(VectorMask m, FUnOp f) { - return (ShortMaxVector) - super.uOpTemplate((ShortMaxMask)m, f); // specialize + ShortVectorMax uOp(VectorMask m, FUnOp f) { + return (ShortVectorMax) + super.uOpTemplate((ShortMaskMax)m, f); // specialize } // Binary operator @ForceInline final @Override - ShortMaxVector bOp(Vector v, FBinOp f) { - return (ShortMaxVector) super.bOpTemplate((ShortMaxVector)v, f); // specialize + ShortVectorMax bOp(Vector v, FBinOp f) { + return (ShortVectorMax) super.bOpTemplate((ShortVectorMax)v, f); // specialize } @ForceInline final @Override - ShortMaxVector bOp(Vector v, + ShortVectorMax bOp(Vector v, VectorMask m, FBinOp f) { - return (ShortMaxVector) - super.bOpTemplate((ShortMaxVector)v, (ShortMaxMask)m, + return (ShortVectorMax) + super.bOpTemplate((ShortVectorMax)v, (ShortMaskMax)m, f); // specialize } @@ -219,19 +224,19 @@ final class ShortMaxVector extends ShortVector { @ForceInline final @Override - ShortMaxVector tOp(Vector v1, Vector v2, FTriOp f) { - return (ShortMaxVector) - super.tOpTemplate((ShortMaxVector)v1, (ShortMaxVector)v2, + ShortVectorMax tOp(Vector v1, Vector v2, FTriOp f) { + return (ShortVectorMax) + super.tOpTemplate((ShortVectorMax)v1, (ShortVectorMax)v2, f); // specialize } @ForceInline final @Override - ShortMaxVector tOp(Vector v1, Vector v2, + ShortVectorMax tOp(Vector v1, Vector v2, VectorMask m, FTriOp f) { - return (ShortMaxVector) - super.tOpTemplate((ShortMaxVector)v1, (ShortMaxVector)v2, - (ShortMaxMask)m, f); // specialize + return (ShortVectorMax) + super.tOpTemplate((ShortVectorMax)v1, (ShortVectorMax)v2, + (ShortMaskMax)m, f); // specialize } @ForceInline @@ -269,64 +274,64 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline - public ShortMaxVector lanewise(Unary op) { - return (ShortMaxVector) super.lanewiseTemplate(op); // specialize + public ShortVectorMax lanewise(Unary op) { + return (ShortVectorMax) super.lanewiseTemplate(op); // specialize } @Override @ForceInline - public ShortMaxVector lanewise(Unary op, VectorMask m) { - return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialize + public ShortVectorMax lanewise(Unary op, VectorMask m) { + return (ShortVectorMax) super.lanewiseTemplate(op, ShortMaskMax.class, (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector lanewise(Binary op, Vector v) { - return (ShortMaxVector) super.lanewiseTemplate(op, v); // specialize + public ShortVectorMax lanewise(Binary op, Vector v) { + return (ShortVectorMax) super.lanewiseTemplate(op, v); // specialize } @Override @ForceInline - public ShortMaxVector lanewise(Binary op, Vector v, VectorMask m) { - return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, v, (ShortMaxMask) m); // specialize + public ShortVectorMax lanewise(Binary op, Vector v, VectorMask m) { + return (ShortVectorMax) super.lanewiseTemplate(op, ShortMaskMax.class, v, (ShortMaskMax) m); // specialize } /*package-private*/ @Override - @ForceInline ShortMaxVector + @ForceInline ShortVectorMax lanewiseShift(VectorOperators.Binary op, int e) { - return (ShortMaxVector) super.lanewiseShiftTemplate(op, e); // specialize + return (ShortVectorMax) super.lanewiseShiftTemplate(op, e); // specialize } /*package-private*/ @Override - @ForceInline ShortMaxVector + @ForceInline ShortVectorMax lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { - return (ShortMaxVector) super.lanewiseShiftTemplate(op, ShortMaxMask.class, e, (ShortMaxMask) m); // specialize + return (ShortVectorMax) super.lanewiseShiftTemplate(op, ShortMaskMax.class, e, (ShortMaskMax) m); // specialize } /*package-private*/ @Override @ForceInline public final - ShortMaxVector + ShortVectorMax lanewise(Ternary op, Vector v1, Vector v2) { - return (ShortMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize + return (ShortVectorMax) super.lanewiseTemplate(op, v1, v2); // specialize } @Override @ForceInline public final - ShortMaxVector + ShortVectorMax lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { - return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, v1, v2, (ShortMaxMask) m); // specialize + return (ShortVectorMax) super.lanewiseTemplate(op, ShortMaskMax.class, v1, v2, (ShortMaskMax) m); // specialize } @Override @ForceInline public final - ShortMaxVector addIndex(int scale) { - return (ShortMaxVector) super.addIndexTemplate(scale); // specialize + ShortVectorMax addIndex(int scale) { + return (ShortVectorMax) super.addIndexTemplate(scale); // specialize } // Type specific horizontal reductions @@ -341,7 +346,7 @@ final class ShortMaxVector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized + return super.reduceLanesTemplate(op, ShortMaskMax.class, (ShortMaskMax) m); // specialized } @Override @@ -354,7 +359,7 @@ final class ShortMaxVector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized + return (long) super.reduceLanesTemplate(op, ShortMaskMax.class, (ShortMaskMax) m); // specialized } @Override @@ -365,160 +370,160 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline - public final ShortMaxShuffle toShuffle() { - return (ShortMaxShuffle) toShuffle(vspecies(), false); + public final ShortShuffleMax toShuffle() { + return (ShortShuffleMax) toShuffle(vspecies(), false); } // Specialized unary testing @Override @ForceInline - public final ShortMaxMask test(Test op) { - return super.testTemplate(ShortMaxMask.class, op); // specialize + public final ShortMaskMax test(Test op) { + return super.testTemplate(ShortMaskMax.class, op); // specialize } @Override @ForceInline - public final ShortMaxMask test(Test op, VectorMask m) { - return super.testTemplate(ShortMaxMask.class, op, (ShortMaxMask) m); // specialize + public final ShortMaskMax test(Test op, VectorMask m) { + return super.testTemplate(ShortMaskMax.class, op, (ShortMaskMax) m); // specialize } // Specialized comparisons @Override @ForceInline - public final ShortMaxMask compare(Comparison op, Vector v) { - return super.compareTemplate(ShortMaxMask.class, op, v); // specialize + public final ShortMaskMax compare(Comparison op, Vector v) { + return super.compareTemplate(ShortMaskMax.class, op, v); // specialize } @Override @ForceInline - public final ShortMaxMask compare(Comparison op, short s) { - return super.compareTemplate(ShortMaxMask.class, op, s); // specialize + public final ShortMaskMax compare(Comparison op, short s) { + return super.compareTemplate(ShortMaskMax.class, op, s); // specialize } @Override @ForceInline - public final ShortMaxMask compare(Comparison op, long s) { - return super.compareTemplate(ShortMaxMask.class, op, s); // specialize + public final ShortMaskMax compare(Comparison op, long s) { + return super.compareTemplate(ShortMaskMax.class, op, s); // specialize } @Override @ForceInline - public final ShortMaxMask compare(Comparison op, Vector v, VectorMask m) { - return super.compareTemplate(ShortMaxMask.class, op, v, (ShortMaxMask) m); + public final ShortMaskMax compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ShortMaskMax.class, op, v, (ShortMaskMax) m); } @Override @ForceInline - public ShortMaxVector blend(Vector v, VectorMask m) { - return (ShortMaxVector) - super.blendTemplate(ShortMaxMask.class, - (ShortMaxVector) v, - (ShortMaxMask) m); // specialize + public ShortVectorMax blend(Vector v, VectorMask m) { + return (ShortVectorMax) + super.blendTemplate(ShortMaskMax.class, + (ShortVectorMax) v, + (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector slice(int origin, Vector v) { - return (ShortMaxVector) super.sliceTemplate(origin, v); // specialize + public ShortVectorMax slice(int origin, Vector v) { + return (ShortVectorMax) super.sliceTemplate(origin, v); // specialize } @Override @ForceInline - public ShortMaxVector slice(int origin) { - return (ShortMaxVector) super.sliceTemplate(origin); // specialize + public ShortVectorMax slice(int origin) { + return (ShortVectorMax) super.sliceTemplate(origin); // specialize } @Override @ForceInline - public ShortMaxVector unslice(int origin, Vector w, int part) { - return (ShortMaxVector) super.unsliceTemplate(origin, w, part); // specialize + public ShortVectorMax unslice(int origin, Vector w, int part) { + return (ShortVectorMax) super.unsliceTemplate(origin, w, part); // specialize } @Override @ForceInline - public ShortMaxVector unslice(int origin, Vector w, int part, VectorMask m) { - return (ShortMaxVector) - super.unsliceTemplate(ShortMaxMask.class, + public ShortVectorMax unslice(int origin, Vector w, int part, VectorMask m) { + return (ShortVectorMax) + super.unsliceTemplate(ShortMaskMax.class, origin, w, part, - (ShortMaxMask) m); // specialize + (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector unslice(int origin) { - return (ShortMaxVector) super.unsliceTemplate(origin); // specialize + public ShortVectorMax unslice(int origin) { + return (ShortVectorMax) super.unsliceTemplate(origin); // specialize } @Override @ForceInline - public ShortMaxVector rearrange(VectorShuffle s) { - return (ShortMaxVector) - super.rearrangeTemplate(ShortMaxShuffle.class, - (ShortMaxShuffle) s); // specialize + public ShortVectorMax rearrange(VectorShuffle s) { + return (ShortVectorMax) + super.rearrangeTemplate(ShortShuffleMax.class, + (ShortShuffleMax) s); // specialize } @Override @ForceInline - public ShortMaxVector rearrange(VectorShuffle shuffle, + public ShortVectorMax rearrange(VectorShuffle shuffle, VectorMask m) { - return (ShortMaxVector) - super.rearrangeTemplate(ShortMaxShuffle.class, - ShortMaxMask.class, - (ShortMaxShuffle) shuffle, - (ShortMaxMask) m); // specialize + return (ShortVectorMax) + super.rearrangeTemplate(ShortShuffleMax.class, + ShortMaskMax.class, + (ShortShuffleMax) shuffle, + (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector rearrange(VectorShuffle s, + public ShortVectorMax rearrange(VectorShuffle s, Vector v) { - return (ShortMaxVector) - super.rearrangeTemplate(ShortMaxShuffle.class, - (ShortMaxShuffle) s, - (ShortMaxVector) v); // specialize + return (ShortVectorMax) + super.rearrangeTemplate(ShortShuffleMax.class, + (ShortShuffleMax) s, + (ShortVectorMax) v); // specialize } @Override @ForceInline - public ShortMaxVector compress(VectorMask m) { - return (ShortMaxVector) - super.compressTemplate(ShortMaxMask.class, - (ShortMaxMask) m); // specialize + public ShortVectorMax compress(VectorMask m) { + return (ShortVectorMax) + super.compressTemplate(ShortMaskMax.class, + (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector expand(VectorMask m) { - return (ShortMaxVector) - super.expandTemplate(ShortMaxMask.class, - (ShortMaxMask) m); // specialize + public ShortVectorMax expand(VectorMask m) { + return (ShortVectorMax) + super.expandTemplate(ShortMaskMax.class, + (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector selectFrom(Vector v) { - return (ShortMaxVector) - super.selectFromTemplate((ShortMaxVector) v); // specialize + public ShortVectorMax selectFrom(Vector v) { + return (ShortVectorMax) + super.selectFromTemplate((ShortVectorMax) v); // specialize } @Override @ForceInline - public ShortMaxVector selectFrom(Vector v, + public ShortVectorMax selectFrom(Vector v, VectorMask m) { - return (ShortMaxVector) - super.selectFromTemplate((ShortMaxVector) v, - ShortMaxMask.class, (ShortMaxMask) m); // specialize + return (ShortVectorMax) + super.selectFromTemplate((ShortVectorMax) v, + ShortMaskMax.class, (ShortMaskMax) m); // specialize } @Override @ForceInline - public ShortMaxVector selectFrom(Vector v1, + public ShortVectorMax selectFrom(Vector v1, Vector v2) { - return (ShortMaxVector) - super.selectFromTemplate((ShortMaxVector) v1, (ShortMaxVector) v2); // specialize + return (ShortVectorMax) + super.selectFromTemplate((ShortVectorMax) v1, (ShortVectorMax) v2); // specialize } @ForceInline @@ -543,7 +548,7 @@ final class ShortMaxVector extends ShortVector { @ForceInline @Override - public ShortMaxVector withLane(int i, short e) { + public ShortVectorMax withLane(int i, short e) { if (i < 0 || i >= VLENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + VLENGTH); } @@ -551,7 +556,7 @@ final class ShortMaxVector extends ShortVector { } @ForceInline - public ShortMaxVector withLaneHelper(int i, short e) { + public ShortVectorMax withLaneHelper(int i, short e) { return VectorSupport.insert( VCLASS, LANE_TYPE_ORDINAL, VLENGTH, this, i, (long)e, @@ -564,19 +569,20 @@ final class ShortMaxVector extends ShortVector { // Mask - static final class ShortMaxMask extends AbstractMask { + static final class ShortMaskMax extends AbstractMask { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - ShortMaxMask(boolean[] bits) { + static final Class CTYPE = short.class; // used by the JVM + + ShortMaskMax(boolean[] bits) { this(bits, 0); } - ShortMaxMask(boolean[] bits, int offset) { + ShortMaskMax(boolean[] bits, int offset) { super(prepare(bits, offset)); } - ShortMaxMask(boolean val) { + ShortMaskMax(boolean val) { super(prepare(val)); } @@ -609,31 +615,31 @@ final class ShortMaxVector extends ShortVector { } @Override - ShortMaxMask uOp(MUnOp f) { + ShortMaskMax uOp(MUnOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i]); } - return new ShortMaxMask(res); + return new ShortMaskMax(res); } @Override - ShortMaxMask bOp(VectorMask m, MBinOp f) { + ShortMaskMax bOp(VectorMask m, MBinOp f) { boolean[] res = new boolean[vspecies().laneCount()]; boolean[] bits = getBits(); - boolean[] mbits = ((ShortMaxMask)m).getBits(); + boolean[] mbits = ((ShortMaskMax)m).getBits(); for (int i = 0; i < res.length; i++) { res[i] = f.apply(i, bits[i], mbits[i]); } - return new ShortMaxMask(res); + return new ShortMaskMax(res); } @ForceInline @Override public final - ShortMaxVector toVector() { - return (ShortMaxVector) super.toVectorTemplate(); // specialize + ShortVectorMax toVector() { + return (ShortVectorMax) super.toVectorTemplate(); // specialize } /** @@ -666,25 +672,25 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline /*package-private*/ - ShortMaxMask indexPartiallyInUpperRange(long offset, long limit) { - return (ShortMaxMask) VectorSupport.indexPartiallyInUpperRange( - ShortMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, - (o, l) -> (ShortMaxMask) TRUE_MASK.indexPartiallyInRange(o, l)); + ShortMaskMax indexPartiallyInUpperRange(long offset, long limit) { + return (ShortMaskMax) VectorSupport.indexPartiallyInUpperRange( + ShortMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, offset, limit, + (o, l) -> (ShortMaskMax) TRUE_MASK.indexPartiallyInRange(o, l)); } // Unary operations @Override @ForceInline - public ShortMaxMask not() { + public ShortMaskMax not() { return xor(maskAll(true)); } @Override @ForceInline - public ShortMaxMask compress() { - return (ShortMaxMask)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, - ShortMaxVector.class, ShortMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, + public ShortMaskMax compress() { + return (ShortMaskMax)VectorSupport.compressExpandOp(VectorSupport.VECTOR_OP_MASK_COMPRESS, + ShortVectorMax.class, ShortMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, null, this, (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount())); } @@ -693,30 +699,30 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline - public ShortMaxMask and(VectorMask mask) { + public ShortMaskMax and(VectorMask mask) { Objects.requireNonNull(mask); - ShortMaxMask m = (ShortMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMaskMax m = (ShortMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @ForceInline - public ShortMaxMask or(VectorMask mask) { + public ShortMaskMax or(VectorMask mask) { Objects.requireNonNull(mask); - ShortMaxMask m = (ShortMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMaskMax m = (ShortMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @Override @ForceInline - public ShortMaxMask xor(VectorMask mask) { + public ShortMaskMax xor(VectorMask mask) { Objects.requireNonNull(mask); - ShortMaxMask m = (ShortMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMaxMask.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, + ShortMaskMax m = (ShortMaskMax)mask; + return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMaskMax.class, null, LANEBITS_TYPE_ORDINAL, VLENGTH, this, m, null, (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } @@ -726,21 +732,21 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline public int trueCount() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> lastTrueHelper(m.getBits())); } @@ -750,7 +756,7 @@ final class ShortMaxVector extends ShortVector { if (length() > Long.SIZE) { throw new UnsupportedOperationException("too many lanes for one long"); } - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, (m) -> toLongHelper(m.getBits())); } @@ -760,7 +766,7 @@ final class ShortMaxVector extends ShortVector { @ForceInline public boolean laneIsSet(int i) { Objects.checkIndex(i, length()); - return VectorSupport.extract(ShortMaxMask.class, LANE_TYPE_ORDINAL, VLENGTH, + return VectorSupport.extract(ShortMaskMax.class, LANE_TYPE_ORDINAL, VLENGTH, this, i, (m, idx) -> (m.getBits()[idx] ? 1L : 0L)) == 1L; } @@ -769,48 +775,49 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline public boolean anyTrue() { - return VectorSupport.test(BT_ne, ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_ne, ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> anyTrueHelper(((ShortMaxMask)m).getBits())); + (m, __) -> anyTrueHelper(((ShortMaskMax)m).getBits())); } @Override @ForceInline public boolean allTrue() { - return VectorSupport.test(BT_overflow, ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + return VectorSupport.test(BT_overflow, ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, this, vspecies().maskAll(true), - (m, __) -> allTrueHelper(((ShortMaxMask)m).getBits())); + (m, __) -> allTrueHelper(((ShortMaskMax)m).getBits())); } @ForceInline /*package-private*/ - static ShortMaxMask maskAll(boolean bit) { - return VectorSupport.fromBitsCoerced(ShortMaxMask.class, LANEBITS_TYPE_ORDINAL, VLENGTH, + static ShortMaskMax maskAll(boolean bit) { + return VectorSupport.fromBitsCoerced(ShortMaskMax.class, LANEBITS_TYPE_ORDINAL, VLENGTH, (bit ? -1 : 0), MODE_BROADCAST, null, (v, __) -> (v != 0 ? TRUE_MASK : FALSE_MASK)); } - private static final ShortMaxMask TRUE_MASK = new ShortMaxMask(true); - private static final ShortMaxMask FALSE_MASK = new ShortMaxMask(false); + private static final ShortMaskMax TRUE_MASK = new ShortMaskMax(true); + private static final ShortMaskMax FALSE_MASK = new ShortMaskMax(false); } // Shuffle - static final class ShortMaxShuffle extends AbstractShuffle { + static final class ShortShuffleMax extends AbstractShuffle { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class ETYPE = short.class; // used by the JVM - ShortMaxShuffle(short[] indices) { + static final Class CTYPE = short.class; // used by the JVM + + ShortShuffleMax(short[] indices) { super(indices); assert(VLENGTH == indices.length); assert(indicesInRange(indices)); } - ShortMaxShuffle(int[] indices, int i) { + ShortShuffleMax(int[] indices, int i) { this(prepare(indices, i)); } - ShortMaxShuffle(IntUnaryOperator fn) { + ShortShuffleMax(IntUnaryOperator fn) { this(prepare(fn)); } @@ -830,23 +837,23 @@ final class ShortMaxVector extends ShortVector { assert(VLENGTH < Short.MAX_VALUE); assert(Short.MIN_VALUE <= -VLENGTH); } - static final ShortMaxShuffle IOTA = new ShortMaxShuffle(IDENTITY); + static final ShortShuffleMax IOTA = new ShortShuffleMax(IDENTITY); @Override @ForceInline - public ShortMaxVector toVector() { + public ShortVectorMax toVector() { return toBitsVector(); } @Override @ForceInline - ShortMaxVector toBitsVector() { - return (ShortMaxVector) super.toBitsVectorTemplate(); + ShortVectorMax toBitsVector() { + return (ShortVectorMax) super.toBitsVectorTemplate(); } @Override - ShortMaxVector toBitsVector0() { - return ((ShortMaxVector) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); + ShortVectorMax toBitsVector0() { + return ((ShortVectorMax) vspecies().asIntegral().dummyVector()).vectorFactory(indices()); } @Override @@ -883,30 +890,30 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline - public final ShortMaxMask laneIsValid() { - return (ShortMaxMask) toBitsVector().compare(VectorOperators.GE, 0) + public final ShortMaskMax laneIsValid() { + return (ShortMaskMax) toBitsVector().compare(VectorOperators.GE, 0) .cast(vspecies()); } @ForceInline @Override - public final ShortMaxShuffle rearrange(VectorShuffle shuffle) { - ShortMaxShuffle concreteShuffle = (ShortMaxShuffle) shuffle; - return (ShortMaxShuffle) toBitsVector().rearrange(concreteShuffle) + public final ShortShuffleMax rearrange(VectorShuffle shuffle) { + ShortShuffleMax concreteShuffle = (ShortShuffleMax) shuffle; + return (ShortShuffleMax) toBitsVector().rearrange(concreteShuffle) .toShuffle(vspecies(), false); } @ForceInline @Override - public final ShortMaxShuffle wrapIndexes() { - ShortMaxVector v = toBitsVector(); + public final ShortShuffleMax wrapIndexes() { + ShortVectorMax v = toBitsVector(); if ((length() & (length() - 1)) == 0) { - v = (ShortMaxVector) v.lanewise(VectorOperators.AND, length() - 1); + v = (ShortVectorMax) v.lanewise(VectorOperators.AND, length() - 1); } else { - v = (ShortMaxVector) v.blend(v.lanewise(VectorOperators.ADD, length()), + v = (ShortVectorMax) v.blend(v.lanewise(VectorOperators.ADD, length()), v.compare(VectorOperators.LT, 0)); } - return (ShortMaxShuffle) v.toShuffle(vspecies(), false); + return (ShortShuffleMax) v.toShuffle(vspecies(), false); } private static short[] prepare(int[] indices, int offset) { @@ -957,14 +964,14 @@ final class ShortMaxVector extends ShortVector { @Override final ShortVector fromArray0(short[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m, offsetInRange); // specialize + return super.fromArray0Template(ShortMaskMax.class, a, offset, (ShortMaskMax) m, offsetInRange); // specialize } @ForceInline @Override final ShortVector fromArray0(short[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { - return super.fromArray0Template(ShortMaxMask.class, a, offset, indexMap, mapOffset, (ShortMaxMask) m); + return super.fromArray0Template(ShortMaskMax.class, a, offset, indexMap, mapOffset, (ShortMaskMax) m); } @ForceInline @@ -978,7 +985,7 @@ final class ShortMaxVector extends ShortVector { @Override final ShortVector fromCharArray0(char[] a, int offset, VectorMask m, int offsetInRange) { - return super.fromCharArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m, offsetInRange); // specialize + return super.fromCharArray0Template(ShortMaskMax.class, a, offset, (ShortMaskMax) m, offsetInRange); // specialize } @@ -993,7 +1000,7 @@ final class ShortMaxVector extends ShortVector { @Override final ShortVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask m, int offsetInRange) { - return super.fromMemorySegment0Template(ShortMaxMask.class, ms, offset, (ShortMaxMask) m, offsetInRange); // specialize + return super.fromMemorySegment0Template(ShortMaskMax.class, ms, offset, (ShortMaskMax) m, offsetInRange); // specialize } @ForceInline @@ -1007,7 +1014,7 @@ final class ShortMaxVector extends ShortVector { @Override final void intoArray0(short[] a, int offset, VectorMask m) { - super.intoArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); + super.intoArray0Template(ShortMaskMax.class, a, offset, (ShortMaskMax) m); } @@ -1016,14 +1023,14 @@ final class ShortMaxVector extends ShortVector { @Override final void intoMemorySegment0(MemorySegment ms, long offset, VectorMask m) { - super.intoMemorySegment0Template(ShortMaxMask.class, ms, offset, (ShortMaxMask) m); + super.intoMemorySegment0Template(ShortMaskMax.class, ms, offset, (ShortMaskMax) m); } @ForceInline @Override final void intoCharArray0(char[] a, int offset, VectorMask m) { - super.intoCharArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); + super.intoCharArray0Template(ShortMaskMax.class, a, offset, (ShortMaskMax) m); } // End of specialized low-level memory operations. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMathLibrary.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMathLibrary.java index ecd03ab9124..1c1cfcc78c7 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMathLibrary.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMathLibrary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,8 +139,8 @@ import static jdk.internal.vm.vector.Utils.debug; public String symbolName(Operator op, VectorSpecies vspecies) { String suffix = suffix(vspecies); String elemType = (vspecies.elementType() == float.class ? "f" : ""); - boolean isFloat64Vector = (vspecies.elementType() == float.class) && (vspecies.length() == 2); // Float64Vector or FloatMaxVector - int vlen = (isFloat64Vector ? 4 : vspecies.length()); // reuse 128-bit variant for 64-bit float vectors + boolean isFloatVector64 = (vspecies.elementType() == float.class) && (vspecies.length() == 2); // FloatVector64 or FloatVectorMax + int vlen = (isFloatVector64 ? 4 : vspecies.length()); // reuse 128-bit variant for 64-bit float vectors return String.format("__jsvml_%s%s%d_ha_%s", op.operatorName(), elemType, vlen, suffix); } @@ -211,8 +211,8 @@ import static jdk.internal.vm.vector.Utils.debug; @Override public String symbolName(Operator op, VectorSpecies vspecies) { - boolean isFloat64Vector = (vspecies.elementType() == float.class) && (vspecies.length() == 2); // Float64Vector or FloatMaxVector - int vlen = (isFloat64Vector ? 4 : vspecies.length()); // reuse 128-bit variant for 64-bit float vectors + boolean isFloatVector64 = (vspecies.elementType() == float.class) && (vspecies.length() == 2); // FloatVector64 or FloatVectorMax + int vlen = (isFloatVector64 ? 4 : vspecies.length()); // reuse 128-bit variant for 64-bit float vectors boolean isShapeAgnostic = isRISCV64() || (isAARCH64() && vspecies.vectorBitSize() > 128); return String.format("%s%s%s_%s%s", op.operatorName(), (vspecies.elementType() == float.class ? "f" : "d"), @@ -283,7 +283,7 @@ import static jdk.internal.vm.vector.Utils.debug; @ForceInline /*package-private*/ static > - V unaryMathOp(Unary op, int opc, VectorSpecies vspecies, + V unaryMathOp(Unary op, int opc, AbstractSpecies vspecies, IntFunction> implSupplier, V v) { var entry = lookup(op, opc, vspecies, implSupplier); @@ -293,7 +293,7 @@ import static jdk.internal.vm.vector.Utils.debug; @SuppressWarnings({"unchecked"}) Class vt = (Class)vspecies.vectorType(); return VectorSupport.libraryUnaryOp( - entry.entry.address(), vt, vspecies.elementType(), vspecies.length(), entry.name, + entry.entry.address(), vt, vspecies.laneTypeOrdinal(), vspecies.length(), entry.name, v, entry.impl); } else { @@ -304,7 +304,7 @@ import static jdk.internal.vm.vector.Utils.debug; @ForceInline /*package-private*/ static > - V binaryMathOp(Binary op, int opc, VectorSpecies vspecies, + V binaryMathOp(Binary op, int opc, AbstractSpecies vspecies, IntFunction> implSupplier, V v1, V v2) { var entry = lookup(op, opc, vspecies, implSupplier); @@ -314,7 +314,7 @@ import static jdk.internal.vm.vector.Utils.debug; @SuppressWarnings({"unchecked"}) Class vt = (Class)vspecies.vectorType(); return VectorSupport.libraryBinaryOp( - entry.entry.address(), vt, vspecies.elementType(), vspecies.length(), entry.name, + entry.entry.address(), vt, vspecies.laneTypeOrdinal(), vspecies.length(), entry.name, v1, v2, entry.impl); } else { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java index f6e36450ce0..84b58ef789a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -250,8 +250,8 @@ public enum VectorShape { private static VectorShape computePreferredShape() { int prefBitSize = Integer.MAX_VALUE; for (LaneType type : LaneType.values()) { - Class etype = type.elementType; - prefBitSize = Math.min(prefBitSize, getMaxVectorBitSize(etype)); + Class ctype = type.carrierType; + prefBitSize = Math.min(prefBitSize, getMaxVectorBitSize(ctype)); } // If these assertions fail, we must reconsider our API portability assumptions. assert(prefBitSize >= Double.SIZE && prefBitSize < Integer.MAX_VALUE / Long.SIZE); @@ -264,16 +264,16 @@ public enum VectorShape { /** * Returns the maximum vector bit size for a given element type. * - * @param etype the element type. + * @param ctype the carrier type. * @return the maximum vector bit. */ /*package-private*/ - static int getMaxVectorBitSize(Class etype) { + static int getMaxVectorBitSize(Class ctype) { // VectorSupport.getMaxLaneCount may return -1 if C2 is not enabled, // or a value smaller than the S_64_BIT.vectorBitSize / elementSizeInBits if MaxVectorSize < 16 // If so default to S_64_BIT - int maxLaneCount = VectorSupport.getMaxLaneCount(etype); - int elementSizeInBits = LaneType.of(etype).elementSize; + int maxLaneCount = VectorSupport.getMaxLaneCount(ctype); + int elementSizeInBits = LaneType.of(ctype).elementSize; return Math.max(maxLaneCount * elementSizeInBits, S_64_BIT.vectorBitSize); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template index 03883cf3e8a..d6763c2c03a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template @@ -88,8 +88,8 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // The various shape-specific subclasses // also specialize them by wrapping // them in a call like this: - // return (Byte128Vector) - // super.bOp((Byte128Vector) o); + // return (ByteVector128) + // super.bOp((ByteVector128) o); // The purpose of that is to forcibly inline // the generic definition from this file // into a sharply-typed and size-specific @@ -3829,7 +3829,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For $Type$MaxVector, if vector length is non-power-of-two or + // For $Type$VectorMax, if vector length is non-power-of-two or // 2048 bits, indexShape of $Type$ species is S_MAX_BIT. // Assume that vector length is 2048, then the lane count of $Type$ // vector is 32. When converting $Type$ species to int species, @@ -3837,7 +3837,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -4455,14 +4455,14 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For $Type$MaxVector, if vector length is 2048 bits, indexShape + // For $Type$VectorMax, if vector length is 2048 bits, indexShape // of $Type$ species is S_MAX_BIT. and the lane count of $Type$ // vector is 32. When converting $Type$ species to int species, // indexShape is still S_MAX_BIT, but the lane count of int vector // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -5061,7 +5061,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For $Type$MaxVector, if vector length is non-power-of-two or + // For $Type$VectorMax, if vector length is non-power-of-two or // 2048 bits, indexShape of $Type$ species is S_MAX_BIT. // Assume that vector length is 2048, then the lane count of $Type$ // vector is 32. When converting $Type$ species to int species, @@ -5069,7 +5069,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -5252,14 +5252,14 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] IntVector vix; if (isp.laneCount() != vsp.laneCount()) { - // For $Type$MaxVector, if vector length is 2048 bits, indexShape + // For $Type$VectorMax, if vector length is 2048 bits, indexShape // of $Type$ species is S_MAX_BIT. and the lane count of $Type$ // vector is 32. When converting $Type$ species to int species, // indexShape is still S_MAX_BIT, but the lane count of int vector // is 64. So when loading index vector (IntVector), only lower half // of index data is needed. vix = IntVector - .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .fromArray(isp, indexMap, mapOffset, IntVectorMax.IntMaskMax.LOWER_HALF_TRUE_MASK) .add(offset); } else { vix = IntVector @@ -5393,6 +5393,22 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { return this; } + @Override + @ForceInline + final + $abstractvectortype$ swapIfNeeded(AbstractSpecies srcSpecies) { +#if[byte] + return this; +#else[byte] + int subLanesPerSrc = subLanesToSwap(srcSpecies); + if (subLanesPerSrc < 0) { + return this; + } + VectorShuffle<$Boxtype$> shuffle = normalizeSubLanesForSpecies(this.vspecies(), subLanesPerSrc); + return ($abstractvectortype$) this.rearrange(shuffle); +#end[byte] + } + static final int ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(Unsafe.ARRAY_$TYPE$_INDEX_SCALE); static final long ARRAY_BASE = @@ -5797,13 +5813,13 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @Override @ForceInline public final $abstractvectortype$ zero() { - if ((Class) vectorType() == $Type$MaxVector.class) - return $Type$MaxVector.ZERO; + if ((Class) vectorType() == $Type$VectorMax.class) + return $Type$VectorMax.ZERO; switch (vectorBitSize()) { - case 64: return $Type$64Vector.ZERO; - case 128: return $Type$128Vector.ZERO; - case 256: return $Type$256Vector.ZERO; - case 512: return $Type$512Vector.ZERO; + case 64: return $Type$Vector64.ZERO; + case 128: return $Type$Vector128.ZERO; + case 256: return $Type$Vector256.ZERO; + case 512: return $Type$Vector512.ZERO; } throw new AssertionError(); } @@ -5811,13 +5827,13 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @Override @ForceInline public final $abstractvectortype$ iota() { - if ((Class) vectorType() == $Type$MaxVector.class) - return $Type$MaxVector.IOTA; + if ((Class) vectorType() == $Type$VectorMax.class) + return $Type$VectorMax.IOTA; switch (vectorBitSize()) { - case 64: return $Type$64Vector.IOTA; - case 128: return $Type$128Vector.IOTA; - case 256: return $Type$256Vector.IOTA; - case 512: return $Type$512Vector.IOTA; + case 64: return $Type$Vector64.IOTA; + case 128: return $Type$Vector128.IOTA; + case 256: return $Type$Vector256.IOTA; + case 512: return $Type$Vector512.IOTA; } throw new AssertionError(); } @@ -5826,13 +5842,13 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @Override @ForceInline public final VectorMask<$Boxtype$> maskAll(boolean bit) { - if ((Class) vectorType() == $Type$MaxVector.class) - return $Type$MaxVector.$Type$MaxMask.maskAll(bit); + if ((Class) vectorType() == $Type$VectorMax.class) + return $Type$VectorMax.$Type$MaskMax.maskAll(bit); switch (vectorBitSize()) { - case 64: return $Type$64Vector.$Type$64Mask.maskAll(bit); - case 128: return $Type$128Vector.$Type$128Mask.maskAll(bit); - case 256: return $Type$256Vector.$Type$256Mask.maskAll(bit); - case 512: return $Type$512Vector.$Type$512Mask.maskAll(bit); + case 64: return $Type$Vector64.$Type$Mask64.maskAll(bit); + case 128: return $Type$Vector128.$Type$Mask128.maskAll(bit); + case 256: return $Type$Vector256.$Type$Mask256.maskAll(bit); + case 512: return $Type$Vector512.$Type$Mask512.maskAll(bit); } throw new AssertionError(); } @@ -5860,42 +5876,42 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_64_BIT VectorShape.S_64_BIT}. */ public static final VectorSpecies<$Boxtype$> SPECIES_64 = new $Type$Species(VectorShape.S_64_BIT, - $Type$64Vector.class, - $Type$64Vector.$Type$64Mask.class, - $Type$64Vector.$Type$64Shuffle.class, - $Type$64Vector::new); + $Type$Vector64.class, + $Type$Vector64.$Type$Mask64.class, + $Type$Vector64.$Type$Shuffle64.class, + $Type$Vector64::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_128_BIT VectorShape.S_128_BIT}. */ public static final VectorSpecies<$Boxtype$> SPECIES_128 = new $Type$Species(VectorShape.S_128_BIT, - $Type$128Vector.class, - $Type$128Vector.$Type$128Mask.class, - $Type$128Vector.$Type$128Shuffle.class, - $Type$128Vector::new); + $Type$Vector128.class, + $Type$Vector128.$Type$Mask128.class, + $Type$Vector128.$Type$Shuffle128.class, + $Type$Vector128::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_256_BIT VectorShape.S_256_BIT}. */ public static final VectorSpecies<$Boxtype$> SPECIES_256 = new $Type$Species(VectorShape.S_256_BIT, - $Type$256Vector.class, - $Type$256Vector.$Type$256Mask.class, - $Type$256Vector.$Type$256Shuffle.class, - $Type$256Vector::new); + $Type$Vector256.class, + $Type$Vector256.$Type$Mask256.class, + $Type$Vector256.$Type$Shuffle256.class, + $Type$Vector256::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_512_BIT VectorShape.S_512_BIT}. */ public static final VectorSpecies<$Boxtype$> SPECIES_512 = new $Type$Species(VectorShape.S_512_BIT, - $Type$512Vector.class, - $Type$512Vector.$Type$512Mask.class, - $Type$512Vector.$Type$512Shuffle.class, - $Type$512Vector::new); + $Type$Vector512.class, + $Type$Vector512.$Type$Mask512.class, + $Type$Vector512.$Type$Shuffle512.class, + $Type$Vector512::new); /** Species representing {@link $Type$Vector}s of {@link VectorShape#S_Max_BIT VectorShape.S_Max_BIT}. */ public static final VectorSpecies<$Boxtype$> SPECIES_MAX = new $Type$Species(VectorShape.S_Max_BIT, - $Type$MaxVector.class, - $Type$MaxVector.$Type$MaxMask.class, - $Type$MaxVector.$Type$MaxShuffle.class, - $Type$MaxVector::new); + $Type$VectorMax.class, + $Type$VectorMax.$Type$MaskMax.class, + $Type$VectorMax.$Type$ShuffleMax.class, + $Type$VectorMax::new); /** * Preferred species for {@link $Type$Vector}s. diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template index 61ac02d84f6..bbf02f9c6cd 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template @@ -54,6 +54,8 @@ final class $vectortype$ extends $abstractvectortype$ { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM + static final Class<$Carriertype$> CTYPE = $carriertype$.class; // carrier type used by the JVM + static final Class<$Boxtype$> ETYPE = $type$.class; // used by the JVM $vectortype$($type$[] v) { @@ -92,6 +94,9 @@ final class $vectortype$ extends $abstractvectortype$ { @Override public final Class<$Boxtype$> elementType() { return $type$.class; } + @ForceInline + final Class<$Carriertype$> carrierType() { return CTYPE; } + @ForceInline @Override public final int elementSize() { return $Boxtype$.SIZE; } @@ -183,8 +188,8 @@ final class $vectortype$ extends $abstractvectortype$ { @ForceInline final @Override - Byte$bits$Vector asByteVectorRaw() { - return (Byte$bits$Vector) super.asByteVectorRawTemplate(); // specialize + ByteVector$bits$ asByteVectorRaw() { + return (ByteVector$bits$) super.asByteVectorRawTemplate(); // specialize } @ForceInline @@ -853,7 +858,8 @@ final class $vectortype$ extends $abstractvectortype$ { static final class $masktype$ extends AbstractMask<$Boxtype$> { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class<$Boxtype$> ETYPE = $type$.class; // used by the JVM + + static final Class<$Carriertype$> CTYPE = $carriertype$.class; // used by the JVM $masktype$(boolean[] bits) { this(bits, 0); @@ -1092,7 +1098,7 @@ final class $vectortype$ extends $abstractvectortype$ { #end[intAndMax] #if[intAndMax] - static final IntMaxMask LOWER_HALF_TRUE_MASK = new IntMaxMask(maskLowerHalf()); + static final IntMaskMax LOWER_HALF_TRUE_MASK = new IntMaskMax(maskLowerHalf()); #end[intAndMax] } @@ -1100,7 +1106,8 @@ final class $vectortype$ extends $abstractvectortype$ { static final class $shuffletype$ extends AbstractShuffle<$Boxtype$> { static final int VLENGTH = VSPECIES.laneCount(); // used by the JVM - static final Class<$Boxbitstype$> ETYPE = $bitstype$.class; // used by the JVM + + static final Class<$Boxbitstype$> CTYPE = $bitstype$.class; // used by the JVM $shuffletype$($bitstype$[] indices) { super(indices); diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh index a9f1648eaa7..a8a7ea83625 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh @@ -72,6 +72,8 @@ do fptype=$type Fptype=$Type Boxfptype=$Boxtype + carriertype=$type + Carriertype=$Type case $type in byte) @@ -90,6 +92,7 @@ do ;; int) Boxtype=Integer + Carriertype=Integer Wideboxtype=Integer Boxbitstype=Integer fptype=float @@ -135,9 +138,10 @@ do args="$args -Dbitstype=$bitstype -DBitstype=$Bitstype -DBoxbitstype=$Boxbitstype" args="$args -Dfptype=$fptype -DFptype=$Fptype -DBoxfptype=$Boxfptype" args="$args -DsizeInBytes=$sizeInBytes" + args="$args -Dcarriertype=$carriertype -DCarriertype=$Carriertype" abstractvectortype=${typeprefix}${Type}Vector - abstractbitsvectortype=${typeprefix}${Bitstype}Vector + abstractbitsvectortype=${typeprefix}Vector${Bitstype} abstractfpvectortype=${typeprefix}${Fptype}Vector args="$args -Dabstractvectortype=$abstractvectortype -Dabstractbitsvectortype=$abstractbitsvectortype -Dabstractfpvectortype=$abstractfpvectortype" case $abstractvectortype in @@ -158,11 +162,11 @@ do old_args="$args" for bits in 64 128 256 512 Max do - vectortype=${typeprefix}${Type}${bits}Vector - masktype=${typeprefix}${Type}${bits}Mask - shuffletype=${typeprefix}${Type}${bits}Shuffle - bitsvectortype=${typeprefix}${Bitstype}${bits}Vector - fpvectortype=${typeprefix}${Fptype}${bits}Vector + vectortype=${typeprefix}${Type}Vector${bits} + masktype=${typeprefix}${Type}Mask${bits} + shuffletype=${typeprefix}${Type}Shuffle${bits} + bitsvectortype=${typeprefix}${Bitstype}Vector${bits} + fpvectortype=${typeprefix}${Fptype}Vector${bits} vectorindexbits=$((bits * 4 / sizeInBytes)) numLanes=$((bits / (sizeInBytes * 8))) @@ -185,7 +189,7 @@ do if [[ "${bits}" == "Max" ]]; then vectorindextype="vix.getClass()" else - vectorindextype="Int${vectorindexbits}Vector.class" + vectorindextype="IntVector${vectorindexbits}.class" fi; BITS=$bits @@ -199,7 +203,7 @@ do Shape=S_${bits}_BIT args="$old_args" args="$args -K$lanes -K$bits" - if [[ "${vectortype}" == "IntMaxVector" ]]; then + if [[ "${vectortype}" == "IntVectorMax" ]]; then args="$args -KintAndMax" fi bitargs="$args -Dbits=$bits -DBITS=$BITS -Dvectortype=$vectortype -Dmasktype=$masktype -Dshuffletype=$shuffletype -Dbitsvectortype=$bitsvectortype -Dfpvectortype=$fpvectortype -Dvectorindextype=$vectorindextype -Dshape=$shape -DShape=$Shape" diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ExternalSpecsWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ExternalSpecsWriter.java index 0115de5558f..b8767dd9913 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ExternalSpecsWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ExternalSpecsWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; import jdk.javadoc.internal.doclets.toolkit.util.IndexItem; import jdk.javadoc.internal.html.Content; import jdk.javadoc.internal.html.ContentBuilder; +import jdk.javadoc.internal.html.HtmlAttr; +import jdk.javadoc.internal.html.HtmlId; +import jdk.javadoc.internal.html.HtmlTag; import jdk.javadoc.internal.html.HtmlTree; +import jdk.javadoc.internal.html.Script; import jdk.javadoc.internal.html.Text; import static java.util.stream.Collectors.groupingBy; @@ -108,6 +112,24 @@ public class ExternalSpecsWriter extends HtmlDocletWriter { HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, contents.getContent("doclet.External_Specifications")))) .addMainContent(mainContent) + .addMainContent(new Script(""" + let select = document.getElementById('specs-by-domain'); + select.addEventListener("change", selectHost); + addEventListener("pageshow", selectHost); + function selectHost() { + const selectedClass = select.value ? "external-specs-tab" + select.value : "external-specs"; + let tabPanel = document.getElementById("external-specs.tabpanel"); + let count = 0; + tabPanel.querySelectorAll("div.external-specs").forEach(function(elem) { + elem.style.display = elem.classList.contains(selectedClass) ? "" : "none"; + if (elem.style.display === "") { + let isEvenRow = count++ % 4 < 2; + toggleStyle(elem.classList, isEvenRow, evenRowColor, oddRowColor); + } + }); + } + selectHost(); + """).asContent()) .setFooter(getFooter())); printHtmlDocument(null, "external specifications", body); @@ -180,7 +202,7 @@ public class ExternalSpecsWriter extends HtmlDocletWriter { boolean noHost = false; for (var searchIndexItems : searchIndexMap.values()) { try { - URI uri = getSpecURI(searchIndexItems.get(0)); + URI uri = getSpecURI(searchIndexItems.getFirst()); String host = uri.getHost(); if (host != null) { hostNamesSet.add(host); @@ -191,14 +213,19 @@ public class ExternalSpecsWriter extends HtmlDocletWriter { // ignore } } - var hostNamesList = new ArrayList<>(hostNamesSet); var table = new Table(HtmlStyles.summaryTable) .setCaption(contents.externalSpecifications) .setHeader(new TableHeader(contents.specificationLabel, contents.referencedIn)) .setColumnStyles(HtmlStyles.colFirst, HtmlStyles.colLast) - .setId(HtmlIds.EXTERNAL_SPECS); + .setId(HtmlIds.EXTERNAL_SPECS) + .setDefaultTab(contents.externalSpecifications) + .setRenderTabs(false); + + var hostNamesList = new ArrayList<>(hostNamesSet); + Content selector = Text.EMPTY; if ((hostNamesList.size() + (noHost ? 1 : 0)) > 1) { + selector = createHostSelect(hostNamesList, noHost); for (var host : hostNamesList) { table.addTab(Text.of(host), u -> host.equals(u.getHost())); } @@ -207,10 +234,9 @@ public class ExternalSpecsWriter extends HtmlDocletWriter { u -> u.getHost() == null); } } - table.setDefaultTab(Text.of(resources.getText("doclet.External_Specifications.All_Specifications"))); for (List searchIndexItems : searchIndexMap.values()) { - IndexItem ii = searchIndexItems.get(0); + IndexItem ii = searchIndexItems.getFirst(); Content specName = createSpecLink(ii); Content referencesList = HtmlTree.UL(HtmlStyles.refList, searchIndexItems, item -> HtmlTree.LI(createLink(item))); @@ -227,6 +253,7 @@ public class ExternalSpecsWriter extends HtmlDocletWriter { table.addRow(specName, references); } } + content.add(selector); content.add(table); } @@ -235,6 +262,29 @@ public class ExternalSpecsWriter extends HtmlDocletWriter { .collect(groupingBy(IndexItem::getLabel, () -> new TreeMap<>(getTitleComparator()), toList())); } + private Content createHostSelect(List hosts, boolean hasLocal) { + var index = 1; + var id = HtmlId.of("specs-by-domain"); + var specsByHost = resources.getText("doclet.External_Specifications.by-host"); + var select = HtmlTree.of(HtmlTag.SELECT) + .setId(id) + .add(HtmlTree.of(HtmlTag.OPTION) + .put(HtmlAttr.VALUE, "") + .add(Text.of(resources.getText("doclet.External_Specifications.all-hosts")))); + + for (var host : hosts) { + select.add(HtmlTree.of(HtmlTag.OPTION) + .put(HtmlAttr.VALUE, Integer.toString(index++)) + .add(Text.of(host))); + } + if (hasLocal) { + select.add(HtmlTree.of(HtmlTag.OPTION) + .put(HtmlAttr.VALUE, Integer.toString(index)) + .add(Text.of("Local"))); + } + return new ContentBuilder(HtmlTree.LABEL(id.name(), Text.of(specsByHost)), Text.of(" "), select); + } + Comparator getTitleComparator() { Collator collator = Collator.getInstance(); return (s1, s2) -> { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index 4366295477b..1aba5c9862b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2026, 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 @@ -180,7 +180,8 @@ doclet.Inheritance_Tree=Inheritance Tree doclet.DefinedIn=Defined In doclet.ReferencedIn=Referenced In doclet.External_Specifications=External Specifications -doclet.External_Specifications.All_Specifications=All Specifications +doclet.External_Specifications.by-host=Show specifications by host name: +doclet.External_Specifications.all-hosts=All host names doclet.External_Specifications.no-host=Local doclet.Specification=Specification doclet.Summary_Page=Summary Page diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css index 6198df5c2f3..5bd14f7cf33 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ @@ -1228,7 +1228,7 @@ input::placeholder { input:focus::placeholder { color: transparent; } -select#search-modules { +select { margin: 0 10px 10px 2px; font-size: var(--nav-font-size); padding: 3px 5px; diff --git a/src/jdk.jcmd/share/man/jmap.md b/src/jdk.jcmd/share/man/jmap.md index b0352ad9194..dd0be1b24ef 100644 --- a/src/jdk.jcmd/share/man/jmap.md +++ b/src/jdk.jcmd/share/man/jmap.md @@ -62,20 +62,20 @@ was produced. ## Options for the jmap Command -`-clstats` *pid* +[`-clstats`]{#option-clstats} *pid* : Connects to a running process and prints class loader statistics of Java heap. -`-finalizerinfo` *pid* +[`-finalizerinfo`]{#option-finalizerinfo} *pid* : Connects to a running process and prints information on objects awaiting finalization. -`-histo`\[`:live`\] *pid* +[`-histo`]{#option-histo}\[`:live`\] *pid* : Connects to a running process and prints a histogram of the Java object heap. If the `live` suboption is specified, it then counts only live objects. -`-dump:`*dump\_options* *pid* +[`-dump:`]{#option-dump_}*dump\_options* *pid* : Connects to a running process and dumps the Java heap. The *dump\_options* include: diff --git a/src/jdk.jcmd/share/man/jstat.md b/src/jdk.jcmd/share/man/jstat.md index 324d0a48cb2..624b675de76 100644 --- a/src/jdk.jcmd/share/man/jstat.md +++ b/src/jdk.jcmd/share/man/jstat.md @@ -125,7 +125,7 @@ Don't write scripts to parse the `jstat` command's output because the format might change in future releases. If you write scripts that parse the `jstat` command output, then expect to modify them for future releases of this tool. -`-statOption` +[`-statOption`]{#option-statOption} : Determines the statistics information that the `jstat` command displays. The following lists the available options. Use the `-options` general option to display the list of options for a particular platform @@ -161,7 +161,7 @@ command output, then expect to modify them for future releases of this tool. `printcompilation`: Displays Java HotSpot VM compilation method statistics. -`-J`*javaOption* +[`-J`]{#option-J}*javaOption* : Passes *javaOption* to the Java application launcher. For example, `-J-Xms48m` sets the startup memory to 48 MB. For a complete list of options, see [java](java.html). @@ -171,7 +171,7 @@ command output, then expect to modify them for future releases of this tool. The following information summarizes the columns that the `jstat` command outputs for each *statOption*. -`-class` *option* +[`-class`]{#option-class} *option* : Class loader statistics. `Loaded`: Number of classes loaded. @@ -184,7 +184,7 @@ outputs for each *statOption*. `Time`: Time spent performing class loading and unloading operations. -`-compiler` *option* +[`-compiler`]{#option-compiler} *option* : Java HotSpot VM Just-in-Time compiler statistics. `Compiled`: Number of compilation tasks performed. @@ -199,7 +199,7 @@ outputs for each *statOption*. `FailedMethod`: Class name and method of the last failed compilation. -`-gc` *option* +[`-gc`]{#option-gc} *option* : Garbage collected heap statistics. `S0C`: Current survivor space 0 capacity (KB). @@ -236,7 +236,7 @@ outputs for each *statOption*. `GCT`: Total garbage collection time. -`-gccapacity` *option* +[`-gccapacity`]{#option-gccapacity} *option* : Memory pool generation and space capacities. `NGCMN`: Minimum new generation capacity (KB). @@ -275,7 +275,7 @@ outputs for each *statOption*. `FGC`: Number of full GC events. -`-gccause` *option* +[`-gccause`]{#option-gccause} *option* : This option displays the same summary of garbage collection statistics as the `-gcutil` option, but includes the causes of the last garbage collection event and (when applicable), the current garbage collection @@ -286,7 +286,7 @@ outputs for each *statOption*. `GCC`: Cause of current garbage collection -`-gcnew` *option* +[`-gcnew`]{#option-gcnew} *option* : New generation statistics. `S0C`: Current survivor space 0 capacity (KB). @@ -311,7 +311,7 @@ outputs for each *statOption*. `YGCT`: Young generation garbage collection time. -`-gcnewcapacity` *option* +[`-gcnewcapacity`]{#option-gcnewcapacity} *option* : New generation space size statistics. `NGCMN`: Minimum new generation capacity (KB). @@ -336,7 +336,7 @@ outputs for each *statOption*. `FGC`: Number of full GC events. -`-gcold` *option* +[`-gcold`]{#option-gcold} *option* : Old generation size statistics. `MC`: Metaspace Committed Size (KB). @@ -359,7 +359,7 @@ outputs for each *statOption*. `GCT`: Total garbage collection time. -`-gcoldcapacity` *option* +[`-gcoldcapacity`]{#option-gcoldcapacity} *option* : Old generation statistics. `OGCMN`: Minimum old generation capacity (KB). @@ -378,7 +378,7 @@ outputs for each *statOption*. `GCT`: Total garbage collection time. -`-gcmetacapacity` *option* +[`-gcmetacapacity`]{#option-gcmetacapacity} *option* : Metaspace size statistics. `MCMN`: Minimum metaspace capacity (KB). @@ -399,7 +399,7 @@ outputs for each *statOption*. `GCT`: Total garbage collection time. -`-gcutil` *option* +[`-gcutil`]{#option-gcutil} *option* : Summary of garbage collection statistics. `S0`: Survivor space 0 utilization as a percentage of the space's current @@ -427,7 +427,7 @@ outputs for each *statOption*. `GCT`: Total garbage collection time. -`-printcompilation` *option* +[`-printcompilation`]{#option-printcompilation} *option* : Java HotSpot VM compiler method statistics. `Compiled`: Number of compilation tasks performed by the most recently diff --git a/src/jdk.jdi/share/man/jdb.md b/src/jdk.jdi/share/man/jdb.md index 75d2d9a150c..8aabb202c80 100644 --- a/src/jdk.jdi/share/man/jdb.md +++ b/src/jdk.jdi/share/man/jdb.md @@ -145,50 +145,50 @@ The following options are accepted by the `jdb` command: `-help` : Displays a help message. -`-sourcepath` *dir1*`:`*dir2*`:`... +[`-sourcepath`]{#option-sourcepath} *dir1*`:`*dir2*`:`... : Uses the specified path to search for source files in the specified path. If this option is not specified, then use the default path of dot (`.`). -`-attach` *address* +[`-attach`]{#option-attach} *address* : Attaches the debugger to a running JVM with the default connection mechanism. -`-listen` *address* +[`-listen`]{#option-listen} *address* : Waits for a running JVM to connect to the specified address with a standard connector. -`-listenany` +[`-listenany`]{#option-listenany} : Waits for a running JVM to connect at any available address using a standard connector. -`-launch` +[`-launch`]{#option-launch} : Starts the debugged application immediately upon startup of the `jdb` command. The `-launch` option removes the need for the `run` command. The debugged application is launched and then stopped just before the initial application class is loaded. At that point, you can set any necessary breakpoints and use the `cont` command to continue execution. -`-listconnectors` +[`-listconnectors`]{#option-listconnectors} : Lists the connectors available in this JVM. -`-connect` *connector-name*`:`*name1*`=`*value1*.... +[`-connect`]{#option-connect} *connector-name*`:`*name1*`=`*value1*.... : Connects to the target JVM with the named connector and listed argument values. -`-dbgtrace` \[*flags*\] +[`-dbgtrace`]{#option-dbgtrace} \[*flags*\] : Prints information for debugging the `jdb` command. -`-tclient` +[`-tclient`]{#option-tclient} : Runs the application in the Java HotSpot VM client. -`-trackallthreads` +[`-trackallthreads`]{#option-trackallthreads} : Track all threads as they are created, including virtual threads. See [Working With Virtual Threads](#working-with-virtual-threads) below. -`-tserver` +[`-tserver`]{#option-tserver} : Runs the application in the Java HotSpot VM server. -`-J`*option* +[`-J`]{#option-J}*option* : Passes *option* to the JDB JVM, where option is one of the options described on the reference page for the Java application launcher. For example, `-J-Xms48m` sets the startup memory to 48 MB. See *Overview of Java diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.c b/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.c index cf330d74d29..d4f4003a43d 100644 --- a/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.c +++ b/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -171,18 +171,16 @@ initState(JNIEnv *env, jthread thread, StepRequest *step) * Initial values that may be changed below */ step->fromLine = -1; - step->fromNative = JNI_FALSE; + step->notifyFramePopFailed = JNI_FALSE; step->frameExited = JNI_FALSE; step->fromStackDepth = getFrameCount(thread); if (step->fromStackDepth <= 0) { /* - * If there are no stack frames, treat the step as though - * from a native frame. This is most likely to occur at the - * beginning of a debug session, right after the VM_INIT event, - * so we need to do something intelligent. + * If there are no stack frames, there is nothing more to do here. If we are + * doing a step INTO, initEvents() will enable stepping. Otherwise it is + * not enabled because there is nothing to step OVER or OUT of. */ - step->fromNative = JNI_TRUE; return JVMTI_ERROR_NONE; } @@ -196,7 +194,13 @@ initState(JNIEnv *env, jthread thread, StepRequest *step) error = JVMTI_FUNC_PTR(gdata->jvmti,NotifyFramePop) (gdata->jvmti, thread, 0); if (error == JVMTI_ERROR_OPAQUE_FRAME) { - step->fromNative = JNI_TRUE; + // OPAQUE_FRAME doesn't always mean native method. It's rare that it doesn't, and + // means that there is something about the frame's state that prevents setting up + // a NotifyFramePop. One example is a frame that is in the process of returning, + // which can happen if we start single stepping after getting a MethodExit event. + // In either any case, we need to be aware that there will be no FramePop event + // when this frame exits. + step->notifyFramePopFailed = JNI_TRUE; error = JVMTI_ERROR_NONE; /* continue without error */ } else if (error == JVMTI_ERROR_DUPLICATE) { @@ -761,31 +765,28 @@ initEvents(jthread thread, StepRequest *step) } } + /* - * Initially enable stepping: - * 1) For step into, always - * 2) For step over, unless right after the VM_INIT. - * Enable stepping for STEP_MIN or STEP_LINE with or without line numbers. - * If the class is redefined then non EMCP methods may not have line - * number info. So enable line stepping for non line number so that it - * behaves like STEP_MIN/STEP_OVER. - * 3) For step out, only if stepping from native, except right after VM_INIT - * - * (right after VM_INIT, a step->over or out is identical to running - * forever) + * Enable step events if necessary. Note that right after VM_INIT, a + * step OVER or OUT is identical to running forever, so we only enable + * step events if fromStackDepth > 0. */ switch (step->depth) { case JDWP_STEP_DEPTH(INTO): enableStepping(thread); break; case JDWP_STEP_DEPTH(OVER): - if (step->fromStackDepth > 0 && !step->fromNative ) { + // We need to always enable for OVER (except right after VM_INIT). + // If we are in a native method, that is the only way to find out + // that we have returned to a java method. + if (step->fromStackDepth > 0) { enableStepping(thread); } break; case JDWP_STEP_DEPTH(OUT): - if (step->fromNative && - (step->fromStackDepth > 0)) { + // We rely on the FramePop event to tell us when we exit the current frame. + // If NotifyFramePop failed, then we need to enable stepping. + if (step->notifyFramePopFailed && (step->fromStackDepth > 0)) { enableStepping(thread); } break; diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.h b/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.h index 63f97fb6231..566b8b00ea0 100644 --- a/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.h +++ b/src/jdk.jdwp.agent/share/native/libjdwp/stepControl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -37,7 +37,7 @@ typedef struct { /* State */ jboolean pending; jboolean frameExited; /* for depth == STEP_OVER or STEP_OUT */ - jboolean fromNative; + jboolean notifyFramePopFailed; jint fromStackDepth; /* for all but STEP_INTO STEP_INSTRUCTION */ jint fromLine; /* for granularity == STEP_LINE */ jmethodID method; /* Where line table came from. */ diff --git a/src/jdk.jfr/share/classes/jdk/jfr/EventSettings.java b/src/jdk.jfr/share/classes/jdk/jfr/EventSettings.java index 6ed20f124d9..c9f24d9f903 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/EventSettings.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/EventSettings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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 @@ -150,6 +150,11 @@ public abstract class EventSettings { return FlightRecorder.getFlightRecorder().getInternal(); } + @Override + public Recording newRecording(RecordingState state) { + return new Recording(state, Map.of()); + } + @Override public EventSettings newEventSettings(EventSettingsModifier esm) { return new EventSettings.DelegatedEventSettings(esm); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Recording.java b/src/jdk.jfr/share/classes/jdk/jfr/Recording.java index 089a5ed37d8..8a3181307d2 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/Recording.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/Recording.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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,6 +35,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import jdk.jfr.RecordingState; import jdk.jfr.internal.PlatformRecorder; import jdk.jfr.internal.PlatformRecording; import jdk.jfr.internal.Type; @@ -100,11 +101,16 @@ public final class Recording implements Closeable { * @since 11 */ public Recording(Map settings) { + this(RecordingState.NEW, settings); + } + + // package private + Recording(RecordingState state, Map settings) { Objects.requireNonNull(settings, "settings"); Map sanitized = Utils.sanitizeNullFreeStringMap(settings); PlatformRecorder r = FlightRecorder.getFlightRecorder().getInternal(); synchronized (r) { - this.internal = r.newRecording(sanitized); + this.internal = r.newRecording(state, sanitized); this.internal.setRecording(this); if (internal.getRecording() != this) { throw new InternalError("Internal recording not properly setup"); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java index cf46c05b804..260f2fed54d 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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 @@ -82,8 +82,8 @@ public final class PlatformRecorder { Runtime.getRuntime().addShutdownHook(shutdownHook); } - public synchronized PlatformRecording newRecording(Map settings) { - return newRecording(settings, ++recordingCounter); + public synchronized PlatformRecording newRecording(RecordingState state, Map settings) { + return newRecording(state, settings, ++recordingCounter); } // To be used internally when doing dumps. @@ -92,15 +92,17 @@ public final class PlatformRecorder { if(!Thread.holdsLock(this)) { throw new InternalError("Caller must have recorder lock"); } - return newRecording(new HashMap<>(), 0); + return newRecording(RecordingState.NEW, new HashMap<>(), 0); } - private synchronized PlatformRecording newRecording(Map settings, long id) { + private synchronized PlatformRecording newRecording(RecordingState state, Map settings, long id) { PlatformRecording recording = new PlatformRecording(this, id); if (!settings.isEmpty()) { recording.setSettings(settings); } - recordings.add(recording); + if (state != RecordingState.CLOSED) { + recordings.add(recording); + } return recording; } @@ -545,8 +547,10 @@ public final class PlatformRecorder { } synchronized Recording newCopy(PlatformRecording r, boolean stop) { - Recording newRec = new Recording(); - PlatformRecording copy = PrivateAccess.getInstance().getPlatformRecording(newRec); + PrivateAccess pr = PrivateAccess.getInstance(); + boolean closed = r.getState() == RecordingState.CLOSED; + Recording newRec = closed ? pr.newRecording(RecordingState.CLOSED) : new Recording(); + PlatformRecording copy = pr.getPlatformRecording(newRec); copy.setSettings(r.getSettings()); copy.setMaxAge(r.getMaxAge()); copy.setMaxSize(r.getMaxSize()); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java index fe5d5aea327..2297bf7bdde 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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 jdk.jfr.Configuration; import jdk.jfr.EventSettings; import jdk.jfr.EventType; import jdk.jfr.Recording; +import jdk.jfr.RecordingState; import jdk.jfr.SettingDescriptor; import jdk.jfr.ValueDescriptor; import jdk.jfr.internal.management.EventSettingsModifier; @@ -96,6 +97,8 @@ public abstract class PrivateAccess { public abstract PlatformRecorder getPlatformRecorder(); + public abstract Recording newRecording(RecordingState state); + public abstract EventSettings newEventSettings(EventSettingsModifier esm); public abstract boolean isVisible(EventType t); diff --git a/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java b/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java index df2aca02d68..3f324ba1364 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java @@ -435,7 +435,10 @@ class JImageTask { } } } catch (IOException ioe) { - throw TASK_HELPER.newBadArgs("err.invalid.jimage", file, ioe.getMessage()); + boolean isVersionMismatch = ioe instanceof BasicImageReader.ImageVersionMismatchException; + // Both messages take the file name and underlying message. + String msgKey = isVersionMismatch ? "err.wrong.version" : "err.invalid.jimage"; + throw TASK_HELPER.newBadArgs(msgKey, file, ioe.getMessage()); } } } diff --git a/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties b/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties index ac13505a0d9..3038dfcc5ec 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties @@ -89,15 +89,20 @@ main.opt.footer=\ \ glob:\n\ \ regex: - - err.not.a.task=task must be one of : {0} err.missing.arg=no value given for {0} err.ambiguous.arg=value for option {0} starts with \"--\" should use {0}= format err.not.a.dir=not a directory: {0} err.not.a.jimage=not a jimage file: {0} -err.invalid.jimage=Unable to open {0}: {1} err.no.jimage=no jimage provided err.option.unsupported={0} not supported: {1} err.unknown.option=unknown option: {0} err.cannot.create.dir=cannot create directory {0} + +# General failure to open a jimage file. +# {0} = path of jimage file, {1} = underlying error message +err.invalid.jimage=Unable to open {0}: {1} +# More specific alternative for cases of version mismatch +err.wrong.version=Unable to open {0}: mismatched file and tool version\n\ +Use ''/bin/jimage'' for the JDK associated with the jimage file:\n\ +{1} diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxBundlingEnvironment.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxBundlingEnvironment.java index d2169ede461..d6d9def9407 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxBundlingEnvironment.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxBundlingEnvironment.java @@ -30,6 +30,7 @@ import static jdk.jpackage.internal.LinuxPackagingPipeline.APPLICATION_LAYOUT; import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_LINUX_APP_IMAGE; import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_LINUX_DEB; import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_LINUX_RPM; +import static jdk.jpackage.internal.util.MemoizingSupplier.runOnce; import java.util.Map; import java.util.Optional; diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigner.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigner.java index c908ec7447c..188430511bb 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigner.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigner.java @@ -167,14 +167,14 @@ final class AppImageSigner { private static IOException handleCodesignException(MacApplication app, CodesignException ex) { if (!app.contentDirSources().isEmpty()) { // Additional content may cause signing error. - Log.info(I18N.getString("message.codesign.failed.reason.app.content")); + Log.fatalError(I18N.getString("message.codesign.failed.reason.app.content")); } // Signing might not work without Xcode with command line // developer tools. Show user if Xcode is missing as possible // reason. if (!isXcodeDevToolsInstalled()) { - Log.info(I18N.getString("message.codesign.failed.reason.xcode.tools")); + Log.fatalError(I18N.getString("message.codesign.failed.reason.xcode.tools")); } return ex.getCause(); diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigningConfigBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigningConfigBuilder.java index 6fc7fe004c2..962c821c20f 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigningConfigBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/AppImageSigningConfigBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,24 +61,26 @@ final class AppImageSigningConfigBuilder { return this; } - Optional create() { - return signingIdentityBuilder.create().map(cfg -> { - final var validatedEntitlements = validatedEntitlements(); - return new AppImageSigningConfig.Stub( - Objects.requireNonNull(cfg.identity()), - Objects.requireNonNull(signingIdentifierPrefix), - validatedEntitlements, - cfg.keychain().map(Keychain::name), - Optional.ofNullable(entitlementsResourceName).orElse("entitlements.plist") - ); - }); + AppImageSigningConfig create() { + + var cfg = signingIdentityBuilder.create(); + + var validatedEntitlements = validatedEntitlements(); + + return new AppImageSigningConfig.Stub( + Objects.requireNonNull(cfg.identity()), + Objects.requireNonNull(signingIdentifierPrefix), + validatedEntitlements, + cfg.keychain().map(Keychain::name), + Optional.ofNullable(entitlementsResourceName).orElse("entitlements.plist") + ); } private Optional validatedEntitlements() { return Optional.ofNullable(entitlements); } - private SigningIdentityBuilder signingIdentityBuilder; + private final SigningIdentityBuilder signingIdentityBuilder; private Path entitlements; private String entitlementsResourceName; private String signingIdentifierPrefix; diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacApplicationBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacApplicationBuilder.java index 2023b425da9..a73a6152f6d 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacApplicationBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacApplicationBuilder.java @@ -191,7 +191,7 @@ final class MacApplicationBuilder { } private Optional createSigningConfig() { - return Optional.ofNullable(signingBuilder).flatMap(AppImageSigningConfigBuilder::create); + return Optional.ofNullable(signingBuilder).map(AppImageSigningConfigBuilder::create); } private String validatedBundleName() { diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacFromOptions.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacFromOptions.java index f3c1765210f..4cd4f386ad8 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacFromOptions.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacFromOptions.java @@ -29,6 +29,8 @@ import static jdk.jpackage.internal.FromOptions.createPackageBuilder; import static jdk.jpackage.internal.MacPackagingPipeline.APPLICATION_LAYOUT; import static jdk.jpackage.internal.MacRuntimeValidator.validateRuntimeHasJliLib; import static jdk.jpackage.internal.MacRuntimeValidator.validateRuntimeHasNoBinDir; +import static jdk.jpackage.internal.OptionUtils.isBundlingOperation; +import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_MAC_PKG; import static jdk.jpackage.internal.cli.StandardBundlingOperation.SIGN_MAC_APP_IMAGE; import static jdk.jpackage.internal.cli.StandardOption.APPCLASS; import static jdk.jpackage.internal.cli.StandardOption.ICON; @@ -57,7 +59,7 @@ import java.util.List; import java.util.Objects; import java.util.Optional; import jdk.jpackage.internal.ApplicationBuilder.MainLauncherStartupInfo; -import jdk.jpackage.internal.SigningIdentityBuilder.ExpiredCertificateException; +import jdk.jpackage.internal.SigningIdentityBuilder.SigningConfigException; import jdk.jpackage.internal.SigningIdentityBuilder.StandardCertificateSelector; import jdk.jpackage.internal.cli.OptionValue; import jdk.jpackage.internal.cli.Options; @@ -75,8 +77,8 @@ import jdk.jpackage.internal.model.MacPkgPackage; import jdk.jpackage.internal.model.PackageType; import jdk.jpackage.internal.model.RuntimeLayout; import jdk.jpackage.internal.util.MacBundle; -import jdk.jpackage.internal.util.Result; import jdk.jpackage.internal.util.RootedPath; +import jdk.jpackage.internal.util.Slot; import jdk.jpackage.internal.util.function.ExceptionBox; @@ -118,62 +120,75 @@ final class MacFromOptions { final boolean sign = MAC_SIGN.findIn(options).orElse(false); final boolean appStore = MAC_APP_STORE.findIn(options).orElse(false); - final var appResult = Result.of(() -> createMacApplicationInternal(options)); + final Optional pkgSigningIdentityBuilder; - final Optional pkgBuilder; - if (appResult.hasValue()) { - final var superPkgBuilder = createMacPackageBuilder(options, appResult.orElseThrow(), MAC_PKG); - pkgBuilder = Optional.of(new MacPkgPackageBuilder(superPkgBuilder)); + if (!sign) { + pkgSigningIdentityBuilder = Optional.empty(); + } else if (hasAppImageSignIdentity(options) && !hasPkgInstallerSignIdentity(options)) { + // They explicitly request to sign the app image, + // but don't specify signing identity for signing the PKG package. + // They want signed app image inside of unsigned PKG. + pkgSigningIdentityBuilder = Optional.empty(); } else { - // Failed to create an app. Is it because of the expired certificate? - rethrowIfNotExpiredCertificateException(appResult); - // Yes, the certificate for signing the app image has expired. - // Keep going, try to create a signing config for the package. - pkgBuilder = Optional.empty(); - } - - if (sign) { final var signingIdentityBuilder = createSigningIdentityBuilder(options); - MAC_INSTALLER_SIGN_IDENTITY.ifPresentIn(options, signingIdentityBuilder::signingIdentity); - MAC_SIGNING_KEY_NAME.findIn(options).ifPresent(userName -> { - final StandardCertificateSelector domain; - if (appStore) { - domain = StandardCertificateSelector.APP_STORE_PKG_INSTALLER; - } else { - domain = StandardCertificateSelector.PKG_INSTALLER; - } - signingIdentityBuilder.certificateSelector(StandardCertificateSelector.create(userName, domain)); - }); + MAC_INSTALLER_SIGN_IDENTITY.findIn(options).ifPresentOrElse( + signingIdentityBuilder::signingIdentity, + () -> { + MAC_SIGNING_KEY_NAME.findIn(options).or(() -> { + if (MAC_APP_IMAGE_SIGN_IDENTITY.findIn(options).isPresent()) { + return Optional.empty(); + } else { + return Optional.of(""); + } + }).ifPresent(userName -> { + final StandardCertificateSelector domain; + if (appStore) { + domain = StandardCertificateSelector.APP_STORE_PKG_INSTALLER; + } else { + domain = StandardCertificateSelector.PKG_INSTALLER; + } - if (pkgBuilder.isPresent()) { - pkgBuilder.orElseThrow().signingBuilder(signingIdentityBuilder); - } else { - // - // The certificate for signing the app image has expired. Can not create a - // package because there is no app. - // Try to create a signing config for the package and see if the certificate for - // signing the package is also expired. - // + signingIdentityBuilder.certificateSelector(StandardCertificateSelector.create(userName, domain)); + }); + } + ); - final var expiredAppCertException = appResult.firstError().orElseThrow(); - - final var pkgSignConfigResult = Result.of(signingIdentityBuilder::create); - try { - rethrowIfNotExpiredCertificateException(pkgSignConfigResult); - // The certificate for the package signing config is also expired! - } catch (RuntimeException ex) { - // Some error occurred trying to configure the signing config for the package. - // Ignore it, bail out with the first error. - throw toUnchecked(expiredAppCertException); - } - - Log.error(pkgSignConfigResult.firstError().orElseThrow().getMessage()); - throw toUnchecked(expiredAppCertException); - } + pkgSigningIdentityBuilder = Optional.of(signingIdentityBuilder); } - return pkgBuilder.orElseThrow().create(); + ApplicationWithDetails app = null; + try { + app = createMacApplicationInternal(options); + } catch (RuntimeException appEx) { + rethrowIfNotSigningConfigException(appEx); + try { + pkgSigningIdentityBuilder.ifPresent(SigningIdentityBuilder::create); + } catch (RuntimeException pkgEx) { + + if (Objects.equals(appEx.getMessage(), pkgEx.getMessage())) { + // Don't report the same error twice. + throw appEx; + } + + // Use suppressed exceptions to communicate multiple exceptions to the caller. + // The top-level error handling code assumes there is a causal connection + // between the exception and its suppressed exceptions. + // Based on this assumption and following the principle "Present cause before consequence", + // it will report the suppressed exceptions before reporting the caught exception. + pkgEx.addSuppressed(appEx); + throw pkgEx; + } + + throw appEx; + } + + final var superPkgBuilder = createMacPackageBuilder(options, app, MAC_PKG); + final var pkgBuilder = new MacPkgPackageBuilder(superPkgBuilder); + + pkgSigningIdentityBuilder.ifPresent(pkgBuilder::signingBuilder); + + return pkgBuilder.create(); } private record ApplicationWithDetails(MacApplication app, Optional externalApp) { @@ -233,33 +248,47 @@ final class MacFromOptions { MAC_BUNDLE_IDENTIFIER.ifPresentIn(options, appBuilder::bundleIdentifier); MAC_APP_CATEGORY.ifPresentIn(options, appBuilder::category); - final boolean sign; + final boolean sign = MAC_SIGN.getFrom(options); final boolean appStore; - if (PREDEFINED_APP_IMAGE.containsIn(options) && OptionUtils.bundlingOperation(options) != SIGN_MAC_APP_IMAGE) { + if (PREDEFINED_APP_IMAGE.containsIn(options)) { final var appImageFileOptions = superAppBuilder.externalApplication().orElseThrow().extra(); - sign = MAC_SIGN.getFrom(appImageFileOptions); appStore = MAC_APP_STORE.getFrom(appImageFileOptions); } else { - sign = MAC_SIGN.getFrom(options); appStore = MAC_APP_STORE.getFrom(options); } appBuilder.appStore(appStore); - if (sign) { - final var signingIdentityBuilder = createSigningIdentityBuilder(options); - MAC_APP_IMAGE_SIGN_IDENTITY.ifPresentIn(options, signingIdentityBuilder::signingIdentity); - MAC_SIGNING_KEY_NAME.findIn(options).ifPresent(userName -> { - final StandardCertificateSelector domain; - if (appStore) { - domain = StandardCertificateSelector.APP_STORE_APP_IMAGE; - } else { - domain = StandardCertificateSelector.APP_IMAGE; - } + final var signOnlyPkgInstaller = sign && ( + isBundlingOperation(options, CREATE_MAC_PKG) + && !hasAppImageSignIdentity(options) + && hasPkgInstallerSignIdentity(options)); - signingIdentityBuilder.certificateSelector(StandardCertificateSelector.create(userName, domain)); - }); + if (sign && !signOnlyPkgInstaller) { + final var signingIdentityBuilder = createSigningIdentityBuilder(options); + + MAC_APP_IMAGE_SIGN_IDENTITY.findIn(options).ifPresentOrElse( + signingIdentityBuilder::signingIdentity, + () -> { + MAC_SIGNING_KEY_NAME.findIn(options).or(() -> { + if (MAC_INSTALLER_SIGN_IDENTITY.containsIn(options)) { + return Optional.empty(); + } else { + return Optional.of(""); + } + }).ifPresent(userName -> { + final StandardCertificateSelector domain; + if (appStore) { + domain = StandardCertificateSelector.APP_STORE_APP_IMAGE; + } else { + domain = StandardCertificateSelector.APP_IMAGE; + } + + signingIdentityBuilder.certificateSelector(StandardCertificateSelector.create(userName, domain)); + }); + } + ); final var signingBuilder = new AppImageSigningConfigBuilder(signingIdentityBuilder); if (appStore) { @@ -298,20 +327,18 @@ final class MacFromOptions { return builder; } - private static void rethrowIfNotExpiredCertificateException(Result result) { - final var ex = result.firstError().orElseThrow(); + private static void rethrowIfNotSigningConfigException(Exception ex) { + var signingConfigExceptionFound = Slot.createEmpty(); - if (ex instanceof ExpiredCertificateException) { - return; - } - - if (ex instanceof ExceptionBox box) { - if (box.getCause() instanceof Exception cause) { - rethrowIfNotExpiredCertificateException(Result.ofError(cause)); + ExceptionBox.visitUnboxedExceptionsRecursively(ex, visited -> { + if (visited instanceof SigningConfigException) { + signingConfigExceptionFound.set(true); } - } + }); - throw toUnchecked(ex); + if (!signingConfigExceptionFound.find().orElse(false)) { + throw toUnchecked(ex); + } } private static SigningIdentityBuilder createSigningIdentityBuilder(Options options) { @@ -336,4 +363,12 @@ final class MacFromOptions { return builder.create(fa); } + + private static boolean hasAppImageSignIdentity(Options options) { + return options.contains(MAC_SIGNING_KEY_NAME) || options.contains(MAC_APP_IMAGE_SIGN_IDENTITY); + } + + private static boolean hasPkgInstallerSignIdentity(Options options) { + return options.contains(MAC_SIGNING_KEY_NAME) || options.contains(MAC_INSTALLER_SIGN_IDENTITY); + } } diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgPackageBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgPackageBuilder.java index b81340354e1..0a5cc09596f 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgPackageBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgPackageBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -48,7 +48,7 @@ final class MacPkgPackageBuilder { } private Optional createSigningConfig() { - return Optional.ofNullable(signingBuilder).flatMap(SigningIdentityBuilder::create).map(cfg -> { + return Optional.ofNullable(signingBuilder).map(SigningIdentityBuilder::create).map(cfg -> { return new PkgSigningConfig.Stub(cfg.identity(), cfg.keychain().map(Keychain::name)); }); } diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java index 0f753c07569..892601eb363 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java @@ -39,23 +39,18 @@ import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; import javax.security.auth.x500.X500Principal; import jdk.jpackage.internal.MacCertificateUtils.CertificateHash; -import jdk.jpackage.internal.model.ConfigException; import jdk.jpackage.internal.model.JPackageException; import jdk.jpackage.internal.model.SigningIdentity; final class SigningIdentityBuilder { - static class SigningConfigException extends ConfigException { - SigningConfigException(ConfigException ex) { - super(ex.getMessage(), ex.getAdvice(), ex.getCause()); + static class SigningConfigException extends JPackageException { + public SigningConfigException(String msg) { + super(msg); } - private static final long serialVersionUID = 1L; - } - - static class ExpiredCertificateException extends SigningConfigException { - ExpiredCertificateException(ConfigException ex) { - super(ex); + public SigningConfigException(String msg, Throwable cause) { + super(msg, cause); } private static final long serialVersionUID = 1L; @@ -83,11 +78,12 @@ final class SigningIdentityBuilder { return this; } - Optional create() { - if (signingIdentity == null && certificateSelector == null) { - return Optional.empty(); + SigningConfig create() { + if (Objects.isNull(certificateSelector) == Objects.isNull(signingIdentity)) { + // Either the signing certificate selector or the signing certificate must be configured. + throw new IllegalStateException(); } else { - return Optional.of(new SigningConfig(validatedSigningIdentity(), validatedKeychain())); + return new SigningConfig(validatedSigningIdentity(), validatedKeychain()); } } @@ -133,8 +129,9 @@ final class SigningIdentityBuilder { try { cert.checkValidity(); - } catch (CertificateExpiredException|CertificateNotYetValidException ex) { - throw new ExpiredCertificateException(I18N.buildConfigException("error.certificate.expired", findSubjectCNs(cert).getFirst()).create()); + } catch (CertificateExpiredException | CertificateNotYetValidException ex) { + throw new SigningConfigException(I18N.format( + "error.certificate.outside-validity-period", findSubjectCNs(cert).getFirst()), ex); } final var signingIdentityHash = CertificateHash.of(cert); @@ -148,7 +145,7 @@ final class SigningIdentityBuilder { Objects.requireNonNull(keychain); switch (certs.size()) { case 0 -> { - throw new JPackageException(I18N.format("error.cert.not.found", + throw new SigningConfigException(I18N.format("error.cert.not.found", certificateSelector.signingIdentities().getFirst(), keychain.map(Keychain::name).orElse(""))); } @@ -156,10 +153,9 @@ final class SigningIdentityBuilder { return certs.getFirst(); } default -> { - throw I18N.buildConfigException("error.multiple.certs.found", + throw new SigningConfigException(I18N.format("error.multiple.certs.found", certificateSelector.signingIdentities().getFirst(), - keychain.map(Keychain::name).orElse("") - ).create(); + keychain.map(Keychain::name).orElse(""))); } } } diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties index e1b154c5933..e43cadc5782 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties @@ -24,7 +24,7 @@ # # error.invalid-cfbundle-version.advice=Set a compatible 'app-version' value. Valid versions are one to three integers separated by dots. -error.certificate.expired=Certificate expired {0} +error.certificate.outside-validity-period=The certificate "{0}" is outside its validity period error.cert.not.found=No certificate found matching [{0}] using keychain [{1}] error.multiple.certs.found=Multiple certificates matching name [{0}] found in keychain [{1}] error.app-image.mac-sign.required=--mac-sign option is required with predefined application image and with type [app-image] diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DefaultBundlingEnvironment.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DefaultBundlingEnvironment.java index 331bde29d27..fc51f60aa66 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DefaultBundlingEnvironment.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DefaultBundlingEnvironment.java @@ -25,6 +25,7 @@ package jdk.jpackage.internal; import static java.util.stream.Collectors.toMap; +import static jdk.jpackage.internal.util.MemoizingSupplier.runOnce; import java.io.IOException; import java.io.UncheckedIOException; @@ -36,7 +37,6 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Objects; import java.util.Optional; -import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Consumer; @@ -50,6 +50,7 @@ import jdk.jpackage.internal.model.Application; import jdk.jpackage.internal.model.BundlingOperationDescriptor; import jdk.jpackage.internal.model.JPackageException; import jdk.jpackage.internal.model.Package; +import jdk.jpackage.internal.util.MemoizingSupplier; import jdk.jpackage.internal.util.PathUtils; import jdk.jpackage.internal.util.Result; @@ -66,7 +67,7 @@ class DefaultBundlingEnvironment implements CliBundlingEnvironment { return runOnce(e.getValue()); })); - this.defaultOperationSupplier = Objects.requireNonNull(defaultOperationSupplier).map(DefaultBundlingEnvironment::runOnce); + this.defaultOperationSupplier = Objects.requireNonNull(defaultOperationSupplier).map(MemoizingSupplier::runOnce); } @@ -110,10 +111,6 @@ class DefaultBundlingEnvironment implements CliBundlingEnvironment { return new Builder(); } - static Supplier runOnce(Supplier supplier) { - return new CachingSupplier<>(supplier); - } - static Supplier>> createBundlerSupplier( Supplier> sysEnvResultSupplier, BiConsumer bundler) { Objects.requireNonNull(sysEnvResultSupplier); @@ -198,11 +195,11 @@ class DefaultBundlingEnvironment implements CliBundlingEnvironment { public void createBundle(BundlingOperationDescriptor op, Options cmdline) { final var bundler = getBundlerSupplier(op).get().orElseThrow(); Optional permanentWorkDirectory = Optional.empty(); - try (var tempDir = new TempDirectory(cmdline)) { + try (var tempDir = new TempDirectory(cmdline, Globals.instance().objectFactory())) { if (!tempDir.deleteOnClose()) { permanentWorkDirectory = Optional.of(tempDir.path()); } - bundler.accept(tempDir.options()); + bundler.accept(tempDir.map(cmdline)); } catch (IOException ex) { throw new UncheckedIOException(ex); } finally { @@ -223,25 +220,6 @@ class DefaultBundlingEnvironment implements CliBundlingEnvironment { }); } - - private static final class CachingSupplier implements Supplier { - - CachingSupplier(Supplier getter) { - this.getter = Objects.requireNonNull(getter); - } - - @Override - public T get() { - return cachedValue.updateAndGet(v -> { - return Optional.ofNullable(v).orElseGet(getter); - }); - } - - private final Supplier getter; - private final AtomicReference cachedValue = new AtomicReference<>(); - } - - private final Map>>> bundlers; private final Optional>> defaultOperationSupplier; } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java index 53c587ab37c..f9ccec7e3bb 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java @@ -49,7 +49,7 @@ import jdk.jpackage.internal.util.CommandOutputControl.Result; import jdk.jpackage.internal.util.RetryExecutor; import jdk.jpackage.internal.util.function.ExceptionBox; -final class Executor { +public final class Executor { static Executor of(String... cmdline) { return of(List.of(cmdline)); @@ -78,118 +78,118 @@ final class Executor { mapper = other.mapper; } - Executor saveOutput(boolean v) { + public Executor saveOutput(boolean v) { commandOutputControl.saveOutput(v); return this; } - Executor saveOutput() { + public Executor saveOutput() { return saveOutput(true); } - Executor saveFirstLineOfOutput() { + public Executor saveFirstLineOfOutput() { commandOutputControl.saveFirstLineOfOutput(); return this; } - Executor charset(Charset v) { + public Executor charset(Charset v) { commandOutputControl.charset(v); return this; } - Executor storeOutputInFiles(boolean v) { + public Executor storeOutputInFiles(boolean v) { commandOutputControl.storeOutputInFiles(v); return this; } - Executor storeOutputInFiles() { + public Executor storeOutputInFiles() { return storeOutputInFiles(true); } - Executor binaryOutput(boolean v) { + public Executor binaryOutput(boolean v) { commandOutputControl.binaryOutput(v); return this; } - Executor binaryOutput() { + public Executor binaryOutput() { return binaryOutput(true); } - Executor discardStdout(boolean v) { + public Executor discardStdout(boolean v) { commandOutputControl.discardStdout(v); return this; } - Executor discardStdout() { + public Executor discardStdout() { return discardStdout(true); } - Executor discardStderr(boolean v) { + public Executor discardStderr(boolean v) { commandOutputControl.discardStderr(v); return this; } - Executor discardStderr() { + public Executor discardStderr() { return discardStderr(true); } - Executor timeout(long v, TimeUnit unit) { + public Executor timeout(long v, TimeUnit unit) { return timeout(Duration.of(v, unit.toChronoUnit())); } - Executor timeout(Duration v) { + public Executor timeout(Duration v) { timeout = v; return this; } - Executor toolProvider(ToolProvider v) { + public Executor toolProvider(ToolProvider v) { toolProvider = Objects.requireNonNull(v); processBuilder = null; return this; } - Optional toolProvider() { + public Optional toolProvider() { return Optional.ofNullable(toolProvider); } - Executor processBuilder(ProcessBuilder v) { + public Executor processBuilder(ProcessBuilder v) { processBuilder = Objects.requireNonNull(v); toolProvider = null; return this; } - Optional processBuilder() { + public Optional processBuilder() { return Optional.ofNullable(processBuilder); } - Executor args(List v) { + public Executor args(List v) { args.addAll(v); return this; } - Executor args(String... args) { + public Executor args(String... args) { return args(List.of(args)); } - List args() { + public List args() { return args; } - Executor setQuiet(boolean v) { + public Executor setQuiet(boolean v) { quietCommand = v; return this; } - Executor mapper(UnaryOperator v) { + public Executor mapper(UnaryOperator v) { mapper = v; return this; } - Optional> mapper() { + public Optional> mapper() { return Optional.ofNullable(mapper); } - Executor copy() { + public Executor copy() { return new Executor(this); } @@ -261,7 +261,7 @@ final class Executor { }); } - List commandLine() { + public List commandLine() { if (processBuilder != null) { return Stream.of(processBuilder.command(), args).flatMap(Collection::stream).toList(); } else if (toolProvider != null) { diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ExecutorFactory.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ExecutorFactory.java index ce703358b82..82d81d1052e 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ExecutorFactory.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ExecutorFactory.java @@ -25,9 +25,9 @@ package jdk.jpackage.internal; @FunctionalInterface -interface ExecutorFactory { +public interface ExecutorFactory { Executor executor(); - static final ExecutorFactory DEFAULT = Executor::new; + public static final ExecutorFactory DEFAULT = Executor::new; } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Globals.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Globals.java index 91ae37870a5..d5c714d1a47 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Globals.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Globals.java @@ -33,17 +33,17 @@ public final class Globals { private Globals() { } - Globals objectFactory(ObjectFactory v) { + public Globals objectFactory(ObjectFactory v) { checkMutable(); objectFactory = Optional.ofNullable(v).orElse(ObjectFactory.DEFAULT); return this; } - ObjectFactory objectFactory() { + public ObjectFactory objectFactory() { return objectFactory; } - Globals executorFactory(ExecutorFactory v) { + public Globals executorFactory(ExecutorFactory v) { return objectFactory(ObjectFactory.build(objectFactory).executorFactory(v).create()); } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ObjectFactory.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ObjectFactory.java index f1a83eb9eab..b6a95ae539b 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ObjectFactory.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ObjectFactory.java @@ -28,38 +28,38 @@ import java.util.Objects; import java.util.Optional; import jdk.jpackage.internal.util.CompositeProxy; -interface ObjectFactory extends ExecutorFactory, RetryExecutorFactory { +public interface ObjectFactory extends ExecutorFactory, RetryExecutorFactory { - static ObjectFactory.Builder build() { + public static ObjectFactory.Builder build() { return new Builder(); } - static ObjectFactory.Builder build(ObjectFactory from) { + public static ObjectFactory.Builder build(ObjectFactory from) { return build().initFrom(from); } - static final class Builder { + public static final class Builder { private Builder() { } - ObjectFactory create() { + public ObjectFactory create() { return CompositeProxy.build().invokeTunnel(CompositeProxyTunnel.INSTANCE).create( ObjectFactory.class, Optional.ofNullable(executorFactory).orElse(ExecutorFactory.DEFAULT), Optional.ofNullable(retryExecutorFactory).orElse(RetryExecutorFactory.DEFAULT)); } - Builder initFrom(ObjectFactory of) { + public Builder initFrom(ObjectFactory of) { Objects.requireNonNull(of); return executorFactory(of).retryExecutorFactory(of); } - Builder executorFactory(ExecutorFactory v) { + public Builder executorFactory(ExecutorFactory v) { executorFactory = v; return this; } - Builder retryExecutorFactory(RetryExecutorFactory v) { + public Builder retryExecutorFactory(RetryExecutorFactory v) { retryExecutorFactory = v; return this; } @@ -68,5 +68,5 @@ interface ObjectFactory extends ExecutorFactory, RetryExecutorFactory { private RetryExecutorFactory retryExecutorFactory; } - static final ObjectFactory DEFAULT = build().create(); + public static final ObjectFactory DEFAULT = build().create(); } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OptionUtils.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OptionUtils.java index 97e1274f078..b39e67a9eb7 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OptionUtils.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OptionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 static jdk.jpackage.internal.cli.StandardOption.PREDEFINED_APP_IMAGE; import static jdk.jpackage.internal.cli.StandardOption.PREDEFINED_RUNTIME_IMAGE; import java.nio.file.Path; +import java.util.Objects; import jdk.jpackage.internal.cli.Options; import jdk.jpackage.internal.cli.StandardBundlingOperation; @@ -51,4 +52,8 @@ final class OptionUtils { static StandardBundlingOperation bundlingOperation(Options options) { return StandardBundlingOperation.valueOf(BUNDLING_OPERATION_DESCRIPTOR.getFrom(options)).orElseThrow(); } + + static boolean isBundlingOperation(Options options, StandardBundlingOperation op) { + return bundlingOperation(options).equals(Objects.requireNonNull(op)); + } } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutorFactory.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutorFactory.java index 3efb522abd4..f18ce61fc04 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutorFactory.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutorFactory.java @@ -27,9 +27,9 @@ package jdk.jpackage.internal; import jdk.jpackage.internal.util.RetryExecutor; @FunctionalInterface -interface RetryExecutorFactory { +public interface RetryExecutorFactory { RetryExecutor retryExecutor(Class exceptionType); - static final RetryExecutorFactory DEFAULT = RetryExecutor::new; + public static final RetryExecutorFactory DEFAULT = RetryExecutor::new; } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/TempDirectory.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/TempDirectory.java index 50d1701bf0d..345a42c5051 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/TempDirectory.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/TempDirectory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,29 +26,46 @@ package jdk.jpackage.internal; import java.io.Closeable; import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.FileVisitor; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; import jdk.jpackage.internal.cli.Options; import jdk.jpackage.internal.cli.StandardOption; import jdk.jpackage.internal.util.FileUtils; +import jdk.jpackage.internal.util.Slot; final class TempDirectory implements Closeable { - TempDirectory(Options options) throws IOException { - final var tempDir = StandardOption.TEMP_ROOT.findIn(options); - if (tempDir.isPresent()) { - this.path = tempDir.orElseThrow(); - this.options = options; - } else { - this.path = Files.createTempDirectory("jdk.jpackage"); - this.options = options.copyWithDefaultValue(StandardOption.TEMP_ROOT, path); - } - - deleteOnClose = tempDir.isEmpty(); + TempDirectory(Options options, RetryExecutorFactory retryExecutorFactory) throws IOException { + this(StandardOption.TEMP_ROOT.findIn(options), retryExecutorFactory); } - Options options() { - return options; + TempDirectory(Optional tempDir, RetryExecutorFactory retryExecutorFactory) throws IOException { + this(tempDir.isEmpty() ? Files.createTempDirectory("jdk.jpackage") : tempDir.get(), + tempDir.isEmpty(), + retryExecutorFactory); + } + + TempDirectory(Path tempDir, boolean deleteOnClose, RetryExecutorFactory retryExecutorFactory) throws IOException { + this.path = Objects.requireNonNull(tempDir); + this.deleteOnClose = deleteOnClose; + this.retryExecutorFactory = Objects.requireNonNull(retryExecutorFactory); + } + + Options map(Options options) { + if (deleteOnClose) { + return options.copyWithDefaultValue(StandardOption.TEMP_ROOT, path); + } else { + return options; + } } Path path() { @@ -62,11 +79,107 @@ final class TempDirectory implements Closeable { @Override public void close() throws IOException { if (deleteOnClose) { - FileUtils.deleteRecursive(path); + retryExecutorFactory.retryExecutor(IOException.class) + .setMaxAttemptsCount(5) + .setAttemptTimeout(2, TimeUnit.SECONDS) + .setExecutable(context -> { + try { + FileUtils.deleteRecursive(path); + } catch (IOException ex) { + if (!context.isLastAttempt()) { + throw ex; + } else { + // Collect the list of leftover files. Collect at most the first 100 files. + var remainingFiles = DirectoryListing.listFilesAndEmptyDirectories( + path, MAX_REPORTED_UNDELETED_FILE_COUNT).paths(); + + if (remainingFiles.equals(List.of(path))) { + Log.info(I18N.format("warning.tempdir.cleanup-failed", path)); + } else { + remainingFiles.forEach(file -> { + Log.info(I18N.format("warning.tempdir.cleanup-file-failed", file)); + }); + } + + Log.verbose(ex); + } + } + return null; + }).execute(); + } + } + + record DirectoryListing(List paths, boolean complete) { + DirectoryListing { + Objects.requireNonNull(paths); + } + + static DirectoryListing listFilesAndEmptyDirectories(Path path, int limit) { + Objects.requireNonNull(path); + if (limit < 0) { + throw new IllegalArgumentException(); + } else if (limit == 0) { + return new DirectoryListing(List.of(), !Files.exists(path)); + } + + var paths = new ArrayList(); + var stopped = Slot.createEmpty(); + + stopped.set(false); + + try { + Files.walkFileTree(path, new FileVisitor<>() { + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { + try (var walk = Files.walk(dir)) { + if (walk.skip(1).findAny().isEmpty()) { + // This is an empty directory, add it to the list. + return addPath(dir, FileVisitResult.SKIP_SUBTREE); + } + } catch (IOException ex) { + Log.verbose(ex); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { + return addPath(file, FileVisitResult.CONTINUE); + } + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) { + return addPath(file, FileVisitResult.CONTINUE); + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) { + return FileVisitResult.CONTINUE; + } + + private FileVisitResult addPath(Path v, FileVisitResult result) { + if (paths.size() < limit) { + paths.add(v); + return result; + } else { + stopped.set(true); + } + return FileVisitResult.TERMINATE; + } + + }); + } catch (IOException ex) { + Log.verbose(ex); + } + + return new DirectoryListing(Collections.unmodifiableList(paths), !stopped.get()); } } private final Path path; - private final Options options; private final boolean deleteOnClose; + private final RetryExecutorFactory retryExecutorFactory; + + private final static int MAX_REPORTED_UNDELETED_FILE_COUNT = 100; } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Main.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Main.java index 73b4850344b..d40895a7da6 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Main.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Main.java @@ -37,6 +37,7 @@ import java.io.PrintWriter; import java.io.StringReader; import java.io.UncheckedIOException; import java.nio.file.NoSuchFileException; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Objects; @@ -239,17 +240,21 @@ public final class Main { } void reportError(Throwable t) { - if (t instanceof ConfigException cfgEx) { - printError(cfgEx, Optional.ofNullable(cfgEx.getAdvice())); - } else if (t instanceof ExceptionBox ex) { - reportError(ex.getCause()); - } else if (t instanceof UncheckedIOException ex) { - reportError(ex.getCause()); - } else if (t instanceof UnexpectedResultException ex) { - printExternalCommandError(ex); - } else { - printError(t, Optional.empty()); - } + + var unfoldedExceptions = new ArrayList(); + ExceptionBox.visitUnboxedExceptionsRecursively(t, unfoldedExceptions::add); + + unfoldedExceptions.forEach(ex -> { + if (ex instanceof ConfigException cfgEx) { + printError(cfgEx, Optional.ofNullable(cfgEx.getAdvice())); + } else if (ex instanceof UncheckedIOException) { + printError(ex.getCause(), Optional.empty()); + } else if (ex instanceof UnexpectedResultException urex) { + printExternalCommandError(urex); + } else { + printError(ex, Optional.empty()); + } + }); } private void printExternalCommandError(UnexpectedResultException ex) { diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/StandardOption.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/StandardOption.java index fedb55116a3..eca82da99aa 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/StandardOption.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/StandardOption.java @@ -109,7 +109,7 @@ public final class StandardOption { public static final OptionValue VERBOSE = auxilaryOption("verbose").create(); - public static final OptionValue TYPE = option("type", BundleType.class).addAliases("t") + static final OptionValue TYPE = option("type", BundleType.class).addAliases("t") .scope(StandardBundlingOperation.values()).inScope(NOT_BUILDING_APP_IMAGE) .converterExceptionFactory(ERROR_WITH_VALUE).converterExceptionFormatString("ERR_InvalidInstallerType") .converter(str -> { @@ -248,7 +248,10 @@ public final class StandardOption { .validatorExceptionFormatString("error.parameter-not-mac-bundle") .validator(StandardValidator.IS_VALID_MAC_BUNDLE) .createValidator().orElseThrow(); - b.validator(Validator.and(directoryValidator, macBundleValidator)); + // Use "lazy and" validator composition. + // If the value of the option is not a directory, we want only one error reported, not two: + // one that the value is not a directory and another that it is not a valid macOS bundle. + b.validator(Validator.andLazy(directoryValidator, macBundleValidator)); } })) .create(); diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Validator.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Validator.java index 0701071b00f..04d8d7cc09b 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Validator.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Validator.java @@ -44,7 +44,7 @@ interface Validator { */ List validate(OptionName optionName, ParsedValue optionValue) throws ValidatorException; - default Validator and(Validator after) { + default Validator andGreedy(Validator after) { Objects.requireNonNull(after); var before = this; return (optionName, optionValue) -> { @@ -55,6 +55,19 @@ interface Validator { }; } + default Validator andLazy(Validator after) { + Objects.requireNonNull(after); + var before = this; + return (optionName, optionValue) -> { + var bErrors = before.validate(optionName, optionValue); + if (!bErrors.isEmpty()) { + return bErrors.stream().map(Exception.class::cast).toList(); + } else { + return after.validate(optionName, optionValue).stream().map(Exception.class::cast).toList(); + } + }; + } + default Validator or(Validator after) { Objects.requireNonNull(after); var before = this; @@ -74,8 +87,13 @@ interface Validator { } @SuppressWarnings("unchecked") - static Validator and(Validator first, Validator second) { - return (Validator)first.and(second); + static Validator andGreedy(Validator first, Validator second) { + return (Validator)first.andGreedy(second); + } + + @SuppressWarnings("unchecked") + static Validator andLazy(Validator first, Validator second) { + return (Validator)first.andLazy(second); } @SuppressWarnings("unchecked") diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties index 6e5de3d9729..233067d6457 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties @@ -109,6 +109,9 @@ error.tool-not-found.advice=Please install "{0}" error.tool-old-version=Can not find "{0}" {1} or newer error.tool-old-version.advice=Please install "{0}" {1} or newer +warning.tempdir.cleanup-failed=Warning: Failed to clean-up temporary directory {0} +warning.tempdir.cleanup-file-failed=Warning: Failed to delete "{0}" file in the temporary directory + error.output-bundle-cannot-be-overwritten=Output package file "{0}" exists and can not be removed. error.blocked.option=jlink option [{0}] is not permitted in --jlink-options diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/MemoizingSupplier.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/MemoizingSupplier.java new file mode 100644 index 00000000000..2974c498867 --- /dev/null +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/MemoizingSupplier.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2026, 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. + */ +package jdk.jpackage.internal.util; + +import jdk.jpackage.internal.util.function.ExceptionBox; +import java.util.Objects; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import java.util.function.Supplier; + +public final class MemoizingSupplier implements Supplier { + + public MemoizingSupplier(Supplier supplier) { + this.future = new FutureTask<>(Objects.requireNonNull(supplier)::get); + } + + @Override + public T get() { + try { + future.run(); + return future.get(); + } catch (InterruptedException ex) { + throw ExceptionBox.toUnchecked(ex); + } catch (ExecutionException ex) { + throw ExceptionBox.toUnchecked(ExceptionBox.unbox(ex.getCause())); + } + } + + public static Supplier runOnce(Supplier supplier) { + return new MemoizingSupplier<>(supplier); + } + + private final FutureTask future; +} diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/function/ExceptionBox.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/function/ExceptionBox.java index 40503469873..0c2963f7397 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/function/ExceptionBox.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/function/ExceptionBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,9 @@ package jdk.jpackage.internal.util.function; import java.lang.reflect.InvocationTargetException; +import java.util.Objects; +import java.util.function.Consumer; +import java.util.stream.Stream; public class ExceptionBox extends RuntimeException { @@ -74,6 +77,40 @@ public class ExceptionBox extends RuntimeException { } } + /** + * Unboxes the specified throwable and its suppressed throwables recursively. + *

    + * Calls {@link #unbox(Throwable)} on the specified throwable and nested + * suppressed throwables, passing the result to the {@code visitor}. + *

    + * Throwables will be traversed in the "cause before consequence" order. E.g.: + * say exception "A" suppresses exceptions "B" and "C", and "B" suppresses "D". + * The traverse order will be "D", "B", "C", "A". + *

    + * If the method encounters cyclic suppressed throwables, it will fall into an + * infinite recursion loop, eventually causing a {@code StackOverflowError}. + *

    + * If the specified throwable or any of its nested suppressed throwables are of + * type {@link Error}, the method will keep notifying the {@code visitor} until + * it hits the first such throwable. When it happens, the method will throw this + * throwable. + * + * @param t the exception to visit + * @param visitor the callback to apply to every subsequently visited exception + */ + public static void visitUnboxedExceptionsRecursively(Throwable t, Consumer visitor) { + Objects.requireNonNull(t); + Objects.requireNonNull(visitor); + + var ex = unbox(t); + + Stream.of(ex.getSuppressed()).forEach(suppressed -> { + visitUnboxedExceptionsRecursively(suppressed, visitor); + }); + + visitor.accept(ex); + } + public static Error reachedUnreachable() { return new AssertionError("Reached unreachable!"); } diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinBundlingEnvironment.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinBundlingEnvironment.java index de52a222d7d..e10bfb95abf 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinBundlingEnvironment.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinBundlingEnvironment.java @@ -29,6 +29,7 @@ import static jdk.jpackage.internal.WinPackagingPipeline.APPLICATION_LAYOUT; import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_WIN_APP_IMAGE; import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_WIN_EXE; import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_WIN_MSI; +import static jdk.jpackage.internal.util.MemoizingSupplier.runOnce; import jdk.jpackage.internal.cli.Options; diff --git a/src/jdk.jshell/share/classes/jdk/jshell/Eval.java b/src/jdk.jshell/share/classes/jdk/jshell/Eval.java index bc6f6d30236..70f3b70fd66 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/Eval.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/Eval.java @@ -337,7 +337,7 @@ class Eval { Set anonymousClasses = Collections.emptySet(); StringBuilder sbBrackets = new StringBuilder(); Tree baseType = vt.getType(); - if (baseType != null) { + if (vt.getType() != null && vt.getType().getKind() != Tree.Kind.VAR_TYPE) { tds.scan(baseType); // Not dependent on initializer fullTypeName = displayType = typeName = EvalPretty.prettyExpr((JCTree) vt.getType(), false); while (baseType instanceof ArrayTypeTree) { diff --git a/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java b/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java index 1cf0c85702f..35faab231af 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java @@ -816,7 +816,7 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis { SourcePositions sp = trees.getSourcePositions(); List tokens = new ArrayList<>(); Context ctx = new Context(); - ctx.put(DiagnosticListener.class, (DiagnosticListener) d -> {}); + ctx.put(DiagnosticListener.class, (DiagnosticListener) d -> {}); Scanner scanner = ScannerFactory.instance(ctx).newScanner(wrappedCode, false); Log.instance(ctx).useSource(cut.getSourceFile()); scanner.nextToken(); @@ -932,7 +932,7 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis { @Override public Void visitVariable(VariableTree node, Void p) { int pos = ((JCTree) node).pos; - if (sp.getEndPosition(cut, node.getType()) == (-1)) { + if (node.getType() != null && node.getType().getKind() == Kind.VAR_TYPE) { Token varCandidate = findTokensBefore(pos, TokenKind.IDENTIFIER); if (varCandidate != null && "var".equals(varCandidate.name().toString())) { addKeyword.accept(varCandidate); diff --git a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/ResourceRecord.java b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/ResourceRecord.java index e0b8dce556e..a2b927cdaa0 100644 --- a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/ResourceRecord.java +++ b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/ResourceRecord.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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,7 +38,6 @@ import java.nio.charset.StandardCharsets; * The string format is based on the master file representation in * RFC 1035. * - * @author Scott Seligman */ @@ -484,11 +483,11 @@ public class ResourceRecord { pos += 2; int preference = getUShort(pos); pos += 2; - StringBuffer flags = new StringBuffer(); + StringBuilder flags = new StringBuilder(); pos += decodeCharString(pos, flags); - StringBuffer services = new StringBuffer(); + StringBuilder services = new StringBuilder(); pos += decodeCharString(pos, services); - StringBuffer regexp = new StringBuffer(rdlen); + StringBuilder regexp = new StringBuilder(rdlen); pos += decodeCharString(pos, regexp); DnsName replacement = decodeName(pos); @@ -501,7 +500,7 @@ public class ResourceRecord { * The rdata consists of one or more s. */ private String decodeTxt(int pos) { - StringBuffer buf = new StringBuffer(rdlen); + StringBuilder buf = new StringBuilder(rdlen); int end = pos + rdlen; while (pos < end) { pos += decodeCharString(pos, buf); @@ -517,7 +516,7 @@ public class ResourceRecord { * The rdata consists of two s. */ private String decodeHinfo(int pos) { - StringBuffer buf = new StringBuffer(rdlen); + StringBuilder buf = new StringBuilder(rdlen); pos += decodeCharString(pos, buf); buf.append(' '); pos += decodeCharString(pos, buf); @@ -532,7 +531,7 @@ public class ResourceRecord { * Returns the size of the encoded string, including the initial * length octet. */ - private int decodeCharString(int pos, StringBuffer buf) { + private int decodeCharString(int pos, StringBuilder buf) { int start = buf.length(); // starting index of this string int len = getUByte(pos++); // encoded string length boolean quoted = (len == 0); // quote string if empty diff --git a/src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/SwingInterOpUtils.java b/src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/SwingInterOpUtils.java index 589744641e4..aaed4d3e048 100644 --- a/src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/SwingInterOpUtils.java +++ b/src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/SwingInterOpUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,6 @@ import java.awt.Toolkit; import java.awt.Window; import java.awt.AWTEvent; import sun.awt.SunToolkit; -import sun.awt.AppContext; import sun.awt.UngrabEvent; /** @@ -47,10 +46,7 @@ public class SwingInterOpUtils { public SwingInterOpUtils() {} public static void postEvent(Object target, java.awt.AWTEvent e) { - AppContext context = SunToolkit.targetToAppContext(target); - if (context != null) { - SunToolkit.postEvent(context, e); - } + SunToolkit.postEvent(e); } public static void grab(Toolkit toolkit, Window window) { 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 ab471694890..3223ff9dccd 100644 --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2026, 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 @@ -105,6 +105,9 @@ class ZipFileSystem extends FileSystem { private static final String COMPRESSION_METHOD_DEFLATED = "DEFLATED"; // Value specified for compressionMethod property to not compress Zip entries private static final String COMPRESSION_METHOD_STORED = "STORED"; + // CEN size is limited to the maximum array size in the JDK + // See ArraysSupport.SOFT_MAX_ARRAY_LENGTH; + private static final int MAX_CEN_SIZE = Integer.MAX_VALUE - 8; private final ZipFileSystemProvider provider; private final Path zfpath; @@ -1233,7 +1236,7 @@ class ZipFileSystem extends FileSystem { private volatile boolean isOpen = true; private final SeekableByteChannel ch; // channel to the zipfile - final byte[] cen; // CEN & ENDHDR + final byte[] cen; // CEN private END end; private long locpos; // position of first LOC header (usually 0) @@ -1353,7 +1356,7 @@ class ZipFileSystem extends FileSystem { // to use the end64 values end.cenlen = cenlen64; end.cenoff = cenoff64; - end.centot = (int)centot64; // assume total < 2g + end.centot = centot64; end.endpos = end64pos; return end; } @@ -1575,25 +1578,36 @@ class ZipFileSystem extends FileSystem { buildNodeTree(); return null; // only END header present } - if (end.cenlen > end.endpos) - throw new ZipException("invalid END header (bad central directory size)"); + // Validate END header + if (end.cenlen > end.endpos) { + zerror("invalid END header (bad central directory size)"); + } long cenpos = end.endpos - end.cenlen; // position of CEN table - // Get position of first local file (LOC) header, taking into - // account that there may be a stub prefixed to the zip file. + // account that there may be a stub prefixed to the ZIP file. locpos = cenpos - end.cenoff; - if (locpos < 0) - throw new ZipException("invalid END header (bad central directory offset)"); + if (locpos < 0) { + zerror("invalid END header (bad central directory offset)"); + } + if (end.cenlen > MAX_CEN_SIZE) { + zerror("invalid END header (central directory size too large)"); + } + if (end.centot < 0 || end.centot > end.cenlen / CENHDR) { + zerror("invalid END header (total entries count too large)"); + } + // Validation ensures these are <= Integer.MAX_VALUE + int cenlen = Math.toIntExact(end.cenlen); + int centot = Math.toIntExact(end.centot); - // read in the CEN and END - byte[] cen = new byte[(int)(end.cenlen + ENDHDR)]; - if (readNBytesAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) { - throw new ZipException("read CEN tables failed"); + // read in the CEN + byte[] cen = new byte[cenlen]; + if (readNBytesAt(cen, 0, cen.length, cenpos) != cenlen) { + zerror("read CEN tables failed"); } // Iterate through the entries in the central directory - inodes = LinkedHashMap.newLinkedHashMap(end.centot + 1); + inodes = LinkedHashMap.newLinkedHashMap(centot + 1); int pos = 0; - int limit = cen.length - ENDHDR; + int limit = cen.length; while (pos < limit) { if (!cenSigAt(cen, pos)) throw new ZipException("invalid CEN header (bad signature)"); @@ -1641,7 +1655,7 @@ class ZipFileSystem extends FileSystem { // skip ext and comment pos += (CENHDR + nlen + elen + clen); } - if (pos + ENDHDR != cen.length) { + if (pos != cen.length) { throw new ZipException("invalid CEN header (bad header size)"); } buildNodeTree(); @@ -1671,7 +1685,7 @@ class ZipFileSystem extends FileSystem { } // CEN Offset where this Extra field ends int extraEndOffset = startingOffset + extraFieldLen; - if (extraEndOffset > cen.length - ENDHDR) { + if (extraEndOffset > cen.length) { zerror("Invalid CEN header (extra data field size too long)"); } int currentOffset = startingOffset; @@ -2666,7 +2680,7 @@ class ZipFileSystem extends FileSystem { // int disknum; // int sdisknum; // int endsub; - int centot; // 4 bytes + long centot; // 4 bytes long cenlen; // 4 bytes long cenoff; // 4 bytes // int comlen; // comment length @@ -2689,7 +2703,7 @@ class ZipFileSystem extends FileSystem { xoff = ZIP64_MINVAL; hasZip64 = true; } - int count = centot; + int count = Math.toIntExact(centot); if (count >= ZIP64_MINVAL32) { count = ZIP64_MINVAL32; hasZip64 = true; diff --git a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java index 66af78e53d2..adfa975c1c3 100644 --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2026, 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 @@ -55,6 +55,8 @@ import static java.nio.file.StandardOpenOption.WRITE; */ final class ZipPath implements Path { + private static final byte[] EMPTY_PATH = new byte[0]; + private final ZipFileSystem zfs; private final byte[] path; private volatile int[] offsets; @@ -93,8 +95,15 @@ final class ZipPath implements Path { @Override public ZipPath getFileName() { int off = path.length; - if (off == 0 || off == 1 && path[0] == '/') + if (off == 0) { + // empty path, which is defined as consisting solely of + // one name element that is empty + return new ZipPath(getFileSystem(), EMPTY_PATH, true); + } + if (off == 1 && path[0] == '/') { + // root path, which is defined as having 0 name elements return null; + } while (--off >= 0 && path[off] != '/') {} if (off < 0) return this; diff --git a/test/docs/TEST.ROOT b/test/docs/TEST.ROOT index 69e66b08b88..9a7e66b631c 100644 --- a/test/docs/TEST.ROOT +++ b/test/docs/TEST.ROOT @@ -1,5 +1,5 @@ # -# Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024, 2026, 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,7 +38,7 @@ groups=TEST.groups # Minimum jtreg version -requiredVersion=8.1+1 +requiredVersion=8.2.1+1 # Use new module options useNewOptions=true diff --git a/test/hotspot/gtest/aarch64/test_spin_pause.cpp b/test/hotspot/gtest/aarch64/test_spin_pause.cpp index e220362eae9..98d05e030c2 100644 --- a/test/hotspot/gtest/aarch64/test_spin_pause.cpp +++ b/test/hotspot/gtest/aarch64/test_spin_pause.cpp @@ -21,7 +21,9 @@ * questions. */ -#if defined(AARCH64) && !defined(ZERO) +// Skip Windows to prevent GTestWrapper.java from failing because +// SpinPause is not implemented on Windows (and therefore returns 0) +#if defined(AARCH64) && !defined(ZERO) && !defined(_WINDOWS) #include "utilities/spinYield.hpp" #include "unittest.hpp" diff --git a/test/hotspot/gtest/cds/test_scaledOffsets.cpp b/test/hotspot/gtest/cds/test_scaledOffsets.cpp new file mode 100644 index 00000000000..93b1b211276 --- /dev/null +++ b/test/hotspot/gtest/cds/test_scaledOffsets.cpp @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2026 salesforce.com, 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. + * + */ + +#include "cds/aotCompressedPointers.hpp" +#include "unittest.hpp" +#include "utilities/globalDefinitions.hpp" + +#include + +TEST_VM(ScaledOffsetsTest, constants) { +#ifdef _LP64 + ASSERT_EQ((size_t)3, AOTCompressedPointers::MetadataOffsetShift); + ASSERT_TRUE(is_aligned(AOTCompressedPointers::MaxMetadataOffsetBytes, (size_t)1 << AOTCompressedPointers::MetadataOffsetShift)); + ASSERT_EQ((size_t)(3584ULL * M), AOTCompressedPointers::MaxMetadataOffsetBytes); +#else + ASSERT_EQ((size_t)0, AOTCompressedPointers::MetadataOffsetShift); + ASSERT_EQ((size_t)0x7FFFFFFF, AOTCompressedPointers::MaxMetadataOffsetBytes); +#endif +} + +TEST_VM(ScaledOffsetsTest, encode_decode_roundtrip) { + // Test that encoding and decoding via get_byte_offset produces correct results + const size_t unit = (size_t)1 << AOTCompressedPointers::MetadataOffsetShift; + + // Test that get_byte_offset correctly applies the shift + // Note: We can't directly test encode_byte_offset as it's private, but we can verify + // the shift value is applied correctly in get_byte_offset + AOTCompressedPointers::narrowPtr np1 = static_cast(1); + ASSERT_EQ(unit, AOTCompressedPointers::get_byte_offset(np1)); + + AOTCompressedPointers::narrowPtr np2 = static_cast(2); + ASSERT_EQ(2 * unit, AOTCompressedPointers::get_byte_offset(np2)); + + AOTCompressedPointers::narrowPtr np1024 = static_cast(1024); + ASSERT_EQ(1024 * unit, AOTCompressedPointers::get_byte_offset(np1024)); + +#ifdef _LP64 + const uint64_t max_units = (uint64_t)UINT32_MAX; + AOTCompressedPointers::narrowPtr np_max = static_cast(UINT32_MAX); + const uint64_t max_bytes = max_units << AOTCompressedPointers::MetadataOffsetShift; + ASSERT_EQ(max_bytes, AOTCompressedPointers::get_byte_offset(np_max)); + ASSERT_GE(max_bytes, AOTCompressedPointers::MaxMetadataOffsetBytes - unit); +#endif +} + +TEST_VM(ScaledOffsetsTest, null_handling) { + // Test that null() returns 0 + ASSERT_EQ(static_cast(0), AOTCompressedPointers::null()); + ASSERT_EQ((size_t)0, AOTCompressedPointers::get_byte_offset(AOTCompressedPointers::null())); +} diff --git a/test/hotspot/gtest/gc/z/test_zVirtualMemoryManager.cpp b/test/hotspot/gtest/gc/z/test_zVirtualMemoryManager.cpp index 7c41dde04cb..f2a62fea57d 100644 --- a/test/hotspot/gtest/gc/z/test_zVirtualMemoryManager.cpp +++ b/test/hotspot/gtest/gc/z/test_zVirtualMemoryManager.cpp @@ -168,8 +168,7 @@ public: ASSERT_EQ(vmem, ZVirtualMemory(base_offset + 2 * ZGranuleSize, ZGranuleSize)); _reserver->unreserve(vmem); - const bool released = os::release_memory((char*)untype(blocked), ZGranuleSize); - ASSERT_TRUE(released); + os::release_memory((char*)untype(blocked), ZGranuleSize); } void test_remove_from_low() { diff --git a/test/hotspot/gtest/memory/test_virtualspace.cpp b/test/hotspot/gtest/memory/test_virtualspace.cpp index d2f8927ba28..eaabc46edaf 100644 --- a/test/hotspot/gtest/memory/test_virtualspace.cpp +++ b/test/hotspot/gtest/memory/test_virtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +34,7 @@ namespace { public: MemoryReleaser(ReservedSpace* rs) : _rs(rs) { } ~MemoryReleaser() { - EXPECT_TRUE(MemoryReserver::release(*_rs)); + MemoryReserver::release(*_rs); } }; @@ -354,11 +354,7 @@ class TestReservedSpace : AllStatic { } static void release_memory_for_test(ReservedSpace rs) { - if (rs.special()) { - EXPECT_TRUE(os::release_memory_special(rs.base(), rs.size())); - } else { - EXPECT_TRUE(os::release_memory(rs.base(), rs.size())); - } + os::release_memory(rs.base(), rs.size()); } static void test_reserved_space1(size_t size, size_t alignment) { diff --git a/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp b/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp index c65808d3f4d..e3b03440141 100644 --- a/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +47,6 @@ "fake message ignore this - " expected_assertion_message); \ } \ } - /////// #if !INCLUDE_ASAN @@ -86,31 +85,6 @@ DEFINE_TEST(test_overwrite_back_long_unaligned_distance, "footer canary broken") /////// -static void test_double_free() { - address p = (address) os::malloc(1, mtTest); - os::free(p); - // Now a double free. Note that this is susceptible to concurrency issues should - // a concurrent thread have done a malloc and gotten the same address after the - // first free. To decrease chance of this happening, we repeat the double free - // several times. - for (int i = 0; i < 100; i ++) { - os::free(p); - } -} - -// What assertion message we will see depends on whether the VM wipes the memory-to-be-freed -// on the first free(), and whether the libc uses the freed memory to store bookkeeping information. -// If the death marker in the header is still intact after the first free, we will recognize this as -// double free; if it got wiped, we should at least see a broken header canary. -// The message would be either -// - "header canary broken" or -// - "header canary dead (double free?)". -// However, since gtest regex expressions do not support unions (a|b), I search for a reasonable -// subset here. -DEFINE_TEST(test_double_free, "header canary") - -/////// - static void test_invalid_block_address() { // very low, like the result of an overflow or of accessing a null this pointer os::free((void*)0x100); diff --git a/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp b/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp index 24ab9888521..e0a452b1831 100644 --- a/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_cornercases.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023 SAP SE. All rights reserved. - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,9 @@ #include "testutils.hpp" #include "unittest.hpp" +// ASAN complains about allocating very large sizes +#if !INCLUDE_ASAN + // Check NMT header for integrity, as well as expected type and size. static void check_expected_malloc_header(const void* payload, MemTag mem_tag, size_t size) { const MallocHeader* hdr = MallocHeader::resolve_checked(payload); @@ -38,9 +41,6 @@ static void check_expected_malloc_header(const void* payload, MemTag mem_tag, si EXPECT_EQ(hdr->mem_tag(), mem_tag); } -// ASAN complains about allocating very large sizes -#if !INCLUDE_ASAN - // Check that a malloc with an overflowing size is rejected. TEST_VM(NMT, malloc_failure1) { void* p = os::malloc(SIZE_MAX, mtTest); diff --git a/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp b/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp index da357285148..48da390e06f 100644 --- a/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp +++ b/test/hotspot/gtest/nmt/test_nmt_malloclimit.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 SAP SE. All rights reserved. - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,6 +23,7 @@ */ #include "memory/allocation.hpp" +#include "memory/arena.hpp" #include "nmt/mallocLimit.hpp" #include "nmt/memTracker.hpp" #include "nmt/nmtCommon.hpp" @@ -155,3 +156,14 @@ TEST_VM_FATAL_ERROR_MSG(NMT, MallocLimitDeathTestOnStrDup, ".*MallocLimit: reach char* p = os::strdup("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", mtTest); } } + +TEST_VM_FATAL_ERROR_MSG(NMT, MallocLimitDeathTestOnArenaGrow, ".*MallocLimit in Arena::grow.*") { + // We fake the correct assert if NMT is off to make the test pass (there is no way to execute a death test conditionally) + if (!MemTracker::enabled()) { + fatal("Fake message please ignore: MallocLimit in Arena::grow"); + } + // the real test + MallocLimitHandler::initialize("test:10m:oom"); + Arena ar(mtTest); + ar.Amalloc(10 * M, AllocFailStrategy::EXIT_OOM); +} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java b/test/hotspot/gtest/nmt/test_nmt_summarydiff.cpp similarity index 57% rename from src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java rename to test/hotspot/gtest/nmt/test_nmt_summarydiff.cpp index 992d86a02ec..fcdbe57bfe1 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java +++ b/test/hotspot/gtest/nmt/test_nmt_summarydiff.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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,35 +22,21 @@ * */ -package sun.jvm.hotspot.oops; +#include "nmt/memTag.hpp" +#include "nmt/vmatree.hpp" +#include "unittest.hpp" -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; -public class ArgInfoData extends ArrayData { - - public ArgInfoData(DataLayout layout) { - super(layout); +// The SummaryDiff is seldom used with a large number of tags +// so test that separately. +TEST(NMTSummaryDiffTest, WorksForLargeTagCount) { + VMATree::SummaryDiff d; + for (int i = 0; i < std::numeric_limits>::max(); i++) { + VMATree::SingleDiff& sd = d.tag(i); + sd.reserve = i; } - - int numberOfArgs() { - return arrayLen(); - } - - int argModified(int arg) { - return arrayUintAt(arg); - } - - public void printDataOn(PrintStream st) { - printShared(st, "ArgInfoData"); - int nargs = numberOfArgs(); - for (int i = 0; i < nargs; i++) { - st.print(" 0x" + Integer.toHexString(argModified(i))); - } - st.println(); + for (int i = 0; i < std::numeric_limits>::max(); i++) { + VMATree::SingleDiff& sd = d.tag(i); + EXPECT_EQ(i, sd.reserve); } } diff --git a/test/hotspot/gtest/nmt/test_regions_tree.cpp b/test/hotspot/gtest/nmt/test_regions_tree.cpp index 7465c84aa72..5d50a797a80 100644 --- a/test/hotspot/gtest/nmt/test_regions_tree.cpp +++ b/test/hotspot/gtest/nmt/test_regions_tree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,30 +44,30 @@ TEST_VM_F(NMTRegionsTreeTest, ReserveCommitTwice) { { VMATree::SummaryDiff diff; rt.reserve_mapping(0, 100, rd, diff); - EXPECT_EQ(100, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); + EXPECT_EQ(100, diff.tag(mtTest).reserve); } { VMATree::SummaryDiff diff, not_used; rt.commit_region(nullptr, 50, ncs, not_used); rt.reserve_mapping(0, 100, rd, diff); - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(-50, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(-50, diff.tag(mtTest).commit); } { VMATree::SummaryDiff diff; rt.reserve_mapping(0, 100, rd2, diff); - EXPECT_EQ(-100, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(100, diff.tag[NMTUtil::tag_to_index(mtGC)].reserve); + EXPECT_EQ(-100, diff.tag(mtTest).reserve); + EXPECT_EQ(100, diff.tag(mtGC).reserve); } { VMATree::SummaryDiff diff1, diff2; rt.commit_region(nullptr, 50, ncs, diff1); - EXPECT_EQ(0, diff1.tag[NMTUtil::tag_to_index(mtGC)].reserve); - EXPECT_EQ(50, diff1.tag[NMTUtil::tag_to_index(mtGC)].commit); + EXPECT_EQ(0, diff1.tag(mtGC).reserve); + EXPECT_EQ(50, diff1.tag(mtGC).commit); rt.commit_region(nullptr, 50, ncs, diff2); - EXPECT_EQ(0, diff2.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(0, diff2.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff2.tag(mtTest).reserve); + EXPECT_EQ(0, diff2.tag(mtTest).commit); } } @@ -79,20 +79,20 @@ TEST_VM_F(NMTRegionsTreeTest, CommitUncommitRegion) { { VMATree::SummaryDiff diff; rt.commit_region(nullptr, 50, ncs, diff); - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(50, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(50, diff.tag(mtTest).commit); } { VMATree::SummaryDiff diff; rt.commit_region((address)60, 10, ncs, diff); - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(10, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(10, diff.tag(mtTest).commit); } { VMATree::SummaryDiff diff; rt.uncommit_region(nullptr, 50, diff); - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(-50, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(-50, diff.tag(mtTest).commit); } } @@ -104,15 +104,15 @@ TEST_VM_F(NMTRegionsTreeTest, FindReservedRegion) { rt.reserve_mapping(1200, 50, rd, not_used); rt.reserve_mapping(1300, 50, rd, not_used); rt.reserve_mapping(1400, 50, rd, not_used); - ReservedMemoryRegion rmr; - rmr = rt.find_reserved_region((address)1205); - EXPECT_EQ(rmr.base(), (address)1200); - rmr = rt.find_reserved_region((address)1305); - EXPECT_EQ(rmr.base(), (address)1300); - rmr = rt.find_reserved_region((address)1405); - EXPECT_EQ(rmr.base(), (address)1400); - rmr = rt.find_reserved_region((address)1005); - EXPECT_EQ(rmr.base(), (address)1000); + VirtualMemoryRegion rgn; + rgn = rt.find_reserved_region((address)1205); + EXPECT_EQ(rgn.base(), (address)1200); + rgn = rt.find_reserved_region((address)1305); + EXPECT_EQ(rgn.base(), (address)1300); + rgn = rt.find_reserved_region((address)1405); + EXPECT_EQ(rgn.base(), (address)1400); + rgn = rt.find_reserved_region((address)1005); + EXPECT_EQ(rgn.base(), (address)1000); } TEST_VM_F(NMTRegionsTreeTest, VisitReservedRegions) { @@ -124,7 +124,7 @@ TEST_VM_F(NMTRegionsTreeTest, VisitReservedRegions) { rt.reserve_mapping(1300, 50, rd, not_used); rt.reserve_mapping(1400, 50, rd, not_used); - rt.visit_reserved_regions([&](const ReservedMemoryRegion& rgn) { + rt.visit_reserved_regions([&](const VirtualMemoryRegion& rgn) { EXPECT_EQ(((size_t)rgn.base()) % 100, 0UL); EXPECT_EQ(rgn.size(), 50UL); return true; @@ -144,9 +144,9 @@ TEST_VM_F(NMTRegionsTreeTest, VisitCommittedRegions) { rt.commit_region((address)1020, 5UL, ncs, not_used); rt.commit_region((address)1030, 5UL, ncs, not_used); rt.commit_region((address)1040, 5UL, ncs, not_used); - ReservedMemoryRegion rmr((address)1000, 50); + VirtualMemoryRegion rgn((address)1000, 50); size_t count = 0; - rt.visit_committed_regions(rmr, [&](CommittedMemoryRegion& crgn) { + rt.visit_committed_regions(rgn, [&](VirtualMemoryRegion& crgn) { count++; EXPECT_EQ((((size_t)crgn.base()) % 100) / 10, count); EXPECT_EQ(crgn.size(), 5UL); diff --git a/test/hotspot/gtest/nmt/test_vmatree.cpp b/test/hotspot/gtest/nmt/test_vmatree.cpp index eed2e5af0be..67cdc080cd6 100644 --- a/test/hotspot/gtest/nmt/test_vmatree.cpp +++ b/test/hotspot/gtest/nmt/test_vmatree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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 @@ -221,13 +221,13 @@ public: EXPECT_EQ(n1.val().out.committed_stack(), upd.new_st.committed_stack()) << failed_case; if (from == to) { - EXPECT_EQ(diff.tag[from].reserve, upd.reserve[0] + upd.reserve[1]) << failed_case; - EXPECT_EQ(diff.tag[from].commit, upd.commit[0] + upd.commit[1]) << failed_case; + EXPECT_EQ(diff.tag(from).reserve, upd.reserve[0] + upd.reserve[1]) << failed_case; + EXPECT_EQ(diff.tag(from).commit, upd.commit[0] + upd.commit[1]) << failed_case; } else { - EXPECT_EQ(diff.tag[from].reserve, upd.reserve[0]) << failed_case; - EXPECT_EQ(diff.tag[from].commit, upd.commit[0]) << failed_case; - EXPECT_EQ(diff.tag[to].reserve, upd.reserve[1]) << failed_case; - EXPECT_EQ(diff.tag[to].commit, upd.commit[1]) << failed_case; + EXPECT_EQ(diff.tag(from).reserve, upd.reserve[0]) << failed_case; + EXPECT_EQ(diff.tag(from).commit, upd.commit[0]) << failed_case; + EXPECT_EQ(diff.tag(to).reserve, upd.reserve[1]) << failed_case; + EXPECT_EQ(diff.tag(to).commit, upd.commit[1]) << failed_case; } } @@ -235,6 +235,7 @@ public: void create_tree(Tree& tree, ExpectedTree& et, int line_no) { using SIndex = NativeCallStackStorage::StackIndex; const SIndex ES = NativeCallStackStorage::invalid; // Empty Stack + VMATree::SummaryDiff not_used; VMATree::IntervalChange st; for (int i = 0; i < N; i++) { st.in.set_type(et.states[i]); @@ -537,8 +538,8 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { tree.reserve_mapping(0, 600, rd, not_used); - tree.set_tag(0, 500, mtGC); - tree.set_tag(500, 100, mtClassShared); + tree.set_tag(0, 500, mtGC, not_used); + tree.set_tag(500, 100, mtClassShared, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -569,8 +570,8 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { tree.commit_mapping(550, 10, rd, not_used); tree.commit_mapping(565, 10, rd, not_used); // OK, set tag - tree.set_tag(0, 500, mtGC); - tree.set_tag(500, 100, mtClassShared); + tree.set_tag(0, 500, mtGC, not_used); + tree.set_tag(500, 100, mtClassShared, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -584,7 +585,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { Tree::RegionData compiler(si, mtCompiler); tree.reserve_mapping(0, 100, gc, not_used); tree.reserve_mapping(100, 100, compiler, not_used); - tree.set_tag(0, 200, mtGC); + tree.set_tag(0, 200, mtGC, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -601,7 +602,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { Tree::RegionData compiler(si2, mtCompiler); tree.reserve_mapping(0, 100, gc, not_used); tree.reserve_mapping(100, 100, compiler, not_used); - tree.set_tag(0, 200, mtGC); + tree.set_tag(0, 200, mtGC, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -615,7 +616,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { VMATree::SummaryDiff not_used; Tree::RegionData compiler(si, mtCompiler); tree.reserve_mapping(0, 200, compiler, not_used); - tree.set_tag(100, 50, mtGC); + tree.set_tag(100, 50, mtGC, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -631,7 +632,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { Tree::RegionData compiler(si, mtCompiler); tree.reserve_mapping(0, 100, gc, not_used); tree.reserve_mapping(100, 100, compiler, not_used); - tree.set_tag(75, 50, mtClass); + tree.set_tag(75, 50, mtClass, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -647,7 +648,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { Tree::RegionData class_shared(si, mtClassShared); tree.reserve_mapping(0, 50, class_shared, not_used); tree.reserve_mapping(75, 25, class_shared, not_used); - tree.set_tag(0, 80, mtGC); + tree.set_tag(0, 80, mtGC, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -659,7 +660,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { VMATree::SummaryDiff not_used; Tree::RegionData class_shared(si, mtClassShared); tree.reserve_mapping(10, 10, class_shared, not_used); - tree.set_tag(0, 100, mtCompiler); + tree.set_tag(0, 100, mtCompiler, not_used); expect_equivalent_form(expected, tree, __LINE__); } @@ -677,7 +678,7 @@ TEST_VM_F(NMTVMATreeTest, SetTag) { tree.reserve_mapping(0, 100, class_shared, not_used); tree.release_mapping(1, 49, not_used); tree.release_mapping(75, 24, not_used); - tree.set_tag(0, 100, mtGC); + tree.set_tag(0, 100, mtGC, not_used); expect_equivalent_form(expected, tree, __LINE__); } } @@ -696,7 +697,7 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // A - Test (reserved) // . - free - VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag(mtTest); EXPECT_EQ(100, diff.reserve); tree.reserve_mapping(50, 25, rd_NMT_cs0, all_diff); // 1 2 3 4 5 6 7 8 9 10 11 @@ -707,8 +708,8 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // B - Native Memory Tracking (reserved) // C - Test (reserved) // . - free - diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; - VMATree::SingleDiff diff2 = all_diff.tag[NMTUtil::tag_to_index(mtNMT)]; + diff = all_diff.tag(mtTest); + VMATree::SingleDiff diff2 = all_diff.tag(mtNMT); EXPECT_EQ(-25, diff.reserve); EXPECT_EQ(25, diff2.reserve); } @@ -723,14 +724,14 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // A - Test (reserved) // . - free - VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag(mtTest); EXPECT_EQ(100, diff.reserve); tree.release_mapping(0, 100, all_diff); // 1 2 3 4 5 6 7 8 9 10 11 // 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 // .............................................................................................................. // Legend: - diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + diff = all_diff.tag(mtTest); EXPECT_EQ(-100, diff.reserve); } { // Convert some of a released mapping to a committed one @@ -744,7 +745,7 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // A - Test (reserved) // . - free - VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag(mtTest); EXPECT_EQ(diff.reserve, 100); tree.commit_mapping(0, 100, rd_Test_cs0, all_diff); // 1 2 3 4 5 6 7 8 9 10 11 @@ -753,7 +754,7 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // a - Test (committed) // . - free - diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + diff = all_diff.tag(mtTest); EXPECT_EQ(0, diff.reserve); EXPECT_EQ(100, diff.commit); } @@ -768,7 +769,7 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // A - Test (reserved) // . - free - VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag(mtTest); EXPECT_EQ(diff.reserve, 10); tree.reserve_mapping(10, 10, rd_Test_cs0, all_diff); // 1 2 3 @@ -777,7 +778,7 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // A - Test (reserved) // . - free - diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + diff = all_diff.tag(mtTest); EXPECT_EQ(10, diff.reserve); } { // Adjacent reserved mappings with different tags @@ -792,7 +793,7 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // A - Test (reserved) // . - free - VMATree::SingleDiff diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + VMATree::SingleDiff diff = all_diff.tag(mtTest); EXPECT_EQ(diff.reserve, 10); tree.reserve_mapping(10, 10, rd_NMT_cs0, all_diff); // 1 2 3 @@ -802,9 +803,9 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // A - Test (reserved) // B - Native Memory Tracking (reserved) // . - free - diff = all_diff.tag[NMTUtil::tag_to_index(mtTest)]; + diff = all_diff.tag(mtTest); EXPECT_EQ(0, diff.reserve); - diff = all_diff.tag[NMTUtil::tag_to_index(mtNMT)]; + diff = all_diff.tag(mtNMT); EXPECT_EQ(10, diff.reserve); } @@ -834,8 +835,8 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccounting) { // Legend: // a - Test (committed) // . - free - EXPECT_EQ(16, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); - EXPECT_EQ(16, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); + EXPECT_EQ(16, diff.tag(mtTest).commit); + EXPECT_EQ(16, diff.tag(mtTest).reserve); } } @@ -845,16 +846,16 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccountingReserveAsUncommit) { VMATree::SummaryDiff diff1, diff2, diff3; tree.reserve_mapping(1200, 100, rd, diff1); tree.commit_mapping(1210, 50, rd, diff2); - EXPECT_EQ(100, diff1.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(50, diff2.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(100, diff1.tag(mtTest).reserve); + EXPECT_EQ(50, diff2.tag(mtTest).commit); tree.reserve_mapping(1220, 20, rd, diff3); - EXPECT_EQ(-20, diff3.tag[NMTUtil::tag_to_index(mtTest)].commit); - EXPECT_EQ(0, diff3.tag[NMTUtil::tag_to_index(mtTest)].reserve); + EXPECT_EQ(-20, diff3.tag(mtTest).commit); + EXPECT_EQ(0, diff3.tag(mtTest).reserve); } // Exceedingly simple tracker for page-granular allocations // Use it for testing consistency with VMATree. - struct SimpleVMATracker : public CHeapObj { +struct SimpleVMATracker : public CHeapObj { const size_t page_size = 4096; enum Kind { Reserved, Committed, Free }; struct Info { @@ -881,10 +882,9 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccountingReserveAsUncommit) { } } - VMATree::SummaryDiff do_it(Kind kind, size_t start, size_t size, NativeCallStack stack, MemTag mem_tag) { + void do_it(Kind kind, size_t start, size_t size, NativeCallStack stack, MemTag mem_tag, VMATree::SummaryDiff& diff) { assert(is_aligned(size, page_size) && is_aligned(start, page_size), "page alignment"); - VMATree::SummaryDiff diff; const size_t page_count = size / page_size; const size_t start_idx = start / page_size; const size_t end_idx = start_idx + page_count; @@ -896,34 +896,33 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccountingReserveAsUncommit) { // Register diff if (old_info.kind == Reserved) { - diff.tag[(int)old_info.mem_tag].reserve -= page_size; + diff.tag(old_info.mem_tag).reserve -= page_size; } else if (old_info.kind == Committed) { - diff.tag[(int)old_info.mem_tag].reserve -= page_size; - diff.tag[(int)old_info.mem_tag].commit -= page_size; + diff.tag(old_info.mem_tag).reserve -= page_size; + diff.tag(old_info.mem_tag).commit -= page_size; } if (kind == Reserved) { - diff.tag[(int)new_info.mem_tag].reserve += page_size; + diff.tag(new_info.mem_tag).reserve += page_size; } else if (kind == Committed) { - diff.tag[(int)new_info.mem_tag].reserve += page_size; - diff.tag[(int)new_info.mem_tag].commit += page_size; + diff.tag(new_info.mem_tag).reserve += page_size; + diff.tag(new_info.mem_tag).commit += page_size; } // Overwrite old one with new pages[i] = new_info; } - return diff; } - VMATree::SummaryDiff reserve(size_t start, size_t size, NativeCallStack stack, MemTag mem_tag) { - return do_it(Reserved, start, size, stack, mem_tag); + void reserve(size_t start, size_t size, NativeCallStack stack, MemTag mem_tag, VMATree::SummaryDiff& diff) { + return do_it(Reserved, start, size, stack, mem_tag, diff); } - VMATree::SummaryDiff commit(size_t start, size_t size, NativeCallStack stack, MemTag mem_tag) { - return do_it(Committed, start, size, stack, mem_tag); + void commit(size_t start, size_t size, NativeCallStack stack, MemTag mem_tag, VMATree::SummaryDiff& diff) { + return do_it(Committed, start, size, stack, mem_tag, diff); } - VMATree::SummaryDiff release(size_t start, size_t size) { - return do_it(Free, start, size, NativeCallStack(), mtNone); + void release(size_t start, size_t size, VMATree::SummaryDiff& diff) { + return do_it(Free, start, size, NativeCallStack(), mtNone, diff); } }; @@ -979,19 +978,19 @@ TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) { VMATree::SummaryDiff tree_diff; VMATree::SummaryDiff simple_diff; if (kind == SimpleVMATracker::Reserved) { - simple_diff = tr->reserve(start, size, stack, mem_tag); + tr->reserve(start, size, stack, mem_tag, simple_diff); tree.reserve_mapping(start, size, data, tree_diff); } else if (kind == SimpleVMATracker::Committed) { - simple_diff = tr->commit(start, size, stack, mem_tag); + tr->commit(start, size, stack, mem_tag, simple_diff); tree.commit_mapping(start, size, data, tree_diff); } else { - simple_diff = tr->release(start, size); + tr->release(start, size, simple_diff); tree.release_mapping(start, size, tree_diff); } for (int j = 0; j < mt_number_of_tags; j++) { - VMATree::SingleDiff td = tree_diff.tag[j]; - VMATree::SingleDiff sd = simple_diff.tag[j]; + VMATree::SingleDiff td = tree_diff.tag(j); + VMATree::SingleDiff sd = simple_diff.tag(j); ASSERT_EQ(td.reserve, sd.reserve); ASSERT_EQ(td.commit, sd.commit); } @@ -1067,22 +1066,22 @@ TEST_VM_F(NMTVMATreeTest, SummaryAccountingWhenUseTagInplace) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // CCCCCCCCCCCCCCCCCCCCCCCCCrrrrrrrrrrrrrrrrrrrrrrrrr - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(25, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(25, diff.tag(mtTest).commit); tree.commit_mapping(30, 5, rd_None_cs1, diff, true); // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // CCCCCCCCCCCCCCCCCCCCCCCCCrrrrrCCCCCrrrrrrrrrrrrrrr - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(5, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(5, diff.tag(mtTest).commit); tree.uncommit_mapping(0, 25, rd_None_cs1, diff); // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrCCCCCrrrrrrrrrrrrrrr - EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve); - EXPECT_EQ(-25, diff.tag[NMTUtil::tag_to_index(mtTest)].commit); + EXPECT_EQ(0, diff.tag(mtTest).reserve); + EXPECT_EQ(-25, diff.tag(mtTest).commit); } // How the memory regions are visualized: @@ -1328,8 +1327,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows0To3) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCCCCCCC.......................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 10); ExpectedTree<6> et = {{ 5, 10, 12, 14, 16, 25 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , C , C , C , C , C , Rl }, @@ -1356,8 +1355,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows0To3) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCC............................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 15); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 5); + EXPECT_EQ(diff.tag(mtTest).commit, 15); + EXPECT_EQ(diff.tag(mtTest).reserve, 5); ExpectedTree<6> et = {{ 5, 10, 12, 14, 16, 20 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , C , C , C , C , C , Rl }, @@ -1402,8 +1401,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows4to7) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrr..........CCCCCCCCCCCCCCCCCCCC........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 20); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 20); ExpectedTree<4> et = {{ 0, 10, 20, 40 }, {mtNone, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , Rl , C , Rl }, @@ -1430,8 +1429,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows4to7) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....rrrrrCCCCCCCCCC............................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 10); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 20 - 15); + EXPECT_EQ(diff.tag(mtTest).commit, 10); + EXPECT_EQ(diff.tag(mtTest).reserve, 20 - 15); ExpectedTree<4> et = {{ 5, 10, 15, 20 }, {mtNone, mtTest, mtTest, mtTest, mtNone}, {Rl , Rs , C , C , Rl }, @@ -1458,8 +1457,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows4to7) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrr..CCCCCCCCCCCCCCCCCCCC........................ - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 10); ExpectedTree<8> et = {{ 0, 5, 7, 10, 12, 14, 16, 27 }, {mtNone, mtTest, mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , Rs , Rl , C , C , C , C , C , Rl }, @@ -1486,8 +1485,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows4to7) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrr..CCCCCCCCCCCCC............................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 13); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 3); + EXPECT_EQ(diff.tag(mtTest).commit, 13); + EXPECT_EQ(diff.tag(mtTest).reserve, 3); ExpectedTree<8> et = {{ 0, 5, 7, 10, 12, 14, 16, 20 }, {mtNone, mtTest, mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , Rs , Rl , C , C , C , C , C , Rl }, @@ -1539,8 +1538,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows8to11) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrrCCCCCCCCCCCCCCCCCCCC..................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 20); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 20); ExpectedTree<3> et = {{ 0, 10, 30 }, {mtNone, mtTest, mtTest, mtNone}, {Rl , Rs , C , Rl }, @@ -1567,8 +1566,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows8to11) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // CCCCCCCCCCCCCCCCCCCC............................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 10); ExpectedTree<3> et = {{ 0, 10, 20 }, {mtNone, mtTest, mtTest, mtNone}, {Rl , C , C , Rl }, @@ -1595,8 +1594,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows8to11) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCCCCCCC.......................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 25 - 20); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 25 - 20); ExpectedTree<6> et = {{ 5, 10, 12, 14, 16, 25 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , C , C , C , C , C , Rl }, @@ -1623,8 +1622,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows8to11) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCC............................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 15); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 0); + EXPECT_EQ(diff.tag(mtTest).commit, 15); + EXPECT_EQ(diff.tag(mtTest).reserve, 0); ExpectedTree<6> et = {{ 5, 10, 12, 14, 16, 20 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , C , C , C , C , C , Rl }, @@ -1670,8 +1669,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows12to15) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCCCCCCC.....rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 20); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 20); ExpectedTree<4> et = {{ 5, 25, 30, 40 }, {mtNone, mtTest, mtNone, mtTest, mtNone}, {Rl , C , Rl , Rs , Rl }, @@ -1698,8 +1697,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows12to15) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCCCCCCCrrrrr..................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 30 - 25); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, 30 - 25); ExpectedTree<4> et = {{ 5, 10, 25, 30 }, {mtNone, mtTest, mtTest, mtTest, mtNone}, {Rl , C , C , Rs , Rl }, @@ -1726,8 +1725,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows12to15) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCCCCCCC.....rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, (10 - 5) + ( 25 - 20)); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, (10 - 5) + ( 25 - 20)); ExpectedTree<8> et = {{ 5, 10, 12, 14, 16, 25, 30, 40 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , C , C , C , C , C , Rl , Rs , Rl }, @@ -1754,8 +1753,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows12to15) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // .....CCCCCCCCCCCCCCC..........rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 15); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10 - 5); + EXPECT_EQ(diff.tag(mtTest).commit, 15); + EXPECT_EQ(diff.tag(mtTest).reserve, 10 - 5); ExpectedTree<8> et = {{ 5, 10, 12, 14, 16, 20, 30, 40 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , C , C , C , C , C , Rl , Rs , Rl }, @@ -1800,8 +1799,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows16to19) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrr.....CCCCCCCCCC.....rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 10); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10); + EXPECT_EQ(diff.tag(mtTest).commit, 10); + EXPECT_EQ(diff.tag(mtTest).reserve, 10); ExpectedTree<6> et = {{ 0, 10, 15, 25, 30, 40 }, {mtNone, mtTest, mtNone, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , Rl , C , Rl , Rs , Rl }, @@ -1828,8 +1827,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows16to19) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrr.....CCCCCCCCCCrrrrr..................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 10); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 20 - 15); + EXPECT_EQ(diff.tag(mtTest).commit, 10); + EXPECT_EQ(diff.tag(mtTest).reserve, 20 - 15); ExpectedTree<6> et = {{ 0, 10, 15, 20, 25, 30 }, {mtNone, mtTest, mtNone, mtTest, mtTest, mtTest, mtNone}, {Rl , Rs , Rl , C , C , Rs , Rl }, @@ -1856,8 +1855,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows16to19) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrr..CCCCCCCCCCCCCCCCCCCC...rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, (10 - 7) + (27 - 20)); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, (10 - 7) + (27 - 20)); ExpectedTree<10> et = {{ 0, 5, 7, 12, 14, 16, 20, 27, 30, 40 }, {mtNone, mtTest, mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , Rl , C , C , C , C , C , Rl , Rs , Rl }, @@ -1884,8 +1883,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows16to19) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrr..CCCCCCCCCCCCC..........rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 13); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10 - 7); + EXPECT_EQ(diff.tag(mtTest).commit, 13); + EXPECT_EQ(diff.tag(mtTest).reserve, 10 - 7); ExpectedTree<10> et = {{ 0, 5, 7, 10, 12, 14, 16, 20, 30, 40 }, {mtNone, mtTest, mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , Rl , C , C , C , C , C , Rl , Rs , Rl }, @@ -1931,8 +1930,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows20to23) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrrCCCCCCCCCCCCCCC.....rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 15); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 15); + EXPECT_EQ(diff.tag(mtTest).commit, 15); + EXPECT_EQ(diff.tag(mtTest).reserve, 15); ExpectedTree<5> et = {{ 0, 10, 25, 30, 40 }, {mtNone, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , C , Rl , Rs , Rl }, @@ -1959,8 +1958,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows20to23) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrrrrrrCCCCCCCCCCCCCCCrrrrr..................... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 15); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 20 - 10); + EXPECT_EQ(diff.tag(mtTest).commit, 15); + EXPECT_EQ(diff.tag(mtTest).reserve, 20 - 10); ExpectedTree<5> et = {{ 0, 10, 20, 25, 30 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtNone}, {Rl , Rs , C , C , Rs , Rl }, @@ -1987,8 +1986,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows20to23) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrCCCCCCCCCCCCCCCCCCCC.....rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 20); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, (10 - 5) + (25 - 20)); + EXPECT_EQ(diff.tag(mtTest).commit, 20); + EXPECT_EQ(diff.tag(mtTest).reserve, (10 - 5) + (25 - 20)); ExpectedTree<9> et = {{ 0, 5, 12, 14, 16, 20, 25, 30, 40 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , C , C , C , C , C , Rl , Rs , Rl }, @@ -2015,8 +2014,8 @@ TEST_VM_F(NMTVMATreeTest, OverlapTableRows20to23) { // 1 2 3 4 5 // 012345678901234567890123456789012345678901234567890 // rrrrrCCCCCCCCCCCCCCC..........rrrrrrrrrr........... - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].commit, 15); - EXPECT_EQ(diff.tag[NMTUtil::tag_to_index(mtTest)].reserve, 10 - 5); + EXPECT_EQ(diff.tag(mtTest).commit, 15); + EXPECT_EQ(diff.tag(mtTest).reserve, 10 - 5); ExpectedTree<9> et = {{ 0, 5, 10, 12, 14, 16, 20, 30, 40 }, {mtNone, mtTest, mtTest, mtTest, mtTest, mtTest, mtTest, mtNone, mtTest, mtNone}, {Rl , Rs , C , C , C , C , C , Rl , Rs , Rl }, @@ -2070,4 +2069,4 @@ TEST_VM_F(NMTVMATreeTest, UpdateRegionTest) { for (auto ci : call_info) { call_update_region(ci); } -} \ No newline at end of file +} diff --git a/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp b/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp index 5b78a66a3ae..8cf62fb9ea5 100644 --- a/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp +++ b/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,15 +45,14 @@ public: VirtualMemoryTracker::Instance::snapshot_thread_stacks(); } - ReservedMemoryRegion rmr_found; + VirtualMemoryRegion rgn_found; { MemTracker::NmtVirtualMemoryLocker vml; - rmr_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region(stack_end); + rgn_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region(stack_end); } - ASSERT_TRUE(rmr_found.is_valid()); - ASSERT_EQ(rmr_found.base(), stack_end); - + ASSERT_TRUE(rgn_found.is_valid()); + ASSERT_EQ(rgn_found.base(), stack_end); int i = 0; address i_addr = (address)&i; @@ -64,12 +63,12 @@ public: bool found_stack_top = false; { MemTracker::NmtVirtualMemoryLocker vml; - VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rmr_found, [&](const CommittedMemoryRegion& cmr) { - if (cmr.base() + cmr.size() == stack_top) { - EXPECT_TRUE(cmr.size() <= stack_size); + VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rgn_found, [&](const VirtualMemoryRegion& rgn) { + if (rgn.base() + rgn.size() == stack_top) { + EXPECT_TRUE(rgn.size() <= stack_size); found_stack_top = true; } - if (i_addr < stack_top && i_addr >= cmr.base()) { + if (i_addr < stack_top && i_addr >= rgn.base()) { found_i_addr = true; } i++; @@ -115,25 +114,25 @@ public: } // trigger the test - ReservedMemoryRegion rmr_found; + VirtualMemoryRegion rgn_found; { MemTracker::NmtVirtualMemoryLocker nvml; VirtualMemoryTracker::Instance::snapshot_thread_stacks(); - rmr_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region((address)base); + rgn_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region((address)base); } - ASSERT_TRUE(rmr_found.is_valid()); - ASSERT_EQ(rmr_found.base(), (address)base); + ASSERT_TRUE(rgn_found.is_valid()); + ASSERT_EQ(rgn_found.base(), (address)base); bool precise_tracking_supported = false; { MemTracker::NmtVirtualMemoryLocker nvml; - VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rmr_found, [&](const CommittedMemoryRegion& cmr){ - if (cmr.size() == size) { + VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rgn_found, [&](const VirtualMemoryRegion& rgn){ + if (rgn.size() == size) { return false; } else { precise_tracking_supported = true; - check_covered_pages(cmr.base(), cmr.size(), (address)base, touch_pages, page_num); + check_covered_pages(rgn.base(), rgn.size(), (address)base, touch_pages, page_num); } return true; }); @@ -151,9 +150,9 @@ public: { MemTracker::NmtVirtualMemoryLocker nvml; VirtualMemoryTracker::Instance::remove_released_region((address)base, size); - rmr_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region((address)base); + rgn_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region((address)base); } - ASSERT_TRUE(!rmr_found.is_valid()); + ASSERT_TRUE(!rgn_found.is_valid()); } static void test_committed_region() { diff --git a/test/hotspot/gtest/runtime/test_globals.cpp b/test/hotspot/gtest/runtime/test_globals.cpp index 84a62732056..9ef5bd6a5af 100644 --- a/test/hotspot/gtest/runtime/test_globals.cpp +++ b/test/hotspot/gtest/runtime/test_globals.cpp @@ -58,7 +58,7 @@ TEST_VM(FlagGuard, size_t_flag) { } TEST_VM(FlagGuard, uint64_t_flag) { - TEST_FLAG(MaxRAM, uint64_t, 1337); + TEST_FLAG(ErrorLogTimeout, uint64_t, 1337); } TEST_VM(FlagGuard, double_flag) { diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index aee7b51e2b3..094f16a4262 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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 @@ -506,16 +506,16 @@ static inline bool can_reserve_executable_memory(void) { #define PRINT_MAPPINGS(s) { tty->print_cr("%s", s); os::print_memory_mappings((char*)p, total_range_len, tty); tty->cr(); } //#define PRINT_MAPPINGS +#ifndef _AIX // Release a range allocated with reserve_multiple carefully, to not trip mapping // asserts on Windows in os::release_memory() static void carefully_release_multiple(address start, int num_stripes, size_t stripe_len) { for (int stripe = 0; stripe < num_stripes; stripe++) { address q = start + (stripe * stripe_len); - EXPECT_TRUE(os::release_memory((char*)q, stripe_len)); + os::release_memory((char*)q, stripe_len); } } -#ifndef _AIX // JDK-8257041 // Reserve an area consisting of multiple mappings // (from multiple calls to os::reserve_memory) static address reserve_multiple(int num_stripes, size_t stripe_len) { @@ -534,7 +534,7 @@ static address reserve_multiple(int num_stripes, size_t stripe_len) { p = (address)os::reserve_memory(total_range_len, mtTest); EXPECT_NE(p, (address)nullptr); // .. release it... - EXPECT_TRUE(os::release_memory((char*)p, total_range_len)); + os::release_memory((char*)p, total_range_len); // ... re-reserve in the same spot multiple areas... for (int stripe = 0; stripe < num_stripes; stripe++) { address q = p + (stripe * stripe_len); @@ -627,7 +627,7 @@ TEST_VM(os, release_multi_mappings) { // On Windows, temporarily switch on UseNUMAInterleaving to allow release_memory to release // multiple mappings in one go (otherwise we assert, which we test too, see death test below). WINDOWS_ONLY(NUMASwitcher b(true);) - ASSERT_TRUE(os::release_memory((char*)p_middle_stripes, middle_stripe_len)); + os::release_memory((char*)p_middle_stripes, middle_stripe_len); } PRINT_MAPPINGS("B"); @@ -641,7 +641,7 @@ TEST_VM(os, release_multi_mappings) { // Clean up. Release all mappings. { WINDOWS_ONLY(NUMASwitcher b(true);) // allow release_memory to release multiple regions - ASSERT_TRUE(os::release_memory((char*)p, total_range_len)); + os::release_memory((char*)p, total_range_len); } } #endif // !AIX @@ -650,29 +650,54 @@ TEST_VM(os, release_multi_mappings) { // On Windows, test that we recognize bad ranges. // On debug this would assert. Test that too. // On other platforms, we are unable to recognize bad ranges. -#ifdef ASSERT -TEST_VM_ASSERT_MSG(os, release_bad_ranges, ".*bad release") { -#else -TEST_VM(os, release_bad_ranges) { -#endif - char* p = os::reserve_memory(4 * M, mtTest); - ASSERT_NE(p, (char*)nullptr); - // Release part of range - ASSERT_FALSE(os::release_memory(p, M)); - // Release part of range - ASSERT_FALSE(os::release_memory(p + M, M)); - // Release more than the range (explicitly switch off NUMA here - // to make os::release_memory() test more strictly and to not - // accidentally release neighbors) - { - NUMASwitcher b(false); - ASSERT_FALSE(os::release_memory(p, M * 5)); - ASSERT_FALSE(os::release_memory(p - M, M * 5)); - ASSERT_FALSE(os::release_memory(p - M, M * 6)); - } - ASSERT_TRUE(os::release_memory(p, 4 * M)); // Release for real - ASSERT_FALSE(os::release_memory(p, 4 * M)); // Again, should fail +#ifdef ASSERT +#define TEST_RELEASE_RANGE_ERROR(name) TEST_VM_ASSERT_MSG(os, name, ".*bad release") +#else +#define TEST_RELEASE_RANGE_ERROR(name) TEST_VM_FATAL_ERROR_MSG(os, name, ".*Failed to release.*") +#endif + +static char* setup_release_test_memory() { + char* p = os::reserve_memory(4 * M, mtTest); + EXPECT_NE(p, (char*)nullptr); + return p; +} + +TEST_RELEASE_RANGE_ERROR(release_bad_range_start) { + char* p = setup_release_test_memory(); + os::release_memory(p, M); // Release part of the range +} + +TEST_RELEASE_RANGE_ERROR(release_bad_range_middle) { + char* p = setup_release_test_memory(); + os::release_memory(p + M, M); // Release middle part +} + +// Release more than the range (explicitly switch off NUMA here +// to make os::release_memory() test more strict and to not +// accidentally release neighbors) +TEST_RELEASE_RANGE_ERROR(release_beyond_range1) { + char* p = setup_release_test_memory(); + NUMASwitcher b(false); + os::release_memory(p, M * 5); +} + +TEST_RELEASE_RANGE_ERROR(release_beyond_range2) { + char* p = setup_release_test_memory(); + NUMASwitcher b(false); + os::release_memory(p - M, M * 5); +} + +TEST_RELEASE_RANGE_ERROR(release_beyond_range3) { + char* p = setup_release_test_memory(); + NUMASwitcher b(false); + os::release_memory(p - M, M * 6); +} + +TEST_RELEASE_RANGE_ERROR(release_already_released) { + char* p = setup_release_test_memory(); + os::release_memory(p, 4 * M); // Release for real + os::release_memory(p, 4 * M); // Again, should fail } #endif // _WIN32 @@ -695,11 +720,11 @@ TEST_VM(os, release_one_mapping_multi_commits) { ASSERT_TRUE(p2 == nullptr || p2 == border); - ASSERT_TRUE(os::release_memory((char*)p, total_range_len)); + os::release_memory((char*)p, total_range_len); PRINT_MAPPINGS("C"); if (p2 != nullptr) { - ASSERT_TRUE(os::release_memory((char*)p2, stripe_len)); + os::release_memory((char*)p2, stripe_len); PRINT_MAPPINGS("D"); } } @@ -772,7 +797,7 @@ TEST_VM(os, find_mapping_simple) { if (os::win32::find_mapping(p + total_range_len, &mapping_info)) { ASSERT_NE(mapping_info.base, p); } - ASSERT_TRUE(os::release_memory((char*)p, total_range_len)); + os::release_memory((char*)p, total_range_len); PRINT_MAPPINGS("B"); ASSERT_FALSE(os::win32::find_mapping(p, &mapping_info)); } @@ -801,7 +826,7 @@ TEST_VM(os, find_mapping_2) { if (os::win32::find_mapping(p + total_range_len, &mapping_info)) { ASSERT_NE(mapping_info.base, p); } - ASSERT_TRUE(os::release_memory((char*)p, total_range_len)); + os::release_memory((char*)p, total_range_len); PRINT_MAPPINGS("B"); ASSERT_FALSE(os::win32::find_mapping(p, &mapping_info)); } @@ -1132,11 +1157,11 @@ TEST_VM(os, commit_memory_or_exit) { ASSERT_NOT_NULL(base); os::commit_memory_or_exit(base, size, false, "Commit failed."); strcpy(base, letters); - ASSERT_TRUE(os::uncommit_memory(base, size, false)); + os::uncommit_memory(base, size, false); os::commit_memory_or_exit(base, size, page_sz, false, "Commit with alignment hint failed."); strcpy(base, letters); - ASSERT_TRUE(os::uncommit_memory(base, size, false)); - EXPECT_TRUE(os::release_memory(base, size)); + os::uncommit_memory(base, size, false); + os::release_memory(base, size); } #if !defined(_AIX) @@ -1152,7 +1177,7 @@ TEST_VM(os, map_memory_to_file) { char* result = os::map_memory_to_file(size, fd, mtTest); ASSERT_NOT_NULL(result); EXPECT_EQ(strcmp(letters, result), 0); - EXPECT_TRUE(os::unmap_memory(result, size)); + os::unmap_memory(result, size); ::close(fd); } @@ -1169,7 +1194,7 @@ TEST_VM(os, map_unmap_memory) { char* result = os::map_memory(fd, path, 0, nullptr, size, mtTest, true, false); ASSERT_NOT_NULL(result); EXPECT_EQ(strcmp(letters, result), 0); - EXPECT_TRUE(os::unmap_memory(result, size)); + os::unmap_memory(result, size); ::close(fd); } @@ -1184,7 +1209,7 @@ TEST_VM(os, map_memory_to_file_aligned) { char* result = os::map_memory_to_file_aligned(os::vm_allocation_granularity(), os::vm_allocation_granularity(), fd, mtTest); ASSERT_NOT_NULL(result); EXPECT_EQ(strcmp(letters, result), 0); - EXPECT_TRUE(os::unmap_memory(result, os::vm_allocation_granularity())); + os::unmap_memory(result, os::vm_allocation_granularity()); ::close(fd); } diff --git a/test/hotspot/gtest/runtime/test_os_linux.cpp b/test/hotspot/gtest/runtime/test_os_linux.cpp index c8467784b0a..9c624267c18 100644 --- a/test/hotspot/gtest/runtime/test_os_linux.cpp +++ b/test/hotspot/gtest/runtime/test_os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ namespace { HugeTlbfsMemory(char* const ptr, size_t size) : _ptr(ptr), _size(size) { } ~HugeTlbfsMemory() { if (_ptr != nullptr) { - os::release_memory_special(_ptr, _size); + os::release_memory(_ptr, _size); } } }; @@ -227,7 +227,7 @@ class TestReserveMemorySpecial : AllStatic { char* addr = os::reserve_memory_special(size, alignment, page_size, nullptr, false); if (addr != nullptr) { small_page_write(addr, size); - os::release_memory_special(addr, size); + os::release_memory(addr, size); } } @@ -285,7 +285,7 @@ class TestReserveMemorySpecial : AllStatic { if (p != nullptr) { EXPECT_TRUE(is_aligned(p, alignment)); small_page_write(p, size); - os::release_memory_special(p, size); + os::release_memory(p, size); } } } @@ -300,7 +300,7 @@ class TestReserveMemorySpecial : AllStatic { if (p != nullptr) { EXPECT_EQ(p, req_addr); small_page_write(p, size); - os::release_memory_special(p, size); + os::release_memory(p, size); } } } @@ -379,8 +379,8 @@ TEST_VM(os_linux, pretouch_thp_and_use_concurrent) { for (int i = 0; i < 1000; i++) EXPECT_EQ(*iptr++, i); - EXPECT_TRUE(os::uncommit_memory(heap, size, false)); - EXPECT_TRUE(os::release_memory(heap, size)); + os::uncommit_memory(heap, size, false); + os::release_memory(heap, size); UseTransparentHugePages = useThp; } diff --git a/test/hotspot/gtest/runtime/test_os_windows.cpp b/test/hotspot/gtest/runtime/test_os_windows.cpp index 2d9a7e00b39..13574dcbdb3 100644 --- a/test/hotspot/gtest/runtime/test_os_windows.cpp +++ b/test/hotspot/gtest/runtime/test_os_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +39,7 @@ namespace { MemoryReleaser(char* ptr, size_t size) : _ptr(ptr), _size(size) { } ~MemoryReleaser() { if (_ptr != nullptr) { - os::release_memory_special(_ptr, _size); + os::release_memory(_ptr, _size); } } }; diff --git a/test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp b/test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp index 4242302997a..a7e4b273788 100644 --- a/test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp +++ b/test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,41 +50,41 @@ namespace { }; } -#define check(vmt, rmr, regions) check_inner((vmt), (rmr), (regions), ARRAY_SIZE(regions), __FILE__, __LINE__) +#define check(vmt, rgn, regions) check_inner((vmt), (rgn), (regions), ARRAY_SIZE(regions), __FILE__, __LINE__) -#define check_empty(vmt, rmr) \ +#define check_empty(vmt, rgn) \ do { \ - check_inner((vmt), (rmr), nullptr, 0, __FILE__, __LINE__); \ + check_inner((vmt), (rgn), nullptr, 0, __FILE__, __LINE__); \ } while (false) -static void diagnostic_print(VirtualMemoryTracker& vmt, const ReservedMemoryRegion& rmr) { - LOG("In reserved region " PTR_FORMAT ", size %X:", p2i(rmr.base()), rmr.size()); - vmt.tree()->visit_committed_regions(rmr, [&](CommittedMemoryRegion& region) { - LOG(" committed region: " PTR_FORMAT ", size %X", p2i(region.base()), region.size()); +static void diagnostic_print(VirtualMemoryTracker& vmt, const VirtualMemoryRegion& rgn) { + LOG("In reserved region " PTR_FORMAT ", size %X:", p2i(rgn.base()), rgn.size()); + vmt.tree()->visit_committed_regions(rgn, [&](VirtualMemoryRegion& crgn) { + LOG(" committed region: " PTR_FORMAT ", size %X", p2i(crgn.base()), crgn.size()); return true; }); } -static void check_inner(VirtualMemoryTracker& vmt, const ReservedMemoryRegion& rmr, R* regions, size_t regions_size, const char* file, int line) { +static void check_inner(VirtualMemoryTracker& vmt, const VirtualMemoryRegion& rgn, R* regions, size_t regions_size, const char* file, int line) { size_t i = 0; size_t size = 0; // Helpful log - diagnostic_print(vmt, rmr); + diagnostic_print(vmt, rgn); #define WHERE " from " << file << ":" << line - vmt.tree()->visit_committed_regions(rmr, [&](CommittedMemoryRegion& region) { + vmt.tree()->visit_committed_regions(rgn, [&](VirtualMemoryRegion& crgn) { EXPECT_LT(i, regions_size) << WHERE; - EXPECT_EQ(region.base(), regions[i]._addr) << WHERE; - EXPECT_EQ(region.size(), regions[i]._size) << WHERE; - size += region.size(); + EXPECT_EQ(crgn.base(), regions[i]._addr) << WHERE; + EXPECT_EQ(crgn.size(), regions[i]._size) << WHERE; + size += crgn.size(); i++; return true; }); EXPECT_EQ(i, regions_size) << WHERE; - EXPECT_EQ(size, vmt.committed_size(&rmr)) << WHERE; + EXPECT_EQ(size, vmt.committed_size(&rgn)) << WHERE; } class VirtualMemoryTrackerTest { @@ -104,11 +104,11 @@ public: NativeCallStack stack(&frame1, 1); NativeCallStack stack2(&frame2, 1); - // Fetch the added RMR for the space - ReservedMemoryRegion rmr = rtree->find_reserved_region(addr); + // Fetch the added region for the space + VirtualMemoryRegion rgn = rtree->find_reserved_region(addr); - ASSERT_EQ(rmr.size(), size); - ASSERT_EQ(rmr.base(), addr); + ASSERT_EQ(rgn.size(), size); + ASSERT_EQ(rgn.base(), addr); // Commit Size Granularity const size_t cs = 0x1000; @@ -118,24 +118,24 @@ public: { // Commit one region rtree->commit_region(addr + cs, cs, stack, diff); R r[] = { {addr + cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit adjacent - lower address rtree->commit_region(addr, cs, stack, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit adjacent - higher address rtree->commit_region(addr + 2 * cs, cs, stack, diff); R r[] = { {addr, 3 * cs} }; - check(vmt,rmr, r); + check(vmt, rgn, r); } // Cleanup rtree->uncommit_region(addr, 3 * cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 0u); + ASSERT_EQ(vmt.committed_size(&rgn), 0u); // Commit adjacent regions with different stacks @@ -143,14 +143,14 @@ public: { // Commit one region rtree->commit_region(addr + cs, cs, stack, diff); R r[] = { {addr + cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit adjacent - lower address rtree->commit_region(addr, cs, stack2, diff); R r[] = { {addr, cs}, {addr + cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit adjacent - higher address @@ -158,12 +158,12 @@ public: R r[] = { {addr, cs}, {addr + cs, cs}, {addr + 2 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // Cleanup rtree->uncommit_region(addr, 3 * cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 0u); + ASSERT_EQ(vmt.committed_size(&rgn), 0u); } static void test_add_committed_region_adjacent_overlapping() { @@ -180,11 +180,11 @@ public: NativeCallStack stack(&frame1, 1); NativeCallStack stack2(&frame2, 1); - // Fetch the added RMR for the space - ReservedMemoryRegion rmr = rtree->find_reserved_region(addr); + // Fetch the added region for the space + VirtualMemoryRegion rgn = rtree->find_reserved_region(addr); - ASSERT_EQ(rmr.size(), size); - ASSERT_EQ(rmr.base(), addr); + ASSERT_EQ(rgn.size(), size); + ASSERT_EQ(rgn.base(), addr); // Commit Size Granularity const size_t cs = 0x1000; @@ -196,28 +196,28 @@ public: rtree->commit_region(addr + 3 * cs, 2 * cs, stack, diff); R r[] = { {addr, 2 * cs}, {addr + 3 * cs, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit adjacent and overlapping rtree->commit_region(addr + 2 * cs, 2 * cs, stack, diff); R r[] = { {addr, 5 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // revert to two non-adjacent regions rtree->uncommit_region(addr + 2 * cs, cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 4 * cs); + ASSERT_EQ(vmt.committed_size(&rgn), 4 * cs); { // Commit overlapping and adjacent rtree->commit_region(addr + cs, 2 * cs, stack, diff); R r[] = { {addr, 5 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // Cleanup rtree->uncommit_region(addr, 5 * cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 0u); + ASSERT_EQ(vmt.committed_size(&rgn), 0u); // Commit adjacent and overlapping regions with different stacks @@ -227,7 +227,7 @@ public: rtree->commit_region(addr + 3 * cs, 2 * cs, stack, diff); R r[] = { {addr, 2 * cs}, {addr + 3 * cs, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit adjacent and overlapping @@ -235,20 +235,20 @@ public: R r[] = { {addr, 2 * cs}, {addr + 2 * cs, 2 * cs}, {addr + 4 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // revert to two non-adjacent regions rtree->commit_region(addr, 5 * cs, stack, diff); rtree->uncommit_region(addr + 2 * cs, cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 4 * cs); + ASSERT_EQ(vmt.committed_size(&rgn), 4 * cs); { // Commit overlapping and adjacent rtree->commit_region(addr + cs, 2 * cs, stack2, diff); R r[] = { {addr, cs}, {addr + cs, 2 * cs}, {addr + 3 * cs, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } rtree->tree().remove_all(); @@ -269,12 +269,12 @@ public: NativeCallStack stack(&frame1, 1); NativeCallStack stack2(&frame2, 1); - // Fetch the added RMR for the space - ReservedMemoryRegion rmr = rtree->find_reserved_region(addr); + // Fetch the added region for the space + VirtualMemoryRegion rgn = rtree->find_reserved_region(addr); - ASSERT_EQ(rmr.size(), size); - ASSERT_EQ(rmr.base(), addr); + ASSERT_EQ(rgn.size(), size); + ASSERT_EQ(rgn.base(), addr); // Commit Size Granularity const size_t cs = 0x1000; @@ -284,54 +284,54 @@ public: { // Commit one region rtree->commit_region(addr, cs, stack, diff); R r[] = { {addr, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit the same region rtree->commit_region(addr, cs, stack, diff); R r[] = { {addr, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit a succeeding region rtree->commit_region(addr + cs, cs, stack, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit over two regions rtree->commit_region(addr, 2 * cs, stack, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } {// Commit first part of a region rtree->commit_region(addr, cs, stack, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit second part of a region rtree->commit_region(addr + cs, cs, stack, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit a third part rtree->commit_region(addr + 2 * cs, cs, stack, diff); R r[] = { {addr, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit in the middle of a region rtree->commit_region(addr + 1 * cs, cs, stack, diff); R r[] = { {addr, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // Cleanup rtree->uncommit_region(addr, 3 * cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 0u); + ASSERT_EQ(vmt.committed_size(&rgn), 0u); // With preceding region @@ -342,71 +342,71 @@ public: { R r[] = { {addr, cs}, {addr + 2 * cs, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } rtree->commit_region(addr + 3 * cs, cs, stack, diff); { R r[] = { {addr, cs}, {addr + 2 * cs, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } rtree->commit_region(addr + 4 * cs, cs, stack, diff); { R r[] = { {addr, cs}, {addr + 2 * cs, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // Cleanup rtree->uncommit_region(addr, 5 * cs, diff); - ASSERT_EQ(vmt.committed_size(&rmr), 0u); + ASSERT_EQ(vmt.committed_size(&rgn), 0u); // With different stacks { // Commit one region rtree->commit_region(addr, cs, stack, diff); R r[] = { {addr, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit the same region rtree->commit_region(addr, cs, stack2, diff); R r[] = { {addr, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit a succeeding region rtree->commit_region(addr + cs, cs, stack, diff); R r[] = { {addr, cs}, {addr + cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit over two regions rtree->commit_region(addr, 2 * cs, stack, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } {// Commit first part of a region rtree->commit_region(addr, cs, stack2, diff); R r[] = { {addr, cs}, {addr + cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit second part of a region rtree->commit_region(addr + cs, cs, stack2, diff); R r[] = { {addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit a third part rtree->commit_region(addr + 2 * cs, cs, stack2, diff); R r[] = { {addr, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } { // Commit in the middle of a region @@ -414,7 +414,7 @@ public: R r[] = { {addr, cs}, {addr + cs, cs}, {addr + 2 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } rtree->tree().remove_all(); @@ -445,11 +445,11 @@ public: NativeCallStack stack(&frame1, 1); NativeCallStack stack2(&frame2, 1); - // Fetch the added RMR for the space - ReservedMemoryRegion rmr = rtree->find_reserved_region(addr); + // Fetch the added region for the space + VirtualMemoryRegion rgn = rtree->find_reserved_region(addr); - ASSERT_EQ(rmr.size(), size); - ASSERT_EQ(rmr.base(), addr); + ASSERT_EQ(rgn.size(), size); + ASSERT_EQ(rgn.base(), addr); // Commit Size Granularity const size_t cs = 0x1000; @@ -457,11 +457,11 @@ public: { // Commit regions rtree->commit_region(addr, 3 * cs, stack, diff); R r[] = { {addr, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); // Remove only existing rtree->uncommit_region(addr, 3 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { @@ -473,7 +473,7 @@ public: rtree->uncommit_region(addr, cs, diff); R r[] = { {addr + 2 * cs, cs}, {addr + 4 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // add back @@ -483,7 +483,7 @@ public: rtree->uncommit_region(addr + 2 * cs, cs, diff); R r[] = { {addr + 0 * cs, cs}, {addr + 4 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } // add back @@ -493,17 +493,17 @@ public: rtree->uncommit_region(addr + 4 * cs, cs, diff); R r[] = { {addr + 0 * cs, cs}, {addr + 2 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); } rtree->uncommit_region(addr, 5 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { // Remove larger region rtree->commit_region(addr + 1 * cs, cs, stack, diff); rtree->uncommit_region(addr, 3 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { // Remove smaller region - in the middle @@ -511,50 +511,50 @@ public: rtree->uncommit_region(addr + 1 * cs, cs, diff); R r[] = { { addr + 0 * cs, cs}, { addr + 2 * cs, cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); rtree->uncommit_region(addr, 3 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { // Remove smaller region - at the beginning rtree->commit_region(addr, 3 * cs, stack, diff); rtree->uncommit_region(addr + 0 * cs, cs, diff); R r[] = { { addr + 1 * cs, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); rtree->uncommit_region(addr, 3 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { // Remove smaller region - at the end rtree->commit_region(addr, 3 * cs, stack, diff); rtree->uncommit_region(addr + 2 * cs, cs, diff); R r[] = { { addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); rtree->uncommit_region(addr, 3 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { // Remove smaller, overlapping region - at the beginning rtree->commit_region(addr + 1 * cs, 4 * cs, stack, diff); rtree->uncommit_region(addr, 2 * cs, diff); R r[] = { { addr + 2 * cs, 3 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); rtree->uncommit_region(addr + 1 * cs, 4 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } { // Remove smaller, overlapping region - at the end rtree->commit_region(addr, 3 * cs, stack, diff); rtree->uncommit_region(addr + 2 * cs, 2 * cs, diff); R r[] = { { addr, 2 * cs} }; - check(vmt, rmr, r); + check(vmt, rgn, r); rtree->uncommit_region(addr, 3 * cs, diff); - check_empty(vmt, rmr); + check_empty(vmt, rgn); } rtree->tree().remove_all(); diff --git a/test/hotspot/gtest/utilities/test_globalDefinitions.cpp b/test/hotspot/gtest/utilities/test_globalDefinitions.cpp index f24d74ea529..6636efbba8e 100644 --- a/test/hotspot/gtest/utilities/test_globalDefinitions.cpp +++ b/test/hotspot/gtest/utilities/test_globalDefinitions.cpp @@ -321,3 +321,38 @@ TEST(globalDefinitions, jlong_from) { val = jlong_from(0xABCD, 0xEFEF); EXPECT_EQ(val, CONST64(0x0000ABCD0000EFEF)); } + +struct NoCopy { + int x; + NONCOPYABLE(NoCopy); +}; + +TEST(globalDefinitions, sizeof_auto) { + char x = 5; + char& y = x; + char* z = &x; + EXPECT_EQ(sizeof_auto(x), sizeof(x)); + EXPECT_EQ(sizeof_auto(y), sizeof(y)); + EXPECT_EQ(sizeof_auto(z), sizeof(z)); + + NoCopy nc{0}; + sizeof_auto(nc); + + static_assert(sizeof_auto(char[1LL]) == 1); + static_assert(sizeof_auto(char[std::numeric_limits::max() + 1LL]) == std::numeric_limits::max() + 1LL); + static_assert(sizeof_auto(char[std::numeric_limits::max() + 1LL]) == std::numeric_limits::max() + 1LL); +#if defined(_LP64) && !defined(_WINDOWS) + // char array sometimes limited to 2 gig length on 32 bit platforms (signed), disabled for Windows because of compiler error C2148. + static_assert(sizeof_auto(char[std::numeric_limits::max() + 1LL]) == std::numeric_limits::max() + 1LL); +#endif + + static_assert(sizeof(sizeof_auto(char[std::numeric_limits::max()])) == sizeof(uint8_t)); + static_assert(sizeof(sizeof_auto(char[std::numeric_limits::max() + 1LL])) == sizeof(uint16_t)); + static_assert(sizeof(sizeof_auto(char[std::numeric_limits::max()])) == sizeof(uint16_t)); + static_assert(sizeof(sizeof_auto(char[std::numeric_limits::max() + 1LL])) == sizeof(uint32_t)); +#if defined(_LP64) && !defined(_WINDOWS) + // char array sometimes limited to 2 gig length on 32 bit platforms (signed), disabled for Windows because of compiler error C2148. + static_assert(sizeof(sizeof_auto(char[std::numeric_limits::max()])) == sizeof(uint32_t)); + static_assert(sizeof(sizeof_auto(char[std::numeric_limits::max() + 1LL])) == sizeof(uint64_t)); +#endif +} diff --git a/test/hotspot/gtest/utilities/test_rbtree.cpp b/test/hotspot/gtest/utilities/test_rbtree.cpp index a351e2141e8..7eca5f54831 100644 --- a/test/hotspot/gtest/utilities/test_rbtree.cpp +++ b/test/hotspot/gtest/utilities/test_rbtree.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -115,6 +115,16 @@ struct ArrayAllocator { using IntrusiveTreeInt = IntrusiveRBTree; using IntrusiveCursor = IntrusiveTreeInt::Cursor; + struct DestructionTracker { + static int destructed_count; + int value; + + DestructionTracker(int value) : value(value) {} + ~DestructionTracker() { destructed_count++; } + + static void reset() { destructed_count = 0; } + }; + public: void inserting_duplicates_results_in_one_value() { constexpr int up_to = 10; @@ -607,6 +617,55 @@ public: } } + void test_remove_destructs() { + using Tree = RBTreeCHeap; + using Node = RBNode; + using Cursor = Tree::Cursor; + + Tree tree; + + // Test the 3 ways of removing a single node + tree.upsert(0, DestructionTracker(0)); + tree.upsert(1, DestructionTracker(1)); + tree.upsert(2, DestructionTracker(2)); + + DestructionTracker::reset(); + + tree.remove(0); + + Node* n = tree.find_node(1); + tree.remove(n); + + Cursor remove_cursor = tree.cursor(2); + tree.remove_at_cursor(remove_cursor); + + EXPECT_EQ(3, DestructionTracker::destructed_count); + + // Test clearing the tree + constexpr int num_nodes = 10; + for (int n = 0; n < num_nodes; n++) { + tree.upsert(n, DestructionTracker(n)); + } + + DestructionTracker::reset(); + + tree.remove_all(); + EXPECT_EQ(num_nodes, DestructionTracker::destructed_count); + + // Test replacing a node + tree.upsert(0, DestructionTracker(0)); + Cursor replace_cursor = tree.cursor(0); + Node* new_node = tree.allocate_node(1, DestructionTracker(1)); + + DestructionTracker::reset(); + + tree.replace_at_cursor(new_node, replace_cursor); + EXPECT_EQ(1, DestructionTracker::destructed_count); + + tree.remove_at_cursor(replace_cursor); + EXPECT_EQ(2, DestructionTracker::destructed_count); + } + void test_cursor() { constexpr int num_nodes = 10; RBTreeInt tree; @@ -971,6 +1030,11 @@ TEST_VM_F(RBTreeTest, NodeHints) { this->test_node_hints(); } +int RBTreeTest::DestructionTracker::destructed_count = 0; +TEST_VM_F(RBTreeTest, RemoveDestructs) { + this->test_remove_destructs(); +} + TEST_VM_F(RBTreeTest, CursorFind) { this->test_cursor(); } @@ -1252,3 +1316,17 @@ TEST_VM_F(RBTreeTest, AllocatorMayReturnNull) { EXPECT_EQ(false, success); // The test didn't exit the VM, so it was succesful. } + +TEST_VM_F(RBTreeTest, ArenaAllocator) { + Arena arena(mtTest); + RBTreeArena rbtree(&arena); + bool success = rbtree.upsert(5, 5); + ASSERT_EQ(true, success); +} + +TEST_VM_F(RBTreeTest, ResourceAreaAllocator) { + ResourceArea area(mtTest); + RBTreeResourceArea rbtree(&area); + bool success = rbtree.upsert(5, 5); + ASSERT_EQ(true, success); +} diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 3e4814180f6..ba63f775223 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -59,6 +59,10 @@ compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-all compiler/vectorapi/reshape/TestVectorReinterpret.java 8320897,8348519 aix-ppc64,linux-ppc64le,linux-s390x compiler/vectorapi/VectorRebracket128Test.java 8330538 generic-all +compiler/vectorization/TestVectorAlgorithms.java#noSuperWord 8376803 aix-ppc64,linux-s390x +compiler/vectorization/TestVectorAlgorithms.java#vanilla 8376803 aix-ppc64,linux-s390x +compiler/vectorization/TestVectorAlgorithms.java#noOptimizeFill 8376803 aix-ppc64,linux-s390x + compiler/jvmci/TestUncaughtErrorInCompileMethod.java 8309073 generic-all compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java 8331704 linux-riscv64 compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java 8331704 linux-riscv64 @@ -92,9 +96,6 @@ gc/TestAllocHumongousFragment.java#g1 8298781 generic-all gc/TestAllocHumongousFragment.java#static 8298781 generic-all gc/shenandoah/oom/TestAllocOutOfMemory.java#large 8344312 linux-ppc64le gc/shenandoah/TestEvilSyncBug.java#generational 8345501 generic-all -gc/shenandoah/TestRetainObjects.java#no-tlab 8361099 generic-all -gc/shenandoah/TestSieveObjects.java#no-tlab 8361099 generic-all -gc/shenandoah/TestSieveObjects.java#no-tlab-genshen 8361099 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 0fdbdae9bc5..d1c72b9768c 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2026, 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 @@ -107,7 +107,7 @@ requires.properties= \ jdk.static # Minimum jtreg version -requiredVersion=8.1+1 +requiredVersion=8.2.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/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnSupportedCPU.java b/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnSupportedCPU.java index 2461f1ae92b..cf8000b7a21 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnSupportedCPU.java +++ b/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnSupportedCPU.java @@ -52,7 +52,7 @@ public class TestUseSHA3IntrinsicsWithUseSHADisabledOnSupportedCPU { private static final String UNLOCK_DIAGNOSTIC = "-XX:+UnlockDiagnosticVMOptions"; public static void main(String[] args) throws Throwable { - if (!IntrinsicPredicates.isSHA3IntrinsicAvailable().getAsBoolean()) { + if (!IntrinsicPredicates.SHA3_INSTRUCTION_AVAILABLE.getAsBoolean()) { throw new SkippedException("Skipping... SHA3 intrinsics are not available on this platform."); } diff --git a/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnUnsupportedCPU.java b/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnUnsupportedCPU.java index 067bc723b5c..1e0df1874b6 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnUnsupportedCPU.java +++ b/test/hotspot/jtreg/compiler/arguments/TestUseSHA3IntrinsicsWithUseSHADisabledOnUnsupportedCPU.java @@ -51,7 +51,7 @@ public class TestUseSHA3IntrinsicsWithUseSHADisabledOnUnsupportedCPU { private static final String UNLOCK_DIAGNOSTIC = "-XX:+UnlockDiagnosticVMOptions"; public static void main(String[] args) throws Throwable { - if (IntrinsicPredicates.isSHA3IntrinsicAvailable().getAsBoolean()) { + if (IntrinsicPredicates.SHA3_INSTRUCTION_AVAILABLE.getAsBoolean()) { throw new SkippedException("Skipping... SHA3 intrinsics are available on this platform."); } diff --git a/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java b/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java index a7e90353f90..6b93f00cdb1 100644 --- a/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java +++ b/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Arm Limited. All rights reserved. + * Copyright (c) 2026, 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,7 +31,7 @@ import java.util.Random; /* * @test - * @bug 8294816 + * @bug 8294816 8342095 * @key randomness * @summary Test Math.min/max vectorization miscompilation for integer subwords * @library /test/lib / @@ -58,11 +59,11 @@ public class TestMinMaxSubword { } } - // Ensure vector max/min instructions are not generated for integer subword types - // as Java APIs for Math.min/max do not support integer subword types and superword - // should not generate vectorized Min/Max nodes for them. + // Ensure that casts to/from subword types are emitted, as java APIs for Math.min/max do not support integer subword + // types and superword should generate int versions and then cast between them. + @Test - @IR(failOn = {IRNode.MIN_VI, IRNode.MIN_VF, IRNode.MIN_VD}) + @IR(applyIfCPUFeature = { "avx", "true" }, counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) public static void testMinShort() { for (int i = 0; i < LENGTH; i++) { sb[i] = (short) Math.min(sa[i], val); @@ -78,7 +79,7 @@ public class TestMinMaxSubword { } @Test - @IR(failOn = {IRNode.MAX_VI, IRNode.MAX_VF, IRNode.MAX_VD}) + @IR(applyIfCPUFeature = { "avx", "true" }, counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) public static void testMaxShort() { for (int i = 0; i < LENGTH; i++) { sb[i] = (short) Math.max(sa[i], val); @@ -93,7 +94,7 @@ public class TestMinMaxSubword { } @Test - @IR(failOn = {IRNode.MIN_VI, IRNode.MIN_VF, IRNode.MIN_VD}) + @IR(applyIfCPUFeature = { "avx", "true" }, counts = { IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", ">0" }) public static void testMinByte() { for (int i = 0; i < LENGTH; i++) { bb[i] = (byte) Math.min(ba[i], val); @@ -109,7 +110,7 @@ public class TestMinMaxSubword { } @Test - @IR(failOn = {IRNode.MAX_VI, IRNode.MAX_VF, IRNode.MAX_VD}) + @IR(applyIfCPUFeature = { "avx", "true" }, counts = { IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", ">0" }) 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/TestVerifyIterativeGVN.java b/test/hotspot/jtreg/compiler/c2/TestVerifyIterativeGVN.java index 4b6215b25bd..39bb8b0a0ad 100644 --- a/test/hotspot/jtreg/compiler/c2/TestVerifyIterativeGVN.java +++ b/test/hotspot/jtreg/compiler/c2/TestVerifyIterativeGVN.java @@ -25,9 +25,9 @@ * @test * @bug 8238756 8351889 * @requires vm.debug == true & vm.flavor == "server" - * @summary Run with -Xcomp to test -XX:VerifyIterativeGVN=11111 in debug builds. + * @summary Run with -Xcomp to test -XX:VerifyIterativeGVN=111111 in debug builds. * - * @run main/othervm/timeout=300 -Xcomp -XX:VerifyIterativeGVN=11111 compiler.c2.TestVerifyIterativeGVN + * @run main/othervm/timeout=300 -Xcomp -XX:VerifyIterativeGVN=111111 compiler.c2.TestVerifyIterativeGVN */ package compiler.c2; diff --git a/test/hotspot/jtreg/compiler/c2/gvn/MissedRShiftLShiftIdentity.java b/test/hotspot/jtreg/compiler/c2/gvn/MissedRShiftLShiftIdentity.java new file mode 100644 index 00000000000..9f8eaab514f --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/gvn/MissedRShiftLShiftIdentity.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2026, 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.c2.gvn; + +/* + * @test + * @bug 8374798 + * @summary RShift(LShift(x, C), C) Identity missed when shift counts are different + * constant nodes for the same effective count (e.g. -1 vs 31) due to + * mask_and_replace_shift_amount normalizing them at different times. + * + * @run main ${test.main.class} + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:+StressIGVN -XX:+StressCCP -XX:VerifyIterativeGVN=1000 -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,${test.main.class}::test* ${test.main.class} + */ + +public class MissedRShiftLShiftIdentity { + public static int iFld = 0; + + public static void test() { + int[] iArr = new int[10]; + int i2 = -1, i3 = 0; + + for (int i11 : iArr) { + iFld = i11; + for (int i1 = 0; i1 < 10; i1++) { + iFld <<= i3; + iFld >>= i2; // RShift + i3 = i2; + } + int i16 = 0; + do { + for (int f3 = 1; f3 < 1; f3 += 3) { + i2 = -1; + } + } while (++i16 < 5); + } + } + + public static void main(String[] args) { + test(); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/gvn/MissedURShiftLShiftIdeal.java b/test/hotspot/jtreg/compiler/c2/gvn/MissedURShiftLShiftIdeal.java new file mode 100644 index 00000000000..774b218b1ca --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/gvn/MissedURShiftLShiftIdeal.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2026, 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.c2.gvn; + +/* + * @test + * @bug 8374798 8377389 + * @summary URShift(LShift(x, C), C) Ideal optimization missed due to missing IGVN notification: + * when LShift inputs change, its URShift users were not re-queued for the + * (X << C) >>> C -> X & mask optimization. + * + * @run main ${test.main.class} + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:+StressIGVN -XX:+StressCCP -XX:VerifyIterativeGVN=0100 -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,${test.main.class}::test* ${test.main.class} + */ + +public class MissedURShiftLShiftIdeal { + public static int iFld = 0; + + public static void test() { + int[] iArr = new int[10]; + int i2 = -1, i3 = 0; + + for (int i11 : iArr) { + iFld = i11; + for (int i1 = 0; i1 < 10; i1++) { + iFld <<= i3; + iFld >>>= i2; // URShift + i3 = i2; + } + int i16 = 0; + do { + for (int f3 = 1; f3 < 1; f3 += 3) { + i2 = -1; + } + } while (++i16 < 5); + } + } + + public static void main(String[] args) { + test(); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/gvn/TestFindStore.java b/test/hotspot/jtreg/compiler/c2/gvn/TestFindStore.java new file mode 100644 index 00000000000..aac3e0cf980 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/gvn/TestFindStore.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2026, 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.c2.gvn; + +import compiler.lib.ir_framework.*; +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; + +/* + * @test + * @bug 8376220 + * @summary Tests that memory accesses can be elided when the compiler can see the value at the + * accessed memory location by walking the memory graph. + * @modules java.base/jdk.internal.misc + * @library /test/lib / + * @run driver ${test.main.class} + */ +public class TestFindStore { + private static final Unsafe U = Unsafe.getUnsafe(); + + static class P { + int v; + int u; + } + + static final long V_OFFSET = U.objectFieldOffset(P.class, "v"); + static final long U_OFFSET = U.objectFieldOffset(P.class, "u"); + + static class C1 extends P {} + static class C2 extends P {} + + public static void main(String[] args) { + TestFramework.runWithFlags("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED"); + } + + @Run(test = {"testLoad", "testStore", "testLoadDependent1", "testLoadDependent2", "testLoadArray", + "testLoadArrayOverlap", "testLoadIndependentAliasClasses", "testLoadMismatched", + "testLoadArrayCopy", "testLoadArrayCopyUnknownLength"}) + public void run() { + C1 c1 = new C1(); + C2 c2 = new C2(); + int[] a1 = new int[1000]; + int[] a2 = new int[1000]; + + Asserts.assertEQ(0, testLoad(c1, c2, 0, 1)); + Asserts.assertEQ(0, testStore(c2, 0).v); + Asserts.assertEQ(0, testLoadDependent1(c1, c1, 0, 1)); + Asserts.assertEQ(1, testLoadDependent1(c2, c1, 0, 1)); + Asserts.assertEQ(1, testLoadDependent2(c1, c1, 0, 1)); + Asserts.assertEQ(0, testLoadDependent2(c2, c1, 0, 1)); + + Asserts.assertEQ(0, testLoadArray(a1, a2, 0, 1)); + Asserts.assertEQ(0, testLoadArrayOverlap(a1, a2, 2, 0, 1)); + Asserts.assertEQ(0, testLoadArrayOverlap(a1, a1, 0, 0, 1)); + Asserts.assertEQ(1, testLoadArrayOverlap(a1, a1, 2, 0, 1)); + Asserts.assertEQ(0, testLoadIndependentAliasClasses(c1, 0, 1)); + Asserts.assertNE(0, testLoadMismatched(c1, 0, -1)); + Asserts.assertEQ(1, testLoadArrayCopy(a1, a2, 1)); + + a1[2] = 0; + Asserts.assertEQ(1, testLoadArrayCopyUnknownLength(a1, a2, 100, 1)); + a1[2] = 0; + Asserts.assertEQ(0, testLoadArrayCopyUnknownLength(a1, a2, 2, 1)); + } + + @Test + @IR(failOn = IRNode.LOAD) + static int testLoad(C1 c1, C2 c2, int v1, int v2) { + // c1 and c2 are provably independent + c1.v = v1; + c2.v = v2; + return c1.v; + } + + @Test + @IR(counts = {IRNode.STORE, "1"}, phase = CompilePhase.BEFORE_MACRO_EXPANSION) + static C1 testStore(C2 c2, int v2) { + C1 c1 = new C1(); + c2.v = v2; + c1.v = 0; + return c1; + } + + @Test + @IR(counts = {IRNode.LOAD, "1"}) + static int testLoadDependent1(P p, C1 c1, int v, int v1) { + // It cannot be proved that p and c1 are independent + c1.v = v1; + p.v = v; + return c1.v; + } + + @Test + @IR(counts = {IRNode.LOAD, "1"}) + static int testLoadDependent2(P p, C1 c1, int v, int v1) { + // It cannot be proved that p and c1 are independent + p.v = v; + c1.v = v1; + return p.v; + } + + @Test + @IR(failOn = IRNode.LOAD) + static int testLoadArray(int[] a1, int[] a2, int v1, int v2) { + // a1[2] and a2[1] are provably independent + a1[2] = v1; + a2[1] = v2; + return a1[2]; + } + + @Test + @IR(counts = {IRNode.LOAD, "1"}) + static int testLoadArrayOverlap(int[] a1, int[] a2, int idx, int v1, int v2) { + // Cannot prove that a1[2] and a2[idx] are independent + a1[2] = v1; + a2[idx] = v2; + return a1[2]; + } + + @Test + @IR(failOn = IRNode.LOAD) + static int testLoadIndependentAliasClasses(P p, int v, int u) { + p.v = v; + p.u = u; + return p.v; + } + + @Test + @IR(counts = {IRNode.LOAD, "1"}) + static int testLoadMismatched(P p, int v1, int v2) { + p.v = v1; + U.putIntUnaligned(p, (V_OFFSET + U_OFFSET) / 2, v2); + return p.v; + } + + @Test + @IR(failOn = IRNode.LOAD, applyIf = {"ArrayCopyLoadStoreMaxElem", "<100"}) + static int testLoadArrayCopy(int[] a1, int[] a2, int v) { + a2[2] = v; + // Should be large so the compiler does not just transform it into a couple of loads and stores + System.arraycopy(a2, 0, a1, 0, 100); + return a1[2]; + } + + @Test + @IR(counts = {IRNode.LOAD, "1"}) + static int testLoadArrayCopyUnknownLength(int[] a1, int[] a2, int len, int v) { + a2[2] = v; + // Cannot determine if this overwrites a1[2] + System.arraycopy(a2, 0, a1, 0, len); + return a1[2]; + } +} diff --git a/test/hotspot/jtreg/compiler/c2/igvn/TestIdealReturnReplaceShiftAmount.java b/test/hotspot/jtreg/compiler/c2/igvn/TestIdealReturnReplaceShiftAmount.java new file mode 100644 index 00000000000..589da988606 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/igvn/TestIdealReturnReplaceShiftAmount.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2026, 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.c2.igvn; + +/* + * @test + * @bug 8373251 + * @summary In Ideal of shift nodes, we call mask_and_replace_shift_amount to reduce the + * shift amount. We need to make sure that Ideal returns something if this is + * the only modification taking place. Use -XX:VerifyIterativeGVN=100000 to + * verify the return value of Ideal if the hash has changed. + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -Xcomp -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,${test.main.class}::test* + * -XX:VerifyIterativeGVN=100000 + * ${test.main.class} + * @run main ${test.main.class} + * + */ + +public class TestIdealReturnReplaceShiftAmount { + static long lFld; + static int iFld; + + static void testLShiftI() { + // we need the loop so that the shift amount replacement happens + // during IGVN and not directly at parsing + for (int i = 0; i < 5; i++) { + iFld <<= (i + 32); + } + } + + static void testLShiftL() { + for (int i = 0; i < 5; i++) { + lFld <<= (i + 64); + } + } + + static void testRShiftI() { + for (int i = 0; i < 5; i++) { + iFld >>= (i + 32); + } + } + + static void testRShiftL() { + for (int i = 0; i < 5; i++) { + lFld >>= (i + 64); + } + } + + static void testURShiftI() { + for (int i = 0; i < 5; i++) { + iFld >>>= (i + 32); + } + } + + static void testURShiftL() { + for (int i = 0; i < 5; i++) { + lFld >>>= (i + 64); + } + } + + public static void main(String[] args) { + testLShiftI(); + testLShiftL(); + testRShiftI(); + testRShiftL(); + testURShiftI(); + testURShiftL(); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/igvn/TestMissingAddSubElimination.java b/test/hotspot/jtreg/compiler/c2/igvn/TestMissingAddSubElimination.java new file mode 100644 index 00000000000..1679e131505 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/igvn/TestMissingAddSubElimination.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2026, 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.c2.igvn; + +import compiler.lib.ir_framework.*; +import java.util.Random; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; + +/* + * @test + * @bug 8373731 + * @summary C2 IGVN should eliminate a + (b - c) after c = a * i folds to a, + * i.e. a + (b - a) -> b + * @library /test/lib / + * @run driver ${test.main.class} + */ + +public class TestMissingAddSubElimination { + private static final Random R = Utils.getRandomInstance(); + + public static void main(String[] args) { + TestFramework.runWithFlags("-XX:+IgnoreUnrecognizedVMOptions", + "-XX:VerifyIterativeGVN=1000", + "-XX:CompileCommand=compileonly,compiler.c2.igvn.TestMissingAddSubElimination::*"); + } + + @Run(test = {"testAddI1", "testAddI2", "testAddL1", "testAddL2"}) + public void runTestAdd(){ + int x = R.nextInt(); + int y = R.nextInt(); + Asserts.assertEQ(testAddI1(x, y), y); + Asserts.assertEQ(testAddI2(x, y), x); + + long xl = R.nextLong(); + long yl = R.nextLong(); + Asserts.assertEQ(testAddL1(xl, yl), yl); + Asserts.assertEQ(testAddL2(xl, yl), xl); + } + + // int: x + (y - x) -> y + @Test + @IR(counts = { + IRNode.ADD_I, "0", + IRNode.SUB_I, "0", + IRNode.MUL_I, "0" + }) + int testAddI1(int x, int y) { + int i; + for (i = -10; i < 1; i++) { } + int c = x * i; + return x + (y - c); + } + + // int: (x - y) + y -> x + @Test + @IR(counts = { + IRNode.ADD_I, "0", + IRNode.SUB_I, "0", + IRNode.MUL_I, "0" + }) + int testAddI2(int x, int y) { + int i; + for (i = -10; i < 1; i++) { } + int c = y * i; + return (x - c) + y; + } + + // long: x + (y - x) -> y + @Test + @IR(counts = { + IRNode.ADD_L, "0", + IRNode.SUB_L, "0", + IRNode.MUL_L, "0" + }) + long testAddL1(long x, long y) { + int i; + for (i = -10; i < 1; i++) { } + long c = x * i; + return x + (y - c); + } + + // long: (x - y) + y -> x + @Test + @IR(counts = { + IRNode.ADD_L, "0", + IRNode.SUB_L, "0", + IRNode.MUL_L, "0" + }) + long testAddL2(long x, long y) { + int i; + for (i = -10; i < 1; i++) { } + long c = y * i; + return (x - c) + y; + } +} \ No newline at end of file diff --git a/test/hotspot/jtreg/compiler/c2/igvn/TestMissingOptReplaceShiftAmount.java b/test/hotspot/jtreg/compiler/c2/igvn/TestMissingOptReplaceShiftAmount.java new file mode 100644 index 00000000000..a2d6505c311 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/igvn/TestMissingOptReplaceShiftAmount.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2026, 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.c2.igvn; + +/* + * @test + * @bug 8373251 + * @summary In Ideal of shift nodes, we call mask_and_replace_shift_amount to reduce the + * shift amount. We need to make sure that the updates are propagated if this is + * the only modification taking place. Use -XX:VerifyIterativeGVN=1110 to + * catch missing optimizations. + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -Xcomp -XX:-TieredCompilation + * -XX:+StressIGVN -XX:StressSeed=342568167 + * -XX:CompileCommand=compileonly,${test.main.class}::test* + * -XX:VerifyIterativeGVN=1110 + * ${test.main.class} + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -Xcomp -XX:-TieredCompilation + * -XX:+StressIGVN + * -XX:CompileCommand=compileonly,${test.main.class}::test* + * -XX:VerifyIterativeGVN=1110 + * ${test.main.class} + * @run main ${test.main.class} + */ + +public class TestMissingOptReplaceShiftAmount { + static long lFld; + static boolean flag; + + static void test() { + int x = 67; + for (int i = 0; i < 20; i++) { + if (flag) { + x = 0; + } + lFld <<= x; + lFld >>>= x; + } + } + + public static void main(String[] args) { + test(); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/irTests/CMoveLConstants.java b/test/hotspot/jtreg/compiler/c2/irTests/CMoveLConstants.java index e62e1adc8d0..cf86764aecc 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/CMoveLConstants.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/CMoveLConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,31 +39,56 @@ public class CMoveLConstants { } @Test - @IR(applyIfPlatform = {"x64", "true"}, counts = {IRNode.X86_CMOVEL_IMM01, "1"}, phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.X86_CMOVEL_IMM01, "1"}, + applyIfPlatform = {"x64", "true"}, + phase = CompilePhase.FINAL_CODE) public static long testSigned(int a, int b) { return a > b ? 1L : 0L; } @Test - @IR(applyIfPlatform = {"x64", "true"}, counts = {IRNode.X86_CMOVEL_IMM01U, "1"}, phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.X86_CMOVEL_IMM01U, "1"}, + applyIfPlatform = {"x64", "true"}, + phase = CompilePhase.FINAL_CODE) public static long testUnsigned(int a, int b) { return Integer.compareUnsigned(a, b) > 0 ? 1L : 0L; } @Test - @IR(applyIfPlatform = {"x64", "true"}, counts = {IRNode.X86_CMOVEL_IMM01UCF, "1"}, phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.X86_CMOVEL_IMM01UCF, "1"}, + applyIfPlatform = {"x64", "true"}, + applyIfCPUFeatureOr = {"apx_f", "false", "avx10_2", "false"}, + phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.X86_CMOVEL_IMM01UCFE, "1"}, + applyIfPlatform = {"x64", "true"}, + applyIfCPUFeatureAnd = {"apx_f", "true", "avx10_2", "true"}, + phase = CompilePhase.FINAL_CODE) public static long testFloat(float a, float b) { return a > b ? 1L : 0L; } + @Test + @IR(counts = {IRNode.X86_CMOVEL_IMM01UCF, "1"}, + applyIfPlatform = {"x64", "true"}, + applyIfCPUFeatureOr = {"apx_f", "false", "avx10_2", "false"}, + phase = CompilePhase.FINAL_CODE) + @IR(counts = {IRNode.X86_CMOVEL_IMM01UCFE, "1"}, + applyIfPlatform = {"x64", "true"}, + applyIfCPUFeatureAnd = {"apx_f", "true", "avx10_2", "true"}, + phase = CompilePhase.FINAL_CODE) + public static long testDouble(double a, double b) { + return a > b ? 1L : 0L; + } + @DontCompile public void assertResults(int a, int b) { Asserts.assertEQ(a > b ? 1L : 0L, testSigned(a, b)); Asserts.assertEQ(Integer.compareUnsigned(a, b) > 0 ? 1L : 0L, testUnsigned(a, b)); Asserts.assertEQ((float) a > (float) b ? 1L : 0L, testFloat(a, b)); + Asserts.assertEQ((double) a > (double) b ? 1L : 0L, testDouble(a, b)); } - @Run(test = {"testSigned", "testUnsigned", "testFloat"}) + @Run(test = {"testSigned", "testUnsigned", "testFloat", "testDouble"}) public void runMethod() { assertResults(10, 20); assertResults(20, 10); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/ConvD2FIdealizationStress.java b/test/hotspot/jtreg/compiler/c2/irTests/ConvD2FIdealizationStress.java new file mode 100644 index 00000000000..ac0df25ff86 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/ConvD2FIdealizationStress.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2026, 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.c2.irTests; + +import compiler.lib.ir_framework.*; +import jdk.test.lib.Asserts; +import java.util.Random; +import jdk.test.lib.Utils; + +/* + * @test + * @bug 8375633 + * @key randomness + * @summary Test that ConvD2F::Ideal optimization is not missed with incremental inlining. + * AlwaysIncrementalInline is not required but deterministically defers even + * small methods, making this test reliable. + * @library /test/lib / + * @run driver ${test.main.class} + */ +public class ConvD2FIdealizationStress { + + private static final Random RANDOM = Utils.getRandomInstance(); + + public static void main(String[] args) { + TestFramework.runWithFlags("-XX:-TieredCompilation", + "-XX:+IgnoreUnrecognizedVMOptions", + "-XX:+AlwaysIncrementalInline", + "-XX:VerifyIterativeGVN=1110"); + } + + // Deferred by AlwaysIncrementalInline; ConvF2D appears only after inlining. + static double toDouble(float x) { + return (double) x; + } + + // ConvD2F(SqrtD(ConvF2D(x))) => SqrtF(x) + // Math.sqrt (intrinsic) is expanded at parse time; toDouble is deferred. + @Test + @IR(counts = {IRNode.SQRT_F, ">=1"}, + failOn = {IRNode.CONV_D2F, IRNode.SQRT_D, IRNode.CONV_F2D}) + public static float testSqrtConversion(float x) { + return (float) Math.sqrt(toDouble(x)); + } + + @Run(test = "testSqrtConversion") + public void runSqrtConversion() { + float input = RANDOM.nextFloat(); + checkSqrtConversion(input, testSqrtConversion(input)); + } + + @DontCompile + public void checkSqrtConversion(float input, float result) { + Asserts.assertEQ((float) Math.sqrt(input), result); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/irTests/ConvF2HFIdealizationStress.java b/test/hotspot/jtreg/compiler/c2/irTests/ConvF2HFIdealizationStress.java new file mode 100644 index 00000000000..941077362d5 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/ConvF2HFIdealizationStress.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2026, 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.c2.irTests; + +import compiler.lib.ir_framework.*; +import jdk.test.lib.Asserts; +import java.util.Random; +import jdk.test.lib.Utils; + +/* + * @test + * @bug 8375633 + * @key randomness + * @summary Test that ConvF2HF::Ideal optimization is not missed with incremental inlining. + * AlwaysIncrementalInline is not required but deterministically defers even + * small methods, making this test reliable. + * @library /test/lib / + * @run driver ${test.main.class} + */ +public class ConvF2HFIdealizationStress { + + private static final Random RANDOM = Utils.getRandomInstance(); + + private short srcBits; + private short twoBits; + private short actualBits; + + public static void main(String[] args) { + TestFramework.runWithFlags("-XX:-TieredCompilation", + "-XX:+IgnoreUnrecognizedVMOptions", + "-XX:+AlwaysIncrementalInline", + "-XX:VerifyIterativeGVN=1110"); + } + + public ConvF2HFIdealizationStress() { + srcBits = Float.floatToFloat16(RANDOM.nextFloat()); + twoBits = Float.floatToFloat16(2.0f); + } + + // Deferred by AlwaysIncrementalInline; ConvHF2F appears only after inlining. + static float toFloat(short hf) { + return Float.float16ToFloat(hf); + } + + // ConvF2HF(MulF(ConvHF2F(a), ConvHF2F(b))) => MulHF(a, b) + // Float.floatToFloat16 (intrinsic) is expanded at parse time; toFloat is deferred. + @Test + @IR(counts = {IRNode.MUL_HF, "1"}, + applyIfCPUFeatureOr = {"avx512_fp16", "true", "zfh", "true"}, + failOn = {IRNode.CONV_F2HF}) + @IR(counts = {IRNode.MUL_HF, "1"}, + applyIfCPUFeatureAnd = {"fphp", "true", "asimdhp", "true"}, + failOn = {IRNode.CONV_F2HF}) + public void testMultiply() { + actualBits = Float.floatToFloat16(toFloat(srcBits) * toFloat(twoBits)); + } + + @Check(test = "testMultiply") + public void checkMultiply() { + float twice = Float.float16ToFloat(srcBits) * Float.float16ToFloat(twoBits); + short expected = Float.floatToFloat16(twice); + Asserts.assertEQ(expected, actualBits); + } +} diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestPushAddThruCast.java b/test/hotspot/jtreg/compiler/c2/irTests/TestPushAddThruCast.java index 3aee78e9d6a..81a88791b07 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestPushAddThruCast.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestPushAddThruCast.java @@ -86,7 +86,7 @@ public class TestPushAddThruCast { // Test commoning of Casts after loop opts when they are at the same control @Test @IR(phase = CompilePhase.ITER_GVN1, counts = { IRNode.CAST_II, "4" }) - @IR(phase = CompilePhase.OPTIMIZE_FINISHED, counts = { IRNode.CAST_II, "2" }) + @IR(phase = CompilePhase.OPTIMIZE_FINISHED, counts = { IRNode.CAST_II, "3" }) public static int test3() { int j = Objects.checkIndex(i - 3, length); j += Objects.checkIndex(i, length); diff --git a/test/hotspot/jtreg/compiler/codecache/CodeCacheSegmentSizeTest.java b/test/hotspot/jtreg/compiler/codecache/CodeCacheSegmentSizeTest.java index 5531bdd1517..b6d051fcd06 100644 --- a/test/hotspot/jtreg/compiler/codecache/CodeCacheSegmentSizeTest.java +++ b/test/hotspot/jtreg/compiler/codecache/CodeCacheSegmentSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 IBM Corporation. All rights reserved. + * Copyright (c) 2025, 2026, IBM Corporation. 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 @@ * - fails gracefully for invalid value * - succeeds for valid value * @library /test/lib + * @requires vm.flagless * @run driver CodeCacheSegmentSizeTest */ diff --git a/test/hotspot/jtreg/compiler/gallery/ParticleLife.java b/test/hotspot/jtreg/compiler/gallery/ParticleLife.java new file mode 100644 index 00000000000..b6c393d328b --- /dev/null +++ b/test/hotspot/jtreg/compiler/gallery/ParticleLife.java @@ -0,0 +1,812 @@ +/* + * Copyright (c) 2026, 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.gallery; + +import java.util.Random; + +import jdk.incubator.vector.*; + +import javax.swing.*; + +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Color; +import java.awt.Font; +import java.awt.Dimension; +import java.awt.BorderLayout; +import java.awt.RenderingHints; +import java.awt.geom.Ellipse2D; + +/** + * This is a visual demo of the Vector API, presenting an N-Body simulation, + * where every body (particle) interacts with every other body. + * + * This is a stand-alone test that you can run directly with: + * java --add-modules=jdk.incubator.vector ParticleLife.java + * + * On x86, you can also play with the UseAVX flag: + * java --add-modules=jdk.incubator.vector -XX:UseAVX=2 ParticleLife.java + * + * There is a JTREG test that automatically runs this demo, + * see {@link TestParticleLife}. + * + * The motivation for this demo is to present a realistic computation, + * such as a physics simulation, but which is currently not auto + * vectorized. It is thus a good candidate for the use of the Vector API. + * This demo is based on the work of Tom Mohr and others before him: + * https://particle-life.com/ + * https://www.youtube.com/@tom-mohr + * + * If you are interested in understanding the components, then look at these: + * - State.update: one step in the simulation. This consists of two parts: + * - updateForce*: This computes the forces between all the particles, which affects the velocities. + * We have multiple implementations (scalar and Vector API). + * This is the most expensive part of the simulation. + * - updatePositions: The velocities are added to the position. + */ +public class ParticleLife { + public static final Random RANDOM = new Random(123); + + // Increasing this number will make the demo slower. + public static int NUMBER_OF_PARTICLES = 2560; + public static int NUMBER_OF_GROUPS = 50; + + public static float ZOOM = 1500f; + + public static float SCALE1 = 0.02f; + public static float SCALE2 = 0.04f; + public static float SCALE3 = 1f; + public static float FORCE_PARTICLE = 0.0001f; + public static float FORCE_ORIGIN = 0.05f; + + // Dampening factor, applied to the velocity. + // 0: no velocity carried to next update, particles have no momentum + // 1: no dampening, can lead to increase in energy in the system over time. + public static float DAMPENING = 0.3f; + + // Time step size of each update. Larger makes the simulation faster. + // But if it is too large, this can lead to numerical instability. + public static float DT = 1f; + + enum Implementation { + Scalar, VectorAPI_Inner_Gather, VectorAPI_Inner_Rearranged, VectorAPI_Outer + } + + public static Implementation IMPLEMENTATION = Implementation.Scalar; + + enum PoleGen { + Default, Random, Rainbow, Sparse + } + + public static PoleGen POLE_GEN = PoleGen.Default; + + private static final VectorSpecies SPECIES_F = FloatVector.SPECIES_PREFERRED; + + public static State STATE = new State(); + + static void main() { + System.out.println("Welcome to the Particle Life Demo!"); + + // Set up a panel we can draw on, and put it in a window. + JFrame frame = new JFrame("Particle Life Demo (VectorAPI)"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(1400, 1000); + frame.setResizable(false); + frame.setLayout(new BorderLayout()); + + ParticlePanel panel = new ParticlePanel(); + panel.setPreferredSize(new Dimension(1000, 0)); + + JPanel controlPanel = new JPanel(); + controlPanel.setLayout(null); + controlPanel.setPreferredSize(new Dimension(400, 0)); + + int y = 10; + // ---------------------------- Reset Button ------------------------- + JButton button = new JButton("Reset"); + button.setBounds(10, y, 120, 30); + button.setToolTipText("Reset state, with new numbers of particles and groups, and new poles."); + controlPanel.add(button); + + button.addActionListener(_ -> { STATE = new State(); }); + y += 40; + + // ---------------------------- Computation Selector ------------------------- + { + JLabel label = new JLabel("Implementation"); + label.setBounds(10, y, 150, 30); + controlPanel.add(label); + + String[] options = {"Scalar", "VectorAPI Inner Gather", "VectorAPI Inner Rearranged", "VectorAPI Outer"}; + JComboBox comboBox = new JComboBox<>(options); + comboBox.setBounds(160, y, 210, 30); + comboBox.setToolTipText("Choose the implementation of the force computation. Using the VectorAPI should be faster."); + controlPanel.add(comboBox); + + comboBox.addActionListener(_ -> { + String selected = (String) comboBox.getSelectedItem(); + switch (selected) { + case "Scalar" -> IMPLEMENTATION = Implementation.Scalar; + case "VectorAPI Inner Gather" -> IMPLEMENTATION = Implementation.VectorAPI_Inner_Gather; + case "VectorAPI Inner Rearranged" -> IMPLEMENTATION = Implementation.VectorAPI_Inner_Rearranged; + case "VectorAPI Outer" -> IMPLEMENTATION = Implementation.VectorAPI_Outer; + } + }); + } + y += 40; + + // ---------------------------- Zoom Slider ------------------------- + JLabel zoomLabel = new JLabel("Zoom"); + zoomLabel.setBounds(10, y, 80, 30); + controlPanel.add(zoomLabel); + + JSlider zoomSlider = new JSlider(JSlider.HORIZONTAL, 10, 2500, (int)ZOOM); + zoomSlider.setBounds(160, y, 200, 30); + zoomSlider.setMajorTickSpacing(100); + zoomSlider.setPaintTicks(false); + zoomSlider.setPaintLabels(false); + controlPanel.add(zoomSlider); + + zoomSlider.addChangeListener(_ -> { + ZOOM = zoomSlider.getValue(); + }); + zoomSlider.setValue((int)ZOOM); + y += 40; + + // ---------------------------- :Particles Slider ------------------------- + JLabel particlesLabel = new JLabel("Particles"); + particlesLabel.setBounds(10, y, 150, 30); + controlPanel.add(particlesLabel); + + JSlider particlesSlider = new JSlider(JSlider.HORIZONTAL, 64, 10000, 64); + particlesSlider.setBounds(160, y, 200, 30); + particlesSlider.setMajorTickSpacing(100); + particlesSlider.setPaintTicks(false); + particlesSlider.setPaintLabels(false); + particlesSlider.setToolTipText("More particles make the simulation slower. Only applied on Reset."); + controlPanel.add(particlesSlider); + + particlesSlider.addChangeListener(_ -> { + NUMBER_OF_PARTICLES = particlesSlider.getValue() / 64 * 64; + particlesLabel.setText("Particles = " + NUMBER_OF_PARTICLES); + }); + particlesSlider.setValue(NUMBER_OF_PARTICLES); + y += 40; + + // ---------------------------- Groups Slider ------------------------- + JLabel groupsLabel = new JLabel("Groups"); + groupsLabel.setBounds(10, y, 150, 30); + controlPanel.add(groupsLabel); + + JSlider groupsSlider = new JSlider(JSlider.HORIZONTAL, 1, 100, 1); + groupsSlider.setBounds(160, y, 200, 30); + groupsSlider.setMajorTickSpacing(100); + groupsSlider.setPaintTicks(false); + groupsSlider.setPaintLabels(false); + groupsSlider.setToolTipText("More groups lead to more complex behavior. Only applied on Reset."); + controlPanel.add(groupsSlider); + + groupsSlider.addChangeListener(_ -> { + NUMBER_OF_GROUPS = groupsSlider.getValue(); + groupsLabel.setText("Groups = " + NUMBER_OF_GROUPS); + }); + groupsSlider.setValue(NUMBER_OF_GROUPS); + y += 40; + + // ---------------------------- Pole Gen Selector ------------------------- + { + JLabel label = new JLabel("Poles"); + label.setBounds(10, y, 150, 30); + controlPanel.add(label); + + String[] options = {"Default", "Random", "Rainbow", "Sparse"}; + JComboBox comboBox = new JComboBox<>(options); + comboBox.setBounds(160, y, 210, 30); + comboBox.setToolTipText("Poles define attraction/repulsion between groups. Only applied on Reset."); + controlPanel.add(comboBox); + + comboBox.addActionListener(_ -> { + String selected = (String) comboBox.getSelectedItem(); + switch (selected) { + case "Default" -> POLE_GEN = PoleGen.Default; + case "Random" -> POLE_GEN = PoleGen.Random; + case "Rainbow" -> POLE_GEN = PoleGen.Rainbow; + case "Sparse" -> POLE_GEN = PoleGen.Sparse; + } + }); + } + y += 40; + + // ---------------------------- Scale1 Slider ------------------------- + JLabel scale1Label = new JLabel("scale1"); + scale1Label.setBounds(10, y, 150, 30); + controlPanel.add(scale1Label); + + JSlider scale1Slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + scale1Slider.setBounds(160, y, 200, 30); + scale1Slider.setMajorTickSpacing(100); + scale1Slider.setPaintTicks(false); + scale1Slider.setPaintLabels(false); + scale1Slider.setToolTipText("Defines (inner) radius: repulsion between all particles."); + controlPanel.add(scale1Slider); + + scale1Slider.addChangeListener(_ -> { + SCALE1 = scale1Slider.getValue() * 0.002f + 0.001f; + scale1Label.setText("scale1 = " + String.format("%.4f", SCALE1)); + }); + scale1Slider.setValue(10); + y += 40; + + // ---------------------------- Scale2 Slider ------------------------- + JLabel scale2Label = new JLabel("scale2"); + scale2Label.setBounds(10, y, 150, 30); + controlPanel.add(scale2Label); + + JSlider scale2Slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + scale2Slider.setBounds(160, y, 200, 30); + scale2Slider.setMajorTickSpacing(100); + scale2Slider.setPaintTicks(false); + scale2Slider.setPaintLabels(false); + scale2Slider.setToolTipText("Defines (outer) radius: attraction/repulsion depending on poles/groups."); + controlPanel.add(scale2Slider); + + scale2Slider.addChangeListener(_ -> { + SCALE2 = scale2Slider.getValue() * 0.002f + 0.001f; + scale2Label.setText("scale2 = " + String.format("%.4f", SCALE2)); + }); + scale2Slider.setValue(20); + y += 40; + + // ---------------------------- Scale3 Slider ------------------------- + JLabel scale3Label = new JLabel("scale3"); + scale3Label.setBounds(10, y, 150, 30); + controlPanel.add(scale3Label); + + JSlider scale3Slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + scale3Slider.setBounds(160, y, 200, 30); + scale3Slider.setMajorTickSpacing(101); + scale3Slider.setPaintTicks(false); + scale3Slider.setPaintLabels(false); + scale3Slider.setToolTipText("Poles factor: adjust attraction/repulsion strenght."); + controlPanel.add(scale3Slider); + + scale3Slider.addChangeListener(_ -> { + SCALE3 = scale3Slider.getValue() * 0.02f; + scale3Label.setText("scale3 = " + String.format("%.4f", SCALE3)); + }); + scale3Slider.setValue(50); + y += 40; + + // ---------------------------- FORCE_PARTICLE Slider ------------------------- + JLabel forceParticlesLabel = new JLabel("fParticles"); + forceParticlesLabel.setBounds(10, y, 150, 30); + controlPanel.add(forceParticlesLabel); + + JSlider forceParticlesSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + forceParticlesSlider.setBounds(160, y, 200, 30); + forceParticlesSlider.setMajorTickSpacing(100); + forceParticlesSlider.setPaintTicks(false); + forceParticlesSlider.setPaintLabels(false); + forceParticlesSlider.setToolTipText("Particles force factor: adjust force strength between particles."); + controlPanel.add(forceParticlesSlider); + + forceParticlesSlider.addChangeListener(_ -> { + FORCE_PARTICLE = forceParticlesSlider.getValue() * 0.00001f; + forceParticlesLabel.setText("fParticles = " + String.format("%.5f", FORCE_PARTICLE)); + }); + forceParticlesSlider.setValue(10); + y += 40; + + // ---------------------------- FORCE_ORIGIN Slider ------------------------- + JLabel forceOriginLabel = new JLabel("fOrigin"); + forceOriginLabel.setBounds(10, y, 150, 30); + controlPanel.add(forceOriginLabel); + + JSlider forceOriginSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + forceOriginSlider.setBounds(160, y, 200, 30); + forceOriginSlider.setMajorTickSpacing(100); + forceOriginSlider.setPaintTicks(false); + forceOriginSlider.setPaintLabels(false); + forceOriginSlider.setToolTipText("Origin force factor: adjust force attracting all particles to the center/origin."); + controlPanel.add(forceOriginSlider); + + forceOriginSlider.addChangeListener(_ -> { + FORCE_ORIGIN = forceOriginSlider.getValue() * 0.0005f; + forceOriginLabel.setText("fOrigin = " + String.format("%.5f", FORCE_ORIGIN)); + }); + forceOriginSlider.setValue(50); + y += 40; + + // ---------------------------- DAMPENING Slider ------------------------- + JLabel dampeningLabel = new JLabel("dampening"); + dampeningLabel.setBounds(10, y, 150, 30); + controlPanel.add(dampeningLabel); + + JSlider dampeningSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + dampeningSlider.setBounds(160, y, 200, 30); + dampeningSlider.setMajorTickSpacing(100); + dampeningSlider.setPaintTicks(false); + dampeningSlider.setPaintLabels(false); + dampeningSlider.setToolTipText("Dampening removes energy from the system over time. 1 = no dampening."); + controlPanel.add(dampeningSlider); + + dampeningSlider.addChangeListener(_ -> { + DAMPENING = dampeningSlider.getValue() * 0.01f; + dampeningLabel.setText("dampening = " + String.format("%.5f", DAMPENING)); + }); + dampeningSlider.setValue(30); + y += 40; + + // ---------------------------- DT Slider ------------------------- + JLabel dtLabel = new JLabel("dt"); + dtLabel.setBounds(10, y, 150, 30); + controlPanel.add(dtLabel); + + JSlider dtSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); + dtSlider.setBounds(160, y, 200, 30); + dtSlider.setMajorTickSpacing(100); + dtSlider.setPaintTicks(false); + dtSlider.setPaintLabels(false); + dtSlider.setToolTipText("Time delta between simulation steps. Small values lead to slow simulation, large values can lead to simulation instability."); + controlPanel.add(dtSlider); + + dtSlider.addChangeListener(_ -> { + DT = dtSlider.getValue() * 0.04f + 0.001f; + dtLabel.setText("dt = " + String.format("%.3f", DT)); + }); + dtSlider.setValue(25); + y += 40; + + // ---------------------------- Force Panel ------------------------- + ForcePanel forcePanel = new ForcePanel(); + forcePanel.setBounds(10, y, 350, 350); + forcePanel.setToolTipText("Displays the attraction/repulsion between the groups. Only updated on Reset."); + controlPanel.add(forcePanel); + y += 360; + + frame.add(panel, BorderLayout.WEST); + frame.add(controlPanel, BorderLayout.CENTER); + frame.setVisible(true); + + System.out.println("Running Demo..."); + try { + // Tight loop where we redraw the panel as fast as possible. + while (true) { + Thread.sleep(1); + STATE.update(); + panel.repaint(); + forcePanel.repaint(); + } + } catch (InterruptedException e) { + System.out.println("Interrputed, terminating demo."); + } finally { + System.out.println("Shut down demo."); + frame.setVisible(false); + frame.dispose(); + } + } + + /** + * State of the simulation. + */ + public static class State { + public long lastTime; + public float fps; + + // "struct of arrays" approach allows adjacent vector loads. + public float[] x; + public float[] y; + public float[] vx; + public float[] vy; + public int[] group; // group index of the particle + + public Color[] colors; // color of the group + + // Matrix of the poles: defines attraction/repulsion between groups i and j + public float[][] poles; + public float[][] polesT; // transpose of poles + public float[] polesScratch; + + public State() { + int n = NUMBER_OF_PARTICLES; + int g = NUMBER_OF_GROUPS; + x = new float[n]; + y = new float[n]; + vx = new float[n]; + vy = new float[n]; + group = new int[n]; + + for (int i = 0; i < n; i++) { + x[i] = 0.2f * (RANDOM.nextFloat() - 0.5f); + y[i] = 0.2f * (RANDOM.nextFloat() - 0.5f); + group[i] = RANDOM.nextInt(g); + } + + colors = new Color[g]; + for (int i = 0; i < g; i++) { + float h = i / (float)g; + colors[i] = Color.getHSBColor(h, 1f, 1f); + } + + poles = new float[g][g]; + polesT = new float[g][g]; + polesScratch = new float[n]; + for (int i = 0; i < g; i++) { + for (int j = 0; j < g; j++) { + poles[i][j] = poleGen(i, j, g); + polesT[j][i] = poles[i][j]; + } + } + + // Set up the FPS tracker + lastTime = System.nanoTime(); + } + + public static float poleGen(int i, int j, int g) { + int offset = (i - j + g) % g; + return switch (POLE_GEN) { + case PoleGen.Default -> (i == j) ? -1f : RANDOM.nextFloat() * 2f - 1f; + case PoleGen.Random -> RANDOM.nextFloat() * 2f - 1f; + case PoleGen.Rainbow -> (i == j) ? -1f : ((offset == 1) ? -0.5f : 0f); + case PoleGen.Sparse -> (i == j) ? -1f : (RANDOM.nextInt(g) <= 2 ? -0.5f : 0.3f); + }; + } + + public void update() { + long nowTime = System.nanoTime(); + float newFPS = 1e9f / (nowTime - lastTime); + fps = 0.9f * fps + 0.1f * newFPS; + lastTime = nowTime; + + switch (IMPLEMENTATION) { + case Implementation.Scalar -> updateForcesScalar(); + case Implementation.VectorAPI_Inner_Gather -> updateForcesVectorAPI_Inner_Gather(); + case Implementation.VectorAPI_Inner_Rearranged -> updateForcesVectorAPI_Inner_Rearranged(); + case Implementation.VectorAPI_Outer -> updateForcesVectorAPI_Outer(); + default -> throw new RuntimeException("not implemented"); + } + + updatePositions(); + } + + public void updateForcesScalar() { + for (int i = 0; i < x.length; i++) { + float pix = x[i]; + float piy = y[i]; + float pivx = vx[i]; + float pivy = vy[i]; + for (int j = 0; j < x.length; j++) { + float pjx = x[j]; + float pjy = y[j]; + + float dx = pix - pjx; + float dy = piy - pjy; + float d = (float)Math.sqrt(dx * dx + dy * dy); + + // Ignoring d=0 avoids division by zero. + // This would happen for i==j which we want to exclude anyway, + // of if two particles have identical position. + if (d > 0f) { + float pole = poles[group[i]][group[j]]; + // If the distance is very large, the force is zero. + float f = 0; + if (d < SCALE1) { + // Small distance: repell all particles + f = (SCALE1 - d) / SCALE1; + } else if (d < SCALE1 + SCALE2) { + // Medium distance: attract/repell according to pole + f = (d - SCALE1) / SCALE2 * pole * SCALE3; + } else if (d < SCALE1 + 2f * SCALE2) { + // Medium distance: attract/repell according to pole + f = ((SCALE1 + 2f * SCALE2) - d) / SCALE2 * pole * SCALE3; + } + // The force is adjustable by the user via FORCE_PARTICLE. + // Additionally we need to respect the DT factor of the simulation + // time step. Finally, we need to normalize dx and dy by dividing + // by d. + f *= FORCE_PARTICLE * DT / d; + pivx += dx * f; + pivy += dy * f; + } + } + vx[i] = pivx; + vy[i] = pivy; + } + } + + // Inner loop vectorization, the inner loop is vectorized. + public void updateForcesVectorAPI_Inner_Gather() { + // We don't want to deal with tail loops, so we just assert that the number of + // particles is a multiple of the vector length. + if (x.length % SPECIES_F.length() != 0) { + throw new RuntimeException("Number of particles is not a multiple of the vector length."); + } + + for (int i = 0; i < x.length; i++) { + float pix = x[i]; + float piy = y[i]; + + // We consider the force of multiple (j) particles on particle i. + var fx = FloatVector.zero(SPECIES_F); + var fy = FloatVector.zero(SPECIES_F); + + for (int j = 0; j < x.length; j += SPECIES_F.length()) { + var pjx = FloatVector.fromArray(SPECIES_F, x, j); + var pjy = FloatVector.fromArray(SPECIES_F, y, j); + + var dx = pjx.sub(pix).neg(); + var dy = pjy.sub(piy).neg(); + var d2 = ( dx.mul(dx) ).add( dy.mul(dy) ); + var d = d2.lanewise(VectorOperators.SQRT); + + // We directly gather the poles from the matrix. + var pole = FloatVector.fromArray(SPECIES_F, poles[group[i]], 0, group, j); + + // We need to compute all 3 piece-wise liner parts. + var poleDivScale2 = pole.mul(SCALE3 / SCALE2); + var f1 = d.sub(SCALE1).neg().mul(1f / SCALE1); + var f2 = d.sub(SCALE1).mul(poleDivScale2); + var f3 = d.sub(SCALE1 + SCALE2 * 2f).neg().mul(poleDivScale2); + + // And we need to perform all checks, for the boundaries of the piece-wise parts. + var f0Mask = d.compare(VectorOperators.GT, 0); + var f1Mask = d.compare(VectorOperators.LT, SCALE1); + var f2Mask = d.compare(VectorOperators.LT, SCALE1 + SCALE2); + var f3Mask = d.compare(VectorOperators.LT, SCALE1 + SCALE2 * 2f); + var f03Mask = f0Mask.and(f3Mask); + + // Then, we put together the 3 middle parts. + var f12 = f2.blend(f1, f1Mask); + var f123 = f3.blend(f12, f2Mask); + + f123 = f123.mul(FORCE_PARTICLE * DT).div(d); + + // And we only apply the middle (non-zero) parts if the mask is enabled. + fx = fx.add(dx.mul(f123), f03Mask); + fy = fy.add(dy.mul(f123), f03Mask); + } + // We need to add the force of all the (j) particles onto i's velocity. + vx[i] += fx.reduceLanes(VectorOperators.ADD); + vy[i] += fy.reduceLanes(VectorOperators.ADD); + } + } + + // Inner loop vectorization, the inner loop is vectorized. But instead of gathering the poles + // in the inner loop, we rearrange it in the outer loop, so the inner loop has a linear access. + public void updateForcesVectorAPI_Inner_Rearranged() { + // We don't want to deal with tail loops, so we just assert that the number of + // particles is a multiple of the vector length. + if (x.length % SPECIES_F.length() != 0) { + throw new RuntimeException("Number of particles is not a multiple of the vector length."); + } + + for (int i = 0; i < x.length; i++) { + // Rearrange data to avoid rearrange in the loop. + // We could also use the VectorAPI for this loop, but it is not even necessary for speedups. + float[] polesgi = poles[group[i]]; + for (int j = 0; j < x.length; j++) { + polesScratch[j] = polesgi[group[j]]; + } + + float pix = x[i]; + float piy = y[i]; + + // We consider the force of multiple (j) particles on particle i. + var fx = FloatVector.zero(SPECIES_F); + var fy = FloatVector.zero(SPECIES_F); + + for (int j = 0; j < x.length; j += SPECIES_F.length()) { + var pjx = FloatVector.fromArray(SPECIES_F, x, j); + var pjy = FloatVector.fromArray(SPECIES_F, y, j); + + var dx = pjx.sub(pix).neg(); + var dy = pjy.sub(piy).neg(); + var d2 = ( dx.mul(dx) ).add( dy.mul(dy) ); + var d = d2.lanewise(VectorOperators.SQRT); + + // We can now access the poles from scratch in a linear access, avoiding the + // repeated gather in each inner loop. This helps especially if gather is + // not supported on a platform. But it also improves the access pattern on + // platforms where gather would be supported, but linear access is faster. + var pole = FloatVector.fromArray(SPECIES_F, polesScratch, j); + + // We need to compute all 3 piece-wise liner parts. + var poleDivScale2 = pole.mul(SCALE3 / SCALE2); + var f1 = d.sub(SCALE1).neg().mul(1f / SCALE1); + var f2 = d.sub(SCALE1).mul(poleDivScale2); + var f3 = d.sub(SCALE1 + SCALE2 * 2f).neg().mul(poleDivScale2); + + // And we need to perform all checks, for the boundaries of the piece-wise parts. + var f0Mask = d.compare(VectorOperators.GT, 0); + var f1Mask = d.compare(VectorOperators.LT, SCALE1); + var f2Mask = d.compare(VectorOperators.LT, SCALE1 + SCALE2); + var f3Mask = d.compare(VectorOperators.LT, SCALE1 + SCALE2 * 2f); + var f03Mask = f0Mask.and(f3Mask); + + // Then, we put together the 3 middle parts. + var f12 = f2.blend(f1, f1Mask); + var f123 = f3.blend(f12, f2Mask); + + f123 = f123.mul(FORCE_PARTICLE * DT).div(d); + + // And we only apply the middle (non-zero) parts if the mask is enabled. + fx = fx.add(dx.mul(f123), f03Mask); + fy = fy.add(dy.mul(f123), f03Mask); + } + // We need to add the force of all the (j) particles onto i's velocity. + vx[i] += fx.reduceLanes(VectorOperators.ADD); + vy[i] += fy.reduceLanes(VectorOperators.ADD); + } + } + + // Instead of vectorizing the inner loop, we can also vectorize the outer loop. + public void updateForcesVectorAPI_Outer() { + // We don't want to deal with tail loops, so we just assert that the number of + // particles is a multiple of the vector length. + if (x.length % SPECIES_F.length() != 0) { + throw new RuntimeException("Number of particles is not a multiple of the vector length."); + } + + for (int i = 0; i < x.length; i += SPECIES_F.length()) { + var pix = FloatVector.fromArray(SPECIES_F, x, i); + var piy = FloatVector.fromArray(SPECIES_F, y, i); + var pivx = FloatVector.fromArray(SPECIES_F, vx, i); + var pivy = FloatVector.fromArray(SPECIES_F, vy, i); + + // Let's consider the force of the j particle on all of the i particles in the vector. + for (int j = 0; j < x.length; j++) { + float pjx = x[j]; + float pjy = y[j]; + + var dx = pix.sub(pjx); + var dy = piy.sub(pjy); + var d2 = ( dx.mul(dx) ).add( dy.mul(dy) ); + var d = d2.lanewise(VectorOperators.SQRT); + + // We need to access transpose of poles, because we need to access adjacent i's + var pole = FloatVector.fromArray(SPECIES_F, polesT[group[j]], 0, group, i); + + var poleDivScale2 = pole.mul(SCALE3 / SCALE2); + var f1 = d.sub(SCALE1).neg().mul(1f / SCALE1); + var f2 = d.sub(SCALE1).mul(poleDivScale2); + var f3 = d.sub(SCALE1 + SCALE2 * 2f).neg().mul(poleDivScale2); + + var f0Mask = d.compare(VectorOperators.GT, 0); + var f1Mask = d.compare(VectorOperators.LT, SCALE1); + var f2Mask = d.compare(VectorOperators.LT, SCALE1 + SCALE2); + var f3Mask = d.compare(VectorOperators.LT, SCALE1 + SCALE2 * 2f); + var f03Mask = f0Mask.and(f3Mask); + + var f12 = f2.blend(f1, f1Mask); + var f123 = f3.blend(f12, f2Mask); + + f123 = f123.mul(FORCE_PARTICLE * DT).div(d); + pivx = pivx.add(dx.mul(f123), f03Mask); + pivy = pivy.add(dy.mul(f123), f03Mask); + } + pivx.intoArray(vx, i); + pivy.intoArray(vy, i); + } + } + + // The loop is so simple that it can be auto vectorized + public void updatePositions() { + float effectiveDampening = (float)Math.pow(DAMPENING, DT); + for (int i = 0; i < x.length; i++) { + float px = x[i]; + float py = y[i]; + float pvx = vx[i]; + float pvy = vy[i]; + + // Force that pulls to origin, based on distance. + float d = (float)Math.sqrt(px * px + py * py); + pvx -= px * d * FORCE_ORIGIN * DT; + pvy -= py * d * FORCE_ORIGIN * DT; + + // Update position and put drag on speed + px += pvx * DT; + py += pvy * DT; + pvx *= effectiveDampening; + pvy *= effectiveDampening; + + x[i] = px; + y[i] = py; + vx[i] = pvx; + vy[i] = pvy; + } + } + } + + /** + * This panel displays the simulation. + **/ + public static class ParticlePanel extends JPanel { + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + + // Rendering settings for smoother circles + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); + g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + + g2d.setColor(new Color(0, 0, 0)); + g2d.fillRect(0, 0, 1000, 1000); + + // Draw position of points + for (int i = 0; i < STATE.x.length; i++) { + g2d.setColor(STATE.colors[STATE.group[i]]); + int xx = (int)(STATE.x[i] * ZOOM + 500f); + int yy = (int)(STATE.y[i] * ZOOM + 500f); + //g2d.fillRect(xx - 3, yy - 3, 6, 6); + g2d.fill(new Ellipse2D.Double(xx - 3, yy - 3, 6, 6)); + } + + g2d.setColor(new Color(0, 0, 0)); + g2d.fillRect(0, 0, 150, 35); + g2d.setColor(new Color(255, 255, 255)); + g2d.setFont(new Font("Consolas", Font.PLAIN, 30)); + g2d.drawString("FPS: " + (int)Math.floor(STATE.fps), 0, 30); + + g2d.setColor(new Color(255, 255, 255)); + int r1 = (int)(ZOOM * SCALE1); + int r2 = (int)(ZOOM * (SCALE1 + SCALE2 * 2f)); + g2d.drawOval(900 - r1, 100 - r1, 2 * r1, 2 * r1); + g2d.drawOval(900 - r2, 100 - r2, 2 * r2, 2 * r2); + } + } + + /** + * This panel displays the pole matrix. + **/ + public static class ForcePanel extends JPanel { + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + + g2d.setColor(new Color(0, 0, 0)); + g2d.fillRect(0, 0, 350, 350); + + int nGroups = STATE.poles.length; + int scale = (int)(300f / nGroups); + for (int i = 0; i < nGroups; i++) { + g2d.setColor(STATE.colors[i]); + g2d.fillRect(scale * (i + 1), 0, scale, scale); + g2d.fillRect(0, scale * (i + 1), scale, scale); + + for (int j = 0; j < nGroups; j++) { + float p = STATE.poles[i][j]; + float cr = Math.max(0, p); + float cg = Math.max(0, -p); + g2d.setColor(new Color(cr, cg, 0)); + g2d.fillRect(scale * (i + 1), scale * (j + 1), scale, scale); + } + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/gallery/TestParticleLife.java b/test/hotspot/jtreg/compiler/gallery/TestParticleLife.java new file mode 100644 index 00000000000..e0fb6164acf --- /dev/null +++ b/test/hotspot/jtreg/compiler/gallery/TestParticleLife.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2026, 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 id=ir + * @bug 8378166 + * @summary Visual example of the Vector API: NBody / Particle Life simulation. + * @library /test/lib / + * @modules jdk.incubator.vector + * @run driver ${test.main.class} ir + */ + +/* + * @test id=visual + * @key headful + * @library /test/lib / + * @modules jdk.incubator.vector + * @run main ${test.main.class} visual + */ + +package compiler.gallery; + +import jdk.test.lib.Utils; + +import compiler.lib.ir_framework.*; + +/** + * This test is the JTREG version for automatic verification of the stand-alone + * {@link ParticleLife}. If you just want to run the demo and play with it, + * go look at the documentation in {@link ParticleLife}. + * Here, we launch both a visual version that just runs for a few seconds, to see + * that there are no crashes, but we don't do any specific verification. + * We also have an IR test, that ensures that we get vectorization. + */ +public class TestParticleLife { + public static void main(String[] args) throws InterruptedException { + String mode = args[0]; + System.out.println("Running JTREG test in mode: " + mode); + + switch (mode) { + case "ir" -> runIR(); + case "visual" -> runVisual(); + default -> throw new RuntimeException("Unknown mode: " + mode); + } + } + + private static void runIR() { + System.out.println("Testing with IR rules..."); + TestFramework.runWithFlags("-XX:CompileCommand=inline,compiler.gallery.ParticleLife$State::update*", + "--add-modules=jdk.incubator.vector"); + } + + private static void runVisual() throws InterruptedException { + System.out.println("Testing with 2d Graphics (visual)..."); + + // We will not do anything special here, just launch the application, + // tell it to run for 10 second, interrupt it and let it shut down. + Thread thread = new Thread() { + public void run() { + ParticleLife.main(); + } + }; + thread.setDaemon(true); + thread.start(); + Thread.sleep(Utils.adjustTimeout(10000)); // let demo run for 10 seconds + thread.interrupt(); + Thread.sleep(Utils.adjustTimeout(1000)); // allow demo 1 second for shutdown + } + + // ---------------------- For the IR testing part only -------------------------------- + ParticleLife.State state = new ParticleLife.State(); + + @Test + @Warmup(100) + @IR(counts = {IRNode.REPLICATE_F, "> 0", + IRNode.LOAD_VECTOR_F, "> 0", + IRNode.SUB_VF, "> 0", + IRNode.MUL_VF, "> 0", + IRNode.ADD_VF, "> 0", + IRNode.SQRT_VF, "> 0", + IRNode.STORE_VECTOR, "> 0"}, + applyIf = {"AlignVector", "false"}, + applyIfPlatform = {"64-bit", "true"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private void testIR_updatePositions() { + // This call should inline given the CompileCommand above. + // We expect auto vectorization of the relatively simple loop. + state.updatePositions(); + } + + @Test + @Warmup(10) + @IR(counts = {IRNode.REPLICATE_F, "= 0", + IRNode.LOAD_VECTOR_F, "= 0", + IRNode.REPLICATE_I, "= 0", + IRNode.LOAD_VECTOR_I, "= 0", + IRNode.ADD_VI, "= 0", + IRNode.LOAD_VECTOR_GATHER, "= 0", + IRNode.SUB_VF, "= 0", + IRNode.MUL_VF, "= 0", + IRNode.ADD_VF, "= 0", + IRNode.NEG_VF, "= 0", + IRNode.SQRT_VF, "= 0", + IRNode.DIV_VF, "= 0", + IRNode.VECTOR_MASK_CMP, "= 0", + IRNode.VECTOR_MASK_CAST, "= 0", + IRNode.AND_V_MASK, "= 0", + IRNode.VECTOR_BLEND_F, "= 0", + IRNode.STORE_VECTOR, "= 0", + IRNode.ADD_REDUCTION_VF, "= 0"}, + applyIfPlatform = {"64-bit", "true"}, + applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"}) + private void testIR_updateForcesScalar() { + // This call should inline given the CompileCommand above. + // We expect no vectorization, though it may in principle be possible + // to auto vectorize one day. + state.updateForcesScalar(); + } + + @Test + @Warmup(10) + @IR(counts = {IRNode.REPLICATE_F, "> 0", + IRNode.LOAD_VECTOR_F, "> 0", + IRNode.REPLICATE_I, "> 0", + IRNode.LOAD_VECTOR_I, "> 0", + IRNode.ADD_VI, "> 0", + IRNode.LOAD_VECTOR_GATHER, "> 0", + IRNode.SUB_VF, "> 0", + IRNode.MUL_VF, "> 0", + IRNode.ADD_VF, "> 0", + IRNode.NEG_VF, "> 0", + IRNode.SQRT_VF, "> 0", + IRNode.DIV_VF, "> 0", + IRNode.VECTOR_MASK_CMP, "> 0", + IRNode.VECTOR_MASK_CAST, "> 0", + IRNode.VECTOR_BLEND_F, "> 0", + IRNode.ADD_REDUCTION_VF, "> 0"}, // instead we reduce the vector to a scalar + applyIfPlatform = {"64-bit", "true"}, + applyIfCPUFeature = {"avx2", "true"}) + private void testIR_updateForcesVectorAPI_Inner_Gather() { + // This call should inline given the CompileCommand above. + // We expect the VectorAPI calls to intrinsify. + state.updateForcesVectorAPI_Inner_Gather(); + } + + @Test + @Warmup(10) + @IR(counts = {IRNode.REPLICATE_F, "> 0", + IRNode.LOAD_VECTOR_F, "> 0", + IRNode.REPLICATE_I, "= 0", // No gather operation + IRNode.LOAD_VECTOR_I, "= 0", // No gather operation + IRNode.ADD_VI, "= 0", // No gather operation + IRNode.LOAD_VECTOR_GATHER, "= 0", // No gather operation + IRNode.SUB_VF, "> 0", + IRNode.MUL_VF, "> 0", + IRNode.ADD_VF, "> 0", + IRNode.NEG_VF, "> 0", + IRNode.SQRT_VF, "> 0", + IRNode.DIV_VF, "> 0", + IRNode.VECTOR_MASK_CMP, "> 0", + IRNode.VECTOR_MASK_CAST, "> 0", + IRNode.VECTOR_BLEND_F, "> 0", + IRNode.ADD_REDUCTION_VF, "> 0"}, // instead we reduce the vector to a scalar + applyIfPlatform = {"64-bit", "true"}, + applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"}) + private void testIR_updateForcesVectorAPI_Inner_Rearranged() { + // This call should inline given the CompileCommand above. + // We expect the VectorAPI calls to intrinsify. + state.updateForcesVectorAPI_Inner_Rearranged(); + } + + + @Test + @Warmup(10) + @IR(counts = {IRNode.REPLICATE_F, "> 0", + IRNode.LOAD_VECTOR_F, "> 0", + IRNode.REPLICATE_I, "> 0", + IRNode.LOAD_VECTOR_I, "> 0", + IRNode.ADD_VI, "> 0", + IRNode.LOAD_VECTOR_GATHER, "> 0", + IRNode.SUB_VF, "> 0", + IRNode.MUL_VF, "> 0", + IRNode.ADD_VF, "> 0", + IRNode.NEG_VF, "> 0", + IRNode.SQRT_VF, "> 0", + IRNode.DIV_VF, "> 0", + IRNode.VECTOR_MASK_CMP, "> 0", + IRNode.VECTOR_MASK_CAST, "> 0", + IRNode.VECTOR_BLEND_F, "> 0", + IRNode.STORE_VECTOR, "> 0", // store back a vector + IRNode.ADD_REDUCTION_VF, "= 0"}, // and no reduction operation + applyIfPlatform = {"64-bit", "true"}, + applyIfCPUFeature = {"avx2", "true"}) + private void testIR_updateForcesVectorAPI_Outer() { + // This call should inline given the CompileCommand above. + // We expect the VectorAPI calls to intrinsify. + state.updateForcesVectorAPI_Outer(); + } +} diff --git a/test/hotspot/jtreg/compiler/igvn/TestMinMaxIdentity.java b/test/hotspot/jtreg/compiler/igvn/TestMinMaxIdentity.java index 5b998caf65c..f91b153817b 100644 --- a/test/hotspot/jtreg/compiler/igvn/TestMinMaxIdentity.java +++ b/test/hotspot/jtreg/compiler/igvn/TestMinMaxIdentity.java @@ -73,6 +73,10 @@ public class TestMinMaxIdentity { .flatMap(MinMaxOp::generate) .forEach(testTemplateTokens::add); + // Note that for floating point Min/Max these cases below don't hold + generate(MinMaxOp.MIN_I, MinMaxOp.MAX_I).forEach(testTemplateTokens::add); + generate(MinMaxOp.MIN_L, MinMaxOp.MAX_L).forEach(testTemplateTokens::add); + Stream.of(Fp16MinMaxOp.values()) .flatMap(Fp16MinMaxOp::generate) .forEach(testTemplateTokens::add); @@ -89,6 +93,38 @@ public class TestMinMaxIdentity { testTemplateTokens); } + static Stream generate(MinMaxOp op1, MinMaxOp op2) { + return Stream.of(template("a", "b", op1, op2), template("b", "a", op1, op2), + template("a", "b", op2, op1), template("b", "a", op2, op1)). + map(Template.ZeroArgs::asToken); + } + + static Template.ZeroArgs template(String arg1, String arg2, MinMaxOp op1, MinMaxOp op2) { + return Template.make(() -> scope( + let("boxedTypeName", op1.type.boxedTypeName()), + let("op1", op1.name()), + let("op2", op2.name()), + let("type", op1.type.name()), + let("fn1", op1.functionName), + let("fn2", op2.functionName), + let("arg1", arg1), + let("arg2", arg2), + """ + @Test + @IR(counts = {IRNode.#op1, "= 0", IRNode.#op2, "= 0"}, + phase = CompilePhase.BEFORE_MACRO_EXPANSION) + @Arguments(values = {Argument.NUMBER_42, Argument.NUMBER_42}) + public #type $test(#type #arg1, #type #arg2) { + int i; + for (i = -10; i < 1; i++) { + } + #type c = a * i; + return #boxedTypeName.#fn1(a, #boxedTypeName.#fn2(b, c)); + } + """ + )); + } + enum MinMaxOp { MIN_D("min", CodeGenerationDataNameType.doubles()), MAX_D("max", CodeGenerationDataNameType.doubles()), @@ -127,7 +163,7 @@ public class TestMinMaxIdentity { """ @IR(counts = {IRNode.#op, "= 1"}, phase = CompilePhase.BEFORE_MACRO_EXPANSION, - applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "darn", "true"}) @IR(counts = {IRNode.#op, "= 1"}, phase = CompilePhase.BEFORE_MACRO_EXPANSION, applyIfPlatform = {"riscv64", "true"}) diff --git a/test/hotspot/jtreg/compiler/integerArithmetic/TestHoistDivision.java b/test/hotspot/jtreg/compiler/integerArithmetic/TestHoistDivision.java new file mode 100644 index 00000000000..26fce864c12 --- /dev/null +++ b/test/hotspot/jtreg/compiler/integerArithmetic/TestHoistDivision.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2026, 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. + */ +package compiler.integerArithmetic; + +import compiler.lib.ir_framework.*; +import jdk.test.lib.Asserts; + +/* + * @test + * @bug 8347365 + * @summary Tests that divisions are hoisted when their zero checks are elided. + * @library /test/lib / + * @run driver ${test.main.class} + */ +public class TestHoistDivision { + public static void main(String[] args) { + TestFramework.run(); + } + + @DontInline + private static void dontInline() {} + + @Run(test = {"testCommon", "testHoistOutOfLoop"}) + public void run() { + Asserts.assertEQ(2, testCommon(1, 1)); + Asserts.assertEQ(0, testHoistOutOfLoop(1, 1, true, 1, 4, 2)); + Asserts.assertEQ(0, testHoistOutOfLoop(1, 1, false, 1, 4, 2)); + } + + @Test + @IR(counts = {IRNode.DIV_I, "1", IRNode.DIV_BY_ZERO_TRAP, "1"}) + public int testCommon(int x, int y) { + // The 2 divisions should be commoned + int result = x / y; + dontInline(); + return result + x / y; + } + + @Test + @IR(failOn = IRNode.DIV_BY_ZERO_TRAP, counts = {IRNode.DIV_I, "1", IRNode.TRAP, "1"}) + public int testHoistOutOfLoop(int x, int y, boolean b, int start, int limit, int step) { + // The divisions should be hoisted out of the loop, allowing them to be commoned + int result = 0; + for (int i = start; i < limit; i *= step) { + if (b) { + dontInline(); + result += x / y; + } else { + result -= x / y; + } + b = !b; + } + return result; + } +} diff --git a/test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java b/test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java index d9a98582aec..3612f5ab3d3 100644 --- a/test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java +++ b/test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,8 @@ import java.lang.reflect.Method; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.Optional; +import jtreg.SkippedException; /** * This is the entry-point for the Compile Framework. Its purpose it to allow @@ -132,10 +134,31 @@ public class CompileFramework { } catch (IllegalAccessException e) { throw new CompileFrameworkException("Illegal access:", e); } catch (InvocationTargetException e) { + // Rethrow jtreg.SkippedException so the tests are properly skipped. + // If we wrapped the SkippedException instead, it would get buried + // in the exception causes and cause a failed test instead. + findJtregSkippedExceptionInCauses(e).ifPresent(ex -> { throw ex; }); throw new CompileFrameworkException("Invocation target:", e); } } + private static Optional findJtregSkippedExceptionInCauses(Throwable ex) { + while (ex != null) { + // jtreg.SkippedException can be from a different classloader, comparing by name + if (ex.getClass().getName().equals(SkippedException.class.getName())) { + return Optional.of((RuntimeException) ex); + } + + if (ex.getCause() == ex) { + break; + } + + ex = ex.getCause(); + } + + return Optional.empty(); + } + private Method findMethod(String className, String methodName) { Class c = getClass(className); Method[] methods = c.getDeclaredMethods(); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 43cae5aa6c7..3508c06ad0a 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -640,6 +640,11 @@ public class IRNode { beforeMatchingNameRegex(CONV, "Conv"); } + public static final String CONV_D2F = PREFIX + "CONV_D2F" + POSTFIX; + static { + beforeMatchingNameRegex(CONV_D2F, "ConvD2F"); + } + public static final String CONV_D2I = PREFIX + "CONV_D2I" + POSTFIX; static { beforeMatchingNameRegex(CONV_D2I, "ConvD2I"); @@ -650,6 +655,11 @@ public class IRNode { beforeMatchingNameRegex(CONV_D2L, "ConvD2L"); } + public static final String CONV_F2D = PREFIX + "CONV_F2D" + POSTFIX; + static { + beforeMatchingNameRegex(CONV_F2D, "ConvF2D"); + } + public static final String CONV_F2HF = PREFIX + "CONV_F2HF" + POSTFIX; static { beforeMatchingNameRegex(CONV_F2HF, "ConvF2HF"); @@ -1478,6 +1488,12 @@ public class IRNode { beforeMatchingNameRegex(VECTOR_MASK_FIRST_TRUE, "VectorMaskFirstTrue"); } + // Can only be used if libjsvml or libsleef is available + public static final String CALL_LEAF_VECTOR = PREFIX + "CALL_LEAF_VECTOR" + POSTFIX; + static { + beforeMatchingNameRegex(CALL_LEAF_VECTOR, "CallLeafVector"); + } + // Can only be used if avx512_vnni is available. public static final String MUL_ADD_VS2VI_VNNI = PREFIX + "MUL_ADD_VS2VI_VNNI" + POSTFIX; static { @@ -1995,6 +2011,11 @@ public class IRNode { beforeMatchingNameRegex(SQRT_HF, "SqrtHF"); } + public static final String SQRT_D = PREFIX + "SQRT_D" + POSTFIX; + static { + beforeMatchingNameRegex(SQRT_D, "SqrtD"); + } + public static final String SQRT_F = PREFIX + "SQRT_F" + POSTFIX; static { beforeMatchingNameRegex(SQRT_F, "SqrtF"); @@ -3090,6 +3111,11 @@ public class IRNode { machOnlyNameRegex(X86_CMOVEL_IMM01UCF, "cmovL_imm_01UCF"); } + public static final String X86_CMOVEL_IMM01UCFE = PREFIX + "X86_CMOVEL_IMM01UCFE" + POSTFIX; + static { + machOnlyNameRegex(X86_CMOVEL_IMM01UCFE, "cmovL_imm_01UCFE"); + } + public static final String MOD_F = PREFIX + "MOD_F" + POSTFIX; static { String regex = START + "ModF" + MID + END; diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java b/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java index 137efd18136..debb025f449 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java @@ -881,8 +881,7 @@ public class TestFramework { if (shouldVerifyIR) { try { TestClassParser testClassParser = new TestClassParser(testClass, allowNotCompilable); - Matchable testClassMatchable = testClassParser.parse(testVMProcess.getHotspotPidFileName(), - testVMProcess.getApplicableIRRules()); + Matchable testClassMatchable = testClassParser.parse(testVMProcess.testVmData()); IRMatcher matcher = new IRMatcher(testClassMatchable); matcher.match(); } catch (IRViolationException e) { diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java index 931d687b0bc..00a9b93d124 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java @@ -24,6 +24,7 @@ package compiler.lib.ir_framework.driver; import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.driver.network.TestVMData; import compiler.lib.ir_framework.shared.TestFrameworkException; import compiler.lib.ir_framework.shared.TestFrameworkSocket; import compiler.lib.ir_framework.shared.NoTestsRunException; @@ -58,10 +59,9 @@ public class TestVMProcess { private static String lastTestVMOutput = ""; private final ArrayList cmds; - private String hotspotPidFileName; private String commandLine; private OutputAnalyzer oa; - private String applicableIRRules; + private final TestVMData testVmData; public TestVMProcess(List additionalFlags, Class testClass, Set> helperClasses, int defaultWarmup, boolean allowNotCompilable, boolean testClassesOnBootClassPath) { @@ -72,20 +72,18 @@ public class TestVMProcess { allowNotCompilable, testClassesOnBootClassPath); start(); } - processSocketOutput(socket); checkTestVMExitCode(); + String hotspotPidFileName = String.format("hotspot_pid%d.log", oa.pid()); + testVmData = socket.testVmData(hotspotPidFileName, allowNotCompilable); + testVmData.printJavaMessages(); } public String getCommandLine() { return commandLine; } - public String getApplicableIRRules() { - return applicableIRRules; - } - - public String getHotspotPidFileName() { - return hotspotPidFileName; + public TestVMData testVmData() { + return testVmData; } public static String getLastTestVMOutput() { @@ -172,55 +170,9 @@ public class TestVMProcess { process.command().add(1, "-DReproduce=true"); // Add after "/path/to/bin/java" in order to rerun the Test VM directly commandLine = "Command Line:" + System.lineSeparator() + String.join(" ", process.command()) + System.lineSeparator(); - hotspotPidFileName = String.format("hotspot_pid%d.log", oa.pid()); lastTestVMOutput = oa.getOutput(); } - /** - * Process the socket output: All prefixed lines are dumped to the standard output while the remaining lines - * represent the Applicable IR Rules used for IR matching later. - */ - private void processSocketOutput(TestFrameworkSocket socket) { - String output = socket.getOutput(); - if (socket.hasStdOut()) { - StringBuilder testListBuilder = new StringBuilder(); - StringBuilder messagesBuilder = new StringBuilder(); - StringBuilder nonStdOutBuilder = new StringBuilder(); - Scanner scanner = new Scanner(output); - while (scanner.hasNextLine()) { - String line = scanner.nextLine(); - if (line.startsWith(TestFrameworkSocket.STDOUT_PREFIX)) { - // Exclude [STDOUT] from message. - line = line.substring(TestFrameworkSocket.STDOUT_PREFIX.length()); - if (line.startsWith(TestFrameworkSocket.TESTLIST_TAG)) { - // Exclude [TESTLIST] from message for better formatting. - line = "> " + line.substring(TestFrameworkSocket.TESTLIST_TAG.length() + 1); - testListBuilder.append(line).append(System.lineSeparator()); - } else { - messagesBuilder.append(line).append(System.lineSeparator()); - } - } else { - nonStdOutBuilder.append(line).append(System.lineSeparator()); - } - } - System.out.println(); - if (!testListBuilder.isEmpty()) { - System.out.println("Run flag defined test list"); - System.out.println("--------------------------"); - System.out.println(testListBuilder); - System.out.println(); - } - if (!messagesBuilder.isEmpty()) { - System.out.println("Messages from Test VM"); - System.out.println("---------------------"); - System.out.println(messagesBuilder); - } - applicableIRRules = nonStdOutBuilder.toString(); - } else { - applicableIRRules = output; - } - } - private void checkTestVMExitCode() { final int exitCode = oa.getExitValue(); if (EXCLUDE_RANDOM || REPORT_STDOUT || (VERBOSE && exitCode == 0)) { 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 893312c5196..5fbe90f0e72 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 @@ -98,7 +98,7 @@ public class IRMethod implements IRMethodMatchable { List match = matcher.match(); long endTime = System.nanoTime(); long duration = (endTime - startTime); - System.out.println("Verifying IR rules for " + name() + ": " + duration + " ns = " + (duration / 1000000) + " ms"); + System.out.println("Verifying IR rules for " + name() + ": " + duration + " ns = " + (duration / 1_000_000) + " ms"); return new IRMethodMatchResult(method, match); } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/ApplicableIRRulesParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/ApplicableIRRulesParser.java index be44c3f3d91..d251c574e47 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/ApplicableIRRulesParser.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/ApplicableIRRulesParser.java @@ -36,8 +36,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Class to parse the Applicable IR Rules emitted by the Test VM and creating {@link TestMethod} objects for each entry. @@ -45,11 +43,6 @@ import java.util.regex.Pattern; * @see TestMethod */ public class ApplicableIRRulesParser { - - private static final boolean PRINT_APPLICABLE_IR_RULES = Boolean.parseBoolean(System.getProperty("PrintApplicableIRRules", "false")); - private static final Pattern APPLICABLE_IR_RULES_PATTERN = - Pattern.compile("(?<=" + ApplicableIRRulesPrinter.START + "\r?\n).*\\R([\\s\\S]*)(?=" + ApplicableIRRulesPrinter.END + ")"); - private final Map testMethods; private final Class testClass; @@ -63,10 +56,6 @@ public class ApplicableIRRulesParser { * entry for each method that needs to be IR matched on. */ public TestMethods parse(String applicableIRRules) { - if (TestFramework.VERBOSE || PRINT_APPLICABLE_IR_RULES) { - System.out.println("Read Applicable IR Rules from Test VM:"); - System.out.println(applicableIRRules); - } createTestMethodMap(applicableIRRules, testClass); // We could have found format errors in @IR annotations. Report them now with an exception. TestFormat.throwIfAnyFailures(); @@ -105,15 +94,11 @@ public class ApplicableIRRulesParser { * Parse the Applicable IR Rules lines without header, explanation line and footer and return them in an array. */ private String[] getApplicableIRRulesLines(String applicableIRRules) { - Matcher matcher = APPLICABLE_IR_RULES_PATTERN.matcher(applicableIRRules); - TestFramework.check(matcher.find(), "Did not find Applicable IR Rules in:" + - System.lineSeparator() + applicableIRRules); - String lines = matcher.group(1).trim(); - if (lines.isEmpty()) { + if (applicableIRRules.isEmpty()) { // Nothing to IR match. return new String[0]; } - return lines.split("\\R"); + return applicableIRRules.split("\\R"); } /** @@ -148,7 +133,7 @@ public class ApplicableIRRulesParser { private void validateIRRuleIds(Method m, IR[] irAnnos, IRRuleIds irRuleIds) { TestFramework.check(irRuleIds != null, "Should find method name in validIrRulesMap for " + m); TestFramework.check(!irRuleIds.isEmpty(), "Did not find any rule indices for " + m); - TestFramework.check((irRuleIds.first() >= 1 || irRuleIds.first() == ApplicableIRRulesPrinter.NO_RULE_APPLIED) + TestFramework.check((irRuleIds.first() >= 1 || irRuleIds.first() == ApplicableIRRulesPrinter.NO_RULES) && irRuleIds.last() <= irAnnos.length, "Invalid IR rule index found in validIrRulesMap for " + m); } @@ -157,6 +142,6 @@ public class ApplicableIRRulesParser { * Does the list of IR rules contain any applicable IR rules for the given conditions? */ private boolean hasAnyApplicableIRRules(IRRuleIds irRuleIds) { - return irRuleIds.first() != ApplicableIRRulesPrinter.NO_RULE_APPLIED; + return irRuleIds.first() != ApplicableIRRulesPrinter.NO_RULES; } } 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 2329b41afbe..ca36a3e9f72 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 @@ -30,6 +30,7 @@ import compiler.lib.ir_framework.driver.irmatching.irmethod.IRMethod; import compiler.lib.ir_framework.driver.irmatching.irmethod.IRMethodMatchable; import compiler.lib.ir_framework.driver.irmatching.parser.hotspot.HotSpotPidFileParser; import compiler.lib.ir_framework.driver.irmatching.parser.hotspot.LoggedMethods; +import compiler.lib.ir_framework.driver.network.TestVMData; import compiler.lib.ir_framework.shared.TestFormat; import java.util.SortedSet; @@ -53,13 +54,13 @@ public class TestClassParser { * Parse the Applicable IR Rules and hotspot_pid* file to create a collection of {@link IRMethod} objects. * Return a default/empty TestClass object if there are no applicable @IR rules in any method of the test class. */ - public Matchable parse(String hotspotPidFileName, String applicableIRRules) { + public Matchable parse(TestVMData testVmData) { ApplicableIRRulesParser applicableIRRulesParser = new ApplicableIRRulesParser(testClass); - TestMethods testMethods = applicableIRRulesParser.parse(applicableIRRules); - VMInfo vmInfo = VMInfoParser.parseVMInfo(applicableIRRules); + TestMethods testMethods = applicableIRRulesParser.parse(testVmData.applicableIRRules()); + VMInfo vmInfo = VMInfoParser.parseVMInfo(testVmData.vmInfo()); if (testMethods.hasTestMethods()) { HotSpotPidFileParser hotSpotPidFileParser = new HotSpotPidFileParser(testClass.getName(), testMethods); - LoggedMethods loggedMethods = hotSpotPidFileParser.parse(hotspotPidFileName); + LoggedMethods loggedMethods = hotSpotPidFileParser.parse(testVmData.hotspotPidFileName()); return createTestClass(testMethods, loggedMethods, vmInfo); } return new NonIRTestClass(); 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 index 2b17303f1a7..44013839754 100644 --- 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 @@ -23,14 +23,10 @@ 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. @@ -39,15 +35,12 @@ import java.util.regex.Pattern; */ 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 applicableIRRules. + * Create a new VMInfo object from the vmInfo string. */ - public static VMInfo parseVMInfo(String applicableIRRules) { + public static VMInfo parseVMInfo(String vmInfo) { Map map = new HashMap<>(); - String[] lines = getVMInfoLines(applicableIRRules); + String[] lines = getVMInfoLines(vmInfo); for (String s : lines) { String line = s.trim(); String[] splitLine = line.split(":", 2); @@ -64,14 +57,11 @@ public class VMInfoParser { /** * Extract the VMInfo from the applicableIRRules string, strip away the header and return the individual key-value lines. */ - private static String[] getVMInfoLines(String applicableIRRules) { - Matcher matcher = VM_INFO_PATTERN.matcher(applicableIRRules); - TestFramework.check(matcher.find(), "Did not find VMInfo in:" + System.lineSeparator() + applicableIRRules); - String lines = matcher.group(1).trim(); - if (lines.isEmpty()) { + private static String[] getVMInfoLines(String vmInfo) { + if (vmInfo.isEmpty()) { // Nothing to IR match. return new String[0]; } - return lines.split("\\R"); + return vmInfo.split("\\R"); } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/TestVMData.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/TestVMData.java new file mode 100644 index 00000000000..413cf3347d8 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/TestVMData.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2026, 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.network; + +import compiler.lib.ir_framework.driver.irmatching.IRMatcher; +import compiler.lib.ir_framework.driver.network.testvm.java.JavaMessages; +import compiler.lib.ir_framework.shared.TestFrameworkSocket; + +/** + * This class collects all the parsed data received over the {@link TestFrameworkSocket}. This data is required later + * in the {@link IRMatcher}. + */ +public class TestVMData { + private final JavaMessages javaMessages; + private final boolean allowNotCompilable; + private final String hotspotPidFileName; + + public TestVMData(JavaMessages javaMessages, String hotspotPidFileName, boolean allowNotCompilable) { + this.javaMessages = javaMessages; + this.hotspotPidFileName = hotspotPidFileName; + this.allowNotCompilable = allowNotCompilable; + } + + public String applicableIRRules() { + return javaMessages.applicableIRRules(); + } + + public String vmInfo() { + return javaMessages.vmInfo(); + } + + public String hotspotPidFileName() { + return hotspotPidFileName; + } + + public boolean allowNotCompilable() { + return allowNotCompilable; + } + + public void printJavaMessages() { + javaMessages.print(); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/TestVmMessageReader.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/TestVmMessageReader.java new file mode 100644 index 00000000000..a203fd367f7 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/TestVmMessageReader.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2026, 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.network.testvm; + +import compiler.lib.ir_framework.driver.network.testvm.java.JavaMessageParser; +import compiler.lib.ir_framework.driver.network.testvm.java.JavaMessages; +import compiler.lib.ir_framework.shared.TestFrameworkException; +import compiler.lib.ir_framework.shared.TestFrameworkSocket; + +import java.io.BufferedReader; +import java.net.Socket; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; + +/** + * Dedicated reader for Test VM messages received by the {@link TestFrameworkSocket}. The reader is used as a task + * wrapped in a {@link Future}. The received messages are parsed with the {@link JavaMessageParser}. Once the Test VM + * is terminated, client connection is closed and the parsed messages can be fetched with {@link Future#get()} which + * calls {@link #call()}. + */ +public class TestVmMessageReader implements Callable { + private final Socket socket; + private final BufferedReader reader; + private final JavaMessageParser messageParser; + + public TestVmMessageReader(Socket socket, BufferedReader reader) { + this.socket = socket; + this.reader = reader; + this.messageParser = new JavaMessageParser(); + } + + @Override + public JavaMessages call() { + try (socket; reader) { + String line; + while ((line = reader.readLine()) != null) { + messageParser.parseLine(line); + } + return messageParser.output(); + } catch (Exception e) { + throw new TestFrameworkException("Error while reading Test VM socket messages", e); + } + } +} diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutNoProxyAsync.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/ExecutedTests.java similarity index 52% rename from test/jdk/java/net/httpclient/ConnectTimeoutNoProxyAsync.java rename to test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/ExecutedTests.java index ace12cd0295..f17d7eb5d74 100644 --- a/test/jdk/java/net/httpclient/ConnectTimeoutNoProxyAsync.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/ExecutedTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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,27 +21,35 @@ * questions. */ -import java.net.http.HttpClient.Version; -import java.time.Duration; -import org.testng.annotations.Test; +package compiler.lib.ir_framework.driver.network.testvm.java; -/* - * @test - * @summary Tests for connection related timeouts - * @bug 8208391 - * @run testng/othervm ConnectTimeoutNoProxyAsync +import compiler.lib.ir_framework.test.network.MessageTag; + +import java.util.List; + +/** + * Class to collect all Java Messages sent with tag {@link MessageTag#TEST_LIST}. These are only generated when the + * user runs with {@code -DTest=myTest} and represent the executed tests. */ +class ExecutedTests implements JavaMessage { + private final List tests; -public class ConnectTimeoutNoProxyAsync extends AbstractConnectTimeout { + public ExecutedTests(List tests) { + this.tests = tests; + } - @Test(dataProvider = "variants") @Override - public void timeoutNoProxyAsync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestduration) - { - super.timeoutNoProxyAsync(requestVersion, scheme, method, connectTimeout, requestduration); + public void print() { + if (tests.isEmpty()) { + return; + } + + System.out.println(); + System.out.println("Executed Subset of Tests"); + System.out.println("------------------------"); + for (String test : tests) { + System.out.println("- " + test); + } + System.out.println(); } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessage.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessage.java new file mode 100644 index 00000000000..7eef84dbbbc --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessage.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026, 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.network.testvm.java; + +import compiler.lib.ir_framework.shared.TestFrameworkSocket; +import compiler.lib.ir_framework.test.network.MessageTag; + +/** + * Interface for a message sent from Java code to the Driver VM via the {@link TestFrameworkSocket}. We differentiate + * between different messages depending on the leading {@link MessageTag} of a received message. + */ +public interface JavaMessage { + void print(); +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessageParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessageParser.java new file mode 100644 index 00000000000..896aef38f1f --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessageParser.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2026, 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.network.testvm.java; + +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.TestFrameworkException; +import compiler.lib.ir_framework.test.network.MessageTag; + +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static compiler.lib.ir_framework.test.network.MessageTag.*; + +/** + * Dedicated parser for {@link JavaMessages} received from the Test VM. Depending on the parsed {@link MessageTag}, the + * message is parsed differently. + */ +public class JavaMessageParser { + private static final Pattern TAG_PATTERN = Pattern.compile("^(\\[[^]]+])\\s*(.*)$"); + + private final List stdoutMessages; + private final List executedTests; + private final Map methodTimes; + private final StringBuilder vmInfoBuilder; + private final StringBuilder applicableIrRules; + + private StringBuilder currentBuilder; + + public JavaMessageParser() { + this.stdoutMessages = new ArrayList<>(); + this.methodTimes = new HashMap<>(); + this.executedTests = new ArrayList<>(); + this.vmInfoBuilder = new StringBuilder(); + this.applicableIrRules = new StringBuilder(); + this.currentBuilder = null; + } + + public void parseLine(String line) { + line = line.trim(); + Matcher tagLineMatcher = TAG_PATTERN.matcher(line); + if (tagLineMatcher.matches()) { + // New tag + assertNoActiveParser(); + parseTagLine(tagLineMatcher); + return; + } + + assertActiveParser(); + if (line.equals(END_MARKER)) { + // End tag + parseEndTag(); + return; + } + + // Multi-line message for single tag. + currentBuilder.append(line).append(System.lineSeparator()); + } + + private void assertNoActiveParser() { + TestFramework.check(currentBuilder == null, "Unexpected new tag while parsing block"); + } + + private void parseTagLine(Matcher tagLineMatcher) { + String tag = tagLineMatcher.group(1); + String message = tagLineMatcher.group(2); + switch (tag) { + case STDOUT -> stdoutMessages.add(message); + case TEST_LIST -> executedTests.add(message); + case PRINT_TIMES -> parsePrintTimes(message); + case VM_INFO -> currentBuilder = vmInfoBuilder; + case APPLICABLE_IR_RULES -> currentBuilder = applicableIrRules; + default -> throw new TestFrameworkException("unknown tag"); + } + } + + private void parsePrintTimes(String message) { + String[] split = message.split(","); + TestFramework.check(split.length == 2, "unexpected format"); + String methodName = split[0]; + try { + long duration = Long.parseLong(split[1]); + methodTimes.put(methodName, duration); + } catch (NumberFormatException e) { + throw new TestFrameworkException("invalid duration", e); + } + } + + private void assertActiveParser() { + TestFramework.check(currentBuilder != null, "Received non-tag line outside of any tag block"); + } + + private void parseEndTag() { + currentBuilder = null; + } + + public JavaMessages output() { + return new JavaMessages(new StdoutMessages(stdoutMessages), + new ExecutedTests(executedTests), + new MethodTimes(methodTimes), + applicableIrRules.toString(), + vmInfoBuilder.toString()); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessages.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessages.java new file mode 100644 index 00000000000..e47ecff4b2a --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/JavaMessages.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2026, 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.network.testvm.java; + +import compiler.lib.ir_framework.TestFramework; + +/** + * Class to collect all Java messages sent from the Test VM to the Driver VM. + */ +public class JavaMessages { + private static final boolean PRINT_APPLICABLE_IR_RULES = Boolean.parseBoolean(System.getProperty("PrintApplicableIRRules", "false")); + + private final StdoutMessages stdoutMessages; + private final ExecutedTests executedTests; + private final MethodTimes methodTimes; + private final String applicableIrRules; + private final String vmInfo; + + JavaMessages(StdoutMessages stdoutMessages, ExecutedTests executedTests, MethodTimes methodTimes, + String applicableIrRules, String vmInfo) { + this.stdoutMessages = stdoutMessages; + this.executedTests = executedTests; + this.methodTimes = methodTimes; + this.applicableIrRules = applicableIrRules; + this.vmInfo = vmInfo; + } + + public String applicableIRRules() { + return applicableIrRules; + } + + public String vmInfo() { + return vmInfo; + } + + public void print() { + stdoutMessages.print(); + methodTimes.print(); + executedTests.print(); + if (TestFramework.VERBOSE || PRINT_APPLICABLE_IR_RULES) { + System.out.println("Read Applicable IR Rules from Test VM:"); + System.out.println(applicableIrRules); + } + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/MethodTimes.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/MethodTimes.java new file mode 100644 index 00000000000..1b4cad52270 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/MethodTimes.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2026, 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.network.testvm.java; + +import compiler.lib.ir_framework.test.network.MessageTag; + +import java.util.List; +import java.util.Map; + + +/** + * Class to collect all Java Messages sent with tag {@link MessageTag#PRINT_TIMES}. These are only generated when the + * user runs with {@code -DPrintTimes=true} and represent the execution times for methods. + */ +class MethodTimes implements JavaMessage { + private final Map methodTimes; + + public MethodTimes(Map methodTimes) { + this.methodTimes = methodTimes; + } + + @Override + public void print() { + if (methodTimes.isEmpty()) { + return; + } + + System.out.println(); + System.out.println("Test Execution Times"); + System.out.println("--------------------"); + + int maxWidthNames = maxMethodNameWidth(); + int maxDurationsWidth = maxDurationsWidth(); + List> sortedMethodTimes = sortByDurationAsc(); + + for (Map.Entry entry : sortedMethodTimes) { + System.out.printf("- %-" + (maxWidthNames + 3) + "s %" + maxDurationsWidth + "d ns%n", + entry.getKey() + ":", entry.getValue()); + } + + System.out.println(); + } + + private int maxMethodNameWidth() { + return methodTimes.keySet().stream() + .mapToInt(String::length) + .max() + .orElseThrow(); + } + + private int maxDurationsWidth() { + return methodTimes.values().stream() + .mapToInt(v -> Long.toString(v).length()) + .max() + .orElseThrow(); + } + + private List> sortByDurationAsc() { + return methodTimes.entrySet().stream() + .sorted(Map.Entry.comparingByValue()) + .toList(); + } + +} diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutWithProxyAsync.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/StdoutMessages.java similarity index 52% rename from test/jdk/java/net/httpclient/ConnectTimeoutWithProxyAsync.java rename to test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/StdoutMessages.java index a6e0c22c15a..11b23ad4237 100644 --- a/test/jdk/java/net/httpclient/ConnectTimeoutWithProxyAsync.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/network/testvm/java/StdoutMessages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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,27 +21,34 @@ * questions. */ -import java.net.http.HttpClient.Version; -import java.time.Duration; -import org.testng.annotations.Test; +package compiler.lib.ir_framework.driver.network.testvm.java; -/* - * @test - * @summary Tests for connection related timeouts - * @bug 8208391 - * @run testng/othervm ConnectTimeoutWithProxyAsync +import compiler.lib.ir_framework.test.network.MessageTag; + +import java.util.List; + + +/** + * Class to collect all Java Messages sent with tag {@link MessageTag#STDOUT}. These messages are generated at various + * places in the Test VM and are unconditionally shown in the Driver VM output. */ +class StdoutMessages implements JavaMessage { + private final List messages; -public class ConnectTimeoutWithProxyAsync extends AbstractConnectTimeout { + public StdoutMessages(List messages) { + this.messages = messages; + } - @Test(dataProvider = "variants") @Override - public void timeoutWithProxyAsync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) - { - super.timeoutWithProxyAsync(requestVersion, scheme, method, connectTimeout, requestTimeout); + public void print() { + if (messages.isEmpty()) { + return; + } + System.out.println(); + System.out.println("Test VM Messages"); + System.out.println("----------------"); + for (String message : messages) { + System.out.println("- " + message); + } } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/shared/TestFrameworkSocket.java b/test/hotspot/jtreg/compiler/lib/ir_framework/shared/TestFrameworkSocket.java index f10540ebc5b..77d560952f1 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/shared/TestFrameworkSocket.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/shared/TestFrameworkSocket.java @@ -24,40 +24,27 @@ package compiler.lib.ir_framework.shared; import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.driver.network.*; +import compiler.lib.ir_framework.driver.network.testvm.TestVmMessageReader; +import compiler.lib.ir_framework.driver.network.testvm.java.JavaMessages; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.FutureTask; +import java.net.*; +import java.util.concurrent.*; /** - * Dedicated socket to send data from the flag and Test VM back to the Driver VM. + * Dedicated Driver VM socket to receive data from the Test VM. Could either be received from Java and C2 code. */ public class TestFrameworkSocket implements AutoCloseable { - public static final String STDOUT_PREFIX = "[STDOUT]"; - public static final String TESTLIST_TAG = "[TESTLIST]"; - public static final String DEFAULT_REGEX_TAG = "[DEFAULT_REGEX]"; - public static final String PRINT_TIMES_TAG = "[PRINT_TIMES]"; - public static final String NOT_COMPILABLE_TAG = "[NOT_COMPILABLE]"; - - // Static fields used for Test VM only. private static final String SERVER_PORT_PROPERTY = "ir.framework.server.port"; - private static final int SERVER_PORT = Integer.getInteger(SERVER_PORT_PROPERTY, -1); - private static final boolean REPRODUCE = Boolean.getBoolean("Reproduce"); - private static Socket clientSocket = null; - private static PrintWriter clientWriter = null; - - private final String serverPortPropertyFlag; - private FutureTask socketTask; + private final int serverSocketPort; private final ServerSocket serverSocket; - private boolean receivedStdOut = false; + private boolean running; + private final ExecutorService executor; + private Future javaFuture; public TestFrameworkSocket() { try { @@ -66,140 +53,80 @@ public class TestFrameworkSocket implements AutoCloseable { } catch (IOException e) { throw new TestFrameworkException("Failed to create TestFramework server socket", e); } - int port = serverSocket.getLocalPort(); + serverSocketPort = serverSocket.getLocalPort(); + executor = Executors.newCachedThreadPool(); if (TestFramework.VERBOSE) { - System.out.println("TestFramework server socket uses port " + port); + System.out.println("TestFramework server socket uses port " + serverSocketPort); } - serverPortPropertyFlag = "-D" + SERVER_PORT_PROPERTY + "=" + port; start(); } public String getPortPropertyFlag() { - return serverPortPropertyFlag; + return "-D" + SERVER_PORT_PROPERTY + "=" + serverSocketPort; } private void start() { - socketTask = initSocketTask(); - Thread socketThread = new Thread(socketTask); - socketThread.start(); + running = true; + executor.submit(this::acceptLoop); } /** - * Waits for a client (created by flag or Test VM) to connect. Return the messages received from the client. + * Main loop to wait for new client connections and handling them upon connection request. */ - private FutureTask initSocketTask() { - return new FutureTask<>(() -> { - try (Socket clientSocket = serverSocket.accept(); - BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())) - ) { - StringBuilder builder = new StringBuilder(); - String next; - while ((next = in.readLine()) != null) { - builder.append(next).append(System.lineSeparator()); - if (next.startsWith(STDOUT_PREFIX)) { - receivedStdOut = true; - } - } - return builder.toString(); - } catch (IOException e) { + private void acceptLoop() { + while (running) { + try { + acceptNewClientConnection(); + } catch (TestFrameworkException e) { + running = false; + throw e; + } catch (Exception e) { + running = false; throw new TestFrameworkException("Server socket error", e); } - }); + } + } + + /** + * Accept new client connection and then submit a task accordingly to manage incoming message on that connection/socket. + */ + private void acceptNewClientConnection() throws IOException { + Socket client = serverSocket.accept(); + BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream())); + submitTask(client, reader); + } + + /** + * Submit dedicated tasks which are wrapped into {@link Future} objects. The tasks will read all messages sent + * over that connection. + */ + private void submitTask(Socket client, BufferedReader reader) { + javaFuture = executor.submit(new TestVmMessageReader(client, reader)); } @Override public void close() { try { + running = false; serverSocket.close(); } catch (IOException e) { throw new TestFrameworkException("Could not close socket", e); } + executor.shutdown(); } - /** - * Only called by Test VM to write to server socket. - */ - public static void write(String msg, String tag) { - write(msg, tag, false); + public TestVMData testVmData(String hotspotPidFileName, boolean allowNotCompilable) { + JavaMessages javaMessages = testVmMessages(); + return new TestVMData(javaMessages, hotspotPidFileName, allowNotCompilable); } - /** - * Only called by Test VM to write to server socket. - *

    - * The Test VM is spawned by the main jtreg VM. The stdout of the Test VM is hidden - * unless the Verbose or ReportStdout flag is used. TestFrameworkSocket is used by the parent jtreg - * VM and the Test VM to communicate. By sending the prints through the TestFrameworkSocket with the - * parameter stdout set to true, the parent VM will print the received messages to its stdout, making it - * visible to the user. - */ - public static void write(String msg, String tag, boolean stdout) { - if (REPRODUCE) { - System.out.println("Debugging Test VM: Skip writing due to -DReproduce"); - return; - } - TestFramework.check(SERVER_PORT != -1, "Server port was not set correctly for flag and/or Test VM " - + "or method not called from flag or Test VM"); + private JavaMessages testVmMessages() { try { - // Keep the client socket open until the Test VM terminates (calls closeClientSocket before exiting main()). - if (clientSocket == null) { - clientSocket = new Socket(InetAddress.getLoopbackAddress(), SERVER_PORT); - clientWriter = new PrintWriter(clientSocket.getOutputStream(), true); - } - if (stdout) { - msg = STDOUT_PREFIX + tag + " " + msg; - } - clientWriter.println(msg); - } catch (Exception e) { - // When the Test VM is directly run, we should ignore all messages that would normally be sent to the - // Driver VM. - String failMsg = System.lineSeparator() + System.lineSeparator() + """ - ########################################################### - Did you directly run the Test VM (TestVM class) - to reproduce a bug? - => Append the flag -DReproduce=true and try again! - ########################################################### - """; - throw new TestRunException(failMsg, e); - } - if (TestFramework.VERBOSE) { - System.out.println("Written " + tag + " to socket:"); - System.out.println(msg); - } - } - - /** - * Closes (and flushes) the printer to the socket and the socket itself. Is called as last thing before exiting - * the main() method of the flag and the Test VM. - */ - public static void closeClientSocket() { - if (clientSocket != null) { - try { - clientWriter.close(); - clientSocket.close(); - } catch (IOException e) { - throw new RuntimeException("Could not close TestVM socket", e); - } - } - } - - /** - * Get the socket output of the Flag VM. - */ - public String getOutput() { - try { - return socketTask.get(); + return javaFuture.get(); } catch (ExecutionException e) { - // Thrown when socket task was not finished, yet (i.e. no client sent data) but socket was already closed. - return ""; + throw new TestFrameworkException("No test VM messages were received", e); } catch (Exception e) { - throw new TestFrameworkException("Could not read from socket task", e); + throw new TestFrameworkException("Error while fetching Test VM Future", e); } } - - /** - * Return whether Test VM sent messages to be put on stdout (starting with {@link ::STDOUT_PREFIX}). - */ - public boolean hasStdOut() { - return receivedStdOut; - } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java index 4d227900e2e..152dcab273a 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,14 +26,13 @@ package compiler.lib.ir_framework.test; import compiler.lib.ir_framework.*; import compiler.lib.ir_framework.shared.TestRun; import compiler.lib.ir_framework.shared.TestRunException; +import compiler.lib.ir_framework.test.network.TestVmSocket; import jdk.test.whitebox.WhiteBox; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import compiler.lib.ir_framework.shared.TestFrameworkSocket; - /** * Abstract super class for base, checked and custom run tests. */ @@ -118,7 +117,7 @@ abstract class AbstractTest { tryCompileMethod(test); } catch (MethodNotCompilableException e) { final Method testMethod = test.getTestMethod(); - TestFrameworkSocket.write("Method not compilable: " + testMethod, TestFrameworkSocket.NOT_COMPILABLE_TAG, true); + TestVmSocket.send("Method not compilable: " + testMethod); TestRun.check(test.isAllowNotCompilable(), "Method " + testMethod + " not compilable (anymore) at level " + test.getCompLevel() + ". Most likely, this is not expected, but if it is, you can use 'allowNotCompilable'."); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/ApplicableIRRulesPrinter.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/ApplicableIRRulesPrinter.java index 4fa1f8f3fe5..79f5c7fe18e 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/ApplicableIRRulesPrinter.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/ApplicableIRRulesPrinter.java @@ -27,6 +27,8 @@ import compiler.lib.ir_framework.IR; import compiler.lib.ir_framework.IRNode; import compiler.lib.ir_framework.TestFramework; import compiler.lib.ir_framework.shared.*; +import compiler.lib.ir_framework.test.network.MessageTag; +import compiler.lib.ir_framework.test.network.TestVmSocket; import jdk.test.lib.Platform; import jdk.test.whitebox.WhiteBox; @@ -45,9 +47,7 @@ import java.util.function.Function; * termination of the Test VM. IR rule indices start at 1. */ public class ApplicableIRRulesPrinter { - public static final String START = "##### ApplicableIRRules - used by TestFramework #####"; - public static final String END = "----- END -----"; - public static final int NO_RULE_APPLIED = -1; + public static final int NO_RULES = -1; private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); private static final List> LONG_GETTERS = Arrays.asList( @@ -110,6 +110,8 @@ public class ApplicableIRRulesPrinter { "avx512_vbmi2", "avx10_2", "bmi2", + // Intel APX + "apx_f", // AArch64 "sha3", "asimd", @@ -124,14 +126,12 @@ public class ApplicableIRRulesPrinter { "zfh", "zvbb", "zvfh", - "zvkn" + "zvkn", + // PPC64 + "darn", + "brw" )); - public ApplicableIRRulesPrinter() { - output.append(START).append(System.lineSeparator()); - output.append(",{comma separated applied @IR rule ids}").append(System.lineSeparator()); - } - /** * Emits ",{ids}" where {ids} is either: * - indices of all @IR rules that should be applied, separated by a comma @@ -158,7 +158,7 @@ public class ApplicableIRRulesPrinter { if (irAnnos.length != 0) { output.append(m.getName()); if (validRules.isEmpty()) { - output.append("," + NO_RULE_APPLIED); + output.append("," + NO_RULES); } else { for (i = 0; i < validRules.size(); i++) { output.append(",").append(validRules.get(i)); @@ -169,9 +169,8 @@ public class ApplicableIRRulesPrinter { } private void printDisableReason(String method, String reason, String[] apply, int ruleIndex, int ruleMax) { - TestFrameworkSocket.write("Disabling IR matching for rule " + ruleIndex + " of " + ruleMax + " in " + - method + ": " + reason + ": " + String.join(", ", apply), - "[ApplicableIRRules]", true); + TestVmSocket.send("Disabling IR matching for rule " + ruleIndex + " of " + ruleMax + " in " + method + ": " + + reason + ": " + String.join(", ", apply)); } private boolean shouldApplyIrRule(IR irAnno, String m, int ruleIndex, int ruleMax) { @@ -284,7 +283,7 @@ public class ApplicableIRRulesPrinter { IRNode.checkIRNodeSupported(s); } } catch (CheckedTestFrameworkException e) { - TestFrameworkSocket.write("Skip Rule " + ruleIndex + ": " + e.getMessage(), TestFrameworkSocket.DEFAULT_REGEX_TAG, true); + TestVmSocket.send("Skip Rule " + ruleIndex + ": " + e.getMessage()); return true; } return false; @@ -521,8 +520,8 @@ public class ApplicableIRRulesPrinter { } public void emit() { - output.append(END); - TestFrameworkSocket.write(output.toString(), "ApplicableIRRules"); + output.append(MessageTag.END_MARKER); + TestVmSocket.sendMultiLine(MessageTag.APPLICABLE_IR_RULES, output.toString()); } } 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 14551141cd7..ac52bcaaa98 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java @@ -26,6 +26,8 @@ package compiler.lib.ir_framework.test; import compiler.lib.ir_framework.*; import compiler.lib.ir_framework.Compiler; import compiler.lib.ir_framework.shared.*; +import compiler.lib.ir_framework.test.network.MessageTag; +import compiler.lib.ir_framework.test.network.TestVmSocket; import jdk.test.lib.Platform; import jdk.test.lib.Utils; import jdk.test.whitebox.WhiteBox; @@ -38,8 +40,6 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import static compiler.lib.ir_framework.shared.TestFrameworkSocket.PRINT_TIMES_TAG; - /** * This class' main method is called from {@link TestFramework} and represents the so-called "Test VM". The class is * the heart of the framework and is responsible for executing all the specified tests in the test class. It uses the @@ -159,6 +159,7 @@ public class TestVM { */ public static void main(String[] args) { try { + TestVmSocket.connect(); String testClassName = args[0]; System.out.println("TestVM main() called - about to run tests in class " + testClassName); Class testClass = getClassObject(testClassName, "test"); @@ -167,7 +168,7 @@ public class TestVM { framework.addHelperClasses(args); framework.start(); } finally { - TestFrameworkSocket.closeClientSocket(); + TestVmSocket.close(); } } @@ -593,8 +594,8 @@ public class TestVM { "Cannot overload @Test methods, but method " + m + " has " + overloads.size() + " overload" + (overloads.size() == 1 ? "" : "s") + ":" + overloads.stream().map(String::valueOf).collect(Collectors.joining("\n - ", "\n - ", "")) ); - TestFormat.check(!testMethodMap.containsKey(m.getName()), - "Cannot overload two @Test methods: " + m + ", " + testMethodMap.get(m.getName())); + TestFramework.check(!testMethodMap.containsKey(m.getName()), + "Cannot overload two @Test methods: " + m + ", " + testMethodMap.get(m.getName())); TestFormat.check(testAnno != null, m + " must be a method with a @Test annotation"); Check checkAnno = getAnnotation(m, Check.class); @@ -835,7 +836,6 @@ public class TestVM { * Once all framework tests are collected, they are run in this method. */ private void runTests() { - TreeMap durations = PRINT_TIMES ? new TreeMap<>() : null; long startTime = System.nanoTime(); List testList; boolean testFilterPresent = testFilterPresent(); @@ -864,7 +864,7 @@ public class TestVM { System.out.println("Run " + test.toString()); } if (testFilterPresent) { - TestFrameworkSocket.write("Run " + test.toString(), TestFrameworkSocket.TESTLIST_TAG, true); + TestVmSocket.sendWithTag(MessageTag.TEST_LIST, "Run " + test.toString()); } try { test.run(); @@ -879,10 +879,11 @@ public class TestVM { if (PRINT_TIMES) { long endTime = System.nanoTime(); long duration = (endTime - startTime); - durations.put(duration, test.getName()); if (VERBOSE) { - System.out.println("Done " + test.getName() + ": " + duration + " ns = " + (duration / 1000000) + " ms"); + System.out.println("Done " + test.getName() + ": " + duration + " ns = " + (duration / 1_000_000) + " ms"); } + // Will be correctly formatted later. + TestVmSocket.sendWithTag(MessageTag.PRINT_TIMES, test.getName() + "," + duration); } if (GC_AFTER) { System.out.println("doing GC"); @@ -890,15 +891,6 @@ public class TestVM { } } - // Print execution times - if (PRINT_TIMES) { - TestFrameworkSocket.write("Test execution times:", PRINT_TIMES_TAG, true); - for (Map.Entry entry : durations.entrySet()) { - TestFrameworkSocket.write(String.format("%-25s%15d ns%n", entry.getValue() + ":", entry.getKey()), - PRINT_TIMES_TAG, true); - } - } - if (failures > 0) { // Finally, report all occurred exceptions in a nice format. String msg = System.lineSeparator() + System.lineSeparator() + "Test Failures (" + failures + ")" diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java index 470569122dd..8fc61ee9bad 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java @@ -23,22 +23,18 @@ package compiler.lib.ir_framework.test; -import compiler.lib.ir_framework.shared.TestFrameworkSocket; +import compiler.lib.ir_framework.test.network.MessageTag; +import compiler.lib.ir_framework.test.network.TestVmSocket; 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(); @@ -64,7 +60,7 @@ public class VMInfoPrinter { .append(useAVXIsDefault ? 1 : 0) .append(System.lineSeparator()); - vmInfo.append(END_VM_INFO); - TestFrameworkSocket.write(vmInfo.toString(), "VMInfo"); + vmInfo.append(MessageTag.END_MARKER); + TestVmSocket.sendMultiLine(MessageTag.VM_INFO, vmInfo.toString()); } } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/network/MessageTag.java similarity index 66% rename from src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java rename to test/hotspot/jtreg/compiler/lib/ir_framework/test/network/MessageTag.java index 8e6b131ee9d..66b89dc122d 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/network/MessageTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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 @@ -19,21 +19,15 @@ * 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 sun.jvm.hotspot.oops; +package compiler.lib.ir_framework.test.network; -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; - -public interface MethodDataInterface { - K getKlassAtAddress(Address addr); - M getMethodAtAddress(Address addr); - void printKlassValueOn(K klass, PrintStream st); - void printMethodValueOn(M klass, PrintStream st); +public class MessageTag { + public static final String STDOUT = "[STDOUT]"; + public static final String TEST_LIST = "[TEST_LIST]"; + public static final String PRINT_TIMES = "[PRINT_TIMES]"; + public static final String VM_INFO = "[VM_INFO]"; + public static final String APPLICABLE_IR_RULES = "[APPLICABLE_IR_RULES]"; + public static final String END_MARKER = "#END#"; } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/network/TestVmSocket.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/network/TestVmSocket.java new file mode 100644 index 00000000000..37e59b9dcae --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/network/TestVmSocket.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2026, 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.network; + +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.TestRunException; +import compiler.lib.ir_framework.test.TestVM; + +import java.io.IOException; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.Socket; + +public class TestVmSocket { + private static final boolean REPRODUCE = Boolean.getBoolean("Reproduce"); + private static final String SERVER_PORT_PROPERTY = "ir.framework.server.port"; + private static final int SERVER_PORT = Integer.getInteger(SERVER_PORT_PROPERTY, -1); + + private static Socket socket = null; + private static PrintWriter writer = null; + + /** + * Send a message to the Driver VM which is unconditionally shown in the Driver VM output. + */ + public static void send(String message) { + sendWithTag(MessageTag.STDOUT, message); + } + + /** + * Send a message with multiple lines to the Driver VM with a {@link MessageTag}. Not all messages are shown by + * default in the Driver VM output and require setting some property flags first like {@code -DPrintTimes=true}. + */ + public static void sendMultiLine(String tag, String message) { + if (REPRODUCE) { + // Debugging Test VM: Skip writing due to -DReproduce; + return; + } + + TestFramework.check(socket != null, "must be connected"); + writer.println(tag + System.lineSeparator() + message); + } + + /** + * Send a message to the Driver VM with a {@link MessageTag}. Not all messages are shown by default in the + * Driver VM output and require setting some property flags first like {@code -DPrintTimes=true}. + */ + public static void sendWithTag(String tag, String message) { + if (REPRODUCE) { + // Debugging Test VM: Skip writing due to -DReproduce; + return; + } + + TestFramework.check(socket != null, "must be connected"); + writer.println(tag + " " + message); + } + + public static void connect() { + if (REPRODUCE) { + // Debugging Test VM: Skip writing due to -DReproduce; + return; + } + + TestFramework.check(SERVER_PORT != -1, "Server port was not set correctly for flag and/or test VM " + + "or method not called from flag or test VM"); + + try { + // Keep the client socket open until the test VM terminates (calls closeClientSocket before exiting main()). + socket = new Socket(InetAddress.getLoopbackAddress(), SERVER_PORT); + writer = new PrintWriter(socket.getOutputStream(), true); + } catch (Exception e) { + // When the test VM is directly run, we should ignore all messages that would normally be sent to the + // driver VM. + String failMsg = System.lineSeparator() + System.lineSeparator() + """ + ########################################################### + Did you directly run the test VM (TestVM class) + to reproduce a bug? + => Append the flag -DReproduce=true and try again! + ########################################################### + """; + throw new TestRunException(failMsg, e); + } + + } + + /** + * Closes (and flushes) the printer to the socket and the socket itself. Is called as last thing before exiting + * the main() method of the flag and the test VM. + */ + public static void close() { + if (socket != null) { + writer.close(); + try { + socket.close(); + } catch (IOException e) { + throw new RuntimeException("Could not close TestVM socket", e); + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/lib/template_framework/Renderer.java b/test/hotspot/jtreg/compiler/lib/template_framework/Renderer.java index 61ab9ab343c..cb83a5ea40c 100644 --- a/test/hotspot/jtreg/compiler/lib/template_framework/Renderer.java +++ b/test/hotspot/jtreg/compiler/lib/template_framework/Renderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -413,8 +413,39 @@ final class Renderer { } } + /** + * Finds the index where the next replacement pattern after {@code start} begins while skipping + * over "$$" and "##". + * + * @param s string to search for replacements + * @param start index from which to start searching + * @return the index of the beginning of the next replacement pattern or the length of {@code s} + */ + private int findNextReplacement(final String s, final int start) { + int next = start; + for (int potentialStart = start; potentialStart < s.length() && s.charAt(next) == s.charAt(potentialStart); potentialStart = next + 1) { + // If this is not the first iteration, we have found a doubled up "$" or "#" and need to skip + // over the second instance. + if (potentialStart != start) { + potentialStart += 1; + } + // Find the next "$" or "#", after the potential start. + int dollar = s.indexOf("$", potentialStart); + int hashtag = s.indexOf("#", potentialStart); + // If the character was not found, we want to have the rest of the + // String s, so instead of "-1" take the end/length of the String. + dollar = (dollar == -1) ? s.length() : dollar; + hashtag = (hashtag == -1) ? s.length() : hashtag; + // Take the first one. + next = Math.min(dollar, hashtag); + } + + return next; + } + /** * We split a {@link String} by "#" and "$", and then look at each part. + * However, we escape "##" to "#" and "$$" to "$". * Example: * * s: "abcdefghijklmnop #name abcdefgh${var_name} 12345#{name2}_con $field_name something" @@ -428,16 +459,19 @@ final class Renderer { int start = 0; boolean startIsAfterDollar = false; do { - // Find the next "$" or "#", after start. - int dollar = s.indexOf("$", start); - int hashtag = s.indexOf("#", start); - // If the character was not found, we want to have the rest of the - // String s, so instead of "-1" take the end/length of the String. - dollar = (dollar == -1) ? s.length() : dollar; - hashtag = (hashtag == -1) ? s.length() : hashtag; - // Take the first one. - int next = Math.min(dollar, hashtag); + int next = findNextReplacement(s, start); + + // Detect most zero sized replacement patterns, i.e. "$#" or "#$", for better error reporting. + if (next < s.length() - 2 && ((s.charAt(next) == '$' && s.charAt(next + 1) == '#') || + (s.charAt(next) == '#' && s.charAt(next + 1) == '$'))) { + String pattern = s.substring(next, next + 2); + throw new RendererException("Found zero sized replacement pattern '" + pattern + "'."); + } + String part = s.substring(start, next); + // Escape doubled up replacement characters. + part = part.replace("##", "#"); + part = part.replace("$$", "$"); if (count == 0) { // First part has no "#" or "$" before it. @@ -452,8 +486,8 @@ final class Renderer { // terminate now. return; } - start = next + 1; // skip over the "#" or "$" - startIsAfterDollar = next == dollar; // remember which character we just split with + start = next + 1; + startIsAfterDollar = s.charAt(next) == '$'; // remember which character we just split with count++; } while (true); } diff --git a/test/hotspot/jtreg/compiler/lib/template_framework/Template.java b/test/hotspot/jtreg/compiler/lib/template_framework/Template.java index f245cda0501..3cd3a9097ff 100644 --- a/test/hotspot/jtreg/compiler/lib/template_framework/Template.java +++ b/test/hotspot/jtreg/compiler/lib/template_framework/Template.java @@ -160,7 +160,8 @@ import compiler.lib.ir_framework.TestFramework; * arguments into the strings. But since string templates are not (yet) available, the Templates provide * hashtag replacements in the {@link String}s: the Template argument names are captured, and * the argument values automatically replace any {@code "#name"} in the {@link String}s. See the different overloads - * of {@link #make} for examples. Additional hashtag replacements can be defined with {@link #let}. + * of {@link #make} for examples. Additional hashtag replacements can be defined with {@link #let}. If a "#" is needed + * in the code, hashtag replacmement can be escaped by writing two hashtags, i.e. "##" will render as "#". * We have decided to keep hashtag replacements constrained to the scope of one Template. They * do not escape to outer or inner Template uses. If one needs to pass values to inner Templates, * this can be done with Template arguments. Keeping hashtag replacements local to Templates @@ -172,7 +173,8 @@ import compiler.lib.ir_framework.TestFramework; * For this, Templates provide dollar replacements, which automatically rename any * {@code "$name"} in the {@link String} with a {@code "name_ID"}, where the {@code "ID"} is unique for every use of * a Template. The dollar replacement can also be captured with {@link #$}, and passed to nested - * Templates, which allows sharing of these identifier names between Templates. + * Templates, which allows sharing of these identifier names between Templates. Similar to hashtag replacements, + * dollars can be escaped by doubling up, i.e. "$$" renders as "$". * *

    * The dollar and hashtag names must have at least one character. The first character must be a letter diff --git a/test/hotspot/jtreg/compiler/lib/template_framework/library/PrimitiveType.java b/test/hotspot/jtreg/compiler/lib/template_framework/library/PrimitiveType.java index b789da45d44..c8541ac1fa6 100644 --- a/test/hotspot/jtreg/compiler/lib/template_framework/library/PrimitiveType.java +++ b/test/hotspot/jtreg/compiler/lib/template_framework/library/PrimitiveType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -141,6 +141,35 @@ public final class PrimitiveType implements CodeGenerationDataNameType { }; } + /** + * Provides the field descriptor for primitive types as per JVMS§4.3.2. + * + * @return the field descriptor of the type. + */ + public String fieldDesc() { + return switch (kind) { + case LONG -> "J"; + case BOOLEAN -> "Z"; + default -> boxedTypeName().substring(0, 1); + }; + } + + /** + * Provides the abbreviation of the type as it would be used for node classes in the + * IR-Framework. Note the the abbreviations for boolean and char are used inconsistently. + * This method maps boolean to "UB", even though it might sometimes be mapped under "B" since + * it is loaded as a byte, and char to "C", even though it might sometimes be mapped to "US" + * for "unsigned short". + * + * @return the abbreviation of the type. + */ + public String abbrev() { + return switch (kind) { + case BOOLEAN -> "UB"; + default -> boxedTypeName().substring(0, 1); + }; + } + /** * Indicates if the type is a floating point type. * diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java index 0e17489e1c8..873533aaba8 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,7 +34,7 @@ import java.nio.ByteOrder; /* * @test - * @bug 8325155 + * @bug 8325155 8342095 * @key randomness * @summary Test some cases that vectorize after the removal of the alignment boundaries code. * Now, we instead check if use-def connections have compatible type size. @@ -106,6 +106,22 @@ public class TestCompatibleUseDefTypeSize { tests.put("test9", () -> { return test9(aL.clone(), bD.clone()); }); tests.put("test10", () -> { return test10(aL.clone(), bD.clone()); }); tests.put("test11", () -> { return test11(aC.clone()); }); + tests.put("testByteToInt", () -> { return testByteToInt(aB.clone(), bI.clone()); }); + tests.put("testByteToShort", () -> { return testByteToShort(aB.clone(), bS.clone()); }); + tests.put("testByteToChar", () -> { return testByteToChar(aB.clone(), bC.clone()); }); + tests.put("testByteToLong", () -> { return testByteToLong(aB.clone(), bL.clone()); }); + tests.put("testShortToByte", () -> { return testShortToByte(aS.clone(), bB.clone()); }); + tests.put("testShortToChar", () -> { return testShortToChar(aS.clone(), bC.clone()); }); + tests.put("testShortToInt", () -> { return testShortToInt(aS.clone(), bI.clone()); }); + tests.put("testShortToLong", () -> { return testShortToLong(aS.clone(), bL.clone()); }); + tests.put("testIntToShort", () -> { return testIntToShort(aI.clone(), bS.clone()); }); + tests.put("testIntToChar", () -> { return testIntToChar(aI.clone(), bC.clone()); }); + tests.put("testIntToByte", () -> { return testIntToByte(aI.clone(), bB.clone()); }); + tests.put("testIntToLong", () -> { return testIntToLong(aI.clone(), bL.clone()); }); + tests.put("testLongToByte", () -> { return testLongToByte(aL.clone(), bB.clone()); }); + tests.put("testLongToShort", () -> { return testLongToShort(aL.clone(), bS.clone()); }); + tests.put("testLongToChar", () -> { return testLongToChar(aL.clone(), bC.clone()); }); + tests.put("testLongToInt", () -> { return testLongToInt(aL.clone(), bI.clone()); }); // Compute gold value for all test methods before compilation for (Map.Entry entry : tests.entrySet()) { @@ -128,7 +144,23 @@ public class TestCompatibleUseDefTypeSize { "test8", "test9", "test10", - "test11"}) + "test11", + "testByteToInt", + "testByteToShort", + "testByteToChar", + "testByteToLong", + "testShortToByte", + "testShortToChar", + "testShortToInt", + "testShortToLong", + "testIntToShort", + "testIntToChar", + "testIntToByte", + "testIntToLong", + "testLongToByte", + "testLongToShort", + "testLongToChar", + "testLongToInt"}) public void runTests() { for (Map.Entry entry : tests.entrySet()) { String name = entry.getKey(); @@ -328,12 +360,12 @@ public class TestCompatibleUseDefTypeSize { } @Test - @IR(counts = {IRNode.STORE_VECTOR, "= 0"}, + @IR(counts = {IRNode.STORE_VECTOR, "> 0"}, applyIfPlatform = {"64-bit", "true"}, - applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"}) + applyIf = {"AlignVector", "false"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}) // "inflate" method: 1 byte -> 2 byte. // Java scalar code has no explicit conversion. - // Vector code would need a conversion. We may add this in the future. static Object[] test1(byte[] src, char[] dst) { for (int i = 0; i < src.length; i++) { dst[i] = (char)(src[i]); @@ -478,4 +510,201 @@ public class TestCompatibleUseDefTypeSize { } return new Object[]{ a, new char[] { m } }; } + + // Narrowing + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) + public Object[] testIntToShort(int[] ints, short[] res) { + for (int i = 0; i < ints.length; i++) { + res[i] = (short) ints[i]; + } + + return new Object[] { ints, res }; + } + + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_char)", ">0" }) + public Object[] testIntToChar(int[] ints, char[] res) { + for (int i = 0; i < ints.length; i++) { + res[i] = (char) ints[i]; + } + + return new Object[] { ints, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", ">0" }) + public Object[] testIntToByte(int[] ints, byte[] res) { + for (int i = 0; i < ints.length; i++) { + res[i] = (byte) ints[i]; + } + + return new Object[] { ints, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE + "min(max_short, max_byte)", ">0" }) + public Object[] testShortToByte(short[] shorts, byte[] res) { + for (int i = 0; i < shorts.length; i++) { + res[i] = (byte) shorts[i]; + } + + return new Object[] { shorts, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx2", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE + "min(max_long, max_byte)", ">0" }) + public Object[] testLongToByte(long[] longs, byte[] res) { + for (int i = 0; i < longs.length; i++) { + res[i] = (byte) longs[i]; + } + + return new Object[] { longs, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE + "min(max_long, max_short)", ">0" }) + public Object[] testLongToShort(long[] longs, short[] res) { + for (int i = 0; i < longs.length; i++) { + res[i] = (short) longs[i]; + } + + return new Object[] { longs, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE + "min(max_long, max_char)", ">0" }) + public Object[] testLongToChar(long[] longs, char[] res) { + for (int i = 0; i < longs.length; i++) { + res[i] = (char) longs[i]; + } + + return new Object[] { longs, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE + "min(max_long, max_int)", ">0" }) + public Object[] testLongToInt(long[] longs, int[] res) { + for (int i = 0; i < longs.length; i++) { + res[i] = (int) longs[i]; + } + + return new Object[] { longs, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.STORE_VECTOR, ">0" }) + public Object[] testShortToChar(short[] shorts, char[] res) { + for (int i = 0; i < shorts.length; i++) { + res[i] = (char) shorts[i]; + } + + return new Object[] { shorts, res }; + } + + // Widening + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE + "min(max_short, max_int)", ">0" }) + public Object[] testShortToInt(short[] shorts, int[] res) { + for (int i = 0; i < shorts.length; i++) { + res[i] = shorts[i]; + } + + return new Object[] { shorts, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE + "min(max_byte, max_int)", ">0" }) + public Object[] testByteToInt(byte[] bytes, int[] res) { + for (int i = 0; i < bytes.length; i++) { + res[i] = bytes[i]; + } + + return new Object[] { bytes, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE + "min(max_byte, max_short)", ">0" }) + public Object[] testByteToShort(byte[] bytes, short[] res) { + for (int i = 0; i < bytes.length; i++) { + res[i] = bytes[i]; + } + + return new Object[] { bytes, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE + "min(max_byte, max_char)", ">0" }) + public Object[] testByteToChar(byte[] bytes, char[] res) { + for (int i = 0; i < bytes.length; i++) { + res[i] = (char) bytes[i]; + } + + return new Object[] { bytes, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx2", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE + "min(max_byte, max_long)", ">0" }) + public Object[] testByteToLong(byte[] bytes, long[] res) { + for (int i = 0; i < bytes.length; i++) { + res[i] = bytes[i]; + } + + return new Object[] { bytes, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE + "min(max_short, max_long)", ">0" }) + public Object[] testShortToLong(short[] shorts, long[] res) { + for (int i = 0; i < shorts.length; i++) { + res[i] = shorts[i]; + } + + return new Object[] { shorts, res }; + } + + @Test + @IR(applyIfCPUFeatureOr = { "avx", "true", "asimd", "true", "rvv", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0" }) + public Object[] testIntToLong(int[] ints, long[] res) { + for (int i = 0; i < ints.length; i++) { + res[i] = ints[i]; + } + + return new Object[] { ints, res }; + } } diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestReductions.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestReductions.java index 1cd5cfa1e75..9d674950499 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestReductions.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestReductions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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 id=no-vectorization - * @bug 8340093 + * @bug 8340093 8342095 * @summary Test vectorization of reduction loops. * @library /test/lib / * @run driver compiler.loopopts.superword.TestReductions P0 @@ -31,7 +31,7 @@ /* * @test id=vanilla - * @bug 8340093 + * @bug 8340093 8342095 * @summary Test vectorization of reduction loops. * @library /test/lib / * @run driver compiler.loopopts.superword.TestReductions P1 @@ -39,7 +39,7 @@ /* * @test id=force-vectorization - * @bug 8340093 + * @bug 8340093 8342095 * @summary Test vectorization of reduction loops. * @library /test/lib / * @run driver compiler.loopopts.superword.TestReductions P2 @@ -455,7 +455,13 @@ public class TestReductions { // ---------byte***Simple ------------------------------------------------------------ @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.AND_REDUCTION_V, "> 0", + IRNode.AND_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteAndSimple() { byte acc = (byte)0xFF; // neutral element for (int i = 0; i < SIZE; i++) { @@ -466,7 +472,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.OR_REDUCTION_V, "> 0", + IRNode.OR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteOrSimple() { byte acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -477,7 +489,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.XOR_REDUCTION_V, "> 0", + IRNode.XOR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteXorSimple() { byte acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -510,7 +528,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.MIN_REDUCTION_V, "> 0", + IRNode.MIN_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteMinSimple() { byte acc = Byte.MAX_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -521,7 +545,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.MAX_REDUCTION_V, "> 0", + IRNode.MAX_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteMaxSimple() { byte acc = Byte.MIN_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -533,7 +563,13 @@ public class TestReductions { // ---------byte***DotProduct ------------------------------------------------------------ @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.AND_REDUCTION_V, "> 0", + IRNode.AND_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteAndDotProduct() { byte acc = (byte)0xFF; // neutral element for (int i = 0; i < SIZE; i++) { @@ -544,7 +580,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.OR_REDUCTION_V, "> 0", + IRNode.OR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteOrDotProduct() { byte acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -555,7 +597,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.XOR_REDUCTION_V, "> 0", + IRNode.XOR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteXorDotProduct() { byte acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -588,7 +636,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.MIN_REDUCTION_V, "> 0", + IRNode.MIN_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteMinDotProduct() { byte acc = Byte.MAX_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -599,7 +653,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.MAX_REDUCTION_V, "> 0", + IRNode.MAX_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteMaxDotProduct() { byte acc = Byte.MIN_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -611,7 +671,13 @@ public class TestReductions { // ---------byte***Big ------------------------------------------------------------ @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.AND_REDUCTION_V, "> 0", + IRNode.AND_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteAndBig() { byte acc = (byte)0xFF; // neutral element for (int i = 0; i < SIZE; i++) { @@ -622,7 +688,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.OR_REDUCTION_V, "> 0", + IRNode.OR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteOrBig() { byte acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -633,7 +705,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.XOR_REDUCTION_V, "> 0", + IRNode.XOR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteXorBig() { byte acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -666,7 +744,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.MIN_REDUCTION_V, "> 0", + IRNode.MIN_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteMinBig() { byte acc = Byte.MAX_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -677,7 +761,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_B) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.MAX_REDUCTION_V, "> 0", + IRNode.MAX_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_B, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static byte byteMaxBig() { byte acc = Byte.MIN_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -923,7 +1013,13 @@ public class TestReductions { // ---------short***Simple ------------------------------------------------------------ @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.AND_REDUCTION_V, "> 0", + IRNode.AND_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortAndSimple() { short acc = (short)0xFFFF; // neutral element for (int i = 0; i < SIZE; i++) { @@ -934,7 +1030,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.OR_REDUCTION_V, "> 0", + IRNode.OR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortOrSimple() { short acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -945,7 +1047,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.XOR_REDUCTION_V, "> 0", + IRNode.XOR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortXorSimple() { short acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -978,7 +1086,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.MIN_REDUCTION_V, "> 0", + IRNode.MIN_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortMinSimple() { short acc = Short.MAX_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -989,7 +1103,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.MAX_REDUCTION_V, "> 0", + IRNode.MAX_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortMaxSimple() { short acc = Short.MIN_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1001,7 +1121,13 @@ public class TestReductions { // ---------short***DotProduct ------------------------------------------------------------ @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.AND_REDUCTION_V, "> 0", + IRNode.AND_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortAndDotProduct() { short acc = (short)0xFFFF; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1012,7 +1138,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.OR_REDUCTION_V, "> 0", + IRNode.OR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortOrDotProduct() { short acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1023,7 +1155,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.XOR_REDUCTION_V, "> 0", + IRNode.XOR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortXorDotProduct() { short acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1056,7 +1194,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.MIN_REDUCTION_V, "> 0", + IRNode.MIN_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortMinDotProduct() { short acc = Short.MAX_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1067,7 +1211,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.MAX_REDUCTION_V, "> 0", + IRNode.MAX_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortMaxDotProduct() { short acc = Short.MIN_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1079,7 +1229,13 @@ public class TestReductions { // ---------short***Big ------------------------------------------------------------ @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.AND_REDUCTION_V, "> 0", + IRNode.AND_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortAndBig() { short acc = (short)0xFFFF; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1090,7 +1246,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.OR_REDUCTION_V, "> 0", + IRNode.OR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortOrBig() { short acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1101,7 +1263,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.XOR_REDUCTION_V, "> 0", + IRNode.XOR_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortXorBig() { short acc = 0; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1134,7 +1302,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.MIN_REDUCTION_V, "> 0", + IRNode.MIN_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortMinBig() { short acc = Short.MAX_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { @@ -1145,7 +1319,13 @@ public class TestReductions { } @Test - @IR(failOn = IRNode.LOAD_VECTOR_S) // does not vectorize for now, might in the future. + @IR(counts = {IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.MAX_REDUCTION_V, "> 0", + IRNode.MAX_VI, "> 0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"}, + applyIf = {"AutoVectorizationOverrideProfitability", "> 0"}) + @IR(failOn = IRNode.LOAD_VECTOR_S, + applyIf = {"AutoVectorizationOverrideProfitability", "= 0"}) private static short shortMaxBig() { short acc = Short.MIN_VALUE; // neutral element for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java b/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java index 19eb98af3ba..0693d6b3df0 100644 --- a/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java +++ b/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java @@ -157,7 +157,7 @@ public class Helper { } public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { - StringUTF16.inflate(src, srcOff, dst, dstOff, len); + StringLatin1.inflate(src, srcOff, dst, dstOff, len); } public static int indexOf(byte[] src, int srcCount, diff --git a/test/hotspot/jtreg/compiler/uncommontrap/TestPrintDiagnosticsWithoutProfileTraps.java b/test/hotspot/jtreg/compiler/uncommontrap/TestPrintDiagnosticsWithoutProfileTraps.java new file mode 100644 index 00000000000..51b30219aca --- /dev/null +++ b/test/hotspot/jtreg/compiler/uncommontrap/TestPrintDiagnosticsWithoutProfileTraps.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2026, 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 8374807 + * @summary Regression test for -XX:+TraceDeoptimization -XX:-ProfileTraps + * -XX:-TieredCompilation -Xcomp crash + * @modules java.base/jdk.internal.misc + * @requires vm.debug + * @run main/othervm -XX:+TraceDeoptimization -XX:-ProfileTraps + * -XX:-TieredCompilation -Xcomp -Xbatch + * -XX:CompileCommand=compileonly,compiler.uncommontrap.TestPrintDiagnosticsWithoutProfileTraps::test + * compiler.uncommontrap.TestPrintDiagnosticsWithoutProfileTraps + */ + +package compiler.uncommontrap; + +import jdk.internal.misc.Unsafe; + +public class TestPrintDiagnosticsWithoutProfileTraps { + static final Unsafe UNSAFE=Unsafe.getUnsafe(); + static volatile long sink; + + static class TestSubClass { + int f; + } + + static void test(){ + // Trigger a deopt/uncommon-trap path while resolving the field offset. + sink = UNSAFE.objectFieldOffset(TestSubClass.class,"f"); + } + + public static void main(String[] args) { + test(); + System.out.println("passed"); + } +} \ No newline at end of file diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java new file mode 100644 index 00000000000..f7837e1abfa --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLibraryUnaryOpAndBinaryOp.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, NTT DATA + * 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.vectorapi; + +import compiler.lib.ir_framework.*; +import jdk.incubator.vector.*; + +/** + * @test + * @bug 8378312 + * @library /test/lib / + * @summary VectorAPI: libraryUnaryOp and libraryBinaryOp should be intrinsified. + * @modules jdk.incubator.vector + * + * @run driver compiler.vectorapi.TestVectorLibraryUnaryOpAndBinaryOp + */ + +public class TestVectorLibraryUnaryOpAndBinaryOp { + + @Test + @IR(counts = { IRNode.CALL_LEAF_VECTOR, "= 1" }, applyIfCPUFeatureOr = { "asimd", "true", "avx", "true" }) + public static void testUnary() { + var vec = FloatVector.broadcast(FloatVector.SPECIES_128, 3.14f); + vec.lanewise(VectorOperators.COS); + } + + @Test + @IR(counts = { IRNode.CALL_LEAF_VECTOR, "= 1" }, applyIfCPUFeatureOr = { "asimd", "true", "avx", "true" }) + public static void testBinary() { + var vec = FloatVector.broadcast(FloatVector.SPECIES_128, 2.0f); + vec.lanewise(VectorOperators.HYPOT, 1.0f); + } + + public static void main(String[] args) { + TestFramework testFramework = new TestFramework(); + testFramework.addFlags("--add-modules=jdk.incubator.vector") + .start(); + } + +} diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java index c603f450d0c..71507bde7c0 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2025, 2026, NVIDIA CORPORATION & 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 @@ import jdk.incubator.vector.*; import jdk.test.lib.Asserts; /** - * @test 8371603 + * @test 8371603 8378239 * @key randomness * @library /test/lib / * @summary Test the missing optimization issues for vector load/store caused by JDK-8286941 @@ -96,6 +96,14 @@ public class TestVectorLoadStoreOptimization { } } + // Test that store a value that is just loaded from the same memory location is elided + @Test + @IR(failOn = IRNode.STORE_VECTOR, + applyIfCPUFeatureOr = {"asimd", "true", "avx", "true", "rvv", "true"}) + public static void testStoreVector2() { + IntVector.fromArray(SPECIES, a, 0).intoArray(a, 0); + } + public static void main(String[] args) { TestFramework testFramework = new TestFramework(); testFramework.setDefaultWarmup(10000) diff --git a/test/hotspot/jtreg/compiler/vectorization/TestRotateByteAndShortVector.java b/test/hotspot/jtreg/compiler/vectorization/TestRotateByteAndShortVector.java index e130fc0ba6c..79cde2f0d26 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestRotateByteAndShortVector.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestRotateByteAndShortVector.java @@ -1,6 +1,7 @@ /* * Copyright (c) 2022, 2025 Loongson Technology Co. Ltd. All rights reserved. * Copyright (c) 2025, Rivos Inc. All rights reserved. + * Copyright (c) 2026, 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 +25,7 @@ /** * @test - * @bug 8286847 8353600 + * @bug 8286847 8353600 8342095 * @key randomness * @summary Test vectorization of rotate byte and short * @library /test/lib / @@ -116,11 +117,10 @@ public class TestRotateByteAndShortVector { } } - // NOTE: currently, there is no platform supporting RotateLeftV/RotateRightV intrinsic. - // If there is some implementation, it could probably in a wrong way which is different - // from what java language spec expects. @Test - @IR(failOn = { IRNode.ROTATE_LEFT_V }) + @IR(counts = { IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.ROTATE_LEFT_V, "> 0" }, + applyIfCPUFeature = {"avx512f", "true"}) @IR(failOn = { IRNode.ROTATE_RIGHT_V }) static void testRotateLeftByte(byte[] test, byte[] arr, int shift) { for (int i = 0; i < ARRLEN; i++) { @@ -130,7 +130,9 @@ public class TestRotateByteAndShortVector { @Test @IR(failOn = { IRNode.ROTATE_LEFT_V }) - @IR(failOn = { IRNode.ROTATE_RIGHT_V }) + @IR(counts = { IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0", + IRNode.ROTATE_RIGHT_V, "> 0" }, + applyIfCPUFeature = {"avx512f", "true"}) static void testRotateRightByte(byte[] test, byte[] arr, int shift) { for (int i = 0; i < ARRLEN; i++) { test[i] = (byte) ((arr[i] >>> shift) | (arr[i] << -shift)); @@ -138,7 +140,9 @@ public class TestRotateByteAndShortVector { } @Test - @IR(failOn = { IRNode.ROTATE_LEFT_V }) + @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.ROTATE_LEFT_V, "> 0" }, + applyIfCPUFeature = {"avx512f", "true"}) @IR(failOn = { IRNode.ROTATE_RIGHT_V }) static void testRotateLeftShort(short[] test, short[] arr, int shift) { for (int i = 0; i < ARRLEN; i++) { @@ -148,7 +152,9 @@ public class TestRotateByteAndShortVector { @Test @IR(failOn = { IRNode.ROTATE_LEFT_V }) - @IR(failOn = { IRNode.ROTATE_RIGHT_V }) + @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0", + IRNode.ROTATE_RIGHT_V, "> 0" }, + applyIfCPUFeature = {"avx512f", "true"}) static void testRotateRightShort(short[] test, short[] arr, int shift) { for (int i = 0; i < ARRLEN; i++) { test[i] = (short) ((arr[i] >>> shift) | (arr[i] << -shift)); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestSubwordTruncation.java b/test/hotspot/jtreg/compiler/vectorization/TestSubwordTruncation.java index 53c1b89a203..2f6296e41d2 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestSubwordTruncation.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestSubwordTruncation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.g * 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 @@ import compiler.lib.generators.*; /* * @test - * @bug 8350177 8362171 8369881 + * @bug 8350177 8362171 8369881 8342095 * @summary Ensure that truncation of subword vectors produces correct results * @library /test/lib / * @run driver compiler.vectorization.TestSubwordTruncation @@ -73,7 +73,8 @@ public class TestSubwordTruncation { // Shorts @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupShortArray") public Object[] testShortLeadingZeros(short[] in) { short[] res = new short[SIZE]; @@ -98,7 +99,8 @@ public class TestSubwordTruncation { } @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupShortArray") public Object[] testShortTrailingZeros(short[] in) { short[] res = new short[SIZE]; @@ -123,7 +125,8 @@ public class TestSubwordTruncation { } @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupShortArray") public Object[] testShortReverse(short[] in) { short[] res = new short[SIZE]; @@ -148,7 +151,8 @@ public class TestSubwordTruncation { } @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupShortArray") public Object[] testShortBitCount(short[] in) { short[] res = new short[SIZE]; @@ -277,7 +281,8 @@ public class TestSubwordTruncation { // Bytes @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupByteArray") public Object[] testByteLeadingZeros(byte[] in) { byte[] res = new byte[SIZE]; @@ -302,7 +307,8 @@ public class TestSubwordTruncation { } @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupByteArray") public Object[] testByteTrailingZeros(byte[] in) { byte[] res = new byte[SIZE]; @@ -327,7 +333,8 @@ public class TestSubwordTruncation { } @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupByteArray") public Object[] testByteReverse(byte[] in) { byte[] res = new byte[SIZE]; @@ -403,7 +410,8 @@ public class TestSubwordTruncation { @Test - @IR(counts = { IRNode.STORE_VECTOR, "=0" }) + @IR(counts = { IRNode.LOAD_VECTOR_B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", "> 0" }, + applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true", "zvbb", "true" }) @Arguments(setup = "setupByteArray") public Object[] testByteBitCount(byte[] in) { byte[] res = new byte[SIZE]; diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java index 1f0c8e668b7..a0434411da7 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java @@ -247,9 +247,8 @@ public class ArrayShiftOpTest extends VectorizationTestRunner { } @Test - // Note that right shift operations on subword expressions cannot be - // vectorized since precise type info about signedness is missing. - @IR(failOn = {IRNode.STORE_VECTOR}) + @IR(applyIfCPUFeature = {"avx", "true"}, + counts = {IRNode.RSHIFT_VI, ">0"}) public short[] subwordExpressionRightShift() { 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 d3119a00c37..f9c5f6199f1 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023, Arm Limited. All rights reserved. - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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 + * @bug 8183390 8340010 8342095 * @summary Vectorization test on array type conversions * @library /test/lib / * @@ -108,10 +109,9 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { // ---------------- Integer Extension ---------------- @Test - @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. - // Assert the vectorization failure so that we are reminded to update - // the test when this limitation is addressed in the future. + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) public int[] signExtension() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -122,7 +122,7 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { @Test @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. + // Subword vector casts with char do not work currently, see JDK-8349562. // Assert the vectorization failure so that we are reminded to update // the test when this limitation is addressed in the future. public int[] zeroExtension() { @@ -134,10 +134,9 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { } @Test - @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. - // Assert the vectorization failure so that we are reminded to update - // the test when this limitation is addressed in the future. + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", ">0" }) public int[] signExtensionFromByte() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,12 +145,23 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { return res; } + @Test + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE + "min(max_short, max_byte)", ">0" }) + public short[] signExtensionFromByteToShort() { + short[] res = new short[SIZE]; + for (int i = 0; i < SIZE; i++) { + res[i] = bytes[i]; + } + return res; + } + // ---------------- Integer Narrow ---------------- @Test - @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. - // Assert the vectorization failure so that we are reminded to update - // the test when this limitation is addressed in the future. + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) public short[] narrowToSigned() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -161,10 +171,9 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { } @Test - @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. - // Assert the vectorization failure so that we are reminded to update - // the test when this limitation is addressed in the future. + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_char)", ">0" }) public char[] narrowToUnsigned() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -174,11 +183,10 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { } @Test - @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. - // Assert the vectorization failure so that we are reminded to update - // the test when this limitation is addressed in the future. - public byte[] NarrowToByte() { + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE + "min(max_int, max_byte)", ">0" }) + public byte[] narrowToByte() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { res[i] = (byte) ints[i]; @@ -186,6 +194,18 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { return res; } + @Test + @IR(applyIfCPUFeature = { "avx", "true" }, + applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"}, + counts = { IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE + "min(max_short, max_byte)", ">0" }) + public byte[] narrowShortToByte() { + byte[] res = new byte[SIZE]; + for (int i = 0; i < SIZE; i++) { + res[i] = (byte) shorts[i]; + } + return res; + } + // ---------------- Convert I/L to F/D ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true", "rvv", "true"}, @@ -268,7 +288,7 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { @Test @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. + // Subword vector casts with char do not work currently, see JDK-8349562. // Assert the vectorization failure so that we are reminded to update // the test when this limitation is addressed in the future. public float[] convertCharToFloat() { @@ -281,7 +301,7 @@ public class ArrayTypeConvertTest extends VectorizationTestRunner { @Test @IR(failOn = {IRNode.STORE_VECTOR}) - // Subword vector casts do not work currently, see JDK-8342095. + // Subword vector casts with char do not work currently, see JDK-8349562. // Assert the vectorization failure so that we are reminded to update // the test when this limitation is addressed in the future. public double[] convertCharToDouble() { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java index 63739584558..b957a00278a 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, 2023, Arm Limited. All rights reserved. + * Copyright (c) 2026, 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,6 +24,7 @@ /* * @test + * @bug 8183390 8342095 * @summary Vectorization test on basic short operations * @library /test/lib / * @@ -210,10 +212,10 @@ public class BasicShortOpTest extends VectorizationTestRunner { return res; } + // Min/Max vectorization requires a cast from subword to int and back to subword, to avoid losing the higher order bits. + @Test - // Note that min operations on subword types cannot be vectorized - // because higher bits will be lost. - @IR(failOn = {IRNode.STORE_VECTOR}) + @IR(applyIfCPUFeature = { "avx", "true" }, counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) public short[] vectorMin() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -223,9 +225,7 @@ public class BasicShortOpTest extends VectorizationTestRunner { } @Test - // Note that max operations on subword types cannot be vectorized - // because higher bits will be lost. - @IR(failOn = {IRNode.STORE_VECTOR}) + @IR(applyIfCPUFeature = { "avx", "true" }, counts = { IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", ">0" }) public short[] vectorMax() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java b/test/hotspot/jtreg/gc/arguments/TestMaxRAMPercentage.java similarity index 73% rename from test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java rename to test/hotspot/jtreg/gc/arguments/TestMaxRAMPercentage.java index e7b2f371ed6..0cf34a0d239 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMaxRAMFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestMaxRAMPercentage.java @@ -24,10 +24,9 @@ package gc.arguments; /* - * @test TestMaxRAMFlags + * @test TestMaxRAMPercentage * @bug 8222252 - * @summary Verify correct MaxHeapSize and UseCompressedOops when MaxRAM and MaxRAMPercentage - * are specified. + * @summary Verify correct MaxHeapSize and UseCompressedOops when MaxRAMPercentage is specified * @library /test/lib * @library / * @requires vm.bits == "64" @@ -35,8 +34,11 @@ package gc.arguments; * java.management * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver gc.arguments.TestMaxRAMFlags - * @author bob.vandette@oracle.com + * @run main/othervm + * -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * gc.arguments.TestMaxRAMPercentage */ import java.util.regex.Matcher; @@ -45,14 +47,17 @@ import java.util.regex.Pattern; import java.util.ArrayList; import java.util.Arrays; +import jdk.test.whitebox.WhiteBox; import jdk.test.lib.process.OutputAnalyzer; +import jtreg.SkippedException; -public class TestMaxRAMFlags { +public class TestMaxRAMPercentage { - private static void checkMaxRAMSize(long maxram, int maxrampercent, boolean forcecoop, long expectheap, boolean expectcoop) throws Exception { + private static final WhiteBox wb = WhiteBox.getWhiteBox(); + + private static void checkMaxRAMSize(double maxrampercent, boolean forcecoop, long expectheap, boolean expectcoop) throws Exception { ArrayList args = new ArrayList(); - args.add("-XX:MaxRAM=" + maxram); args.add("-XX:MaxRAMPercentage=" + maxrampercent); if (forcecoop) { args.add("-XX:+UseCompressedOops"); @@ -107,21 +112,32 @@ public class TestMaxRAMFlags { } public static void main(String args[]) throws Exception { - // Tests - // 1. Verify that MaxRAMPercentage overrides UseCompressedOops Ergo - // 2. Verify that UseCompressedOops forces compressed oops limit even - // when other flags are specified. - - long oneG = 1L * 1024L * 1024L * 1024L; - // Hotspot startup logic reduces MaxHeapForCompressedOops by HeapBaseMinAddress // in order to get zero based compressed oops offsets. long heapbaseminaddr = getHeapBaseMinAddress(); long maxcoopheap = TestUseCompressedOopsErgoTools.getMaxHeapForCompressedOops(new String [0]) - heapbaseminaddr; - // Args: MaxRAM , MaxRAMPercentage, forcecoop, expect heap, expect coop - checkMaxRAMSize(maxcoopheap - oneG, 100, false, maxcoopheap - oneG, true); - checkMaxRAMSize(maxcoopheap + oneG, 100, false, maxcoopheap + oneG, false); - checkMaxRAMSize(maxcoopheap + oneG, 100, true, maxcoopheap, true); + // The headroom is used to get/not get compressed oops from the maxcoopheap size + long M = 1L * 1024L * 1024L; + long headroom = 64 * M; + + long requiredHostMemory = maxcoopheap + headroom; + + // Get host memory + long hostMemory = wb.hostPhysicalMemory(); + + System.out.println("hostMemory: " + hostMemory + ", requiredHostMemory: " + requiredHostMemory); + + if (hostMemory < requiredHostMemory) { + throw new SkippedException("Not enough RAM on machine to run. Test skipped!"); + } + + double MaxRAMPercentage = ((double)maxcoopheap / hostMemory) * 100.0; + double headroomPercentage = ((double)headroom / hostMemory) * 100.0; + + // Args: MaxRAMPercentage, forcecoop, expectheap, expectcoop + checkMaxRAMSize(MaxRAMPercentage - headroomPercentage, false, maxcoopheap - (long)headroom, true); + checkMaxRAMSize(MaxRAMPercentage + headroomPercentage, false, maxcoopheap + (long)headroom, false); + checkMaxRAMSize(MaxRAMPercentage, true, maxcoopheap, true); } } diff --git a/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java b/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java deleted file mode 100644 index 2cd9e9cd60b..00000000000 --- a/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2018, 2025, 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 gc.arguments; - -/* - * @test id=Serial - * @summary Test defaults processing for -XX:+ParallelRefProcEnabled with Serial GC. - * @library /test/lib - * @library / - * @requires vm.gc.Serial - * @run driver gc.arguments.TestParallelRefProc Serial - */ - -/* - * @test id=Parallel - * @summary Test defaults processing for -XX:+ParallelRefProcEnabled with Parallel GC. - * @library /test/lib - * @library / - * @requires vm.gc.Parallel - * @run driver gc.arguments.TestParallelRefProc Parallel - */ - -/* - * @test id=G1 - * @summary Test defaults processing for -XX:+ParallelRefProcEnabled with G1 GC. - * @library /test/lib - * @library / - * @requires vm.gc.G1 - * @run driver gc.arguments.TestParallelRefProc G1 - */ - -import java.util.Arrays; -import java.util.ArrayList; - -import jdk.test.lib.process.OutputAnalyzer; - -public class TestParallelRefProc { - - public static void main(String args[]) throws Exception { - if (args.length == 0) { - throw new IllegalArgumentException("Test type must be specified as argument"); - } - - String testType = args[0]; - - switch (testType) { - case "Serial": - testSerial(); - break; - case "Parallel": - testParallel(); - break; - case "G1": - testG1(); - break; - default: - throw new IllegalArgumentException("Unknown test type \"" + testType + "\""); - } - } - - private static void testSerial() throws Exception { - testFlag(new String[] { "-XX:+UseSerialGC" }, false); - } - - private static void testParallel() throws Exception { - testFlag(new String[] { "-XX:+UseParallelGC", "-XX:ParallelGCThreads=1" }, false); - testFlag(new String[] { "-XX:+UseParallelGC", "-XX:ParallelGCThreads=2" }, true); - testFlag(new String[] { "-XX:+UseParallelGC", "-XX:-ParallelRefProcEnabled", "-XX:ParallelGCThreads=2" }, false); - } - - private static void testG1() throws Exception { - testFlag(new String[] { "-XX:+UseG1GC", "-XX:ParallelGCThreads=1" }, false); - testFlag(new String[] { "-XX:+UseG1GC", "-XX:ParallelGCThreads=2" }, true); - testFlag(new String[] { "-XX:+UseG1GC", "-XX:-ParallelRefProcEnabled", "-XX:ParallelGCThreads=2" }, false); - } - - private static final String parallelRefProcEnabledPattern = - " *bool +ParallelRefProcEnabled *= *true +\\{product\\}"; - - private static final String parallelRefProcDisabledPattern = - " *bool +ParallelRefProcEnabled *= *false +\\{product\\}"; - - private static void testFlag(String[] args, boolean expectedTrue) throws Exception { - ArrayList result = new ArrayList(); - result.addAll(Arrays.asList(args)); - result.add("-XX:+PrintFlagsFinal"); - result.add("-version"); - OutputAnalyzer output = GCArguments.executeTestJava(result); - - output.shouldHaveExitValue(0); - - final String expectedPattern = expectedTrue ? parallelRefProcEnabledPattern : parallelRefProcDisabledPattern; - - String value = output.firstMatch(expectedPattern); - if (value == null) { - throw new RuntimeException( - Arrays.toString(args) + " didn't set ParallelRefProcEnabled to " + expectedTrue + " as expected"); - } - } -} diff --git a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java index c9cf7291aaa..10c85c30c33 100644 --- a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java +++ b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java @@ -26,8 +26,7 @@ package gc.arguments; /* * @test TestUseCompressedOopsFlagsWithUlimit * @bug 8280761 - * @summary Verify correct UseCompressedOops when MaxRAM and MaxRAMPercentage - * are specified with ulimit -v. + * @summary Verify that ergonomic setting of UseCompressedOops adheres to ulimit -v * @library /test/lib * @library / * @requires vm.bits == "64" @@ -50,10 +49,9 @@ import jdk.test.lib.process.ProcessTools; public class TestUseCompressedOopsFlagsWithUlimit { - private static void checkFlag(long ulimit, long maxram, int maxrampercent, boolean expectcoop) throws Exception { + private static void checkFlag(long ulimit, int maxrampercent, boolean expectcoop) throws Exception { ArrayList args = new ArrayList(); - args.add("-XX:MaxRAM=" + maxram); args.add("-XX:MaxRAMPercentage=" + maxrampercent); args.add("-XX:+PrintFlagsFinal"); @@ -74,7 +72,7 @@ public class TestUseCompressedOopsFlagsWithUlimit { boolean actualcoop = getFlagBoolValue("UseCompressedOops", stdout); if (actualcoop != expectcoop) { throw new RuntimeException("UseCompressedOops set to " + actualcoop + - ", expected " + expectcoop + " when running with the following flags: " + Arrays.asList(args).toString()); + ", expected " + expectcoop + " when running with the following flags: " + Arrays.asList(args).toString() + ", and ulimit: " + ulimit); } } @@ -91,10 +89,13 @@ public class TestUseCompressedOopsFlagsWithUlimit { // Verify that UseCompressedOops Ergo follows ulimit -v setting. long oneG = 1L * 1024L * 1024L * 1024L; + long ulimit = 10 * oneG; - // Args: ulimit, max_ram, max_ram_percent, expected_coop - // Setting MaxRAMPercentage explicitly to make the test more resilient. - checkFlag(10 * oneG, 32 * oneG, 100, true); - checkFlag(10 * oneG, 128 * oneG, 100, true); + // Regardless of how much memory that is available on the machine, we should + // always get compressed oops if we have set a ulimit below the COOPS limit. + // We set MaxRAMPercentage explicitly to make the test more resilient. + + // Args: ulimit, maxrampercent, expectedcoop + checkFlag(ulimit, 100, true); } } diff --git a/test/hotspot/jtreg/gc/epsilon/TestInitAllocs.java b/test/hotspot/jtreg/gc/epsilon/TestInitAllocs.java index 353daaef8b6..cdfd29bad61 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestInitAllocs.java +++ b/test/hotspot/jtreg/gc/epsilon/TestInitAllocs.java @@ -23,54 +23,84 @@ package gc.epsilon; -/** - * @test TestInitAllocs +import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/* @test id=default * @requires vm.gc.Epsilon - * @summary Test that allocation path taken in early JVM phases works - * - * @run main/othervm -Xmx256m - * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * gc.epsilon.TestInitAllocs - * - * @run main/othervm -Xmx256m - * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * -XX:+UseTLAB - * -XX:+UseCompressedOops - * -XX:EpsilonMinHeapExpand=1024 - * -XX:EpsilonUpdateCountersStep=1 - * -XX:EpsilonPrintHeapSteps=1000000 - * gc.epsilon.TestInitAllocs - * - * @run main/othervm -Xmx256m - * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * -XX:+UseTLAB - * -XX:-UseCompressedOops - * -XX:EpsilonMinHeapExpand=1024 - * -XX:EpsilonUpdateCountersStep=1 - * -XX:EpsilonPrintHeapSteps=1000000 - * gc.epsilon.TestInitAllocs - * - * @run main/othervm -Xmx256m - * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * -XX:-UseTLAB - * -XX:+UseCompressedOops - * -XX:EpsilonMinHeapExpand=1024 - * -XX:EpsilonUpdateCountersStep=1 - * -XX:EpsilonPrintHeapSteps=1000000 - * gc.epsilon.TestInitAllocs - * - * @run main/othervm -Xmx256m - * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC - * -XX:-UseTLAB - * -XX:-UseCompressedOops - * -XX:EpsilonMinHeapExpand=1024 - * -XX:EpsilonUpdateCountersStep=1 - * -XX:EpsilonPrintHeapSteps=1000000 - * gc.epsilon.TestInitAllocs + * @summary Stress test that allocation path taken in early JVM phases works + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs + */ + +/* @test id=nocoops + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:-UseCompressedOops + */ + +/* @test id=notlabs + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:-UseTLAB + */ + +/* @test id=notlabs-nocoops + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:-UseCompressedOops -XX:-UseTLAB + */ + +/* @test id=coh + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:+UseCompactObjectHeaders + */ + +/* @test id=coh-nocoops + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:+UseCompactObjectHeaders -XX:-UseCompressedOops + */ + +/* @test id=coh-notlabs + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:+UseCompactObjectHeaders -XX:-UseTLAB + */ + +/* @test id=coh-notlabs-nocoops + * @requires vm.gc.Epsilon + * @library /test/lib + * @run driver gc.epsilon.TestInitAllocs -XX:+UseCompactObjectHeaders -XX:-UseCompressedOops -XX:-UseTLAB */ public class TestInitAllocs { - public static void main(String[] args) throws Exception { - System.out.println("Hello World"); + static final Integer TRIES = Integer.getInteger("tries", 500); + + public static void main(String... args) throws Exception { + List testArgs = new ArrayList<>(); + testArgs.add("-Xmx256m"); + testArgs.add("-XX:+UnlockExperimentalVMOptions"); + testArgs.add("-XX:+UseEpsilonGC"); + testArgs.add("-XX:EpsilonMinHeapExpand=1024"); + testArgs.add("-XX:EpsilonUpdateCountersStep=1"); + testArgs.add("-XX:EpsilonPrintHeapSteps=1000000"); + testArgs.addAll(Arrays.asList(args)); + testArgs.add(TestInitAllocs.Main.class.getName()); + for (int t = 0; t < TRIES; t++) { + OutputAnalyzer oa = ProcessTools.executeLimitedTestJava(testArgs); + oa.shouldHaveExitValue(0); + } + } + + static class Main { + public static void main(String... args) { + // Do nothing + } } } diff --git a/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java index cf3445bd656..b0cf8f582b2 100644 --- a/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java +++ b/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java @@ -70,14 +70,6 @@ public class TestDynamicNumberOfGCThreads { // Base test with gc and +UseDynamicNumberOfGCThreads: OutputAnalyzer output = ProcessTools.executeLimitedTestJava(baseArgs); verifyDynamicNumberOfGCThreads(output); - - // Turn on parallel reference processing - String[] parRefProcArg = {"-XX:+ParallelRefProcEnabled", "-XX:-ShowMessageBoxOnError"}; - String[] parRefArgs = new String[baseArgs.length + parRefProcArg.length]; - System.arraycopy(parRefProcArg, 0, parRefArgs, 0, parRefProcArg.length); - System.arraycopy(baseArgs, 0, parRefArgs, parRefProcArg.length, baseArgs.length); - output = ProcessTools.executeLimitedTestJava(parRefArgs); - verifyDynamicNumberOfGCThreads(output); } static class GCTest { diff --git a/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java b/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java index e36ccace9dc..94441840723 100644 --- a/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java +++ b/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ package gc.g1; * during concurrent mark, and verify that after the concurrent cycle additional code * cache gc requests start more concurrent cycles. * @requires vm.gc.G1 + * @requires vm.flagless * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/gc/g1/TestRegionAlignment.java b/test/hotspot/jtreg/gc/g1/TestRegionAlignment.java index 2bc25079068..3555fad56a8 100644 --- a/test/hotspot/jtreg/gc/g1/TestRegionAlignment.java +++ b/test/hotspot/jtreg/gc/g1/TestRegionAlignment.java @@ -28,12 +28,12 @@ package gc.g1; * @bug 8013791 * @requires vm.gc.G1 * @summary Make sure that G1 ergonomics pick a heap size that is aligned with the region size - * @run main/othervm -XX:+UseG1GC -XX:G1HeapRegionSize=32m -XX:MaxRAM=555m gc.g1.TestRegionAlignment - * - * When G1 ergonomically picks a maximum heap size it must be aligned to the region size. - * This test tries to get the VM to pick a small and unaligned heap size (by using MaxRAM=555) and a - * large region size (by using -XX:G1HeapRegionSize=32m). This will fail without the fix for 8013791. + * @comment When G1 ergonomically picks a maximum heap size it must be aligned to the region size. + * This test tries to get the VM to pick a small and unaligned heap size (by using MaxRAM=555) and a + * large region size (by using -XX:G1HeapRegionSize=32m). This will fail without the fix for 8013791. + * @run main/othervm -XX:+UseG1GC -XX:G1HeapRegionSize=32m -Xmx140m gc.g1.TestRegionAlignment */ + public class TestRegionAlignment { public static void main(String[] args) { } } diff --git a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java index 6f2c7c005df..2028e8751d7 100644 --- a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java +++ b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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 @@ -119,7 +119,6 @@ public class TestIHOPStatic { System.out.println(" MaxHeapSize : " + heapSize); System.out.println(" Expect for concurrent cycle initiation message : " + expectInitiationMessage); List options = new ArrayList<>(); - Collections.addAll(options, Utils.getTestJavaOpts()); Collections.addAll(options, "-XX:InitiatingHeapOccupancyPercent=" + ihop, "-Dmemory.fill=" + (heapSize * 1024 * 1024 * pctToFill / 100), diff --git a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java index 6f64e6e9b5e..390159e7cd2 100644 --- a/test/hotspot/jtreg/gc/logging/TestPrintReferences.java +++ b/test/hotspot/jtreg/gc/logging/TestPrintReferences.java @@ -57,8 +57,7 @@ public class TestPrintReferences { static final String gcLogTimeRegex = ".* GC\\([0-9]+\\) "; public static void main(String[] args) throws Exception { - testPhases(true); - testPhases(false); + testPhases(); testRefs(); } @@ -93,16 +92,15 @@ public class TestPrintReferences { refRegex("PhantomReference")); } - public static void testPhases(boolean parallelRefProcEnabled) throws Exception { + public static void testPhases() throws Exception { OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-Xlog:gc+phases+ref=debug", "-XX:+UseG1GC", "-Xmx32M", - "-XX:" + (parallelRefProcEnabled ? "+" : "-") + "ParallelRefProcEnabled", "-XX:-UseDynamicNumberOfGCThreads", "-XX:ParallelGCThreads=2", GCTest.class.getName()); - checkLogFormat(output, parallelRefProcEnabled); + checkLogFormat(output); checkLogValue(output); output.shouldHaveExitValue(0); @@ -113,37 +111,31 @@ public class TestPrintReferences { return indent(6) + phaseName + ": " + timeRegex + "\n"; } - private static String subphaseRegex(String subphaseName, boolean parallelRefProcEnabled) { + private static String subphaseRegex(String subphaseName) { final String timeRegex = "\\s+" + doubleRegex; - if (parallelRefProcEnabled) { - final String timeInParRegex = timeRegex +",\\s"; - return gcLogTimeRegex + indent(8) + subphaseName + - " \\(ms\\):\\s+(Min:" + timeInParRegex + "Avg:" + timeInParRegex + "Max:" + timeInParRegex + "Diff:" + timeInParRegex + "Sum:" + timeInParRegex + - "Workers: [0-9]+|skipped)" + "\n"; - } else { - return gcLogTimeRegex + indent(8) + subphaseName + ":(" + timeRegex + "ms|\\s+skipped)\n"; - } + final String timeInParRegex = timeRegex +",\\s"; + return gcLogTimeRegex + indent(8) + subphaseName + + " \\(ms\\):\\s+(Min:" + timeInParRegex + "Avg:" + timeInParRegex + "Max:" + timeInParRegex + "Diff:" + timeInParRegex + "Sum:" + timeInParRegex + + "Workers: [0-9]+|skipped)" + "\n"; } // Find the first Reference Processing log and check its format. - private static void checkLogFormat(OutputAnalyzer output, boolean parallelRefProcEnabled) { + private static void checkLogFormat(OutputAnalyzer output) { String timeRegex = doubleRegex + "ms"; /* Total Reference processing time */ String totalRegex = gcLogTimeRegex + indent(4) + referenceProcessing + ": " + timeRegex + "\n"; - String balanceRegex = parallelRefProcEnabled ? "(" + gcLogTimeRegex + indent(8) + "Balance queues: " + timeRegex + "\n)??" : ""; - - final boolean p = parallelRefProcEnabled; + String balanceRegex = "(" + gcLogTimeRegex + indent(8) + "Balance queues: " + timeRegex + "\n)??"; String phase2Regex = gcLogTimeRegex + phaseRegex(phaseNotifySoftWeakReferences) + balanceRegex + - subphaseRegex("SoftRef", p) + - subphaseRegex("WeakRef", p) + - subphaseRegex("FinalRef", p) + - subphaseRegex("Total", p); - String phase3Regex = gcLogTimeRegex + phaseRegex(phaseNotifyKeepAliveFinalizer) + balanceRegex + subphaseRegex("FinalRef", p); - String phase4Regex = gcLogTimeRegex + phaseRegex(phaseNotifyPhantomReferences) + balanceRegex + subphaseRegex("PhantomRef", p); + subphaseRegex("SoftRef") + + subphaseRegex("WeakRef") + + subphaseRegex("FinalRef") + + subphaseRegex("Total"); + String phase3Regex = gcLogTimeRegex + phaseRegex(phaseNotifyKeepAliveFinalizer) + balanceRegex + subphaseRegex("FinalRef"); + String phase4Regex = gcLogTimeRegex + phaseRegex(phaseNotifyPhantomReferences) + balanceRegex + subphaseRegex("PhantomRef"); output.shouldMatch(totalRegex + phase2Regex + diff --git a/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java b/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java index 96440ba15ae..2877e8a4a85 100644 --- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java +++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java @@ -30,7 +30,7 @@ * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" | os.arch == "ppc64" | os.arch == "ppc64le" * @requires vm.gc.Shenandoah * - * @run main/othervm --enable-native-access=ALL-UNNAMED -XX:+UnlockDiagnosticVMOptions + * @run main/native/othervm --enable-native-access=ALL-UNNAMED -XX:+UnlockDiagnosticVMOptions * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive TestLinkToNativeRBP * */ diff --git a/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java b/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java index 475c86d889f..6adf00af250 100644 --- a/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java +++ b/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java @@ -28,6 +28,7 @@ * @library /test/lib * @requires vm.flagless * @requires os.arch=="aarch64" + * @requires os.family != "windows" * @run main/native GTestWrapper --gtest_filter=SpinPause* * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=none * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=nop @@ -41,6 +42,6 @@ * @summary Run SpinPause gtest using SB instruction for SpinPause * @library /test/lib * @requires vm.flagless - * @requires (os.arch=="aarch64" & vm.cpu.features ~= ".*sb.*") + * @requires (os.arch=="aarch64" & vm.cpu.features ~= ".*sb.*" & os.family != "windows") * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=sb */ diff --git a/test/hotspot/jtreg/runtime/7167069/PrintAsFlag.java b/test/hotspot/jtreg/runtime/7167069/PrintAsFlag.java index 9948ef1738f..cd03af20b34 100644 --- a/test/hotspot/jtreg/runtime/7167069/PrintAsFlag.java +++ b/test/hotspot/jtreg/runtime/7167069/PrintAsFlag.java @@ -27,7 +27,7 @@ * * @test PrintAsFlag * @summary verify that Flag::print_as_flag() works correctly. This is used by "jinfo -flag" and -XX:+PrintCommandLineFlags. - * @run main/othervm -XX:+PrintCommandLineFlags -XX:-ShowMessageBoxOnError -XX:ParallelGCThreads=4 -XX:MaxRAM=1G -XX:ErrorFile="file" PrintAsFlag + * @run main/othervm -XX:+PrintCommandLineFlags -XX:-ShowMessageBoxOnError -XX:ParallelGCThreads=4 -XX:ErrorLogTimeout=12345 -XX:ErrorFile="file" PrintAsFlag */ public class PrintAsFlag { diff --git a/test/hotspot/jtreg/runtime/ClassFile/NestedAnnotations.java b/test/hotspot/jtreg/runtime/ClassFile/NestedAnnotations.java new file mode 100644 index 00000000000..e523c2ed736 --- /dev/null +++ b/test/hotspot/jtreg/runtime/ClassFile/NestedAnnotations.java @@ -0,0 +1,77 @@ + /* + * Copyright (c) 2026, 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 NestedAnnotations + * @summary The JVM handles nested annotations + * @bug 8364655 + * @requires vm.flagless + * @library /test/lib + * @library /testlibrary/asm + * @modules java.base/jdk.internal.misc + * java.desktop + * java.management + * @run driver NestedAnnotations + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassWriter; + +import java.lang.invoke.MethodHandles; +import java.util.ArrayList; + +import static org.objectweb.asm.Opcodes.*; + +public class NestedAnnotations { + static void test() throws Exception { + var cw = new ClassWriter(0); + cw.visit(V17, 0, "Annotations", null, "java/lang/Object", null); + final int number_of_annotations = 65535; + var av = cw.visitAnnotation("LTest;", true); + var stack = new ArrayList(number_of_annotations + 1); + stack.add(av); + for (int i = 0; i < number_of_annotations; i++) { + stack.add(av = av.visitAnnotation("value", "LTest;")); + } + for (int i = number_of_annotations; i != 0;) { + stack.get(--i).visitEnd(); + } + + cw.visitEnd(); + // Does not matter whether the class is hidden, used for simplicity's sake. + MethodHandles.lookup().defineHiddenClass(cw.toByteArray(), true); + } + + public static void main(String[] args) throws Exception { + if (args.length == 1 && args[0].equals("testIt")) { + test(); + } else { + OutputAnalyzer oa = ProcessTools.executeTestJava("NestedAnnotations", "testIt"); + oa.shouldHaveExitValue(0); + } + } +} + diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index 0ac19c4a487..eb0fd5f8be5 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -237,7 +237,6 @@ public class TestOptionsWithRanges { excludeTestMaxRange("G1ConcRefinementThreads"); excludeTestMaxRange("InitialHeapSize"); excludeTestMaxRange("MaxHeapSize"); - excludeTestMaxRange("MaxRAM"); excludeTestMaxRange("NewSize"); excludeTestMaxRange("ParallelGCThreads"); excludeTestMaxRange("TLABSize"); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java b/test/hotspot/jtreg/runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java index a9d957bac18..61d017d2264 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2025, Red Hat, Inc. - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,8 @@ * @library /test/lib * @requires vm.bits == 64 & vm.debug == true & vm.flagless * @requires os.family != "aix" + * @comment This test relies on crashing which conflicts with ASAN checks + * @requires !vm.asan * @modules java.base/jdk.internal.misc * java.management * @build jdk.test.whitebox.WhiteBox @@ -40,6 +42,8 @@ * @summary Test that dereferencing a Klass that is the result of a decode(0) crashes accessing the nKlass guard zone * @requires vm.cds & vm.bits == 64 & vm.debug == true & vm.flagless * @requires os.family != "aix" + * @comment This test relies on crashing which conflicts with ASAN checks + * @requires !vm.asan * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -53,6 +57,8 @@ * @summary Test that dereferencing a Klass that is the result of a decode(0) crashes accessing the nKlass guard zone * @requires vm.bits == 64 & vm.debug == true & vm.flagless * @requires os.family != "aix" + * @comment This test relies on crashing which conflicts with ASAN checks + * @requires !vm.asan * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -66,6 +72,8 @@ * @summary Test that dereferencing a Klass that is the result of a decode(0) crashes accessing the nKlass guard zone * @requires vm.cds & vm.bits == 64 & vm.debug == true & vm.flagless * @requires os.family != "aix" + * @comment This test relies on crashing which conflicts with ASAN checks + * @requires !vm.asan * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java index 74cedae5f1a..7608c5f5619 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 @@ * @requires vm.flagless * @requires vm.compiler2.enabled * @requires test.thread.factory == null + * @comment This test relies on crashing which conflicts with ASAN checks + * @requires !vm.asan * @summary Test that abstract machine code is dumped for the top frames in a hs-err log * @library /test/lib * @modules java.base/jdk.internal.misc @@ -167,6 +169,10 @@ public class MachCodeFramesInErrorFile { Matcher matcher = Pattern.compile("\\[MachCode\\]\\s*\\[Verified Entry Point\\]\\s* # \\{method\\} \\{[^}]*\\} '([^']+)' '([^']+)' in '([^']+)'", Pattern.DOTALL).matcher(hsErr); List machCodeHeaders = matcher.results().map(mr -> String.format("'%s' '%s' in '%s'", mr.group(1), mr.group(2), mr.group(3))).collect(Collectors.toList()); int minExpectedMachCodeSections = Math.max(1, compiledJavaFrames); + if ((hsErr.contains("stop reattempt (retry printing native stack (no source info))") || hsErr.contains("reason: Step time limit reached"))) { + // In this case, the vm only prints the crashing frame. + minExpectedMachCodeSections = 1; + } if (machCodeHeaders.size() < minExpectedMachCodeSections) { Asserts.fail(machCodeHeaders.size() + " < " + minExpectedMachCodeSections); } diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java index 5bbc4cfac00..583ed894035 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ResourceMarkTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,8 @@ * @library /test/lib * @requires vm.flagless * @requires vm.debug + * @comment ASAN grabs SIGFPE earlier than vm signal handler + * @requires !vm.asan * @requires os.family != "windows" * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java index 5b28e2a1d8b..f7facaab186 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2024 SAP SE. All rights reserved. - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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,8 @@ * @library /test/lib * @requires vm.flagless * @requires vm.debug + * @comment ASAN grabs SIGFPE earlier than vm signal handler + * @requires !vm.asan * @requires os.family != "windows" * @modules java.base/jdk.internal.misc * java.management @@ -41,6 +43,8 @@ * @library /test/lib * @requires vm.flagless * @requires vm.debug + * @comment ASAN grabs SIGFPE earlier than vm signal handler + * @requires !vm.asan * @requires os.family != "windows" * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java index 00b5becdbfa..6fe00498797 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestDwarf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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 @@ -108,13 +108,19 @@ public class TestDwarf { if (Platform.isX64() || Platform.isX86()) { // Not all platforms raise SIGFPE but x86_32 and x86_64 do. runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeDivByZero"), - new DwarfConstraint(0, "Java_TestDwarf_crashNativeDivByZero", "libTestDwarf.c", 59)); + new DwarfConstraint(0, "Java_TestDwarf_crashNativeDivByZero", "libTestDwarf.c", 62)); runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeMultipleMethods"), - new DwarfConstraint(0, "foo", "libTestDwarf.c", 42), - new DwarfConstraint(1, "Java_TestDwarf_crashNativeMultipleMethods", "libTestDwarf.c", 70)); + new DwarfConstraint(0, "foo", "libTestDwarf.c", 45), + new DwarfConstraint(1, "Java_TestDwarf_crashNativeMultipleMethods", "libTestDwarf.c", 73)); + } + // Null pointer dereferences exhibit different behaviour depending on if GCC or Clang is used. + // When using GCC, the VM will crash gracefully and generate a hs_err which can be parsed. + // On the contrary, with Clang the process exits immediately without hs_err. + // Since runAndCheck needs an hs_err file, we have to skip this subtest. + if (!isUsingClang()) { + runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeDereferenceNull"), + new DwarfConstraint(0, "dereference_null", "libTestDwarfHelper.h", 49)); } - runAndCheck(new Flags(TestDwarf.class.getCanonicalName(), "nativeDereferenceNull"), - new DwarfConstraint(0, "dereference_null", "libTestDwarfHelper.h", 46)); } // A full pattern could check for lines like: @@ -240,6 +246,7 @@ public class TestDwarf { private static native void crashNativeDivByZero(); private static native void crashNativeDereferenceNull(); private static native void crashNativeMultipleMethods(int x); + private static native boolean isUsingClang(); } class UnsupportedDwarfVersionException extends RuntimeException { } diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c index 616a6f07d12..19993d17de3 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c +++ b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +28,10 @@ int zero = 0; int result = 0; int limit = 20; -// Just big enough by doing some random things such that it is not inlined. +// Explicitly don't inline. foo needs complexity so GCC/Clang don't optimize it away. +#if !defined(_MSC_VER) +__attribute__((noinline)) +#endif void foo(int x) { printf("foo3:"); printf(" %d\n", x); @@ -76,3 +79,12 @@ JNIEXPORT void JNICALL Java_TestDwarf_crashNativeMultipleMethods(JNIEnv* env, jc } } +// Need to tell if Clang was used to build libTestDwarf. +JNIEXPORT jboolean JNICALL Java_TestDwarf_isUsingClang(JNIEnv* env, jobject obj) { +#if defined(__clang__) + return JNI_TRUE; +#else + return JNI_FALSE; +#endif +} + diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h index 1da05c1c3d3..9f9ef33add2 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h +++ b/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,6 +41,9 @@ void unused4() { void unused5() { } +#if !defined(_MSC_VER) +__attribute__((noinline)) +#endif EXPORT void dereference_null() { int* x = (int*)0; *x = 34; // Crash diff --git a/test/hotspot/jtreg/runtime/cds/DumpSymbolAndStringTable.java b/test/hotspot/jtreg/runtime/cds/DumpSymbolAndStringTable.java index 735d5a3070b..f606f242cf6 100644 --- a/test/hotspot/jtreg/runtime/cds/DumpSymbolAndStringTable.java +++ b/test/hotspot/jtreg/runtime/cds/DumpSymbolAndStringTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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,70 +24,26 @@ /* * @test * @bug 8059510 8213445 - * @summary Test jcmd VM.symboltable, VM.stringtable and VM.systemdictionary options + * @summary Test jcmd VM.symboltable and VM.stringtable * @library /test/lib - * @build jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI DumpSymbolAndStringTable + * @run main/othervm DumpSymbolAndStringTable */ import jdk.test.lib.cds.CDSTestUtils; import jdk.test.lib.dcmd.PidJcmdExecutor; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.whitebox.WhiteBox; public class DumpSymbolAndStringTable { - public static void main(String[] args) throws Exception { - WhiteBox wb = WhiteBox.getWhiteBox(); - boolean sharingEnabled = wb.isSharingEnabled(); + public static final String s = "MY_INTERNED_STRING"; + public static void main(String[] args) throws Exception { ProcessBuilder pb = new ProcessBuilder(); + pb.command(new PidJcmdExecutor().getCommandLine("VM.symboltable", "-verbose")); OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-symboltable"); - final String sharedSymbolsHeader = "Shared symbols:\n"; - try { - output.shouldContain("24 2: DumpSymbolAndStringTable\n"); - if (sharingEnabled) { - output.shouldContain(sharedSymbolsHeader); - output.shouldContain("17 65535: java.lang.runtime\n"); - } - } catch (RuntimeException e) { - output.shouldContain("Unknown diagnostic command"); - } + output.shouldContain("18 1: MY_INTERNED_STRING\n"); // This symbol should have been interned pb.command(new PidJcmdExecutor().getCommandLine("VM.stringtable", "-verbose")); output = CDSTestUtils.executeAndLog(pb, "jcmd-stringtable"); - final String sharedStringsHeader = "Shared strings:\n"; - try { - output.shouldContain("24: DumpSymbolAndStringTable\n"); - if (sharingEnabled && wb.canWriteJavaHeapArchive()) { - output.shouldContain(sharedStringsHeader); - if (!wb.isSharedInternedString("MILLI_OF_SECOND")) { - throw new RuntimeException("'MILLI_OF_SECOND' should be a shared string"); - } - } - } catch (RuntimeException e) { - output.shouldContain("Unknown diagnostic command"); - } - - pb.command(new PidJcmdExecutor().getCommandLine("VM.systemdictionary")); - output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary"); - try { - output.shouldContain("System Dictionary for 'app' class loader statistics:"); - output.shouldContain("Number of buckets"); - output.shouldContain("Number of entries"); - output.shouldContain("Maximum bucket size"); - } catch (RuntimeException e) { - output.shouldContain("Unknown diagnostic command"); - } - - pb.command(new PidJcmdExecutor().getCommandLine("VM.systemdictionary", "-verbose")); - output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary"); - try { - output.shouldContain("Dictionary for loader data: 0x"); - output.shouldContain("^java.lang.String"); - } catch (RuntimeException e) { - output.shouldContain("Unknown diagnostic command"); - } + output.shouldContain("18: MY_INTERNED_STRING\n"); // This string should have been interned } } diff --git a/test/hotspot/jtreg/runtime/cds/SharedStrings.java b/test/hotspot/jtreg/runtime/cds/SharedStrings.java deleted file mode 100644 index db0bc3264b2..00000000000 --- a/test/hotspot/jtreg/runtime/cds/SharedStrings.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2015, 2025, 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 Check to make sure that shared strings in the bootstrap CDS archive - * are actually shared - * @requires vm.cds.write.mapped.java.heap - * @requires vm.flagless - * @library /test/lib - * @build SharedStringsWb jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox - * @run driver SharedStrings - */ - -import jdk.test.lib.cds.CDSTestUtils; -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.helpers.ClassFileInstaller; - -public class SharedStrings { - public static void main(String[] args) throws Exception { - // Note: This is a basic sanity test for Shared Strings feature. - // This also serves as a reference on how to use this feature, - // hence the command lines are spelled out instead of using the - // test utils methods. - ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./SharedStrings.jsa", - "-Xlog:cds,aot+hashtables", - // Needed for bootclasspath match, for CDS to work with WhiteBox API - "-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"), - "-Xshare:dump"); - - OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "dump"); - CDSTestUtils.checkDump(out, "Shared string table stats"); - - - pb = ProcessTools.createLimitedTestJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./SharedStrings.jsa", - // needed for access to white box test API - "-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"), - "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-Xshare:on", "-showversion", "SharedStringsWb"); - - out = CDSTestUtils.executeAndLog(pb, "exec"); - CDSTestUtils.checkExec(out); - } -} diff --git a/test/hotspot/jtreg/runtime/cds/SharedStringsWb.java b/test/hotspot/jtreg/runtime/cds/SharedStringsWb.java deleted file mode 100644 index 5a4d24e4fdf..00000000000 --- a/test/hotspot/jtreg/runtime/cds/SharedStringsWb.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013, 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. - */ - -import jdk.test.whitebox.WhiteBox; - -// This class is used by the test SharedStrings.java -// It should be launched in CDS mode -public class SharedStringsWb { - public static void main(String[] args) throws Exception { - WhiteBox wb = WhiteBox.getWhiteBox(); - - if (!wb.areSharedStringsMapped()) { - System.out.println("Shared strings are not mapped, assuming PASS"); - return; - } - - // The string below is known to be added to CDS archive - String s = ""; - String internedS = s.intern(); - - // Check that it's a valid string - if (s.getClass() != String.class || !(s instanceof String)) { - throw new RuntimeException("Shared string is not a valid String: FAIL"); - } - - if (wb.isSharedInternedString(internedS)) { - System.out.println("Found shared string, result: PASS"); - } else { - throw new RuntimeException("String is not shared, result: FAIL"); - } - } -} - - diff --git a/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java b/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java index 7c0b5896a98..eb42bb9f93d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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 + * @test id=COH * @bug 8232069 * @requires vm.cds * @requires vm.bits == 64 @@ -31,7 +31,32 @@ * @requires vm.gc == null * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile test-classes/Hello.java - * @run driver TestZGCWithCDS + * @comment Only run if COH is unset or enabled. + * @requires vm.opt.UseCompactObjectHeaders != "false" + * @comment Driver sets compressed oops/class pointers, jtreg overrides will cause problems. + Only run the test if the flags are not set via the command line. + * @requires vm.opt.UseCompressedOops == null + * @requires vm.opt.UseCompressedClassPointers == null + * @run driver TestZGCWithCDS true + */ + +/* + * @test id=NO-COH + * @bug 8232069 + * @requires vm.cds + * @requires vm.bits == 64 + * @requires vm.gc.Z + * @requires vm.gc.Serial + * @requires vm.gc == null + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * @compile test-classes/Hello.java + * @comment Only run if COH is unset or disabled. + * @requires vm.opt.UseCompactObjectHeaders != "true" + * @comment Driver sets compressed oops/class pointers, jtreg overrides will cause problems. + Only run the test if the flags are not set via the command line. + * @requires vm.opt.UseCompressedOops == null + * @requires vm.opt.UseCompressedClassPointers == null + * @run driver TestZGCWithCDS false */ import jdk.test.lib.Platform; @@ -42,7 +67,8 @@ public class TestZGCWithCDS { public final static String UNABLE_TO_USE_ARCHIVE = "Unable to use shared archive."; public final static String ERR_MSG = "The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled."; public static void main(String... args) throws Exception { - String compactHeaders = "-XX:+UseCompactObjectHeaders"; + boolean compactHeadersOn = Boolean.valueOf(args[0]); + String compactHeaders = "-XX:" + (compactHeadersOn ? "+" : "-") + "UseCompactObjectHeaders"; String helloJar = JarBuilder.build("hello", "Hello"); System.out.println("0. Dump with ZGC"); OutputAnalyzer out = TestCommon diff --git a/test/hotspot/jtreg/runtime/cds/appcds/aotCache/ChangedJarFile.java b/test/hotspot/jtreg/runtime/cds/appcds/aotCache/ChangedJarFile.java new file mode 100644 index 00000000000..a717b267347 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/aotCache/ChangedJarFile.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2026, 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 AOT cache should be rejected if JAR file(s) in the classpath have changed + * @bug 8377932 + * @requires vm.cds.supports.aot.class.linking + * @library /test/lib + * @build ChangedJarFile + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar MyTestApp OtherClass + * @run driver ChangedJarFile AOT + */ + +import jdk.jfr.Event; +import jdk.test.lib.cds.CDSAppTester; +import jdk.test.lib.helpers.ClassFileInstaller; +import jdk.test.lib.process.OutputAnalyzer; + +public class ChangedJarFile { + static final String appJar = ClassFileInstaller.getJarPath("app.jar"); + static final String mainClass = MyTestApp.class.getName(); + + public static void main(String[] args) throws Exception { + // Train and run with unchanged JAR file (which has OtherClass.class) + Tester tester = new Tester(); + tester.run(args); + + // Run again with changed JAR file (which doesn't have OtherClass.class anymore) + ClassFileInstaller.writeJar(appJar, "MyTestApp"); + + // First disable AOT cache to verify test login + tester.productionRun(new String[] {"-XX:AOTMode=off"}, + new String[] {"jarHasChanged"}); + + // Now see if the AOT cache will be automatically disabled + OutputAnalyzer out = + tester.productionRun(new String[] {"-XX:AOTMode=auto", "-Xlog:aot"}, + new String[] {"jarHasChanged"}); + out.shouldMatch("This file is not the one used while building the " + + "AOT cache: '.*app.jar', timestamp has changed, size has changed"); + } + + static class Tester extends CDSAppTester { + public Tester() { + super(mainClass); + } + + @Override + public String classpath(RunMode runMode) { + return appJar; + } + + @Override + public String[] appCommandLine(RunMode runMode) { + return new String[] { mainClass }; + } + + @Override + public void checkExecution(OutputAnalyzer out, RunMode runMode) { + + } + } + + +} + +class MyTestApp { + public static void main(String args[]) { + boolean jarHasChanged = (args.length != 0); + + System.out.println("JAR has changed = " + (jarHasChanged)); + Class c = null; + try { + c = Class.forName("OtherClass"); + System.out.println("Other class = " + c); + } catch (Throwable t) { + if (!jarHasChanged) { + throw new RuntimeException("OtherClass should have been loaded because JAR has not been changed yet", t); + } + } + + if (jarHasChanged && c != null) { + throw new RuntimeException("OtherClass should not be in JAR file"); + } + } +} + +class OtherClass {} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCPUFeatureIncompatibilityTest.java b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCPUFeatureIncompatibilityTest.java new file mode 100644 index 00000000000..8d1e190d1e3 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCPUFeatureIncompatibilityTest.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2026, 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 CPU feature compatibility test for AOT Code Cache + * @requires vm.cds.supports.aot.code.caching + * @requires vm.compMode != "Xcomp" & vm.compMode != "Xint" + * @requires os.simpleArch == "x64" | os.simpleArch == "aarch64" + * @comment The test verifies AOT checks during VM startup and not code generation. + * No need to run it with -Xcomp. + * @library /test/lib /test/setup_aot + * @build AOTCodeCPUFeatureIncompatibilityTest JavacBenchApp + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar + * JavacBenchApp + * JavacBenchApp$ClassFile + * JavacBenchApp$FileManager + * JavacBenchApp$SourceFile + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AOTCodeCPUFeatureIncompatibilityTest + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import jdk.test.lib.Platform; +import jdk.test.lib.cds.CDSAppTester; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +import jdk.test.whitebox.WhiteBox; +import jdk.test.whitebox.cpuinfo.CPUInfo; + +public class AOTCodeCPUFeatureIncompatibilityTest { + public static void main(String... args) throws Exception { + List cpuFeatures = CPUInfo.getFeatures(); + if (Platform.isX64()) { + // Minimum value of UseSSE required by JVM is 2. So the production run has to be executed with UseSSE=2. + // To simulate the case of incmpatible SSE feature, we can run this test only on system with higher SSE level (sse3 or above). + if (isSSE3Supported(cpuFeatures)) { + testIncompatibleFeature("-XX:UseSSE=2", "sse3"); + } + if (isAVXSupported(cpuFeatures)) { + testIncompatibleFeature("-XX:UseAVX=0", "avx"); + } + } + } + + // vmOption = command line option to disable CPU feature + // featureName = name of the CPU feature used by the JVM in the log messages + public static void testIncompatibleFeature(String vmOption, String featureName) throws Exception { + new CDSAppTester("AOTCodeCPUFeatureIncompatibilityTest") { + @Override + public String[] vmArgs(RunMode runMode) { + if (runMode == RunMode.PRODUCTION) { + return new String[] {vmOption, "-Xlog:aot+codecache+init=debug"}; + } + return new String[] {}; + } + @Override + public void checkExecution(OutputAnalyzer out, RunMode runMode) throws Exception { + if (runMode == RunMode.ASSEMBLY) { + out.shouldMatch("CPU features recorded in AOTCodeCache:.*" + featureName + ".*"); + } else if (runMode == RunMode.PRODUCTION) { + out.shouldMatch("AOT Code Cache disabled: required cpu features are missing:.*" + featureName + ".*"); + out.shouldContain("Unable to use AOT Code Cache"); + } + } + @Override + public String classpath(RunMode runMode) { + return "app.jar"; + } + @Override + public String[] appCommandLine(RunMode runMode) { + return new String[] { + "JavacBenchApp", "10" + }; + } + }.runAOTWorkflow("--two-step-training"); + } + + // Only used on x86-64 platform + static boolean isSSE3Supported(List cpuFeatures) { + return cpuFeatures.contains("sse3"); + } + + // Only used on x86-64 platform + static boolean isAVXSupported(List cpuFeatures) { + return cpuFeatures.contains("avx"); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsApp.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsApp.java deleted file mode 100644 index 9e4558002cc..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsApp.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 - * 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.net.URL; -import jdk.test.whitebox.WhiteBox; - -// -// - Test static final String field with initial value in cached mirror should be also archived. -// - GC should not crash when reference fields in cached mirror are updated at runtime -// - Reference fields are updated to point to runtime created objects -// - Reference fields are nullified -// -public class MirrorWithReferenceFieldsApp { - - // Static String field with initial value - static final String archived_field = "abc"; - - // Static object field - static Object non_archived_field_1; - - // Instance field - Integer non_archived_field_2; - - public MirrorWithReferenceFieldsApp() { - non_archived_field_1 = new Object(); - non_archived_field_2 = Integer.valueOf(1); - } - - public static void main(String args[]) throws Exception { - WhiteBox wb = WhiteBox.getWhiteBox(); - - if (!wb.areOpenArchiveHeapObjectsMapped()) { - System.out.println("Archived open_archive_heap objects are not mapped."); - System.out.println("This may happen during normal operation. Test Skipped."); - return; - } - - MirrorWithReferenceFieldsApp m = new MirrorWithReferenceFieldsApp(); - m.test(wb); - } - - public void test(WhiteBox wb) { - Class c = MirrorWithReferenceFieldsApp.class; - if (wb.isSharedClass(c)) { - if (wb.isSharedInternedString(archived_field)) { - System.out.println("archived_field is archived as excepted"); - } else { - throw new RuntimeException( - "FAILED. archived_field is not archived."); - } - - // GC should not crash - System.gc(); - System.gc(); - System.gc(); - - non_archived_field_1 = null; - non_archived_field_2 = null; - - System.gc(); - System.gc(); - System.gc(); - - System.out.println("Done."); - } - } -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java deleted file mode 100644 index 4c670ccba9b..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2018, 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 Test archived mirror with reference fields - * @requires vm.cds.write.archived.java.heap - * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds - * @build jdk.test.whitebox.WhiteBox - * @compile MirrorWithReferenceFieldsApp.java - * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar MirrorWithReferenceFieldsApp - * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar WhiteBox.jar jdk.test.whitebox.WhiteBox - * @run driver MirrorWithReferenceFieldsTest - */ - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.helpers.ClassFileInstaller; -import jdk.test.whitebox.WhiteBox; - -public class MirrorWithReferenceFieldsTest { - public static void main(String[] args) throws Exception { - String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar"); - String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar; - String appJar = ClassFileInstaller.getJarPath("app.jar"); - - String classlist[] = new String[] { - "MirrorWithReferenceFieldsApp", - }; - - TestCommon.testDump(appJar, classlist, use_whitebox_jar); - OutputAnalyzer output = TestCommon.exec(appJar, use_whitebox_jar, - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - "-XX:+VerifyAfterGC", - "MirrorWithReferenceFieldsApp"); - try { - TestCommon.checkExec(output, "Done"); - } catch (Exception e) { - output.shouldContain("Archived open_archive_heap objects are not mapped"); - } - } -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassApp.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassApp.java index e247a8158f7..0bac9f4e77d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassApp.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -55,11 +55,6 @@ public class RedefineClassApp { static Instrumentation instrumentation; public static void main(String args[]) throws Throwable { - if (!wb.areSharedStringsMapped()) { - System.out.println("Shared strings are ignored."); - return; - } - File bootJar = new File(args[0]); File appJar = new File(args[1]); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/HelloStringGC.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/HelloStringGC.java deleted file mode 100644 index 0f8dbf7e753..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/HelloStringGC.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2015, 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. - * - */ - -import jdk.test.whitebox.WhiteBox; - -public class HelloStringGC { - public static String[] array01 = new String[1000]; - public static String[] array02 = new String[1000]; - - public static void main(String args[]) throws RuntimeException { - String testString1 = "shared_test_string_unique_14325"; - String testString2 = "test123"; - - WhiteBox wb = WhiteBox.getWhiteBox(); - if (wb.areSharedStringsMapped() && !wb.isSharedInternedString(testString1)) { - throw new RuntimeException("testString1 is not shared"); - } - - for (int i=0; i<5; i++) { - allocSomeStrings(testString1, testString2); - array01 = null; - array02 = null; - System.gc(); - sleep(300); - array01 = new String[1000]; - array02 = new String[1000]; - } - - wb.fullGC(); - - System.out.println("HelloStringGC: PASS"); - } - - private static void allocSomeStrings(String s1, String s2) { - for (int i = 0; i < 1000; i ++) { - array01[i] = new String(s1); - array02[i] = new String(s2); - } - } - - private static void sleep(int ms) { - try { - Thread.sleep(ms); - } catch (InterruptedException e) { - } - } - -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/HelloStringPlus.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/HelloStringPlus.java deleted file mode 100644 index da111ced43a..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/HelloStringPlus.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2015, 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. - * - */ - -// A test class to be launched in AppCDS mode, has basic+ -// coverage of string operations - -import jdk.test.whitebox.WhiteBox; - -public class HelloStringPlus { - public static void main(String args[]) { - // Let's reference the string that is in archive - String testString1 = "shared_test_string_unique_14325"; - System.out.println("Hello String: " + testString1); - - WhiteBox wb = WhiteBox.getWhiteBox(); - if (wb.areSharedStringsMapped() && !wb.isSharedInternedString(testString1)) { - throw new RuntimeException("testString1 is not shared"); - } - - // Check other basic string operations - // Interning and equality - String[] testArray = new String[] {"shared_", "test_", "string_", "intern_", "12345"}; - String toBeInterned = ""; - - StringBuilder sb = new StringBuilder(); - for (String s : testArray) { - sb.append(s); - } - toBeInterned = sb.toString(); - - System.out.println("About to intern a string: " + toBeInterned); - toBeInterned.intern(); - - // check equality - if (testString1.equals(toBeInterned)) - throw new RuntimeException("Equality test 1 failed"); - - if (!testString1.equals("shared_test_string" + '_' + "unique_14325")) - throw new RuntimeException("Equality test 2 failed"); - - // Chech the hash code functionality; no special assertions, just make sure - // no crashe or exception occurs - System.out.println("testString1.hashCode() = " + testString1.hashCode()); - - // Check intern() method for "" string - String empty = ""; - String empty_interned = empty.intern(); - if (wb.areSharedStringsMapped() && !wb.isSharedInternedString(empty)) { - throw new RuntimeException("Empty string should be shared"); - } - if (empty_interned != empty) { - throw new RuntimeException("Different string is returned from intern() for empty string"); - } - } -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java deleted file mode 100644 index 89136ebdc4d..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2015, 2025, 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 Test shared strings together with string intern operation - * @requires vm.gc == null - * @requires vm.cds.write.mapped.java.heap - * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib - * @compile InternStringTest.java - * @build jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver InternSharedString - */ - -// This test requires the vm.cds.write.mapped.java.heap specifically as it has expectations -// about using the mechanism for dumping the entire string table, which the streaming solution -// does not do. - -public class InternSharedString { - public static void main(String[] args) throws Exception { - SharedStringsUtils.run(args, InternSharedString::test); - } - - public static void test(String[] args) throws Exception { - SharedStringsUtils.buildJarAndWhiteBox("InternStringTest"); - - SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("InternStringTest"), - "ExtraSharedInput.txt", "-Xlog:cds,aot+hashtables"); - - String[] extraMatches = new String[] { - InternStringTest.passed_output1, - InternStringTest.passed_output2, - InternStringTest.passed_output3 }; - - SharedStringsUtils.runWithArchiveAndWhiteBox(extraMatches, "InternStringTest"); - } -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternStringTest.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternStringTest.java deleted file mode 100644 index bea24c87888..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternStringTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2015, 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. - * - */ - -import jdk.test.whitebox.WhiteBox; - -public class InternStringTest { - public static String passed_output1 = "Found shared string."; - public static String passed_output2 = "Shared strings are equal."; - public static String passed_output3 = "Found shared string containing latin1 supplement chars."; - public static String passed_output4 = "Found shared string containing non-western chars."; - public static final String latin1Sup = "XXXX \u00a3 YYYY"; // \u00a3 = The pound sign - public static final String nonWestern = "XXXX \u5678 YYYY"; // \u5678 = Unicode Han Character 'ton (metric or English)' - - public static void main(String[] args) throws Exception { - WhiteBox wb = WhiteBox.getWhiteBox(); - - // All string literals are shared. - String shared1 = "LiveOak"; - String interned1 = shared1.intern(); - if (wb.areSharedStringsMapped()) { - if (wb.isSharedInternedString(interned1)) { - System.out.println(passed_output1); - } else { - throw new RuntimeException("Failed: String is not shared."); - } - } - - // Test 2: shared_string1.intern() == shared_string2.intern() - String shared2 = "LiveOak"; - String interned2 = shared2.intern(); - if (interned1 == interned2) { - System.out.println(passed_output2); - } else { - throw new RuntimeException("Not equal!"); - } - - // Test 3: interned strings with a char in latin1 supplement block [\u0080-\u00ff] - { - String a = "X" + latin1Sup.substring(1); - String b = a.intern(); - - if (wb.areSharedStringsMapped()) { - if (wb.isSharedInternedString(b)) { - System.out.println(passed_output3); - } else { - throw new RuntimeException("Failed: expected shared string with latin1-supplement chars."); - } - } - } - - // Test 5: interned strings with non-western characters - { - String a = "X" + nonWestern.substring(1); - String b = a.intern(); - if (wb.areSharedStringsMapped()) { - if (wb.isSharedInternedString(b)) { - System.out.println(passed_output4); - } else { - throw new RuntimeException("Failed: expected shared string with non-western chars."); - } - } - } - } -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java deleted file mode 100644 index 6145ea7719b..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2015, 2025, 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 Basic plus test for shared strings - * @requires vm.cds.write.mapped.java.heap - * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib - * @build HelloStringPlus jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver SharedStringsBasicPlus - */ - -// This test requires the vm.cds.write.mapped.java.heap specifically as it has expectations -// about using the mechanism for dumping the entire string table, which the streaming solution -// does not do. - -public class SharedStringsBasicPlus { - public static void main(String[] args) throws Exception { - SharedStringsUtils.run(args, SharedStringsBasicPlus::test); - } - - public static void test(String[] args) throws Exception { - SharedStringsUtils.buildJarAndWhiteBox("HelloStringPlus"); - - SharedStringsUtils.dumpWithWhiteBox( TestCommon.list("HelloStringPlus"), - "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables"); - - SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringPlus"); - } -} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java index e15cfafa3cb..15686d76ab3 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 +47,7 @@ public class SharedStringsUtils { // SharedStringsUtils.run() is for running the main test body multiple times, each with a different // set of extra VM options that are passed to the child processes. // - // See ./ExerciseGC.java for an example. + // See ./LargePages.java for an example. public static void run(String args[], Test t) throws Exception { int numSetOfChildVMOptions = vmOptionCombos.length; for (int i=0; i< numSetOfChildVMOptions; i++) { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java deleted file mode 100644 index 20dbad30441..00000000000 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016, 2025, 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 White box test for shared strings - * @requires vm.cds.write.mapped.java.heap - * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds - * @build jdk.test.whitebox.WhiteBox SharedStringsWb - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver SharedStringsWbTest - */ - -// This test requires the vm.cds.write.mapped.java.heap specifically as it has expectations -// about using the mechanism for dumping the entire string table, which the streaming solution -// does not do. - -import java.io.*; -import jdk.test.whitebox.WhiteBox; - -public class SharedStringsWbTest { - public static void main(String[] args) throws Exception { - SharedStringsUtils.run(args, SharedStringsWbTest::test); - } - - public static void test(String[] args) throws Exception { - SharedStringsUtils.buildJarAndWhiteBox("SharedStringsWb"); - - SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("SharedStringsWb"), - "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables"); - - SharedStringsUtils.runWithArchiveAndWhiteBox("SharedStringsWb"); - } -} diff --git a/test/hotspot/jtreg/runtime/interpreter/CoherentBytecodeTraceTest.java b/test/hotspot/jtreg/runtime/interpreter/CoherentBytecodeTraceTest.java new file mode 100644 index 00000000000..e0fb8cf98ec --- /dev/null +++ b/test/hotspot/jtreg/runtime/interpreter/CoherentBytecodeTraceTest.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2026, 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 8370044 + * @library / /test/lib + * @summary Ensures that individual bytecodes are not broken apart. + * @requires vm.debug == true & vm.flagless + * @run driver CoherentBytecodeTraceTest + */ + +import module java.base; + +import jdk.test.lib.Utils; +import jdk.test.lib.process.*; + +public class CoherentBytecodeTraceTest { + private static final int NUM_THREADS = 3; + private static final String THE_METHOD = ""; + + public static void main(String[] args) + throws InterruptedException, IOException { + if (args.length == 1 && "worker".equals(args[0])) { + schedule(); + return; + } + // Create a VM process and trace its bytecodes. + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder( + "-XX:+TraceBytecodes", + // Make sure that work() is not compiled. If there is no compiler, + // the flag is still accepted. + "-XX:CompileCommand=exclude,CoherentBytecodeTraceTest.work", + CoherentBytecodeTraceTest.class.getName(), "worker" + ); + OutputAnalyzer oa = new OutputAnalyzer(pb.start()).shouldHaveExitValue(0); + analyze(oa.stdoutAsLines()); + } + + private static void schedule() throws InterruptedException { + Thread[] threads = + IntStream.range(0, NUM_THREADS) + .mapToObj(i -> { + Thread thread = new Thread( + CoherentBytecodeTraceTest::work + ); + thread.start(); + return thread; + }) + .toArray(Thread[]::new); + for (Thread thread : threads) { + thread.join(); + } + } + + // The analysis works by finding the invokeinterface bytecode when calling + // Strategy.foo. The trace should look something like the following: + // invokeinterface 116 + // The strategy is to find CoherentBytecodeTraceTest$Strategy.foo's index + // and then ensure the constant pool ref and opcode before are correct. + // This requires going through the file line-by-line. + private static void analyze(List lines) { + IO.println("Analyzing " + lines.size() + " lines"); + boolean foundAtLeastOne = false; + // Reverse regex for: 'invokeinterface \d+ '. This is needed to look + // back from the interface name to ensure that the thing that + // preceeds it is an invokeinterface with a constant pool reference. + // Use 'XXXX' to denote where we want to put \d+ or else it will get + // reversed and lose its semantics. + String searchRegex = reverseString("invokeinterface XXXX ") + .replace("XXXX", "\\d+"); + Pattern reverseFirstPart = Pattern.compile(searchRegex); + for (String line : lines) { + int fooCallIndex = line.indexOf(THE_METHOD); + if (fooCallIndex == -1) { + continue; + } + String untilFooCall = line.substring(0, fooCallIndex); + String beginningReverse = reverseString(untilFooCall); + // Use a Scanner to do a match for "invokeinterface XXXX " + // immediately before the constant pool reference. + Scanner scanner = new Scanner(beginningReverse); + // Scanner#hasNext would use the next token given by whitespace, + // but whitespace is part of the pattern. Use horizon instead, if + // this is null, then there is no match. + if (scanner.findWithinHorizon(reverseFirstPart, 0) == null) { + IO.println("Using regex: " + reverseFirstPart); + IO.println("Regex rejected: " + beginningReverse); + throw new RuntimeException( + "torn bytecode trace: " + line + ); + } + foundAtLeastOne = true; + } + // If there are no invokeinterface calls then something went wrong + // and the test probably needs to be updated. + if (!foundAtLeastOne) { + throw new RuntimeException( + "sanity failure: no invokeinterface found for " + THE_METHOD + ); + } + } + + // Performs some random work. + // The goal is to have this emit some bytecodes that contain other bytes. + public static void work() { + int x = 10; + int y = 30; + int sum = 123; + for (int i = 0; i < 10_000; i++) { + if (i == x) { + int modulo = y % i; + sum ^= modulo; + } else { + Strategy[] arr = new Strategy[] { new Outer(new Object()) }; + arr[0].foo(i); + x = y - sum; + } + } + } + + private static String reverseString(String input) { + return new StringBuilder(input).reverse().toString(); + } + + private record Outer(Object inner) implements Strategy { + @Override + public void foo(int i) { + if (i % 1000 == 0) { + IO.println("foo" + i); + } + } + } + + public interface Strategy { + void foo(int i); + } +} diff --git a/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java b/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java index 7c0dfb2f3bb..6c5896df058 100644 --- a/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java +++ b/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, 2024, Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -26,6 +26,7 @@ * @test id=Default * @summary Test JVM large page setup (default options) * @library /test/lib + * @requires vm.flagless * @requires os.family == "linux" * @modules java.base/jdk.internal.misc * java.management @@ -36,6 +37,7 @@ * @test id=LP_enabled * @summary Test JVM large page setup (+LP) * @library /test/lib + * @requires vm.flagless * @requires os.family == "linux" * @modules java.base/jdk.internal.misc * java.management @@ -46,6 +48,7 @@ * @test id=THP_enabled * @summary Test JVM large page setup (+THP) * @library /test/lib + * @requires vm.flagless * @requires os.family == "linux" * @library /test/lib * @modules java.base/jdk.internal.misc diff --git a/test/hotspot/jtreg/runtime/os/TestMemoryAllocationLogging.java b/test/hotspot/jtreg/runtime/os/TestMemoryAllocationLogging.java index 9f4f4baeead..60f6d29f16d 100644 --- a/test/hotspot/jtreg/runtime/os/TestMemoryAllocationLogging.java +++ b/test/hotspot/jtreg/runtime/os/TestMemoryAllocationLogging.java @@ -157,7 +157,7 @@ public class TestMemoryAllocationLogging { expectedLogs = new String[] { /* Debug level log */ String.format("Reserved \\[0x.* - 0x.*\\), \\(%d bytes\\)", PAGE_SIZE), - "Failed to uncommit \\[0x.* - 0x.*\\), \\(.* bytes\\)", + "fatal error: Failed to uncommit \\[0x.* - 0x.*\\), \\(.* bytes\\).*", /* Trace level log */ "mmap failed: \\[0x.* - 0x.*\\), \\(.* bytes\\) errno=\\(Invalid argument\\)" }; diff --git a/test/hotspot/jtreg/runtime/os/TestWXHealing.java b/test/hotspot/jtreg/runtime/os/TestWXHealing.java index 46875848a89..1ed2caf2433 100644 --- a/test/hotspot/jtreg/runtime/os/TestWXHealing.java +++ b/test/hotspot/jtreg/runtime/os/TestWXHealing.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2025 IBM Corporation. All rights reserved. + * Copyright (c) 2026, 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,31 +23,72 @@ */ /* - * @test + * @test id=TraceWXHealing + * @summary Run shell with -XX:+StressWXHealing and -XX:+TraceWXHealing. This tests most of + * the triggers for WX mode. * @requires os.family == "mac" * @requires os.arch == "aarch64" - * @summary Run shell with -XX:+StressWXHealing. This tests most of - * the triggers for WX mode. + * @requires vm.debug == true * @library /test/lib * @compile WXHealing.java - * @run main TestWXHealing + * @build jtreg.SkippedException + * @run main TestWXHealing traceWXHealing */ +/* + * @test id=No-TraceWXHealing + * @summary Run shell with -XX:+StressWXHealing. This tests most of + * the triggers for WX mode. + * @requires os.family == "mac" + * @requires os.arch == "aarch64" + * @library /test/lib + * @compile WXHealing.java + * @build jtreg.SkippedException + * @run main TestWXHealing + */ import java.util.regex.*; import jdk.test.lib.process.*; +import jtreg.SkippedException; -import static java.nio.charset.StandardCharsets.*; +import static java.nio.charset.StandardCharsets.UTF_8; public class TestWXHealing { public static void main(String[] args) throws Throwable { - String[] opts = {"-XX:+UnlockDiagnosticVMOptions", - "-XX:+TraceWXHealing", "-XX:+StressWXHealing", "WXHealing"}; + String[] opts; + boolean traceWXHealing = args.length > 0 && args[0].equals("traceWXHealing"); + // pass -XX:+TraceWXHealing only when instructed to do so + if (traceWXHealing) { + opts = new String[]{ + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+TraceWXHealing", + "-XX:+StressWXHealing", + "WXHealing" + }; + } else { + opts = new String[]{ + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+StressWXHealing", + "WXHealing" + }; + } var process = ProcessTools.createTestJavaProcessBuilder(opts).start(); - String output = new String(process.getInputStream().readAllBytes(), UTF_8); - System.out.println(output); + OutputAnalyzer oa = new OutputAnalyzer(process, UTF_8); + oa.shouldHaveExitValue(0); + String output = oa.getStdout(); + System.out.println("output from WXHealing application: " + output); + if (output.isEmpty()) { + throw new RuntimeException("no output generated by WXHealing application"); + } + if (!traceWXHealing) { + // if -XX:+TraceWXHealing wasn't enabled, then this test merely + // verifies that the java application launched with -XX:+StressWXHealing + // exited normally. + return; + } + // verify the output generated by -XX:+TraceWXHealing if (output.contains("MAP_JIT write protection does not work on this system")) { - System.out.println("Test was not run because MAP_JIT write protection does not work on this system"); + throw new SkippedException("Test was not run because MAP_JIT write protection does not work on this system"); } else { var pattern = Pattern.compile("Healing WXMode WXArmedForWrite at 0x[0-9a-f]* to WXWrite "); var matches = pattern.matcher(output).results().count(); diff --git a/test/hotspot/jtreg/runtime/os/WXHealing.java b/test/hotspot/jtreg/runtime/os/WXHealing.java index ba790db2c59..eb5c5ad7b4b 100644 --- a/test/hotspot/jtreg/runtime/os/WXHealing.java +++ b/test/hotspot/jtreg/runtime/os/WXHealing.java @@ -22,6 +22,8 @@ */ import java.io.*; +import java.util.HashMap; + import jdk.jshell.tool.*; public class WXHealing { @@ -31,6 +33,8 @@ public class WXHealing { public static void main(String[] args) throws Throwable { JavaShellToolBuilder .builder() + // we don't need system level history/storage for this test + .persistence(new HashMap<>()) .in(new ByteArrayInputStream (""" void main() { diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineVerifyError.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineVerifyError.java index fa6bf0b98d4..340207071e0 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineVerifyError.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineVerifyError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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 6402717 8330606 + * @bug 6402717 8330606 8376295 * @summary Redefine VerifyError to get a VerifyError should not throw SOE * @requires vm.jvmti * @library /test/lib @@ -33,10 +33,18 @@ * java.instrument * jdk.jartool/sun.tools.jar * @run main RedefineClassHelper + * * @run main/othervm/timeout=180 * -javaagent:redefineagent.jar * -Xlog:class+init,exceptions * RedefineVerifyError + * + * @run main/othervm/timeout=180 + * -javaagent:redefineagent.jar + * -Xlog:class+init,exceptions + * -XX:+UnlockDiagnosticVMOptions + * -XX:-BytecodeVerificationRemote + * RedefineVerifyError */ import org.objectweb.asm.AnnotationVisitor; diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/SelfSuspendDisablerTest/SelfSuspendDisablerTest.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/SelfSuspendDisablerTest/SelfSuspendDisablerTest.java index b596a5c7ee2..359d4a0b5be 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/SelfSuspendDisablerTest/SelfSuspendDisablerTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/SelfSuspendDisablerTest/SelfSuspendDisablerTest.java @@ -111,7 +111,7 @@ public class SelfSuspendDisablerTest { t3.start(); while(!isSuspended(t3)) { - sleep(100); + sleep(1); } testJvmtiThreadState(t3, SUSPENDED); diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendResume3/SuspendResume3.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendResume3/SuspendResume3.java new file mode 100644 index 00000000000..fbc9ff2d5b3 --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendResume3/SuspendResume3.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2026, 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 8373944 + * @summary Suspend thread while it's trying to acquire a monitor when unmounted vthreads are in the queue + * @requires vm.continuations + * @requires vm.jvmti + * @library /test/lib /test/hotspot/jtreg/testlibrary + * @run main/othervm/native SuspendResume3 + */ + +import java.time.Instant; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Phaser; + +import jvmti.JVMTIUtils; + +public class SuspendResume3 { + int iterations; + int dummyCounter; + Object lock = new Object(); + Phaser allSync = new Phaser(3); + + SuspendResume3 (int iterations) { + this.iterations = iterations; + } + + void worker1(Phaser sync1, Phaser sync2) { + for (int i = 0; i < iterations; i++) { + synchronized (lock) { + sync1.arriveAndAwaitAdvance(); + sync2.arriveAndAwaitAdvance(); + } + allSync.arriveAndAwaitAdvance(); + } + }; + + void worker2(Phaser sync1, Phaser sync2) { + for (int i = 0; i < iterations; i++) { + sync1.arriveAndAwaitAdvance(); + synchronized (lock) { + sync2.arriveAndAwaitAdvance(); + } + allSync.arriveAndAwaitAdvance(); + } + }; + + void vthreadWorker(CountDownLatch started) { + started.countDown(); + synchronized (lock) { + dummyCounter++; + } + } + + private void runTest() throws Exception { + final Phaser w1Sync1 = new Phaser(2); + final Phaser w1Sync2 = new Phaser(2); + Thread worker1 = Thread.ofPlatform().start(() -> worker1(w1Sync1, w1Sync2)); + + final Phaser w2Sync1 = new Phaser(2); + final Phaser w2Sync2 = new Phaser(2); + Thread worker2 = Thread.ofPlatform().start(() -> worker2(w2Sync1, w2Sync2)); + + for (int i = 0; i < iterations; i++) { + // Wait until worker1 acquires monitor + w1Sync1.arriveAndAwaitAdvance(); + // Let worker2 block on monitor + w2Sync1.arriveAndAwaitAdvance(); + await(worker2, Thread.State.BLOCKED); + + // Suspend worker2 + JVMTIUtils.suspendThread(worker2); + + // Add umounted vthread to _entry_list + var started = new CountDownLatch(1); + Thread vthread = Thread.ofVirtual().start(() -> vthreadWorker(started)); + started.await(); + await(vthread, Thread.State.BLOCKED); + + // Now let worker1 release the monitor picking worker2 + // as successor. Since worker2 is suspended, it will wake + // up, acquire the monitor and release it, unparking the + // unmounted thread as next successor. + w1Sync2.arriveAndAwaitAdvance(); + + // Force safepoint + System.gc(); + + // Let vthread terminate + vthread.join(); + + // Resume worker2 + JVMTIUtils.resumeThread(worker2); + w2Sync2.arriveAndAwaitAdvance(); + + if ((i % 10) == 0) { + System.out.println(Instant.now() + " => " + i + " of " + iterations); + } + allSync.arriveAndAwaitAdvance(); + } + + worker1.join(); + worker2.join(); + } + + public static void main(String[] args) throws Exception { + int iterations = (args.length > 0) ? Integer.parseInt(args[0]) : 100; + + SuspendResume3 obj = new SuspendResume3(iterations); + obj.runTest(); + } + + /** + * Waits for the given thread to reach a given state. + */ + private void await(Thread thread, Thread.State expectedState) throws InterruptedException { + Thread.State state = thread.getState(); + while (state != expectedState) { + assertTrue(state != Thread.State.TERMINATED, "Thread has terminated"); + Thread.sleep(10); + state = thread.getState(); + } + } + + private static void assertTrue(boolean condition, String msg) { + if (!condition) { + throw new RuntimeException(msg); + } + } +} diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java index 53370fc09d6..aa3b19c4fcf 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 @@ /** * @test * @bug 8174994 8200613 - * @summary Test the clhsdb commands 'printmdo', 'printall', 'jstack' on a CDS enabled corefile. + * @summary Test the clhsdb commands 'printall', 'jstack' on a CDS enabled corefile. * @requires vm.cds * @requires vm.hasSA * @requires vm.flavor == "server" @@ -124,24 +124,10 @@ public class ClhsdbCDSCore { throw new SkippedException("The CDS archive is not mapped"); } - List testJavaOpts = Arrays.asList(Utils.getTestJavaOpts()); - - if (testJavaOpts.contains("-XX:TieredStopAtLevel=1")) { - // No MDOs are allocated in -XX:TieredStopAtLevel=1 - // The reason is methods being compiled aren't hot enough - // Let's not call printmdo in such scenario - cmds = List.of("printall", "jstack -v"); - } else { - cmds = List.of("printmdo -a", "printall", "jstack -v"); - } + cmds = List.of("printall", "jstack -v"); Map> expStrMap = new HashMap<>(); Map> unExpStrMap = new HashMap<>(); - expStrMap.put("printmdo -a", List.of( - "CounterData", - "BranchData")); - unExpStrMap.put("printmdo -a", List.of( - "No suitable match for type of address")); expStrMap.put("printall", List.of( "aload_0", "_nofast_aload_0", diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbDumpheap.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbDumpheap.java index ee9872867ac..d9f856ab0a3 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbDumpheap.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbDumpheap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,11 +27,14 @@ import java.util.Map; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import static jdk.test.lib.Asserts.assertTrue; import static jdk.test.lib.Asserts.assertFalse; +import static jdk.test.lib.Asserts.fail; import jdk.test.lib.hprof.HprofParser; import jdk.test.lib.apps.LingeredApp; +import jdk.test.lib.hprof.model.Root; import jdk.test.lib.hprof.parser.HprofReader; import jtreg.SkippedException; @@ -66,9 +69,35 @@ public class ClhsdbDumpheap { } } + private static void verifyLocalRefs(String file) throws IOException { + try (var snapshot = HprofReader.readFile(file, false, 0)) { + for (var root = snapshot.getRoots(); root.hasMoreElements();) { + if (root.nextElement().getType() == Root.JAVA_LOCAL) { + // expected + return; + } + } + } + fail("HPROF_GC_ROOT_JAVA_FRAME not found"); + } + + private static void verifyStickyClasses(String file) throws IOException { + try (var snapshot = HprofReader.readFile(file, false, 0)) { + for (var root = snapshot.getRoots(); root.hasMoreElements();) { + if (root.nextElement().getType() == Root.SYSTEM_CLASS) { + // expected + return; + } + } + } + fail("HPROF_GC_ROOT_STICKY_CLASS not found"); + } + private static void verifyDumpFile(File dump) throws Exception { assertTrue(dump.exists() && dump.isFile(), "Could not create dump file " + dump.getAbsolutePath()); printStackTraces(dump.getAbsolutePath()); + verifyLocalRefs(dump.getAbsolutePath()); + verifyStickyClasses(dump.getAbsolutePath()); } private static class SubTest { diff --git a/test/hotspot/jtreg/serviceability/sa/LingeredAppWithVDSOCall.java b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithVDSOCall.java new file mode 100644 index 00000000000..d893ddf6f89 --- /dev/null +++ b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithVDSOCall.java @@ -0,0 +1,61 @@ + +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, NTT DATA + * 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.lang.invoke.MethodHandle; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Linker; +import java.lang.foreign.ValueLayout; + +import jdk.test.lib.Asserts; +import jdk.test.lib.apps.LingeredApp; + + +public class LingeredAppWithVDSOCall extends LingeredApp { + + private static final MethodHandle gettimeofday; + + static { + var desc = FunctionDescriptor.of(ValueLayout.JAVA_INT, // return + ValueLayout.JAVA_LONG, // tv + ValueLayout.JAVA_LONG); // tz + var linker = Linker.nativeLinker(); + var gettimeofdayPtr = linker.defaultLookup().findOrThrow("gettimeofday"); + gettimeofday = linker.downcallHandle(gettimeofdayPtr, desc); + } + + private static void crashAtGettimeofday(long tvAddr, long tzAddr) { + try { + gettimeofday.invoke(tvAddr, tzAddr); + } catch (Throwable t) { + throw new RuntimeException(t); + } + Asserts.fail("gettimeofday() didn't crash"); + } + + public static void main(String[] args) { + setCrasher(() -> crashAtGettimeofday(100L, 200L)); + LingeredApp.main(args); + } +} diff --git a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java index b02d3f3aef3..e90418b1030 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java +++ b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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.util.regex.Matcher; import java.util.regex.Pattern; import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Platform; import jdk.test.lib.SA.SATestUtils; import jdk.test.lib.Utils; import jdk.test.lib.apps.LingeredApp; @@ -35,8 +36,8 @@ import jdk.test.lib.process.OutputAnalyzer; /** * @test * @key randomness - * @bug 8208091 - * @requires (os.family == "linux") & (vm.hasSA) + * @bug 8208091 8374469 8377710 + * @requires (os.family == "linux" | os.family == "windows") & (vm.hasSA) * @requires (os.arch != "riscv64" | !(vm.cpu.features ~= ".*qemu.*")) * @library /test/lib * @run driver TestJhsdbJstackMixed @@ -50,8 +51,11 @@ public class TestJhsdbJstackMixed { private static final Pattern LINE_PATTERN = Pattern .compile(LINE_MATCHER_STR); private static final String HEX_STR_PATTERN = "0x([a-fA-F0-9]+)"; - private static final String FIB_SPLIT_PATTERN = NATIVE_FUNCTION_NAME + + // On windows the native symbol will be prefixed with "NoFramePointer!" + private static final String FIB_SPLIT_PATTERN = "(NoFramePointer!)?" + NATIVE_FUNCTION_NAME + "\\s+\\+"; + private static final Pattern HEX_PATTERN = Pattern.compile(HEX_STR_PATTERN); private static final int ADDRESS_ALIGNMENT_X86 = 4; @@ -149,6 +153,11 @@ public class TestJhsdbJstackMixed { System.err.println(out.getStderr()); out.shouldContain(LingeredAppWithNativeMethod.THREAD_NAME); + out.shouldNotContain("sun.jvm.hotspot.debugger.UnmappedAddressException:"); + if (Platform.isWindows()) { + // We need to check stdout/stderr only once on Windows. + break; + } if (isFibAndAlignedAddress(out.asLines())) { System.out.println("DEBUG: Test triggered interesting condition."); out.shouldNotContain("sun.jvm.hotspot.debugger.UnmappedAddressException:"); @@ -157,7 +166,6 @@ public class TestJhsdbJstackMixed { } System.out.println("DEBUG: Iteration: " + (i + 1) + " - Test didn't trigger interesting condition."); - out.shouldNotContain("sun.jvm.hotspot.debugger.UnmappedAddressException:"); } System.out.println("DEBUG: Test didn't trigger interesting condition " + "but no UnmappedAddressException was thrown. PASS!"); diff --git a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedCore.java b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedCore.java index d781e8c5c09..84a62eb65e5 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedCore.java +++ b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedCore.java @@ -37,7 +37,7 @@ import jtreg.SkippedException; /** * @test - * @bug 8374482 8376264 8376284 + * @bug 8374482 8376264 8376284 8377395 * @requires (os.family == "linux") & (vm.hasSA) * @requires os.arch == "amd64" * @library /test/lib @@ -66,7 +66,7 @@ public class TestJhsdbJstackMixedCore { out.shouldContain("__restore_rt "); out.shouldContain("Java_jdk_test_lib_apps_LingeredApp_crash"); - out.shouldContain("* jdk.test.lib.apps.LingeredApp.crash()"); + out.shouldContain("jdk.test.lib.apps.LingeredApp.crash()"); } public static void main(String... args) throws Throwable { diff --git a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVDSOCallCore.java b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVDSOCallCore.java new file mode 100644 index 00000000000..84da46e272f --- /dev/null +++ b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVDSOCallCore.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, NTT DATA + * 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.nio.file.Path; + +import jtreg.SkippedException; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Platform; +import jdk.test.lib.SA.SATestUtils; +import jdk.test.lib.Utils; +import jdk.test.lib.apps.LingeredApp; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.util.CoreUtils; + +/** + * @test + * @bug 8376269 + * @requires (os.family == "linux") & (vm.hasSA) + * @requires os.arch == "amd64" + * @library /test/lib + * @run driver TestJhsdbJstackMixedWithVDSOCallCore + */ +public class TestJhsdbJstackMixedWithVDSOCallCore { + + private static void runJstackMixed(String coreFileName) throws Exception { + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb"); + launcher.addVMArgs(Utils.getTestJavaOpts()); + launcher.addToolArg("jstack"); + launcher.addToolArg("--mixed"); + launcher.addToolArg("--exe"); + launcher.addToolArg(JDKToolFinder.getTestJDKTool("java")); + launcher.addToolArg("--core"); + launcher.addToolArg(coreFileName); + + ProcessBuilder pb = SATestUtils.createProcessBuilder(launcher); + Process jhsdb = pb.start(); + OutputAnalyzer out = new OutputAnalyzer(jhsdb); + + jhsdb.waitFor(); + + System.out.println(out.getStdout()); + System.err.println(out.getStderr()); + + out.shouldContain("vdso_gettimeofday"); + } + + private static void checkVDSODebugInfo() { + var kernelVersion = System.getProperty("os.version"); + var vdso = Path.of("/lib", "modules", kernelVersion, "vdso", "vdso64.so"); + if (SATestUtils.getDebugInfo(vdso.toString()) == null) { + // Skip this test if debuginfo of vDSO not found because internal + // function of gettimeofday() would not be exported, and vDSO + // binary might be stripped. + throw new SkippedException("vDSO debuginfo not found (" + vdso.toString() + ")"); + } + } + + public static void main(String... args) throws Throwable { + if (Platform.isMusl()) { + throw new SkippedException("This test does not work on musl libc."); + } + checkVDSODebugInfo(); + + var app = new LingeredAppWithVDSOCall(); + app.setForceCrash(true); + LingeredApp.startApp(app, CoreUtils.getAlwaysPretouchArg(true)); + app.waitAppTerminate(); + + String crashOutput = app.getOutput().getStdout(); + String coreFileName = CoreUtils.getCoreFileLocation(crashOutput, app.getPid()); + runJstackMixed(coreFileName); + } +} diff --git a/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java b/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java deleted file mode 100644 index 7292d797740..00000000000 --- a/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2017, 2025, 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.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.HashMap; -import jdk.test.lib.apps.LingeredApp; -import jdk.test.lib.Utils; -import jtreg.SkippedException; - -/** - * @test - * @library /test/lib - * @requires vm.hasSA - * @requires (os.arch != "riscv64" | !(vm.cpu.features ~= ".*qemu.*")) - * @requires vm.flavor == "server" & !vm.emulatedClient & !(vm.opt.TieredStopAtLevel == 1) - * @run main/othervm TestPrintMdo - */ - -public class TestPrintMdo { - - public static void main (String... args) throws Exception { - System.out.println("Starting TestPrintMdo test"); - LingeredApp app = null; - try { - ClhsdbLauncher test = new ClhsdbLauncher(); - app = LingeredApp.startApp("-XX:+ProfileInterpreter", "-XX:CompileThreshold=100"); - System.out.println ("Started LingeredApp with pid " + app.getPid()); - List cmds = List.of("printmdo -a"); - - Map> expStrMap = new HashMap<>(); - Map> unExpStrMap = new HashMap<>(); - expStrMap.put("printmdo -a", List.of( - "VirtualCallData", - "CounterData", - "bci", - "MethodData", - "java/lang/Object")); - unExpStrMap.put("printmdo -a", List.of( - "missing reason for ")); - test.run(app.getPid(), cmds, expStrMap, unExpStrMap); - } catch (SkippedException se) { - throw se; - } catch (Exception ex) { - throw new RuntimeException("Test ERROR " + ex, ex); - } finally { - LingeredApp.stopApp(app); - } - - System.out.println("Test PASSED"); - } -} diff --git a/test/hotspot/jtreg/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java b/test/hotspot/jtreg/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java index cee7bebbd50..9f5355bcdbc 100644 --- a/test/hotspot/jtreg/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java +++ b/test/hotspot/jtreg/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -88,18 +88,11 @@ public class JstatGcCapacityResults extends JstatResults { assertThat(EC <= NGC, "EC > NGC (eden space capacity > new generation capacity)"); // Verify relative size of NGC and S0C + S1C + EC. - // The rule depends on if the tenured GC is parallel or not. - // For parallell GC: NGC >= S0C + S1C + EC - // For non-parallell GC: NGC == S0C + S1C + EC - boolean isTenuredParallelGC = isTenuredParallelGC(); + // NGC == S0C + S1C + EC String errMsg = String.format( - "NGC %s (S0C + S1C + EC) (NGC = %.1f, S0C = %.1f, S1C = %.1f, EC = %.1f, (S0C + S1C + EC) = %.1f)", - isTenuredParallelGC ? "<" : "!=", NGC, S0C, S1C, EC, S0C + S1C + EC); - if (isTenuredParallelGC) { - assertThat(NGC >= S0C + S1C + EC, errMsg); - } else { - assertThat(checkFloatIsSum(NGC, S0C, S1C, EC), errMsg); - } + "NGC != (S0C + S1C + EC) (NGC = %.1f, S0C = %.1f, S1C = %.1f, EC = %.1f, (S0C + S1C + EC) = %.1f)", + NGC, S0C, S1C, EC, S0C + S1C + EC); + assertThat(checkFloatIsSum(NGC, S0C, S1C, EC), errMsg); // Check Old Gen consistency float OGCMN = getFloatValue("OGCMN"); @@ -121,23 +114,4 @@ public class JstatGcCapacityResults extends JstatResults { assertThat(MC >= MCMN, "MC < MCMN (generation capacity < min generation capacity)"); assertThat(MC <= MCMX, "MGC > MCMX (generation capacity > max generation capacity)"); } - - /** - * Check if the tenured generation are currently using a parallel GC. - */ - protected static boolean isTenuredParallelGC() { - // Currently the only parallel GC for the tenured generation is PS MarkSweep. - List parallelGCs = Arrays.asList(new String[] { "PS MarkSweep"}); - try { - List beans = ManagementFactory.getGarbageCollectorMXBeans(); - for (GarbageCollectorMXBean bean : beans) { - if (parallelGCs.contains(bean.getName())) { - return true; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java index 70e4c463c55..8bec7c03bfe 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java @@ -69,8 +69,7 @@ public class TestPhaseIRMatching { List testVMFlags = flagVMProcess.getTestVMFlags(); TestVMProcess testVMProcess = new TestVMProcess(testVMFlags, testClass, null, -1, false, false); TestClassParser testClassParser = new TestClassParser(testClass, false); - Matchable testClassMatchable = testClassParser.parse(testVMProcess.getHotspotPidFileName(), - testVMProcess.getApplicableIRRules()); + Matchable testClassMatchable = testClassParser.parse(testVMProcess.testVmData()); MatchResult result = testClassMatchable.match(); List expectedFails = new ExpectedFailsBuilder().build(testClass); List foundFailures = new FailureBuilder().build(result); diff --git a/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestPrimitiveTypes.java b/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestPrimitiveTypes.java index b1f5f74e682..6193b6aad0c 100644 --- a/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestPrimitiveTypes.java +++ b/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestPrimitiveTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -174,6 +174,46 @@ public class TestPrimitiveTypes { tests.put("test_names", namesTemplate.asToken()); + var abbrevDefTemplate = Template.make("type", (PrimitiveType type) -> scope( + let("CON1", type.con()), + let("CON2", type.con()), + let("abbrev", type.abbrev()), + let("fieldDesc", type.fieldDesc()), + """ + static #type varAbbrev#abbrev = #CON1; + static #type varFieldDesc#fieldDesc = #CON2; + """ + )); + var swapTemplate = Template.make("type", (PrimitiveType type) -> scope( + let("abbrev", type.abbrev()), + let("fieldDesc", type.fieldDesc()), + """ + #type tmp#abbrev = varAbbrev#abbrev; + varAbbrev#abbrev = varFieldDesc#fieldDesc; + varFieldDesc#fieldDesc = tmp#abbrev; + """ + )); + var abbrevTemplate = Template.make(() -> scope( + """ + public static void test_abbrev() { + """, + Hooks.CLASS_HOOK.insert(scope( + // Create fields that would collide if the abbrev() or fieldDesc() methods produced colliding + // strings for different types + CodeGenerationDataNameType.PRIMITIVE_TYPES.stream().map(type -> + abbrevDefTemplate.asToken(type) + ).toList() + )), + CodeGenerationDataNameType.PRIMITIVE_TYPES.stream().map(type -> + swapTemplate.asToken(type) + ).toList(), + """ + } + """ + )); + + tests.put("test_abbrev", abbrevTemplate.asToken()); + // Test runtime random value generation with LibraryRNG // Runtime random number generation of a given primitive type can be very helpful // when writing tests that require random inputs. @@ -231,6 +271,9 @@ public class TestPrimitiveTypes { import compiler.lib.generators.*; public class InnerTest { + """, + Hooks.CLASS_HOOK.anchor(scope( + """ public static void main() { """, // Call all test methods from main. @@ -241,7 +284,8 @@ public class TestPrimitiveTypes { } """, // Now add all the test methods. - tests.values().stream().toList(), + tests.values().stream().toList() + )), """ } """ diff --git a/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java b/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java index ed542180bad..7de32d1bc10 100644 --- a/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java +++ b/test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -226,6 +226,8 @@ public class TestTutorial { // we automatically rename the names that have a $ prepended with // var_1, var_2, etc. """ + // You can escape a hashtag by doubling it up. e.g. ## will render as a + // single hashtag. The same goes for $$. int $var = #con; System.out.println("T1: #x, #con, " + $var); """ diff --git a/test/hotspot/jtreg/testlibrary_tests/template_framework/tests/TestTemplate.java b/test/hotspot/jtreg/testlibrary_tests/template_framework/tests/TestTemplate.java index 9be74d232a7..f56a9d5b231 100644 --- a/test/hotspot/jtreg/testlibrary_tests/template_framework/tests/TestTemplate.java +++ b/test/hotspot/jtreg/testlibrary_tests/template_framework/tests/TestTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 8344942 + * @bug 8344942 8364393 * @summary Test some basic Template instantiations. We do not necessarily generate correct * java code, we just test that the code generation deterministically creates the * expected String. @@ -138,6 +138,7 @@ public class TestTemplate { testHookWithNestedTemplates(); testHookRecursion(); testDollar(); + testEscaping(); testLet1(); testLet2(); testDollarAndHashtagBrackets(); @@ -182,7 +183,6 @@ public class TestTemplate { expectRendererException(() -> testFailingDollarName5(), "Is not a valid '$' replacement pattern: '$' in '$'."); expectRendererException(() -> testFailingDollarName6(), "Is not a valid '$' replacement pattern: '$' in 'asdf$'."); expectRendererException(() -> testFailingDollarName7(), "Is not a valid '$' replacement pattern: '$1' in 'asdf$1'."); - expectRendererException(() -> testFailingDollarName8(), "Is not a valid '$' replacement pattern: '$' in 'abc$$abc'."); expectRendererException(() -> testFailingLetName1(), "A hashtag replacement should not be null."); expectRendererException(() -> testFailingHashtagName1(), "Is not a valid hashtag replacement name: ''."); expectRendererException(() -> testFailingHashtagName2(), "Is not a valid hashtag replacement name: 'abc#abc'."); @@ -191,11 +191,12 @@ public class TestTemplate { expectRendererException(() -> testFailingHashtagName5(), "Is not a valid '#' replacement pattern: '#' in '#'."); expectRendererException(() -> testFailingHashtagName6(), "Is not a valid '#' replacement pattern: '#' in 'asdf#'."); expectRendererException(() -> testFailingHashtagName7(), "Is not a valid '#' replacement pattern: '#1' in 'asdf#1'."); - expectRendererException(() -> testFailingHashtagName8(), "Is not a valid '#' replacement pattern: '#' in 'abc##abc'."); expectRendererException(() -> testFailingDollarHashtagName1(), "Is not a valid '#' replacement pattern: '#' in '#$'."); expectRendererException(() -> testFailingDollarHashtagName2(), "Is not a valid '$' replacement pattern: '$' in '$#'."); - expectRendererException(() -> testFailingDollarHashtagName3(), "Is not a valid '#' replacement pattern: '#' in '#$name'."); - expectRendererException(() -> testFailingDollarHashtagName4(), "Is not a valid '$' replacement pattern: '$' in '$#name'."); + expectRendererException(() -> testFailingDollarHashtagName3(), "Found zero sized replacement pattern '#$'."); + expectRendererException(() -> testFailingDollarHashtagName4(), "Found zero sized replacement pattern '$#'."); + expectRendererException(() -> testFailingDollarHashtagName5(), "Found zero sized replacement pattern '#$'."); + expectRendererException(() -> testFailingDollarHashtagName6(), "Found zero sized replacement pattern '$#'."); expectRendererException(() -> testFailingHook(), "Hook 'Hook1' was referenced but not found!"); expectRendererException(() -> testFailingSample1a(), "No Name found for DataName.FilterdSet(MUTABLE, subtypeOf(int), supertypeOf(int))"); expectRendererException(() -> testFailingSample1b(), "No Name found for StructuralName.FilteredSet( subtypeOf(StructuralA) supertypeOf(StructuralA))"); @@ -822,6 +823,60 @@ public class TestTemplate { checkEQ(code, expected); } + public static void testEscaping() { + var template1 = Template.make(() -> scope( + let("one", 1), + let("two", 2), + let("three", 3), + """ + abc##def + abc$$def + abc####def + abc$$$$def + ##abc + $$abc + abc## + abc$$ + ## + $$ + ###### + $$$$$$ + abc###one + abc$$$dollar + #one ###two #####three + ###{one}## + $dollar $$$dollar $$$$$dollar + $$${dollar}$$ + ##$dollar $$#one $$##$$## + """ + )); + + String code = template1.render(); + String expected = + """ + abc#def + abc$def + abc##def + abc$$def + #abc + $abc + abc# + abc$ + # + $ + ### + $$$ + abc#1 + abc$dollar_1 + 1 #2 ##3 + #1# + dollar_1 $dollar_1 $$dollar_1 + $dollar_1$ + #dollar_1 $1 $#$# + """; + checkEQ(code, expected); + } + public static void testLet1() { var hook1 = new Hook("Hook1"); @@ -3382,13 +3437,6 @@ public class TestTemplate { String code = template1.render(); } - public static void testFailingDollarName8() { - var template1 = Template.make(() -> scope( - "abc$$abc" // empty dollar name - )); - String code = template1.render(); - } - public static void testFailingLetName1() { var template1 = Template.make(() -> scope( let(null, $("abc")) // Null input for hashtag name @@ -3447,13 +3495,6 @@ public class TestTemplate { String code = template1.render(); } - public static void testFailingHashtagName8() { - var template1 = Template.make(() -> scope( - "abc##abc" // empty hashtag name - )); - String code = template1.render(); - } - public static void testFailingDollarHashtagName1() { var template1 = Template.make(() -> scope( "#$" // empty hashtag name @@ -3470,14 +3511,28 @@ public class TestTemplate { public static void testFailingDollarHashtagName3() { var template1 = Template.make(() -> scope( - "#$name" // empty hashtag name + "#$name" // Zero sized replacement )); String code = template1.render(); } public static void testFailingDollarHashtagName4() { var template1 = Template.make(() -> scope( - "$#name" // empty dollar name + "$#name" // Zero sized replacement + )); + String code = template1.render(); + } + + public static void testFailingDollarHashtagName5() { + var template1 = Template.make(() -> scope( + "asdf#$abc" // Zero sized replacement + )); + String code = template1.render(); + } + + public static void testFailingDollarHashtagName6() { + var template1 = Template.make(() -> scope( + "asdf$#abc" // Zero sized replacement )); String code = template1.render(); } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CompiledMethodUnload/compmethunload001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CompiledMethodUnload/compmethunload001.java index 09fdb1ae3f7..cf840e56c07 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CompiledMethodUnload/compmethunload001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CompiledMethodUnload/compmethunload001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,8 +24,6 @@ package nsk.jvmti.CompiledMethodUnload; import java.io.*; -import java.math.*; -import java.util.*; import nsk.share.*; import nsk.share.jvmti.*; @@ -93,8 +91,11 @@ public class compmethunload001 { hotCls = null; c = null; - boolean clsUnloaded = clsUnLoader.unloadClass(); - clsUnLoader = null; + // BackgroundCompilation is on by default so wait for compiler threads + // to drop references to the to-be-unloaded class. + if (!clsUnLoader.unloadClassAndWait(10_000)) { + throw new Failure("Class should have been unloaded"); + } } private int runThis(String argv[], PrintStream out) throws Exception { @@ -114,7 +115,7 @@ public class compmethunload001 { num = unloaded(); iter++; if (iter > MAX_ITERATIONS) { - throw new Failure("PRODUCT BUG: class was not unloaded in " + MAX_ITERATIONS); + throw new Failure("PRODUCT BUG: no classunloading callback in " + MAX_ITERATIONS); } } System.out.println("Number of unloaded events " + num + " number of iterations " + iter); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/ClassUnloader.java b/test/hotspot/jtreg/vmTestbase/nsk/share/ClassUnloader.java index 5c7d2b8d640..8f473bf60c5 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/ClassUnloader.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/ClassUnloader.java @@ -33,6 +33,7 @@ import java.util.*; import nsk.share.gc.gp.*; import nsk.share.test.ExecutionController; import nsk.share.test.Stresser; +import jdk.test.lib.Utils; import jdk.test.whitebox.WhiteBox; /** @@ -231,45 +232,49 @@ public class ClassUnloader { * Forces GC to unload previously loaded classes by cleaning all references * to class loader with its loaded classes. * - * @return true if classes unloading has been detected + * @return true if the class has been unloaded or false otherwise * - * @throws Failure if exception other than OutOfMemoryError - * is thrown while triggering full GC - * * @see WhiteBox.getWhiteBox().fullGC() */ - - public static final int MAX_UNLOAD_ATTEMPS = 10; - public boolean unloadClass() { - // free references to class and class loader to be able for collecting by GC classObjects.removeAllElements(); customClassLoader = null; // force class unloading by triggering full GC WhiteBox.getWhiteBox().fullGC(); - int count = 0; - while (count++ < MAX_UNLOAD_ATTEMPS && !isClassLoaderReclaimed()) { - System.out.println("ClassUnloader: waiting for class loader reclaiming... " + count); - WhiteBox.getWhiteBox().fullGC(); - try { - // small delay to give more changes to process objects - // inside VM like jvmti deferred queue - Thread.sleep(100); - } catch (InterruptedException e) { - } - } - // force GC to unload marked class loader and its classes if (isClassLoaderReclaimed()) { System.out.println("ClassUnloader: class loader has been reclaimed."); return true; + } else { + System.out.println("ClassUnloader: class loader is still reachable."); + return false; } + } - // class loader has not been reclaimed - System.out.println("ClassUnloader: class loader is still reachable."); - return false; + /** + * Forces GC to unload previously loaded classes by cleaning all references + * to class loader with its loaded classes and wait for class loader to be reclaimed. + * + * @param timeout max time to wait for class loader to be reclaimed in milliseconds + * @return true if the class has been unloaded + or false otherwise + */ + public boolean unloadClassAndWait(long timeout) { + timeout = Utils.adjustTimeout(timeout); + boolean wasUnloaded; + final long waitTime = 100; + do { + try { + Thread.sleep(waitTime); + } catch (InterruptedException e) { + // ignore + } + timeout -= waitTime; + wasUnloaded = unloadClass(); + } while (!wasUnloaded && timeout > 0); + return wasUnloaded; } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/AbstractDebuggeeTest.java b/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/AbstractDebuggeeTest.java index 74516fd5a69..ec4dcd87d67 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/AbstractDebuggeeTest.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/AbstractDebuggeeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2026, 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 @@ -153,7 +153,18 @@ public class AbstractDebuggeeTest { ClassUnloader classUnloader = loadedClasses.get(className); if (classUnloader != null) { - boolean wasUnloaded = classUnloader.unloadClass(); + boolean wasUnloaded; + if (expectedUnloadingResult) { + // We expect unloading to succeed. Retry multiple times because + // the debug agent creates global references (NewGlobalRef) + // when handling ClassPrepare events. These global references + // are released only by the agent thread, whose scheduling can + // be delayed, causing class unloading to occur later than + // expected. + wasUnloaded = classUnloader.unloadClassAndWait(10_000); + } else { + wasUnloaded = classUnloader.unloadClass(); + } if (wasUnloaded) loadedClasses.remove(className); diff --git a/test/jaxp/TEST.ROOT b/test/jaxp/TEST.ROOT index 82504c251c0..aff3b769830 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=8.1+1 +requiredVersion=8.2.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 94015ebc680..070f9b0ce03 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -223,6 +223,7 @@ sun/awt/shell/ShellFolderMemoryLeak.java 8197794 windows-all sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java 8196102 generic-all sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java 8196180 windows-all,macosx-all sun/java2d/OpenGL/OpaqueDest.java#id1 8367574 macosx-all +sun/java2d/OpenGL/ScaleParamsOOB.java#id0 8377908 linux-all sun/java2d/SunGraphics2D/EmptyClipRenderingTest.java 8144029 macosx-all,linux-all sun/java2d/SunGraphics2D/DrawImageBilinear.java 8297175 linux-all sun/java2d/SunGraphics2D/PolyVertTest.java 6986565 generic-all diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index f22b316e19a..cc571deab20 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This file identifies the root of the test-suite hierarchy. @@ -123,7 +123,7 @@ requires.properties= \ jdk.static # Minimum jtreg version -requiredVersion=8.1+1 +requiredVersion=8.2.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/com/sun/jdi/EATests.java b/test/jdk/com/sun/jdi/EATests.java index cb51e91021b..3a936f288cc 100644 --- a/test/jdk/com/sun/jdi/EATests.java +++ b/test/jdk/com/sun/jdi/EATests.java @@ -84,6 +84,15 @@ * @comment Regression test for using the wrong thread when logging during re-locking from deoptimization. * * @comment DiagnoseSyncOnValueBasedClasses=2 will cause logging when locking on \@ValueBased objects. + * @run driver EATests + * -XX:+UnlockDiagnosticVMOptions + * -Xms256m -Xmx256m + * -Xbootclasspath/a:. + * -XX:CompileCommand=dontinline,*::dontinline_* + * -XX:+WhiteBoxAPI + * -Xbatch + * -XX:+DoEscapeAnalysis -XX:+EliminateAllocations -XX:+EliminateLocks -XX:+EliminateNestedLocks + * -XX:DiagnoseSyncOnValueBasedClasses=2 * * @comment Re-lock may inflate monitors when re-locking, which cause monitorinflation trace logging. * @run driver EATests diff --git a/test/jdk/com/sun/jdi/JdbMethodExitTest.java b/test/jdk/com/sun/jdi/JdbMethodExitTest.java index 77e12b5f4a6..da76ddb4ab6 100644 --- a/test/jdk/com/sun/jdi/JdbMethodExitTest.java +++ b/test/jdk/com/sun/jdi/JdbMethodExitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2026, 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 @@ -239,6 +239,7 @@ public class JdbMethodExitTest extends JdbTest { // trace exit of methods with all the return values // (but just check a couple of them) jdb.command(JdbCommand.traceMethodExits(true, threadId)); + execCommand(JdbCommand.trace()); execCommand(JdbCommand.cont()) .shouldContain("instance of JdbMethodExitTestTarg") .shouldContain("return value = 8"); @@ -252,7 +253,7 @@ public class JdbMethodExitTest extends JdbTest { .shouldContain("Method entered:"); execCommand(JdbCommand.cont()) .shouldContain("Method exited: return value = \"traceMethods\""); - jdb.command(JdbCommand.stepUp()); + jdb.command(JdbCommand.next()); List reply = new LinkedList<>(); diff --git a/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java b/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java index 80931ca7440..76acac11506 100644 --- a/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java +++ b/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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,10 +35,11 @@ import javax.management.remote.JMXConnectionNotification; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; +import jdk.test.lib.Utils; public class Client { - public static final int COUNTER_TIMEOUT_SECONDS = 60; + public static final int COUNTER_TIMEOUT_SECONDS = 30; public static void run(String url) throws Exception { final int notifEmittedCnt = 10; @@ -87,7 +88,7 @@ public class Client { System.out.println(); try { System.out.println("waiting for " + notifEmittedCnt + " notifications to arrive"); - if (!counter.await(COUNTER_TIMEOUT_SECONDS, TimeUnit.SECONDS)) { + if (!counter.await(Utils.adjustTimeout(COUNTER_TIMEOUT_SECONDS), TimeUnit.SECONDS)) { throw new Error("Client: Counter await expired"); } if (duplNotification.get()) { diff --git a/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java b/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java index 0e5e5e30d4e..5fac14d76e3 100644 --- a/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java +++ b/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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,9 @@ import java.util.Arrays; * @author Jaroslav Bachorik * @bug 6937053 8005472 * + * @library /test/lib + * @build jdk.test.lib.Utils + * * @modules java.management * jdk.compiler * @run clean TestSerializationMismatch diff --git a/test/jdk/com/sun/jndi/dns/ConfigTests/PortUnreachable.java b/test/jdk/com/sun/jndi/dns/ConfigTests/PortUnreachable.java index 0a92e52c270..eb917c2f25a 100644 --- a/test/jdk/com/sun/jndi/dns/ConfigTests/PortUnreachable.java +++ b/test/jdk/com/sun/jndi/dns/ConfigTests/PortUnreachable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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 @@ -36,7 +36,7 @@ import javax.naming.directory.InitialDirContext; * @requires os.family != "aix" * @library ../lib/ * @modules java.base/sun.security.util - * @run main/othervm -Djdk.net.usePlainDatagramSocketImpl=false PortUnreachable + * @run main PortUnreachable */ public class PortUnreachable extends DNSTestBase { diff --git a/test/jdk/com/sun/jndi/ldap/SaslOutputStreamCloseTest.java b/test/jdk/com/sun/jndi/ldap/SaslOutputStreamCloseTest.java new file mode 100644 index 00000000000..5558a4ab196 --- /dev/null +++ b/test/jdk/com/sun/jndi/ldap/SaslOutputStreamCloseTest.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2026, 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.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.reflect.Constructor; + +import javax.security.sasl.SaslClient; +import javax.security.sasl.SaslException; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; + +/* + * @test + * @bug 8377486 + * @summary Verify that SaslOutputStream.write() methods throw an IOException, if invoked + * when the stream is closed + * @modules java.security.sasl/com.sun.security.sasl + * java.naming/com.sun.jndi.ldap.sasl:+open + * @run junit ${test.main.class} + */ +class SaslOutputStreamCloseTest { + + /* + * Verifies that SaslOutputStream.write(...) throws IOException if the SaslOutputStream + * is closed. + */ + @Test + void testWriteThrowsIOExceptionOnClose() throws Exception { + try (final OutputStream os = createSaslOutputStream(new ByteArrayOutputStream())) { + os.write(new byte[]{0x42, 0x42}); + os.close(); + try { + os.write(new byte[]{0x42}, 0, 1); + fail("OutputStream.write(...) on closed " + os + " did not throw IOException"); + } catch (IOException ioe) { + // verify it was thrown for right reason + if (!"stream closed".equals(ioe.getMessage())) { + throw ioe; // propagate original exception + } + // expected + System.err.println("received expected IOException: " + ioe); + } + } + } + + // reflectively construct an instance of + // (package private) com.sun.jndi.ldap.sasl.SaslOutputStream class + private static OutputStream createSaslOutputStream(final OutputStream underlying) throws Exception { + final Constructor constructor = Class.forName("com.sun.jndi.ldap.sasl.SaslOutputStream") + .getDeclaredConstructor(new Class[]{SaslClient.class, OutputStream.class}); + constructor.setAccessible(true); + return (OutputStream) constructor.newInstance(new DummySaslClient(), underlying); + } + + + private static final class DummySaslClient implements SaslClient { + private boolean closed; + + @Override + public String getMechanismName() { + return "DUMMY"; + } + + @Override + public boolean hasInitialResponse() { + return false; + } + + @Override + public byte[] evaluateChallenge(byte[] challenge) throws SaslException { + return new byte[0]; + } + + @Override + public boolean isComplete() { + return true; + } + + @Override + public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { + if (closed) { + // intentionally throw something other than a IOException + throw new IllegalStateException(this + " is closed"); + } + return incoming; + } + + @Override + public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { + if (closed) { + // intentionally throw something other than a IOException + throw new IllegalStateException(this + " is closed"); + } + return outgoing; + } + + @Override + public Object getNegotiatedProperty(String propName) { + return null; + } + + @Override + public void dispose() { + this.closed = true; + } + } +} diff --git a/test/jdk/com/sun/jndi/ldap/SkipAbandonRequestOnClosedConn.java b/test/jdk/com/sun/jndi/ldap/SkipAbandonRequestOnClosedConn.java new file mode 100644 index 00000000000..cb2eef49bd2 --- /dev/null +++ b/test/jdk/com/sun/jndi/ldap/SkipAbandonRequestOnClosedConn.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2026, 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.io.FilterInputStream; +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.net.Socket; +import java.util.Arrays; +import java.util.Hashtable; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import com.sun.jndi.ldap.Connection; +import com.sun.jndi.ldap.LdapClient; +import com.sun.jndi.ldap.LdapCtx; +import jdk.test.lib.net.URIBuilder; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; + +/* + * @test + * @bug 8362268 + * @summary Verify that unexpected exceptions aren't propagated to LdapCtx callers + * when the LdapCtx's (internal) connection is closed due to an exception + * when reading/writing over the connection's stream + * @modules java.naming/com.sun.jndi.ldap:+open + * @library /test/lib lib/ + * @build jdk.test.lib.net.URIBuilder + * BaseLdapServer LdapMessage + * @run junit/othervm ${test.main.class} + */ +class SkipAbandonRequestOnClosedConn { + + private static final String LOOKUP_NAME = "ou=People,o=FooBar"; + + private static final class Server extends BaseLdapServer { + + private Server() throws IOException { + super(); + } + + // handles and responds to the incoming LDAP request + @Override + protected void handleRequest(final Socket socket, + final LdapMessage request, + final OutputStream out) throws IOException { + switch (request.getOperation()) { + case SEARCH_REQUEST: { + System.err.println("responding to SEARCH_REQUEST with id: " + + request.getMessageID() + " on socket " + socket); + // write out some bytes as a response. it doesn't matter what those + // bytes are - in this test they aren't expected to reach + // the application code. + final byte[] irrelevantResponse = new byte[]{0x42, 0x42, 0x42}; + System.err.println("Response: " + Arrays.toString(irrelevantResponse)); + out.write(irrelevantResponse); + out.flush(); + break; + } + default: { + throw new IOException("unexpected operation type: " + request.getOperation() + + ", request: " + request); + } + } + } + } + + private static Server server; + + @BeforeAll + static void beforeAll() throws Exception { + server = new Server(); + server.start(); + System.err.println("server started at " + server.getInetAddress() + + ":" + server.getPort()); + } + + @AfterAll + static void afterAll() throws Exception { + if (server != null) { + System.err.println("stopping server " + server.getInetAddress() + + ":" + server.getPort()); + server.close(); + } + } + + + /* + * Creates a com.sun.jndi.ldap.LdapCtx and configures its internal com.sun.jndi.ldap.Connection + * instance with an InputStream that throws an IOException in its read() methods. The test + * then initiates a Context.lookup() so that a LDAP request is internally issued and a LDAP + * response is waited for. Due to the configured InputStream throwing an exception from its + * read(), the com.sun.jndi.ldap.Connection will get closed (internally) when reading the + * response and the main thread which was waiting for the LDAP response is woken up and notices + * the connection closure. This test verifies that a NamingException gets thrown from the + * lookup() in this scenario. + */ + @Test + void testNamingException() throws Exception { + final Hashtable envProps = new Hashtable<>(); + envProps.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + final String providerUrl = URIBuilder.newBuilder() + .scheme("ldap") + .host(server.getInetAddress().getHostAddress()) + .port(server.getPort()) + .build().toString(); + envProps.put(Context.PROVIDER_URL, providerUrl); + // explicitly set LDAP version to 3 to prevent LDAP BIND requests + // during LdapCtx instantiation + envProps.put("java.naming.ldap.version", "3"); + // create a (custom) InitialContext which allows us to access the + // LdapCtx's internal connection instance + try (final CustomContext ctx = new CustomContext(envProps)) { + // replace the InputStream and OutputStream of the LdapCtx's + // internal connection, to allow us to raise exception from + // the InputStream and OutputStream as necessary + ctx.replaceStreams(); + + System.err.println("issuing ldap request against " + providerUrl + + " using context " + ctx); + // trigger the LDAP SEARCH request through the lookup call. we are not + // interested in the returned value and are merely interested in the + // Context.lookup(...) failing with a NamingException + assertLookupThrowsNamingException(ctx); + } + } + + // assert that Context.lookup(...) raises a NamingException + private static void assertLookupThrowsNamingException(final Context ctx) { + try { + final Object result = ctx.lookup(LOOKUP_NAME); + fail("Context.lookup() was expected to throw NamingException" + + " but returned result " + result); + } catch (NamingException ne) { + // verify the NamingException is for the right reason + if (!ne.toString().contains("LDAP connection has been closed")) { + // unexpected exception, propagate it + fail("NamingException is missing \"LDAP connection has been closed\" message", ne); + } + // expected + System.err.println("got expected exception: " + ne); + } + } + + private static final class CustomContext extends InitialContext implements AutoCloseable { + + private CustomContext(final Hashtable environment) throws NamingException { + super(environment); + } + + private LdapCtx getLdapCtx() throws NamingException { + final Context ctx = getDefaultInitCtx(); + if (ctx instanceof LdapCtx ldapCtx) { + return ldapCtx; + } + throw new IllegalStateException("Not a LdapCtx: " + ctx.getClass().getName()); + } + + // using reflection, return the com.sun.jndi.ldap.Connection instance + // from within the com.sun.jndi.ldap.LdapCtx + private Connection getConnection() throws Exception { + final LdapCtx ldapCtx = getLdapCtx(); + final Field clientField = ldapCtx.getClass().getDeclaredField("clnt"); + clientField.setAccessible(true); + final LdapClient ldapClient = (LdapClient) clientField.get(ldapCtx); + final Field connField = ldapClient.getClass().getDeclaredField("conn"); + connField.setAccessible(true); + return (Connection) connField.get(ldapClient); + } + + private void replaceStreams() throws Exception { + final Connection conn = getConnection(); + assertNotNull(conn, "com.sun.jndi.ldap.Connection instance is null"); + final InputStream originalInputStream = conn.inStream; + final OutputStream originalOutputStream = conn.outStream; + // replace the connection's streams with our test specific streams + conn.replaceStreams(new In(originalInputStream), new Out(originalOutputStream)); + System.err.println("replaced streams on connection: " + conn); + } + } + + // an OutputStream which intentionally throws a NullPointerException + // from its write(...) methods if the OutputStream has been closed + private static final class Out extends FilterOutputStream { + private volatile boolean closed; + + private Out(final OutputStream underlying) { + super(underlying); + } + + @Override + public void write(final int b) throws IOException { + if (closed) { + throw new NullPointerException("OutputStream is closed - intentional" + + " NullPointerException instead of IOException"); + } + super.write(b); + } + + @Override + public void write(final byte[] b, final int off, final int len) throws IOException { + if (closed) { + throw new NullPointerException("OutputStream is closed - intentional" + + " NullPointerException instead of IOException"); + } + super.write(b, off, len); + } + + @Override + public void close() throws IOException { + System.err.println("closing output stream " + this); + closed = true; + super.close(); + } + } + + // an InputStream which intentionally throws an exception + // from its read(...) methods. + private static final class In extends FilterInputStream { + + private In(InputStream underlying) { + super(underlying); + } + + @Override + public int read() throws IOException { + final int v = super.read(); + System.err.println("read " + v + " from " + in + + ", will now intentionally throw an exception"); + throw new IOException("intentional IOException from " + In.class.getName() + ".read()"); + } + + @Override + public int read(final byte[] b, final int off, final int len) throws IOException { + final int v = super.read(b, off, len); + System.err.println("read " + v + " byte(s) from " + in + + ", will now intentionally throw an exception"); + throw new IOException("intentional IOException from " + In.class.getName() + + ".read(byte[], int, int)"); + } + } +} diff --git a/test/jdk/com/sun/net/httpserver/ContextPathMatcherPathPrefixTest.java b/test/jdk/com/sun/net/httpserver/ContextPathMatcherPathPrefixTest.java new file mode 100644 index 00000000000..e1cff62a45f --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/ContextPathMatcherPathPrefixTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2026, 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 com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; + +import static java.net.http.HttpClient.Builder.NO_PROXY; + +import org.junit.jupiter.api.AfterAll; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +/* + * @test id=default + * @bug 8272758 + * @summary Verifies path prefix matching using defaults + * @build EchoHandler + * @run junit ${test.main.class} + */ + +/* + * @test id=withProperty + * @bug 8272758 + * @summary Verifies path prefix matching by providing a system property + * @build EchoHandler + * @run junit/othervm + * -Dsun.net.httpserver.pathMatcher=pathPrefix + * ${test.main.class} + */ + +/* + * @test id=withInvalidProperty + * @bug 8272758 + * @summary Verifies path prefix matching by providing a system property + * containing an invalid value, and observing it fall back to the + * default + * @build EchoHandler + * @run junit/othervm + * -Dsun.net.httpserver.pathMatcher=noSuchMatcher + * ${test.main.class} + */ + +public class ContextPathMatcherPathPrefixTest { + + protected static final HttpClient CLIENT = + HttpClient.newBuilder().proxy(NO_PROXY).build(); + + @AfterAll + static void stopClient() { + CLIENT.shutdownNow(); + } + + @Test + void testContextPathOfEmptyString() { + var iae = assertThrows(IllegalArgumentException.class, () -> new Infra("")); + assertEquals("Illegal value for path or protocol", iae.getMessage()); + } + + @Test + void testContextPathAtRoot() throws Exception { + try (var infra = new Infra("/")) { + infra.expect(200, "/foo", "/foo/", "/foo/bar", "/foobar"); + } + } + + @Test + void testContextPathAtSubDir() throws Exception { + try (var infra = new Infra("/foo")) { + infra.expect(200, "/foo", "/foo/", "/foo/bar"); + infra.expect(404, "/foobar"); + } + } + + @Test + void testContextPathAtSubDirWithTrailingSlash() throws Exception { + try (var infra = new Infra("/foo/")) { + infra.expect(200, "/foo/", "/foo/bar"); + infra.expect(404, "/foo", "/foobar"); + } + } + + protected static final class Infra implements AutoCloseable { + + private static final InetSocketAddress LO_SA_0 = + new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); + + private static final HttpHandler HANDLER = new EchoHandler(); + + private final HttpServer server; + + private final String contextPath; + + protected Infra(String contextPath) throws IOException { + this.server = HttpServer.create(LO_SA_0, 10); + server.createContext(contextPath, HANDLER); + server.start(); + this.contextPath = contextPath; + } + + protected void expect(int statusCode, String... requestPaths) throws Exception { + for (String requestPath : requestPaths) { + var requestURI = URI.create("http://%s:%s%s".formatted( + server.getAddress().getHostString(), + server.getAddress().getPort(), + requestPath)); + var request = HttpRequest.newBuilder(requestURI).build(); + var response = CLIENT.send(request, HttpResponse.BodyHandlers.discarding()); + assertEquals( + statusCode, response.statusCode(), + "unexpected status code " + Map.of( + "contextPath", contextPath, + "requestPath", requestPath)); + } + } + + @Override + public void close() { + server.stop(0); + } + + } + +} diff --git a/test/jdk/com/sun/net/httpserver/ContextPathMatcherStringPrefixTest.java b/test/jdk/com/sun/net/httpserver/ContextPathMatcherStringPrefixTest.java new file mode 100644 index 00000000000..3f3008a8531 --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/ContextPathMatcherStringPrefixTest.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2026, 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.Test; + +/* + * @test + * @bug 8272758 + * @summary Verifies string prefix matching configured using a system property + * @build ContextPathMatcherPathPrefixTest + * EchoHandler + * @run junit/othervm + * -Dsun.net.httpserver.pathMatcher=stringPrefix + * ${test.main.class} + */ + +class ContextPathMatcherStringPrefixTest extends ContextPathMatcherPathPrefixTest { + + @Test + @Override + void testContextPathAtRoot() throws Exception { + try (var infra = new Infra("/")) { + infra.expect(200, "/foo", "/foo/", "/foo/bar", "/foobar"); + } + } + + @Test + @Override + void testContextPathAtSubDir() throws Exception { + try (var infra = new Infra("/foo")) { + infra.expect(200, "/foo", "/foo/", "/foo/bar", "/foobar"); + } + } + + @Test + @Override + void testContextPathAtSubDirWithTrailingSlash() throws Exception { + try (var infra = new Infra("/foo/")) { + infra.expect(200, "/foo/", "/foo/bar"); + infra.expect(404, "/foo", "/foobar"); + } + } + +} diff --git a/test/jdk/com/sun/net/httpserver/FailAndStopTest.java b/test/jdk/com/sun/net/httpserver/FailAndStopTest.java new file mode 100644 index 00000000000..005d78add18 --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/FailAndStopTest.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2026, 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 8377302 + * @summary HttpServer.stop() blocks indefinitely if handler throws + * @modules jdk.httpserver java.logging + * @library /test/lib + * @run main/othervm ${test.main.class} + */ + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import java.util.function.BiPredicate; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsServer; +import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; +import jdk.test.lib.Utils; +import static com.sun.net.httpserver.HttpExchange.RSPBODY_CHUNKED; + +public class FailAndStopTest implements HttpHandler { + // Keep that logger in a static field to make sure it doesn't + // get GC'ed and recreated before the HttpServer is initialized. + private static final Logger LOGGER = Logger.getLogger("com.sun.net.httpserver"); + private static final String BODY = "OK"; + + static enum TestCases { + FAILNOW("failNow", TestCases::shouldAlwaysFail), + ASSERTNOW("assertNow", TestCases::shouldAlwaysFail), + RESPANDFAIL("failAfterResponseStatus", TestCases::shouldFailExceptForHead), + RESPANDASSERT("assertAfterResponseStatus", TestCases::shouldFailExceptForHead), + CLOSEAFTERRESP("closeExchangeAfterResponseStatus", TestCases::shouldFailExceptForHead), + BODYANDFAIL("failAfterBody", TestCases::shouldFailExceptForHeadOrHttps), + BODYANDASSERT("assertAfterBody", TestCases::shouldFailExceptForHeadOrHttps), + CLOSEBEFOREOS("closeExchangeBeforeOS", TestCases::shouldNeverFail), + CLOSEANDRETURN("closeAndReturn", TestCases::shouldNeverFail), + CLOSEANDFAIL("closeAndFail", TestCases::shouldNeverFail), + CLOSEANDASSERT("closeAndAssert", TestCases::shouldNeverFail); + + private final String query; + private BiPredicate shouldFail; + TestCases(String query, BiPredicate shouldFail) { + this.query = query; + this.shouldFail = shouldFail; + } + boolean shouldFail(String scheme, String method) { + // in case of HEAD method the client should not + // fail if we throw after sending response headers + return shouldFail.test(scheme, method); + } + private static boolean shouldAlwaysFail(String scheme, String method) { + return true; + } + private static boolean shouldNeverFail(String scheme, String method) { + return false; + } + private static boolean shouldFailExceptForHead(String scheme, String method) { + return !"HEAD".equals(method); + } + private static boolean shouldFailExceptForHeadOrHttps(String scheme, String method) { + // When using https, the buffered response bytes may be sent + // when the connection is closed, in which case the full body + // will be correctly received, and the client connection + // will not fail. With plain http, the bytes are not sent and + // the client fails with premature end of file. + return !"HEAD".equals(method) && !"https".equalsIgnoreCase(scheme); + } + + } + + @Override + public void handle(HttpExchange ex) throws IOException { + String query = ex.getRequestURI().getRawQuery(); + TestCases step = TestCases.FAILNOW; + if (query == null || query.equals(step.query)) { + System.out.println("Server: " + step); + throw new NullPointerException("Got you!"); + } + step = TestCases.ASSERTNOW; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new AssertionError("Got you!"); + } + byte[] body = BODY.getBytes(StandardCharsets.UTF_8); + ex.sendResponseHeaders(200, body.length); + step = TestCases.RESPANDFAIL; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new NullPointerException("Got you!"); + } + step = TestCases.RESPANDASSERT; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new AssertionError("Got you!"); + } + step = TestCases.CLOSEAFTERRESP; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + ex.close(); + return; + } + if (!"HEAD".equals(ex.getRequestMethod())) { + ex.getResponseBody().write(body); + } + step = TestCases.BODYANDFAIL; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new NullPointerException("Got you!"); + } + step = TestCases.BODYANDASSERT; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new AssertionError("Got you!"); + } + step = TestCases.CLOSEBEFOREOS; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + ex.close(); + return; + } + System.out.println("Server: closing response body"); + ex.getResponseBody().close(); + step = TestCases.CLOSEANDRETURN; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + ex.close(); + return; + } + step = TestCases.CLOSEANDFAIL; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new NullPointerException("Got you!"); + } + step = TestCases.CLOSEANDASSERT; + if (query.equals(step.query)) { + System.out.println("Server: " + step); + throw new AssertionError("Got you!"); + } + } + + private static void enableHttpServerLogging() { + // set HttpServer's logger to ALL + LOGGER.setLevel(Level.ALL); + // get the root logger, get its first handler (by default + // it's a ConsoleHandler), and set its level to ALL (by + // default its level is INFO). + Logger.getLogger("").getHandlers()[0].setLevel(Level.ALL); + } + + + public static void main(String[] args) throws Exception { + + enableHttpServerLogging(); + + // test with GET + for (var test : TestCases.values()) { + test(test, Optional.empty(), "http"); + test(test, Optional.empty(), "https"); + } + // test with HEAD + for (var test : TestCases.values()) { + test(test, Optional.of("HEAD"), "http"); + test(test, Optional.of("HEAD"), "https"); + } + } + + private static SSLContext initSSLContext(boolean secure) { + SSLContext context = secure ? SimpleSSLContext.findSSLContext() : null; + if (secure) { + SSLContext.setDefault(context); + } + return context; + } + + private static HttpServer createHttpServer(SSLContext context) throws IOException { + var address = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); + if (context != null) { + var server = HttpsServer.create(address, 0); + server.setHttpsConfigurator(new HttpsConfigurator(context)); + return server; + } else { + return HttpServer.create(address, 0); + } + } + + private static HttpURLConnection createConnection(URL url, boolean secure) + throws IOException { + HttpURLConnection urlc = (HttpURLConnection) url.openConnection(Proxy.NO_PROXY); + if (secure) { + ((HttpsURLConnection)urlc).setHostnameVerifier(new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); + } + return urlc; + } + + private static void test(TestCases test, Optional method, String scheme) + throws Exception { + boolean secure = "https".equalsIgnoreCase(scheme); + SSLContext context = initSSLContext(secure); + HttpServer server = createHttpServer(context); + + System.out.println("Test: " + method.orElse("GET") + " " + test.query); + System.out.println("Server listening at: " + server.getAddress()); + try { + server.createContext("/FailAndStopTest/", new FailAndStopTest()); + server.start(); + + URL url = URIBuilder.newBuilder() + .scheme(scheme) + .loopback() + .port(server.getAddress().getPort()) + .path("/FailAndStopTest/") + .query(test.query) + .toURLUnchecked(); + System.out.println("Connecting to: " + url); + HttpURLConnection urlc = createConnection(url, secure); + if (method.isPresent()) urlc.setRequestMethod(method.get()); + try { + System.out.println("Client: Response code received: " + urlc.getResponseCode()); + InputStream is = urlc.getInputStream(); + String body = new String(is.readAllBytes(), StandardCharsets.UTF_8); + is.close(); + System.out.printf("Client: read body: \"%s\"%n", body); + if (test.shouldFail(scheme, urlc.getRequestMethod())) { + throw new AssertionError(test.query + ": test did not fail"); + } + if (!method.orElse("GET").equals("HEAD")) { + if (!BODY.equals(body)) { + throw new AssertionError( + String.format("\"%s\" != \"%s\"", body, BODY)); + } + } else if (!body.isEmpty()) { + throw new AssertionError("Body is not empty: " + body); + } + } catch (IOException so) { + if (test.shouldFail(scheme, urlc.getRequestMethod())) { + // expected + System.out.println(test.query + ": Got expected exception: " + so); + } else if (!test.shouldFail("http", urlc.getRequestMethod())) { + // When using https, the buffered response bytes may be sent + // when the connection is closed, in which case the full body + // will be correctly received, and the client connection + // will not fail. With plain http, the bytes are not sent and + // the client fails with premature end of file. + // So only fail here if the test should not fail with plain + // http - we want to accept possible exception for https... + throw new AssertionError( + String.format("%s: test failed with %s", test.query, so), so); + } else { + System.out.printf("%s: WARNING: unexpected exception: %s%n", test.query, so); + // should only happen in those two cases: + assert secure && !"HEAD".equals(method) && + (test == TestCases.BODYANDFAIL || test == TestCases.BODYANDASSERT); + } + } + } finally { + // if not fixed will cause the test to fail in jtreg timeout + server.stop((int)Utils.adjustTimeout(5000)); + System.out.println("Server stopped as expected"); + } + } +} diff --git a/test/jdk/java/awt/ColorClass/ColorARGBConstructorTest.java b/test/jdk/java/awt/ColorClass/ColorARGBConstructorTest.java new file mode 100644 index 00000000000..3464e2057b9 --- /dev/null +++ b/test/jdk/java/awt/ColorClass/ColorARGBConstructorTest.java @@ -0,0 +1,66 @@ +/* + * 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.awt.Color; + +/** + * @test + * @bug 6434110 + * @summary Verify Color(int, boolean) constructor uses ARGB bit layout + */ +public final class ColorARGBConstructorTest { + + public static void main(String[] args) { + for (int argb : new int[]{0x00000000, 0x01020304, 0xC0903020, + 0x40302010, 0xD08040C0, 0x80000000, + 0x7FFFFFFF, 0xFFFFFFFF, 0xFF000000, + 0x00FF0000, 0x0000FF00, 0x000000FF}) + { + verify(argb, true); + verify(argb, false); + } + } + + private static void verify(int argb, boolean hasAlpha) { + var c = new Color(argb, hasAlpha); + int expRGB = hasAlpha ? argb : (0xFF000000 | argb); + int expA = hasAlpha ? (argb >>> 24) : 0xFF; + int expR = (argb >> 16) & 0xFF; + int expG = (argb >> 8) & 0xFF; + int expB = argb & 0xFF; + check("RGB", expRGB, c.getRGB(), argb, hasAlpha); + check("Alpha", expA, c.getAlpha(), argb, hasAlpha); + check("Red", expR, c.getRed(), argb, hasAlpha); + check("Green", expG, c.getGreen(), argb, hasAlpha); + check("Blue", expB, c.getBlue(), argb, hasAlpha); + } + + private static void check(String comp, int exp, int got, int argb, + boolean hasAlpha) + { + if (exp != got) { + throw new RuntimeException("0x%08X(%b) %s: 0x%08X != 0x%08X" + .formatted(argb, hasAlpha, comp, exp, got)); + } + } +} diff --git a/test/jdk/java/awt/Dialog/CloseDialog/CloseDialogTest.java b/test/jdk/java/awt/Dialog/CloseDialog/CloseDialogTest.java deleted file mode 100644 index 1201e5c835c..00000000000 --- a/test/jdk/java/awt/Dialog/CloseDialog/CloseDialogTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2014, 2025, 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.Dialog; -import java.awt.Frame; -import java.io.*; -import javax.swing.*; -import sun.awt.SunToolkit; -import java.util.concurrent.atomic.AtomicReference; - -/** - * @test - * @key headful - * @bug 8043705 - * @summary Can't exit color chooser dialog when running in non-default AppContext - * @modules java.desktop/sun.awt - * @run main CloseDialogTest - */ - -public class CloseDialogTest { - - private static volatile Frame frame; - private static volatile Dialog dialog; - private static volatile InputStream testErrorStream; - private static final PrintStream systemErrStream = System.err; - private static final AtomicReference caughtException - = new AtomicReference<>(); - - public static void main(String[] args) throws Exception { - - // redirect System err - PipedOutputStream errorOutputStream = new PipedOutputStream(); - testErrorStream = new PipedInputStream(errorOutputStream); - System.setErr(new PrintStream(errorOutputStream)); - - ThreadGroup swingTG = new ThreadGroup(getRootThreadGroup(), "SwingTG"); - try { - new Thread(swingTG, () -> { - SunToolkit.createNewAppContext(); - SwingUtilities.invokeLater(() -> { - frame = new Frame(); - frame.setSize(300, 300); - frame.setVisible(true); - - dialog = new Dialog(frame); - dialog.setSize(200, 200); - dialog.setModal(true); - dialog.setVisible(true); - }); - }).start(); - - Thread.sleep(400); - - Thread disposeThread = new Thread(swingTG, () -> - SwingUtilities.invokeLater(() -> { - try { - while (dialog == null || !dialog.isVisible()) { - Thread.sleep(100); - } - dialog.setVisible(false); - dialog.dispose(); - frame.dispose(); - } catch (Exception e) { - caughtException.set(e); - } - })); - disposeThread.start(); - disposeThread.join(); - Thread.sleep(500); - - // read System err - final char[] buffer = new char[2048]; - System.err.print("END"); - System.setErr(systemErrStream); - try (Reader in = new InputStreamReader(testErrorStream, "UTF-8")) { - int size = in.read(buffer, 0, buffer.length); - String errorString = new String(buffer, 0, size); - if (!errorString.startsWith("END")) { - System.err.println(errorString. - substring(0, errorString.length() - 4)); - throw new RuntimeException("Error output is not empty!"); - } - } - } finally { - if (caughtException.get() != null) { - throw new RuntimeException("Failed. Caught exception!", - caughtException.get()); - } - } - } - - private static ThreadGroup getRootThreadGroup() { - ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); - while (threadGroup.getParent() != null) { - threadGroup = threadGroup.getParent(); - } - return threadGroup; - } -} diff --git a/test/jdk/java/awt/Toolkit/DisplayChangesException/DisplayChangesException.java b/test/jdk/java/awt/Toolkit/DisplayChangesException/DisplayChangesException.java deleted file mode 100644 index 0f13265ac58..00000000000 --- a/test/jdk/java/awt/Toolkit/DisplayChangesException/DisplayChangesException.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2018, 2020, 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.EventQueue; -import java.awt.GraphicsEnvironment; -import java.awt.Toolkit; -import java.lang.reflect.Method; -import java.util.concurrent.CountDownLatch; - -import javax.swing.JButton; -import javax.swing.JFrame; - -import sun.awt.DisplayChangedListener; -import sun.awt.SunToolkit; - -/** - * @test - * @key headful - * @bug 8207070 - * @modules java.desktop/sun.java2d - * java.desktop/sun.awt - * java.desktop/sun.awt.windows:open - */ -public final class DisplayChangesException { - - private static boolean fail; - private static CountDownLatch go = new CountDownLatch(1); - - static final class TestThread extends Thread { - - private JFrame frame; - - private TestThread(ThreadGroup tg, String threadName) { - super(tg, threadName); - } - - public void run() { - try { - test(); - } catch (final Exception e) { - throw new RuntimeException(e); - } - } - - private void test() throws Exception { - SunToolkit.createNewAppContext(); - EventQueue.invokeAndWait(() -> { - frame = new JFrame(); - final JButton b = new JButton(); - b.addPropertyChangeListener(evt -> { - if (!SunToolkit.isDispatchThreadForAppContext(b)) { - System.err.println("Wrong thread:" + currentThread()); - fail = true; - } - }); - frame.add(b); - frame.setSize(100, 100); - frame.setLocationRelativeTo(null); - frame.pack(); - }); - go.await(); - EventQueue.invokeAndWait(() -> { - frame.dispose(); - }); - } - } - - public static void main(final String[] args) throws Exception { - ThreadGroup tg0 = new ThreadGroup("ThreadGroup0"); - ThreadGroup tg1 = new ThreadGroup("ThreadGroup1"); - - TestThread t0 = new TestThread(tg0, "TestThread 0"); - TestThread t1 = new TestThread(tg1, "TestThread 1"); - - t0.start(); - t1.start(); - Thread.sleep(1500); // Cannot use Robot.waitForIdle - testToolkit(); - Thread.sleep(1500); - testGE(); - Thread.sleep(1500); - go.countDown(); - - if (fail) { - throw new RuntimeException(); - } - } - - private static void testGE() { - Object ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); - if (!(ge instanceof DisplayChangedListener)) { - return; - } - ((DisplayChangedListener) ge).displayChanged(); - } - - private static void testToolkit() { - final Class toolkit; - try { - toolkit = Class.forName("sun.awt.windows.WToolkit"); - } catch (final ClassNotFoundException ignored) { - return; - } - try { - final Method displayChanged = toolkit.getMethod("displayChanged"); - displayChanged.invoke(Toolkit.getDefaultToolkit()); - } catch (final Exception e) { - e.printStackTrace(); - fail = true; - } - } -} - diff --git a/test/jdk/java/awt/font/GlyphVector/GlyphMetricsRotatedFontTest.java b/test/jdk/java/awt/font/GlyphVector/GlyphMetricsRotatedFontTest.java new file mode 100644 index 00000000000..eb00fd4f34d --- /dev/null +++ b/test/jdk/java/awt/font/GlyphVector/GlyphMetricsRotatedFontTest.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2026, 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 8148334 8377937 + * @summary Checks behavior of GlyphVector.getGlyphMetrics(int) with rotated fonts. + */ + +import java.awt.Font; +import java.awt.GraphicsEnvironment; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphMetrics; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; + +public class GlyphMetricsRotatedFontTest { + + public static void main(String[] args) { + + String text = "The quick brown \r\n fox JUMPS over \t the lazy dog."; + FontRenderContext frc = new FontRenderContext(null, true, true); + + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + String[] names = ge.getAvailableFontFamilyNames(); + + for (String name : names) { + + Font normal = new Font(name, Font.PLAIN, 60); + if (normal.canDisplayUpTo("AZaz09") != -1) { + continue; + } + + double theta = 0.5; // about 30 degrees + AffineTransform tx = AffineTransform.getRotateInstance(theta); + Font rotated = normal.deriveFont(tx); + + GlyphVector gv1 = normal.createGlyphVector(frc, text); + GlyphVector gv2 = rotated.createGlyphVector(frc, text); + + for (int i = 0; i < gv1.getNumGlyphs(); i++) { + GlyphMetrics gm1 = gv1.getGlyphMetrics(i); + GlyphMetrics gm2 = gv2.getGlyphMetrics(i); + assertEqual(0, gm1.getAdvanceY(), 0, name + " normal y", i); + double expectedX = Math.cos(theta) * gm1.getAdvanceX(); + double expectedY = Math.sin(theta) * gm1.getAdvanceX(); + assertEqual(expectedX, gm2.getAdvanceX(), 1, name + " rotated x", i); + assertEqual(expectedY, gm2.getAdvanceY(), 1, name + " rotated y", i); + } + } + } + + private static void assertEqual(double d1, double d2, double variance, + String scenario, int index) { + if (Math.abs(d1 - d2) > variance) { + String msg = String.format("%s for index %d: %f != %f", scenario, index, d1, d2); + throw new RuntimeException(msg); + } + } +} diff --git a/test/jdk/java/awt/font/TextLayout/FormatCharAdvanceTest.java b/test/jdk/java/awt/font/TextLayout/FormatCharAdvanceTest.java index 63cd890f1db..4a3f759c559 100644 --- a/test/jdk/java/awt/font/TextLayout/FormatCharAdvanceTest.java +++ b/test/jdk/java/awt/font/TextLayout/FormatCharAdvanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,9 +67,13 @@ public class FormatCharAdvanceTest { * font.em = 2048 * font.ascent = 1638 * font.descent = 410 - * font.familyname = 'Test' - * font.fontname = 'Test' - * font.fullname = 'Test' + * font.familyname = 'TTFTest' + * font.fontname = 'TTFTest' + * font.fullname = 'TTFTest' + * #Use below values for Type 1 font + * #font.familyname = 'Type1Test' + * #font.fontname = 'Type1Test' + * #font.fullname = 'Type1Test' * font.copyright = '' * font.autoWidth(0, 0, 2048) * @@ -107,29 +111,30 @@ public class FormatCharAdvanceTest { * * ttf = 'test.ttf' # TrueType * t64 = 'test.ttf.txt' # TrueType Base64 - * pfb = 'test.pfb' # PostScript Type1 - * p64 = 'test.pfb.txt' # PostScript Type1 Base64 + * #Use commented lines to generate Type1 font + * #pfb = 'test.pfb' # PostScript Type1 + * #p64 = 'test.pfb.txt' # PostScript Type1 Base64 * * font.generate(ttf) - * font.generate(pfb) + * #font.generate(pfb) * * with open(ttf, 'rb') as f1: * encoded = base64.b64encode(f1.read()) * with open(t64, 'wb') as f2: * f2.write(encoded) * - * with open(pfb, 'rb') as f3: - * encoded = base64.b64encode(f3.read()) - * with open(p64, 'wb') as f4: - * f4.write(encoded) + * #with open(pfb, 'rb') as f3: + * #encoded = base64.b64encode(f3.read()) + * #with open(p64, 'wb') as f4: + * #f4.write(encoded) *

  • */ - private static final String TTF_BYTES = "AAEAAAANAIAAAwBQRkZUTarBS1AAABbcAAAAHE9TLzKD7vqWAAABWAAAAGBjbWFw11zF/AAAAvwAAANSY3Z0IABEBREAAAZQAAAABGdhc3D//wADAAAW1AAAAAhnbHlmgVJ3qAAAB4gAAAnMaGVhZCqFqboAAADcAAAANmhoZWEIcgJiAAABFAAAACRobXR4L1UevAAAAbgAAAFEbG9jYb8EwZoAAAZUAAABNG1heHAA4ABCAAABOAAAACBuYW1lJWcF2wAAEVQAAAGJcG9zdBSfZd0AABLgAAAD8QABAAAAAQAAzMHptF8PPPUACwgAAAAAAORfr7QAAAAA5F+vtABEAAACZAVVAAAACAACAAAAAAAAAAEAAAVVAAAAuAJYAAAAAAJkAAEAAAAAAAAAAAAAAAAAAAAJAAEAAACZAAgAAgAIAAIAAgAAAAEAAQAAAEAALgABAAEABAJXAZAABQAABTMFmQAAAR4FMwWZAAAD1wBmAhIAAAIABQMAAAAAAACAACADAgAAABECAKgAAAAAUGZFZACAAAn//wZm/mYAuAVVAAAAAAABAAAAAADIAMgAAAAgAAEC7ABEAAAAAAJYAGQCWABkAlgAZAJYAGQCWABkAjkAAAJYAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAAAAFAAAAAwAAACwAAAAEAAAA7AABAAAAAAJMAAMAAQAAACwAAwAKAAAA7AAEAMAAAAAoACAABAAIAA0AIAA5AFoAegCFAK0GBQYcBt0HDwiRCOIYDiAPIC8gb/7///v//wAAAAkAIAAwAEEAYQCFAK0GAAYcBt0HDwiQCOIYDiALICggYP7///n//wAA/+f/2P/R/8v/wf+a+kj6Mvly+UH3wfdx6EbgSuAy4AIBcwAAAAEAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAMABAAFAAYAAgBzAHQAdQAMAAAAAAFgAAAAAAAAABwAAAAJAAAADAAAAAMAAAANAAAADQAAAAIAAAAgAAAAIAAAAAcAAAAwAAAAOQAAAAgAAABBAAAAWgAAABIAAABhAAAAegAAACwAAACFAAAAhQAAAEYAAACtAAAArQAAAEcAAAYAAAAGBQAAAEgAAAYcAAAGHAAAAE4AAAbdAAAG3QAAAE8AAAcPAAAHDwAAAFAAAAiQAAAIkQAAAFEAAAjiAAAI4gAAAFMAABgOAAAYDgAAAFQAACALAAAgDwAAAFUAACAoAAAgLwAAAFoAACBgAAAgbwAAAGIAAP7/AAD+/wAAAHIAAP/5AAD/+wAAAHMAARC9AAEQvQAAAHYAARDNAAEQzQAAAHcAATQwAAE0PwAAAHgAAbygAAG8owAAAIgAAdFzAAHRegAAAIwADgABAA4AAQAAAJQADgAgAA4AIQAAAJUADgB+AA4AfwAAAJcAAAEGAAABAAAAAAAAAAEDBAUGAgAAAAAAAAAAAAAAAAAAAAEAAAcAAAAAAAAAAAAAAAAAAAAICQoLDA0ODxARAAAAAAAAABITFBUWFxgZGhscHR4fICEiIyQlJicoKSorAAAAAAAALC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAURAAAALAAsADQAPABEAEwAVABUAFwAZABsAHQAfACEAIwAlACcAKQArAC0ALwAxADMANQA3ADkAOwA9AD8AQQBDAEUARwBJAEsATQBPAFEAUwBVAFcAWQBbAF0AYYBjgGWAZ4BpgGuAbYBvgHGAc4B1gHeAeYB7gH2Af4CBgIOAhYCHgImAi4CNgI+AkYCTgJWAl4CZgJuAnYCfgKGAo4ClgKeAqYCrgK2Ar4CxgLOAtYC3gLmAu4C9gL+AwYDDgMWAx4DJgMuAzYDPgNGA04DVgNeA2YDbgN2A34DhgOOA5YDngOmA64DtgO+A8YDzgPWA94D5gPuA/YD/gQGBA4EFgQeBCYELgQ2BD4ERgROBFYEXgRmBG4EdgR+BIYEjgSWBJ4EpgSuBLYEvgTGBM4E1gTeBOYAAgBEAAACZAVVAAMABwAusQEALzyyBwQA7TKxBgXcPLIDAgDtMgCxAwAvPLIFBADtMrIHBgH8PLIBAgDtMjMRIRElIREhRAIg/iQBmP5oBVX6q0QEzQAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAAAAgBkAGQB9ADIAAMABwAANzUhFSE1IRVkAZD+cAGQZGRkZGT//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAAAAAAOAK4AAQAAAAAAAAAAAAIAAQAAAAAAAQAEAA0AAQAAAAAAAgAHACIAAQAAAAAAAwAgAGwAAQAAAAAABAAEAJcAAQAAAAAABQAPALwAAQAAAAAABgAEANYAAwABBAkAAAAAAAAAAwABBAkAAQAIAAMAAwABBAkAAgAOABIAAwABBAkAAwBAACoAAwABBAkABAAIAI0AAwABBAkABQAeAJwAAwABBAkABgAIAMwAAAAAVABlAHMAdAAAVGVzdAAAUgBlAGcAdQBsAGEAcgAAUmVndWxhcgAARgBvAG4AdABGAG8AcgBnAGUAIAAyAC4AMAAgADoAIABUAGUAcwB0ACAAOgAgADMAMAAtADUALQAyADAAMgA1AABGb250Rm9yZ2UgMi4wIDogVGVzdCA6IDMwLTUtMjAyNQAAVABlAHMAdAAAVGVzdAAAVgBlAHIAcwBpAG8AbgAgADAAMAAxAC4AMAAwADAAAFZlcnNpb24gMDAxLjAwMAAAVABlAHMAdAAAVGVzdAAAAAAAAgAAAAAAAP9nAGYAAAAAAAAAAAAAAAAAAAAAAAAAAACZAAAAAQECAQMBBAEFAQYAAwATABQAFQAWABcAGAAZABoAGwAcACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0BBwEIAQkBCgELAQwBDQEOAQ8BEAERARIBEwEUARUBFgEXARgBGQEaARsBHAEdAR4BHwEgASEBIgEjASQBJQEmAScBKAEpASoBKwEsAS0BLgEvATABMQEyATMBNAE1ATYBNwE4ATkBOgE7ATwBPQE+AT8BQAFBAUIBQwFEAUUBRgFHAUgBSQFKAUsBTAFNAU4BTwFQAVEBUgFTAVQBVQFWAVcBWAFZB3VuaTAwMEQHdW5pMDAwOQd1bmkwMDBBB3VuaTAwMEIHdW5pMDAwQwd1bmkwMDg1B3VuaTAwQUQHdW5pMDYwMAd1bmkwNjAxB3VuaTA2MDIHdW5pMDYwMwd1bmkwNjA0B3VuaTA2MDUHdW5pMDYxQwd1bmkwNkREB3VuaTA3MEYHdW5pMDg5MAd1bmkwODkxB3VuaTA4RTIHdW5pMTgwRQd1bmkyMDBCB3VuaTIwMEMHdW5pMjAwRAd1bmkyMDBFB3VuaTIwMEYHdW5pMjAyOAd1bmkyMDI5B3VuaTIwMkEHdW5pMjAyQgd1bmkyMDJDB3VuaTIwMkQHdW5pMjAyRQd1bmkyMDJGB3VuaTIwNjAHdW5pMjA2MQd1bmkyMDYyB3VuaTIwNjMHdW5pMjA2NAd1bmkyMDY1B3VuaTIwNjYHdW5pMjA2Nwd1bmkyMDY4B3VuaTIwNjkHdW5pMjA2QQd1bmkyMDZCB3VuaTIwNkMHdW5pMjA2RAd1bmkyMDZFB3VuaTIwNkYHdW5pRkVGRgd1bmlGRkY5B3VuaUZGRkEHdW5pRkZGQgZ1MTEwQkQGdTExMENEBnUxMzQzMAZ1MTM0MzEGdTEzNDMyBnUxMzQzMwZ1MTM0MzQGdTEzNDM1BnUxMzQzNgZ1MTM0MzcGdTEzNDM4BnUxMzQzOQZ1MTM0M0EGdTEzNDNCBnUxMzQzQwZ1MTM0M0QGdTEzNDNFBnUxMzQzRgZ1MUJDQTAGdTFCQ0ExBnUxQkNBMgZ1MUJDQTMGdTFEMTczBnUxRDE3NAZ1MUQxNzUGdTFEMTc2BnUxRDE3NwZ1MUQxNzgGdTFEMTc5BnUxRDE3QQZ1RTAwMDEGdUUwMDIwBnVFMDAyMQZ1RTAwN0UGdUUwMDdGAAAAAAAAAf//AAIAAAABAAAAAOIB6+cAAAAA5F+vtAAAAADkX6+0"; + private static final String TTF_BYTES = "AAEAAAANAIAAAwBQRkZUTbCUBjwAABcAAAAAHE9TLzKD7vqWAAABWAAAAGBjbWFw11zF/AAAAvwAAANSY3Z0IABEBREAAAZQAAAABGdhc3D//wADAAAW+AAAAAhnbHlmgVJ3qAAAB4gAAAnMaGVhZC1MmToAAADcAAAANmhoZWEIcgJiAAABFAAAACRobXR4L1UevAAAAbgAAAFEbG9jYb8EwZoAAAZUAAABNG1heHAA4ABCAAABOAAAACBuYW1lLzI4NgAAEVQAAAGtcG9zdBSfZd0AABMEAAAD8QABAAAAAQAAp/gvll8PPPUACwgAAAAAAOXDJ3QAAAAA5cMndABEAAACZAVVAAAACAACAAAAAAAAAAEAAAVVAAAAuAJYAAAAAAJkAAEAAAAAAAAAAAAAAAAAAAAJAAEAAACZAAgAAgAIAAIAAgAAAAEAAQAAAEAALgABAAEABAJXAZAABQAABTMFmQAAAR4FMwWZAAAD1wBmAhIAAAIABQMAAAAAAACAACADAgAAABECAKgAAAAAUGZFZACAAAn//wZm/mYAuAVVAAAAAAABAAAAAADIAMgAAAAgAAEC7ABEAAAAAAJYAGQCWABkAlgAZAJYAGQCWABkAjkAAAJYAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAAAAFAAAAAwAAACwAAAAEAAAA7AABAAAAAAJMAAMAAQAAACwAAwAKAAAA7AAEAMAAAAAoACAABAAIAA0AIAA5AFoAegCFAK0GBQYcBt0HDwiRCOIYDiAPIC8gb/7///v//wAAAAkAIAAwAEEAYQCFAK0GAAYcBt0HDwiQCOIYDiALICggYP7///n//wAA/+f/2P/R/8v/wf+a+kj6Mvly+UH3wfdx6EbgSuAy4AIBcwAAAAEAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAMABAAFAAYAAgBzAHQAdQAMAAAAAAFgAAAAAAAAABwAAAAJAAAADAAAAAMAAAANAAAADQAAAAIAAAAgAAAAIAAAAAcAAAAwAAAAOQAAAAgAAABBAAAAWgAAABIAAABhAAAAegAAACwAAACFAAAAhQAAAEYAAACtAAAArQAAAEcAAAYAAAAGBQAAAEgAAAYcAAAGHAAAAE4AAAbdAAAG3QAAAE8AAAcPAAAHDwAAAFAAAAiQAAAIkQAAAFEAAAjiAAAI4gAAAFMAABgOAAAYDgAAAFQAACALAAAgDwAAAFUAACAoAAAgLwAAAFoAACBgAAAgbwAAAGIAAP7/AAD+/wAAAHIAAP/5AAD/+wAAAHMAARC9AAEQvQAAAHYAARDNAAEQzQAAAHcAATQwAAE0PwAAAHgAAbygAAG8owAAAIgAAdFzAAHRegAAAIwADgABAA4AAQAAAJQADgAgAA4AIQAAAJUADgB+AA4AfwAAAJcAAAEGAAABAAAAAAAAAAEDBAUGAgAAAAAAAAAAAAAAAAAAAAEAAAcAAAAAAAAAAAAAAAAAAAAICQoLDA0ODxARAAAAAAAAABITFBUWFxgZGhscHR4fICEiIyQlJicoKSorAAAAAAAALC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAURAAAALAAsADQAPABEAEwAVABUAFwAZABsAHQAfACEAIwAlACcAKQArAC0ALwAxADMANQA3ADkAOwA9AD8AQQBDAEUARwBJAEsATQBPAFEAUwBVAFcAWQBbAF0AYYBjgGWAZ4BpgGuAbYBvgHGAc4B1gHeAeYB7gH2Af4CBgIOAhYCHgImAi4CNgI+AkYCTgJWAl4CZgJuAnYCfgKGAo4ClgKeAqYCrgK2Ar4CxgLOAtYC3gLmAu4C9gL+AwYDDgMWAx4DJgMuAzYDPgNGA04DVgNeA2YDbgN2A34DhgOOA5YDngOmA64DtgO+A8YDzgPWA94D5gPuA/YD/gQGBA4EFgQeBCYELgQ2BD4ERgROBFYEXgRmBG4EdgR+BIYEjgSWBJ4EpgSuBLYEvgTGBM4E1gTeBOYAAgBEAAACZAVVAAMABwAusQEALzyyBwQA7TKxBgXcPLIDAgDtMgCxAwAvPLIFBADtMrIHBgH8PLIBAgDtMjMRIRElIREhRAIg/iQBmP5oBVX6q0QEzQAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAAAAgBkAGQB9ADIAAMABwAANzUhFSE1IRVkAZD+cAGQZGRkZGT//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAD//wBkAGQB9ADIEgYALAAA//8AZABkAfQAyBIGACwAAP//AGQAZAH0AMgSBgAsAAAAAAAOAK4AAQAAAAAAAAAAAAIAAQAAAAAAAQAHABMAAQAAAAAAAgAHACsAAQAAAAAAAwAjAHsAAQAAAAAABAAHAK8AAQAAAAAABQAPANcAAQAAAAAABgAHAPcAAwABBAkAAAAAAAAAAwABBAkAAQAOAAMAAwABBAkAAgAOABsAAwABBAkAAwBGADMAAwABBAkABAAOAJ8AAwABBAkABQAeALcAAwABBAkABgAOAOcAAAAAVABUAEYAVABlAHMAdAAAVFRGVGVzdAAAUgBlAGcAdQBsAGEAcgAAUmVndWxhcgAARgBvAG4AdABGAG8AcgBnAGUAIAAyAC4AMAAgADoAIABUAFQARgBUAGUAcwB0ACAAOgAgADIANAAtADIALQAyADAAMgA2AABGb250Rm9yZ2UgMi4wIDogVFRGVGVzdCA6IDI0LTItMjAyNgAAVABUAEYAVABlAHMAdAAAVFRGVGVzdAAAVgBlAHIAcwBpAG8AbgAgADAAMAAxAC4AMAAwADAAAFZlcnNpb24gMDAxLjAwMAAAVABUAEYAVABlAHMAdAAAVFRGVGVzdAAAAAAAAgAAAAAAAP9nAGYAAAAAAAAAAAAAAAAAAAAAAAAAAACZAAAAAQECAQMBBAEFAQYAAwATABQAFQAWABcAGAAZABoAGwAcACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0BBwEIAQkBCgELAQwBDQEOAQ8BEAERARIBEwEUARUBFgEXARgBGQEaARsBHAEdAR4BHwEgASEBIgEjASQBJQEmAScBKAEpASoBKwEsAS0BLgEvATABMQEyATMBNAE1ATYBNwE4ATkBOgE7ATwBPQE+AT8BQAFBAUIBQwFEAUUBRgFHAUgBSQFKAUsBTAFNAU4BTwFQAVEBUgFTAVQBVQFWAVcBWAFZB3VuaTAwMEQHdW5pMDAwOQd1bmkwMDBBB3VuaTAwMEIHdW5pMDAwQwd1bmkwMDg1B3VuaTAwQUQHdW5pMDYwMAd1bmkwNjAxB3VuaTA2MDIHdW5pMDYwMwd1bmkwNjA0B3VuaTA2MDUHdW5pMDYxQwd1bmkwNkREB3VuaTA3MEYHdW5pMDg5MAd1bmkwODkxB3VuaTA4RTIHdW5pMTgwRQd1bmkyMDBCB3VuaTIwMEMHdW5pMjAwRAd1bmkyMDBFB3VuaTIwMEYHdW5pMjAyOAd1bmkyMDI5B3VuaTIwMkEHdW5pMjAyQgd1bmkyMDJDB3VuaTIwMkQHdW5pMjAyRQd1bmkyMDJGB3VuaTIwNjAHdW5pMjA2MQd1bmkyMDYyB3VuaTIwNjMHdW5pMjA2NAd1bmkyMDY1B3VuaTIwNjYHdW5pMjA2Nwd1bmkyMDY4B3VuaTIwNjkHdW5pMjA2QQd1bmkyMDZCB3VuaTIwNkMHdW5pMjA2RAd1bmkyMDZFB3VuaTIwNkYHdW5pRkVGRgd1bmlGRkY5B3VuaUZGRkEHdW5pRkZGQgZ1MTEwQkQGdTExMENEBnUxMzQzMAZ1MTM0MzEGdTEzNDMyBnUxMzQzMwZ1MTM0MzQGdTEzNDM1BnUxMzQzNgZ1MTM0MzcGdTEzNDM4BnUxMzQzOQZ1MTM0M0EGdTEzNDNCBnUxMzQzQwZ1MTM0M0QGdTEzNDNFBnUxMzQzRgZ1MUJDQTAGdTFCQ0ExBnUxQkNBMgZ1MUJDQTMGdTFEMTczBnUxRDE3NAZ1MUQxNzUGdTFEMTc2BnUxRDE3NwZ1MUQxNzgGdTFEMTc5BnUxRDE3QQZ1RTAwMDEGdUUwMDIwBnVFMDAyMQZ1RTAwN0UGdUUwMDdGAAAAAAAAAf//AAIAAAABAAAAAOUNt1MAAAAA5cMndAAAAADlwyd0"; /** - * Same font as above, but in PostScript Type1 (PFB) format. + * Same font as above, but in PostScript Type1 (PFB) format with different font name. */ - private static final String TYPE1_BYTES = "gAFSBwAAJSFQUy1BZG9iZUZvbnQtMS4wOiBUZXN0IDAwMS4wMDAKJSVUaXRsZTogVGVzdAolVmVyc2lvbjogMDAxLjAwMAolJUNyZWF0aW9uRGF0ZTogRnJpIE1heSAzMCAyMDo1NTo0OCAyMDI1CiUlQ3JlYXRvcjogRGFuaWVsIEdyZWRsZXIKJSAyMDI1LTUtMzA6IENyZWF0ZWQgd2l0aCBGb250Rm9yZ2UgKGh0dHA6Ly9mb250Zm9yZ2Uub3JnKQolIEdlbmVyYXRlZCBieSBGb250Rm9yZ2UgMjAyMzAxMDEgKGh0dHA6Ly9mb250Zm9yZ2Uuc2YubmV0LykKJSVFbmRDb21tZW50cwoKMTAgZGljdCBiZWdpbgovRm9udFR5cGUgMSBkZWYKL0ZvbnRNYXRyaXggWzAuMDAwNDg4MjgxIDAgMCAwLjAwMDQ4ODI4MSAwIDAgXXJlYWRvbmx5IGRlZgovRm9udE5hbWUgL1Rlc3QgZGVmCi9Gb250QkJveCB7MTAwIDEwMCA1MDAgMjAwIH1yZWFkb25seSBkZWYKL1BhaW50VHlwZSAwIGRlZgovRm9udEluZm8gMTAgZGljdCBkdXAgYmVnaW4KIC92ZXJzaW9uICgwMDEuMDAwKSByZWFkb25seSBkZWYKIC9Ob3RpY2UgKCkgcmVhZG9ubHkgZGVmCiAvRnVsbE5hbWUgKFRlc3QpIHJlYWRvbmx5IGRlZgogL0ZhbWlseU5hbWUgKFRlc3QpIHJlYWRvbmx5IGRlZgogL1dlaWdodCAoUmVndWxhcikgcmVhZG9ubHkgZGVmCiAvRlNUeXBlIDAgZGVmCiAvSXRhbGljQW5nbGUgMCBkZWYKIC9pc0ZpeGVkUGl0Y2ggZmFsc2UgZGVmCiAvVW5kZXJsaW5lUG9zaXRpb24gLTIwNC44IGRlZgogL1VuZGVybGluZVRoaWNrbmVzcyAxMDIuNCBkZWYKZW5kIHJlYWRvbmx5IGRlZgovRW5jb2RpbmcgMjU2IGFycmF5CiAwIDEgMjU1IHsgMSBpbmRleCBleGNoIC8ubm90ZGVmIHB1dH0gZm9yCmR1cCA5L3VuaTAwMDkgcHV0CmR1cCAxMC91bmkwMDBBIHB1dApkdXAgMTEvdW5pMDAwQiBwdXQKZHVwIDEyL3VuaTAwMEMgcHV0CmR1cCAxMy91bmkwMDBEIHB1dApkdXAgMzIvc3BhY2UgcHV0CmR1cCA0OC96ZXJvIHB1dApkdXAgNDkvb25lIHB1dApkdXAgNTAvdHdvIHB1dApkdXAgNTEvdGhyZWUgcHV0CmR1cCA1Mi9mb3VyIHB1dApkdXAgNTMvZml2ZSBwdXQKZHVwIDU0L3NpeCBwdXQKZHVwIDU1L3NldmVuIHB1dApkdXAgNTYvZWlnaHQgcHV0CmR1cCA1Ny9uaW5lIHB1dApkdXAgNjUvQSBwdXQKZHVwIDY2L0IgcHV0CmR1cCA2Ny9DIHB1dApkdXAgNjgvRCBwdXQKZHVwIDY5L0UgcHV0CmR1cCA3MC9GIHB1dApkdXAgNzEvRyBwdXQKZHVwIDcyL0ggcHV0CmR1cCA3My9JIHB1dApkdXAgNzQvSiBwdXQKZHVwIDc1L0sgcHV0CmR1cCA3Ni9MIHB1dApkdXAgNzcvTSBwdXQKZHVwIDc4L04gcHV0CmR1cCA3OS9PIHB1dApkdXAgODAvUCBwdXQKZHVwIDgxL1EgcHV0CmR1cCA4Mi9SIHB1dApkdXAgODMvUyBwdXQKZHVwIDg0L1QgcHV0CmR1cCA4NS9VIHB1dApkdXAgODYvViBwdXQKZHVwIDg3L1cgcHV0CmR1cCA4OC9YIHB1dApkdXAgODkvWSBwdXQKZHVwIDkwL1ogcHV0CmR1cCA5Ny9hIHB1dApkdXAgOTgvYiBwdXQKZHVwIDk5L2MgcHV0CmR1cCAxMDAvZCBwdXQKZHVwIDEwMS9lIHB1dApkdXAgMTAyL2YgcHV0CmR1cCAxMDMvZyBwdXQKZHVwIDEwNC9oIHB1dApkdXAgMTA1L2kgcHV0CmR1cCAxMDYvaiBwdXQKZHVwIDEwNy9rIHB1dApkdXAgMTA4L2wgcHV0CmR1cCAxMDkvbSBwdXQKZHVwIDExMC9uIHB1dApkdXAgMTExL28gcHV0CmR1cCAxMTIvcCBwdXQKZHVwIDExMy9xIHB1dApkdXAgMTE0L3IgcHV0CmR1cCAxMTUvcyBwdXQKZHVwIDExNi90IHB1dApkdXAgMTE3L3UgcHV0CmR1cCAxMTgvdiBwdXQKZHVwIDExOS93IHB1dApkdXAgMTIwL3ggcHV0CmR1cCAxMjEveSBwdXQKZHVwIDEyMi96IHB1dApkdXAgMTMzL3VuaTAwODUgcHV0CmR1cCAxNzMvdW5pMDBBRCBwdXQKcmVhZG9ubHkgZGVmCmN1cnJlbnRkaWN0IGVuZApjdXJyZW50ZmlsZSBlZXhlYwqAAo0WAAB0P4QT82NsqFqf/vtQtLsnMCpcwKtuL5Wb8g0yDDc8ISjQoM5wcrH2cqCqOMPA7OsEtEyxdKHDFhLXH/ogyQlUJWN4Ny95WwvylB9DfwWfQa4FmMAFFf7xhzM1V/Ms4yqe59S6tl2lND+ScH4s/PPozkRuWtrDn8N+zmS2izVs4NcQ9FsefyzXaKvKFDYINmh2GhAJRkFi0FTB9r8sRqMZs8ZkUodjFsE6kmRW02YpWP1WdA1YVnNuYQT4E+0xkVZ3eTTuscVEWua/buWeWxlwi0KH20ubr5iCkavAb953/MMe4XMKlPvGzsx0Slmp9qOOLD0ko2287peB1DvLavHCG/r2rr8MhqsKVoSyFr36sVd9hMSQrwFxpRjVEjtt5HDGcbHwy3ylp8b1oopSl5AQmeoW/oGT0rPr+358A+Qd2/wpQgStXDcDExQWDrdOL7J5Fr7VBDu8NNORXc7c5uKb2iVQq5AOF+Yfa5bH4reIFcWrAItBML9L9b8sOf1QKzGymFzgcDW3EEx07Y07ys95zSLkYtY5lkjm07GFSyM9cuWhRctY6RTcjTAFNdbxOUBXbIGf4Q8nhdXXi3IKhYdqdgKEsWphwKEdQeP7QYqW4bPSB881DjF/e7r6PIkua8MXGI3G1I0C53TIFnHXai5dtVJ4cZhdaTzgoD9K6zYMNsb8Tof6THYx+cRUzPbJmb+VbprjDk96+92jF+P0EwubV0GQMLEdCyPDV1u/vIHPePqSJt2/YjgkXEugRbyqzFwfZJdeAmkzcqs1CU9EiqrwgqbEfdmWWwv9BDxgkWD4omPKAKX1A6asv/UVfH8lebHSbrKddpR8XU/C2I/t7UhI19oTFqIvUL061MrZPiHZaFE9bnvJw+P91hF+MoPs69ddhD4Kj6z6MJYNGlvAZMuUM/RdAUwE3HHhwGiCN3Hqi4V+byVeB95B/8YLQK1CiW/pgfU7TqZ1d5nWGoAXAcAu6UYGvZZ0ChX3AEPlIFJ4x4hXfBo0I/k/TEHus/u5dNm/+ixyBcr/rX/e2yPIBfJkBJDG8x/y7JaxOFAD1NMQ4zWjbzP1uPpiGzRKfCXYLF6YXLfGDKJ1w3IENGwIMXBgqOx6O2v2xkYhcAUkrZ2Nw3xpRrnj2RqGCGwz00AHrl9AU7CNaM8BkSe6d86xT8teVYuOk926Xj4/+Kx6rfu526Ylz91kxebopcMvql6ysRVzzSGsW2ec9ZPJo1Q/WKb+tCvBm8OdUnRi+DldIajpytyl08TmlS+IRUcHZbxoIjxb7ZCvF8hd03yDhs9bsUSO6h7jbhegenLIiQPX7RtsGAg3logZLD0NUjcAm2tKBieMHhMxAD89lVmuMkNj5r6EaixXvkvhgqzhjPExdu30Knife5IEnlCvIlMCh1EXQsY9KRkzeTRTKfnZTJ/idze+cX0nCEGcFrvCCjZRfNuaLRHx73o2KlDHmoYBm1mFEEvfUReQxS987AiVfSF7cs8IrLEqV9qe2mCAv7ATbVUFbnvYxTBYvHL9sc4892rLrjSu/yP5RZmmIMOpTH8CStLw1zGAcXH3W3ZfPjQkEA4jzvo1U5Oi9EkBKqlgqjj2pFLWepwuNG/L3Iyr36frW6NFtqCxyVQYcNwOTnmQjY0LXPAKxyz2l+xyo/gcDY8nqtWms5aqINgemqM0pG2wBt3GawARbEVkkKllyB/WJbRw0GGHktmj73ixkTulD6nHZ+vMd+aS8iKXPa2ASEOPpxp515DZxg+VYZIrM0h4mDdRff4To/8NKs7Kx4IZx2qzlhIKS2zHpLwuY/U2Wt80e9nqMCFEtnS8sKpcy1rrE9FzXsFUNtYE6LdIat4ygQxoq24Y6D3bfDpl3E8wMvECaVCJX8lfBhQcGGU6+Jba1qfQ7jonjQM0zfoOwHrApk/dkPkSdjQy7UM+dZNMtgZf2N46UuWC2YCtcqCN1X+o5SpojTgXNmTjUy3KOy6L4GNYOxutsDhWiah6rJ+FGVL9D51MJvT3l02T1+LpNt8ZeZQSkZpx7NdFFTFA4/SE8zycfBLNm71Q9pjQKa30TnCY9ZkMEH9rnArLV0w2Gi6LoJoWpT7GoAB2Cdvi3x9wGDdt60K6oABWiD5mpAv4KfrJMBn5dRDJVyRPARXxwBUROAc3BxY8St3WuWKqDqqef0t0rlqAXGynPrcAjqFMXc/GBWORQ7W/dTvbu/eZb+apjKEX7szjaY4cSRsNge4gTyCEsfhLrdBkncM7up9jj206tIaqZQILxHAnrVwYplJ5D2EvSSLYvxFEVHSrI19aNJEvDK64tzXCV+P4yOCOuXpBmc15PDlrMQEauqrD+xneCO+CrCbudHXOJsbmvQq56+ovLp5SNBfdEPQpqo5tBgQaNHcEjg/iVt++uLxT3vAEFW5d7WXPMYdy+XqoMmdRDOzey0Mdx5BZ92rNM/LthQa6F54nvzkypM64HdxCYlri8cO3k0G6bp2eWdseP0P4zMc5QikuXc/Dr4NztBYe2yJLbLLesWSB8nOWcl+gd0GMX5PY4P5mn5WJDNStLWPdD9NapzMsyx6lZwR9Tfv/XSmay9LEo9YaaxysWfllDIasUCdvhZVi7LJvPu/0GbuHLOz9mP6prkF8h8KmjBYMlMktouA23G74M+Pkdfbj9KAM8zOYCgQFZUaXx3iZ4m3uBtDPeKjUcdFZSnHdW11eSv5aCz2fMbExV/qnPOSMbkR5rvpR71WwVZP6j3tNWr8jlPQ8d60k8jXPy7d8wjw9obnDEpvKzKreEzjfA0wCovNt7FLH9oxWmO5TF8JMg/U7+ToEv0fPAW475dXTXdue98/k/c+3+LCJNbHzBBx14CzpteKXKqGNA3jwgJUhfDsTISiN4gF222zIi1deY9BspjPl7jergbwh+ZPdfk2BLaPTDeNUycKdeiFoJEd8gKLvjMrnPa9IX4HwR9gJSjsQ0UWhnYuaXdk12zk8sVkGJAJLrphh5tHcd4LwG2rWcVXwM/2zw1YXQR+jffC1uxUEPVaq1fSf9RB6iEb8LgIollE+gDEybc+Dw3Q/gxVe5/Nu0vHHur6B+4YEcxvz3O5cYKUQTxDgG4mXJhqZ6z7etSWINChQyP6PUFFbsUIDXjfuHZ9oF4ce1NNOnn/RIwm/u/+AduDTtqloUooZjqak4VbvmBEZcW75liKm0MggeilL0nl5arItzTwE8OudJDBkJ/xnf1yZIgeFKSODIz5aQrIiSMJX3BGRxHEEQrm1xtwCfjtMPpFhFtG+o5fjMlCnowJ6+/HrG3FdZKn4/gv7qCxF2/3NW2J4OWuXbjEsUlSHu57DFvhrVl/q8jv81OfXhZKutYQWjaDWwOQHR+ym6wvMyQ9YfiiJpBXa+Ig9uGAbERyApc8wsCLcy0d8Msxx9PAfhrDa+Gf2yhYGA57t8iGxEcoI0A4B8zKVqYXKf4AdsrVzE9cUpfRN/HH8OGWyv9mKMTJyGJQql/OH5hYHnvJVKZXIz6l3nL/7gnpYaGtASiV1q+JwO7WSk1pfwT9SE4sFl7uS7f3pu4BwPhcz/wyN82f144yav11mrGqypOMaMDR27/L0sW1c3hWBBa8BMU/EuwF7ldclS9nxmFHOc35RLruyQ26cp1niukcpK42wg3ozqGQLoQRIoin0AWnUwnOmkdBEkILqFCiWgERDZuCB7G3pZJW/32HPgD3byO0lH8JF6OiINsUmM+75Y3qdvuepTHxXwpDa9Isero3x/f+UWGGUO12s+Ou2yQKtLsQaBNSTaGEBVCAtpJ58TgZ+KfVyhgRQdINr7GuGq9iRPQBY00anspxvsrhfffggqOariHO8h0jdEZPJarJJAufQbYgKiACtJ8iG6jlIs3GfWRI0jRYDw+kHPc2/A6fS5XGF360aX1I6iy5J1pZpN+6stJq5MQ8QRHopTJWQ0DW1Pq46BglmHH9av/X4tvLFFyyC4X6OB2jDb9+XwwcuJ2t/352IcJC06IsWKDsr6E6vF3hC3GUBUy9I7JbqlAh7zlYK52MITQzGINZD2p8+TJjmDycEr/UM/JHqBzbJniUzxg8vo2/FjpZggU8NuBsTZ5P/YZSgRsZcVKkhkGYAn+euvrQIiZ2LMwOygD0gW/zy7v+Z1aHfxKig7kkOR1ZuVCFE8FWx1unCnFHtkjFIx9JY4cYHboveIlF2IzNhfnKJncBt7DuZORqfAT3gQDZlIFNx06tSnTe1v5l7u7VSKMXRhc3bbeCqfvO/NSOqfLz1QYlj2b0C5sm0AcUe1RpC7rOu6muPLeJ38DOIhJHzs+wpqBZTHJr9zdnjZl+OyXaAAbgCsxamEQW91iGdRmVHqyT+0+XQxssYOF795eGYpsXy9Bik6Z4apt/AcuZQFu3XthVXvjyVCi0Rj3gXjOkFdT1YaiRe6yPRdBB2GorcxCzQQvjZXTuh5P4a7MD/6W0mJYoh0BzQHYC0O/T9v3d8GepAbQTytL7MWIWk9C2qZ0pPciuIfXNmGRWBUkCCts1BAsW39l4giNBCwDQ6CauWkz8iWaxx2krBQpKl0WyBBSd/SIJUFM4psvYNaGNk+xR18s0OrPqvxQvc3NNgVwpAljSM/wt3IzIcIsJHF/u0T60hXgEv4H0f44/SzROL0iGUZIfRZK6sJRGBQH2ZVrFCJ6ageJX7WTBLVwKAtxgIUK2dXAemsYgGm/CIe3JCmwL/YmEh8I8W4LrWzXq4vNF6/Sq1hQ2r4dndAO+HEZ8nYpPr+9pUCUgSvnN7aVWZpc/xJaj5L4U6W28hVZ2mb+UUKDpq0bSxKdkVr2SC/7Q/8WimMNDYCaExzXQ+RzZyv/4227pn/k3y1avulXGz3ujy+lqdciVVWHmPYyJPhqeoyDEkM6g46KL9kg912jsB1SGP7Yc2l7XENW59mh5RE+fNiW8wWjxW0Oa+xSe2+RTOgRA+Ojq2L8+g9sL7jKw7BPAPjnYTo8gMat4DurAKbJrtaRLZMzXkFyE7heHr9NsLJl/d1JLRwNoGDpnvLjyPNBUjW/2CTEEIyI6yq3oOJivAwe1yiJib7IUTkh5MCBSnEssvxOYJRUaR/ILAHMJpAoEV/VOCfBlh/I55gVYZWa+Y/5/AMs5Po1w9/18Q6V4ichv80Qr+Up7+2s8sV6zM7m78WMmQp3IR6uTJasqI2Vnr99KAY31BJVpBelRq2xjIruSHx/BAr2kSHA+Kuk1I9+Y1dEaSbfUpjcly0WDUh9x1VTkrUu1u6XN/i/SkFeO1k8o2o7s0rVXNI+VipXQt69H+yVDea7AYuvy9Rp2kKuq7o7mgcFCVq1Vbeyv++vDSKdYmKbyQ2N7ubU6u41Td59YNfRldl56ec0bl7hgyMUb/7/ifjdRXOVl1sTTMUiETnT+44vuAiiUeOHRgKmRlLgHp9iMnPPZVF3DqExLV1IPraZO/olA9QIc4bM2g6SPebITaH94rZn80oQzWzBAFUzK/B2vY39XGdPSTAZTFn1yAYcRHIhqWZs9+FtJvBN9f9lUxPFHUs3vyKBC8sFph/yee7KNIKyTinMNAs1+jcnVS4LPqR4L4cn3ancasZ6wBgexKIjjwf8KPkgUcMwZqk+KwDeJbmyGblqsRzSuhrwPq0U+n4n1ktcqI11Y4D/u93UrU04LgZwWPEZPrgjGUgciPrRa3BIJb6oT1s5VSfgiupwHaFYgF5sJ3VD0ZcT1zwdet8tPprxRq00SIZMZKZeVSIWD0ai82pPxH4PYLUGwUbW3ocaYouILRf9sF9DP1gaVfd4SDRUuKUtZRiG6lpSopmFO24N1vWq90caknzY91uUWX2v4+C/JHDd47e4h/g1Lf13euI6csefzsnQDTDsyrh5zSJDo26B81kY5RyKv+AnsvTnTl8uroRsh1KqeIUywpWImmlnnWT8rpNg822BjraGaWc9NHFzkUSmOmD/iJRdfRjno1JaeDVk8KBniY0vnMqdBG1BWRMsnUAhWxHJ4Jn5fXCltO2C5OV+x+jYocNhWw4Mgu3CVZp9erAEPsDEUsY4qaMitjRq6yJPn3nwkQRpFHGbXv187fPU/z8+BQ5/W4Qfg/qEmJKcp1T5VcrwLAlZQTomKAt/7xNlJIxlx9bCMVXnvk3Y8hB7kCTaSQmvjC8IXCHbJyMCFQV7qAKdmaihyV7zmpqWcDqfELQChm2KxmQJ1dPYJ1+jR+aYm3an5bPEoCdbsZauFF8qXHIhx8JKvRGgxPrTGHi8N5FcfuNsCA3xOkoSGX9Sxg6h5KEtoeFdkwf5BKqhJj5pcsBewAHkWng86BzAqt7R+a9TnyvLMWvmpI/0fkpRkbg731aWOnWOvbpz6f+nXSxGgrvs/B6xSgFPDo6Ty3ivL+CGitfK6XwdHA07TV/eK5vd5oyNe/Ay5wMdXiypEUWukN+jiuGmrVMkke/0DmXmtqqY3T45iLrqfgwRhXsT9kEdzcWVqM4OkAEqEzpjI0NHG74cslhQvDPbX/ZRp57/bcOuarHpCDakvzajblF2NXf0Wp0dO0NltExHFoY8myAlBu/SMn3VN6GF5faMq370MevoNi4eNRD8XiGUYh+QzVphqtLIeqyyt6W4MzTjwSLgAB0kITRYcG0KVi89iUgZMQdwIOfMUBmS/q1GpBtTFKqI2TwC3dz9oBnNzwi3Ru9yyNuX1mw1p0Sd8UNY0yVbdb7UrLrd0ldVrx2FWNVCEedkn0npe9xstIJvgMuRLA0DNN7vex3hfvGvV7qCuQi5ssNVYUkoyEjlFR3xCThuVCgwzK77JmvWMpeB0eR0O3SH9KK/1qaAkXK/bhyazFdT+WHrexsFYZuO5I1MiQWJzNDQ9r3act5mt0senky0dQ+Sb233mB+RX2AWxOf9SUcRtkKjiTvfSdcKHmLx7ns2F8MQdwFoKz7j4a7sPsuruL+BMHWuDj/VTfnVmG6nlzIjs92LVWKnZ010UOv156HJYQvhlSV+WzPv8EC/2A2LhBx0g1ZJ3vYQIu2G1AuhcZurtEOfbhcIsS6cq9P2YoRYTYTHeiXHNzKot/25uSAFs85GQhWyMz+2L3HBiszTmSdwtf0ZzHgGEBc90JD6yNfjwqF4FJ7AcuLYw5euNz/VEON3z2C021shibn6LGd4RjflA8XmBGSakJ0nkpplflYaQ9Awcv2eKYR4ebAVjhyErm4zHikUC5Vgtz/0UbghbNcX0RIEESW2GaGtFNYIYNPHJNtj4QMYLK7BrUOnzITF+Kx/FZG6oIeySnU+TJoZIkJBIqGLOYSkw+QuEbCbf1BM5nERddA8z+IFxYz7Goxg4XMpc3+L/Hx29UZzkNSY55Y2Swii1qxBWgBaRGpzI66cKfr6mHES+cbb9vNAdFPuBgJttyT/t3Jf+W5yRYt8M4VyIlEiUjAGqL3bqakDP5IwywMSpYeS1PmqWBsbUcV9bAavsLMnnEHvUue8GboIr+EeBMCk6XPBKFahrRZBTQq802IGDYOi++VjG7805Tleu2pX6H/IY/LDQVLnqVhxDaVonTvQqMffVvSwXp7EFNvR/XKxh+IJxO/W3tQeAi8Jn77E3itRU+tQEl8QQ65psW7FBQXujG6YYWK9XbPUPI/AkdVmaAuQQt7RPni0MhxB0Q8k6BqzhwbpyLMPa/XCkHdJLrO2xGupnrwYvt0OcF7Ia/hN9+HAekLtq8l+HcNGIY/JA2RPYOYGSEgAEVAgAACjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMApjbGVhcnRvbWFyawqAAw=="; + private static final String TYPE1_BYTES = "gAFfBwAAJSFQUy1BZG9iZUZvbnQtMS4wOiBUeXBlMVRlc3QgMDAxLjAwMAolJVRpdGxlOiBUeXBlMVRlc3QKJVZlcnNpb246IDAwMS4wMDAKJSVDcmVhdGlvbkRhdGU6IFR1ZSBGZWIgMjQgMTU6MzQ6MDUgMjAyNgolJUNyZWF0b3I6IEpheWF0aGlydGggUmFvIEQgVgolIDIwMjYtMi0yNDogQ3JlYXRlZCB3aXRoIEZvbnRGb3JnZSAoaHR0cDovL2ZvbnRmb3JnZS5vcmcpCiUgR2VuZXJhdGVkIGJ5IEZvbnRGb3JnZSAyMDI1MTAwOSAoaHR0cDovL2ZvbnRmb3JnZS5zZi5uZXQvKQolJUVuZENvbW1lbnRzCgoxMCBkaWN0IGJlZ2luCi9Gb250VHlwZSAxIGRlZgovRm9udE1hdHJpeCBbMC4wMDA0ODgyODEgMCAwIDAuMDAwNDg4MjgxIDAgMCBdcmVhZG9ubHkgZGVmCi9Gb250TmFtZSAvVHlwZTFUZXN0IGRlZgovRm9udEJCb3ggezEwMCAxMDAgNTAwIDIwMCB9cmVhZG9ubHkgZGVmCi9QYWludFR5cGUgMCBkZWYKL0ZvbnRJbmZvIDkgZGljdCBkdXAgYmVnaW4KIC92ZXJzaW9uICgwMDEuMDAwKSByZWFkb25seSBkZWYKIC9Ob3RpY2UgKCkgcmVhZG9ubHkgZGVmCiAvRnVsbE5hbWUgKFR5cGUxVGVzdCkgcmVhZG9ubHkgZGVmCiAvRmFtaWx5TmFtZSAoVHlwZTFUZXN0KSByZWFkb25seSBkZWYKIC9XZWlnaHQgKFJlZ3VsYXIpIHJlYWRvbmx5IGRlZgogL0l0YWxpY0FuZ2xlIDAgZGVmCiAvaXNGaXhlZFBpdGNoIGZhbHNlIGRlZgogL1VuZGVybGluZVBvc2l0aW9uIC0yMDQuOCBkZWYKIC9VbmRlcmxpbmVUaGlja25lc3MgMTAyLjQgZGVmCmVuZCByZWFkb25seSBkZWYKL0VuY29kaW5nIDI1NiBhcnJheQogMCAxIDI1NSB7IDEgaW5kZXggZXhjaCAvLm5vdGRlZiBwdXR9IGZvcgpkdXAgOS91bmkwMDA5IHB1dApkdXAgMTAvdW5pMDAwQSBwdXQKZHVwIDExL3VuaTAwMEIgcHV0CmR1cCAxMi91bmkwMDBDIHB1dApkdXAgMTMvdW5pMDAwRCBwdXQKZHVwIDMyL3NwYWNlIHB1dApkdXAgNDgvemVybyBwdXQKZHVwIDQ5L29uZSBwdXQKZHVwIDUwL3R3byBwdXQKZHVwIDUxL3RocmVlIHB1dApkdXAgNTIvZm91ciBwdXQKZHVwIDUzL2ZpdmUgcHV0CmR1cCA1NC9zaXggcHV0CmR1cCA1NS9zZXZlbiBwdXQKZHVwIDU2L2VpZ2h0IHB1dApkdXAgNTcvbmluZSBwdXQKZHVwIDY1L0EgcHV0CmR1cCA2Ni9CIHB1dApkdXAgNjcvQyBwdXQKZHVwIDY4L0QgcHV0CmR1cCA2OS9FIHB1dApkdXAgNzAvRiBwdXQKZHVwIDcxL0cgcHV0CmR1cCA3Mi9IIHB1dApkdXAgNzMvSSBwdXQKZHVwIDc0L0ogcHV0CmR1cCA3NS9LIHB1dApkdXAgNzYvTCBwdXQKZHVwIDc3L00gcHV0CmR1cCA3OC9OIHB1dApkdXAgNzkvTyBwdXQKZHVwIDgwL1AgcHV0CmR1cCA4MS9RIHB1dApkdXAgODIvUiBwdXQKZHVwIDgzL1MgcHV0CmR1cCA4NC9UIHB1dApkdXAgODUvVSBwdXQKZHVwIDg2L1YgcHV0CmR1cCA4Ny9XIHB1dApkdXAgODgvWCBwdXQKZHVwIDg5L1kgcHV0CmR1cCA5MC9aIHB1dApkdXAgOTcvYSBwdXQKZHVwIDk4L2IgcHV0CmR1cCA5OS9jIHB1dApkdXAgMTAwL2QgcHV0CmR1cCAxMDEvZSBwdXQKZHVwIDEwMi9mIHB1dApkdXAgMTAzL2cgcHV0CmR1cCAxMDQvaCBwdXQKZHVwIDEwNS9pIHB1dApkdXAgMTA2L2ogcHV0CmR1cCAxMDcvayBwdXQKZHVwIDEwOC9sIHB1dApkdXAgMTA5L20gcHV0CmR1cCAxMTAvbiBwdXQKZHVwIDExMS9vIHB1dApkdXAgMTEyL3AgcHV0CmR1cCAxMTMvcSBwdXQKZHVwIDExNC9yIHB1dApkdXAgMTE1L3MgcHV0CmR1cCAxMTYvdCBwdXQKZHVwIDExNy91IHB1dApkdXAgMTE4L3YgcHV0CmR1cCAxMTkvdyBwdXQKZHVwIDEyMC94IHB1dApkdXAgMTIxL3kgcHV0CmR1cCAxMjIveiBwdXQKZHVwIDEzMy91bmkwMDg1IHB1dApkdXAgMTczL3VuaTAwQUQgcHV0CnJlYWRvbmx5IGRlZgpjdXJyZW50ZGljdCBlbmQKY3VycmVudGZpbGUgZWV4ZWMKgAKNFgAAdD+EE/NjbKhan/77ULS7JzAqXMCrbi+Vm/INMgw3PCEo0KDOcHKx9nKgqjjDwOzrBLRMsXShwxYS1x/6IMkJVCVjeDcveVsL8pQfQ38Fn0GuBZjABRX+8YczNVfzLOMqnufUurZdpTQ/knB+LPzz6M5Eblraw5/Dfs5ktos1bODXEPRbHn8s12iryhQ2CDZodhoQCUZBYtBUwfa/LEajGbPGZFKHYxbBOpJkVtNmKVj9VnQNWFZzbmEE+BPtMZFWd3k07rHFRFrmv27lnlsZcItCh9tLm6+YgpGrwG/ed/zDHuFzCpT7xs7MdEpZqfajjiw9JKNtvO6XgdQ7y2rxwhv69q6/DIarClaEsha9+rFXfYTEkK8BcaUY1RI7beRwxnGx8Mt8pafG9aKKUpeQEJnqFv6Bk9Kz6/t+fAPkHdv8KUIErVw3AxMUFg63Ti+yeRa+1QQ7vDTTkV3O3Obim9olUKuQDhfmH2uWx+K3iBXFqwCLQTC/S/W/LDn9UCsxsphc4HA1txBMdO2NO8rPec0i5GLWOZZI5tOxhUsjPXLloUXLWOkU3I0wBTXW8TlAV2yBn+EPJ4XV14tyCoWHanYChLFqYcChHUHj+0GKluGz0gfPNQ4xf3u6+jyJLmvDFxiNxtSNAud0yBZx12ouXbVSeHGYXWk84KA/Sus2DDbG/E6H+kx2MfnEVMz2yZm/lW6a4w5Pevvdoxfj9BMLm1dBkDCxHQsjw1dbv7yBz3j6kibdv2I4JFxLoEW8qsxcH2SXXgJpM3KrNQlPRIqq8IKmxH3ZllsL/QQ8YJFg+KJjygCl9QOmrL/1FXx/JXmx0m6ynXaUfF1PwtiP7e1ISNfaExaiL1C9OtTK2T4h2WhRPW57ycPj/dYRfjKD7OvXXYQ+Co+s+jCWDRpbwGTLlDP0XQFMBNxx4cBogjdx6ouFfm8lXgfeQf/GC0CtQolv6YH1O06mdXeZ1hqAFwHALulGBr2WdAoV9wBD5SBSeMeIV3waNCP5P0xB7rP7uXTZv/oscgXK/61/3tsjyAXyZASQxvMf8uyWsThQA9TTEOM1o28z9bj6Yhs0Snwl2CxemFy3xgyidcNyBDRsCDFwYKjsejtr9sZGIXAFJK2djcN8aUa549kahghsM9NAB65fQFOwjWjPAZEnunfOsU/LXlWLjpPdul4+P/iseq37udumJc/dZMXm6KXDL6pesrEVc80hrFtnnPWTyaNUP1im/rQrwZvDnVJ0Yvg5XSGo6crcpdPE5pUviEVHB2W8aCI8W+2QrxfIXdN8g4bPW7FEjuoe424XoHpyyIkD1+0MyVNgCVywIoFjugUfAu5NKoFo+7+WyIvtrHlgEuMjEK70a2RhFp7wVuod4VD0EHJ+MWXUglKomSB7mA07KQiQDck++iAwwPmxKLmUdUItfeOcEji8RBoUkcTu9YuNij22HrsBxawVzE8Yz/ZRKqlbHpuuRHao7z2gIobOg8wHb/+lMC1o4vjwayYLSNfFyvf6XivjCkz2KUQlrLX+8WyTVA6JDHsI1xfhI+kr3NTJ2fZBKweobTge72fpGuiVEjV82l52w9UZBH9P70XJUqd1lYIstqLN+mDdVSJ1axsp9sDufLMEFWX9xUlCOyAdOefz02cniXnJcxIVdH8q01OLa5jxMlJ+CBeXO0D4j+r7qY8ZCTyeRT9eEpAykqEajhOoZPjhjtMlw5jgyZJ9COaM30bC3coKF93YSmRQaIkE9b1kw5dGlFvpGGYL4bAzo0SNSkIO00So24z3TISF9aJ1ssBn2072KoV99O/5QN5cWKdDvaSFkMJp0YFRHXNNHe1Zo0kV5Shq0uEygfikR1XDyuLuiycQSHWnFxVr2xSaMnA5CfKwfQu8hQ5ljap6spe1+Qh6Am4TkDa/CaO1QlQ03mRUcyyxFwGZJljNAkI7mVgG6DUlxxVSK8wJMH7otzpS0L2LYTHTG6LV0iXQBjNB4wuH5LqyqTgsiA8x7UASJFYY0RJGrD9moFp/ON0t+NPT6Rfw3Semq239oYpxMQr/mHkHfExaIA0AX31DjfMqWzj4bypd8B9zZFvOogC2EHPobmhYhjzFcbMdVXwnAENC0EVbEMdLzDQFeSFRpDwF6MJ5CyqFS4wD7PsyF/aVlPwi0rLnr6+xygmhFhtpsOi/zVT8qT0BCWBG4+9UZIh6MfLm+JWkLNQcEGmhTglxzIhntDTZkBO9MkYhs2vOM9pAWS9Pjcba8OR6+aiVMOZVReGm7FH3BixWPTHOeqMGpZYH09MRTScHecT7G/TgiZIcUReqM7OdmyExBR2IJ0tLuaEuHxyn7SC5Gdlcf9mL9Kz15sZFzTkZMjJAtCOTPMaHq/0eQIr/Ln1YMDd6O+ApErFrIGDQd4hBA2H8tIZMIuSct/KMzwj83QiB+wvvF/ec6vJCSEjU7FPayLiPt9ELxOKC0p3+k4wfc4PCX0VLozKllmEQ2+m7gkcI+mvWXGkjziNZtg7HsgEZbRTjH2H8LuaonHwNzpASWjt8e6deQzOglya7sRNKamea3s1oGPx1ZAZmGs5EZGtW0wT7h7WbQkM0Pv0Xcmb2d+0MWyOpvThTQOqog9wOrBZp8WQwFMbimf5h3nqrmgeRcmQL5YGrA0lLaShxIB9fiC8RBJ2ndEs8vW4MJU3u95ZJmQUwTDewI2WhsgV4CG9t74y790nLu/OWuRtm83j6FLEvtmgs0fMoE0WAtqrbzB2BLblT4GN7VXbZSE7K8B+zPTlx2Lw1mH4AwW0RK/6Hl6P8Y2KMsVSnLDDhKXxXSpaQQiiMV6lGAT4JLO9dh4cSAl0KVseZ62jLfcpN3T5UpiNAXr/OMqe0Vki/TLdwUCbfNL606j7Ki8v84s/ob3kaoYzKE5HDhgxKRYkd5NXmT321GSDdGW5OG4J5kwcF7KgJ7lY4HwLAkumbF4oMWMDz3FYRK5BxlYA65pSMxhCYKV5XMg2cPDPpLj8S55CI0Nq8WX8vnIY8JhSA2nbnTwzrSU30sN6BpXPILan6UBbNn91PgLOawA9Qnqebuq3BwqHOYAFecMIf3W/70HZ+iFc87AiEPK7kmn2Fm4az69PV3jVBZlIKAYGUHQvTm3+KYnNEGKSoOLB0bUGhklOy3vnbCuZt7Z2i0OpM2d7J9SqaCF1qrmIItsPKwGI6E1XyOhs1pVMwbWUzwHh4EU/wvU0bmcMinR9PWfvyusq4wUeP/rSQoRd7TfFNHZaCg9HJkgDdtjcTjpPBv/SPMNahf6KdknrkRunKE1+XxvdjKxo+7DXcijK8kPwDB5ZAv//BxZ6NEkippShPuCXnlP6huGWMNaM4Ascw+BU3R5P6SHODlrafn48qAqemBBnoUfmCw2mu+su+agNtVYx5MEacrmpyZGaQizFF/IAygncdllch8YCF6upwv0J8ehKxqIrdB5EpS8NwVmSl9HnL4Xkob5/T/PzCK5wCZYkECwKZEF1atSrcoKBeIHzn7FsCGLNDU7WPEseSYZvRNOUmunflZDysYSLBf7XMKkeaLijeB1qrD4P4fone9c9g1KrdZO597AT3DFfL/fTuKfvzLFS2dFJW3JxBhtIAEbVyd7hhE1ik1QulOOh7ZyPiuu60urRcrGU+fQVbXtdCVCZ+NMn/gvFbipQ+4w4Ry8xfBpyWQrIFTyzQ/hyBgecQnA7iJhrSiV56aCErXrHDhNCXvApKd9+rUB6w8Ltrp2ag/AIn3jA414KjLwvcvh2ztTYW9kGsA9c/TQYKYXrgbaWoSd7Z357cmY9I4UOEVad3Fxk8QZ2zWFdvydAyOrGU+7lo6fvirobuADWo1P6/4BSh7ZdzHxs5s3RvDAYrWwoO/WpmMdWzF5RvAXKXXcYhme5QBalZw270QjmB3VOvaZLQgkBFYV/USdi2Pl5yJRxmeRLHxW+9U3gi/vUxowUiFPaJ4hjgzuogct3zF0oJ3ZrSamVut85DZC88fY5RdC/GR53FR+nt51wzu+PPjh2UtQgZTdTD4tfmZ8MGc2BaHiQ+yhEPpXWi2sfkFwkVlOMnHrJOFwKil0Uy8OoHHiDlSQNX22YinDSmcY8silpqltMmVnibm4mQodIocSfNY+DMA6v5oiFFsXUCEiS5P8975OihDJIokTGt4E/z7VQag2vChKPSEMaK6NIhQjGn1qAVq26MDnXkLe1ScmDDVhdBH7F9OiPdGEoGz0R/EHqAiPC6LaGByJwvKm87QgQ0bP/CIWKAGOmV9b9GV18G8nN4+T1xu4bcatp+0RzLNXxPXBMvFYBDvhBv0JqM1Bzkff5VHc8Cly7qfWJ9GPfghDC1cdFtXf/qNzdrCNvEeT5BloKFZ6s7vkDEfGPLqgMxt5T3ywQPJhdh0J5m7HurwNA+BwBycoPts7h33elU2NlSNe7iRbTViFFLirJdYGSlZaelccnNqAJEWC55V5gxbZiA+nym/7KRlEeUpFmLtFBBPKHOsbhK5uNWw2w2cCCJuwlC8FcLoqsGaykaQimUJNrg4r5lDLwcdIPslHivyRywMP4f/rr509DL/ZsvrEZHXpC1UHiuUnpoYp5uD8Sd5t7TCG1pKC5Wqw6QnE3j5Ra0Zd3WaY9MJkTtmj5zAmPvBWtda/uhdM++vqUD5pm2FkmZjpcxdQ+Dw2ebN3eOKQsDcRrNc07d8qWC2XkqAxyolN21qFg4FBcM68Szc1/50XwOK8QyEBhG24XJbMDfwTGOtzKCExUaTje30HoD3Nzzee39rTe8t3aQJ56VVEdDPBsxqjrYHdbEPJFqwRSExlngpbIWjOiEyWu5YbcX0cQgk/TSlnRGV16o9pg2qBbcvWm5gpPZ0Kj3QrxPpmJIUqq6tYoc2zt2LZUbrTnopjvISz8+fm1jIQJt2vpRgnwLwC9uAsf3vBEoZvnxGQKVsG+1B6uVnlK4hKB0retrDEbdcGGpiACMc8IuXH+vQztfpFYR8aCY79MpHm+oHiIUWsBiosbWoYNOZv1D3T28W+A3xBrKABzqhwvymGnMrec/JzNPObaj4szJYJegxC7SyWuNbA8Je5xNon8SKM9KvtSh6MWDOhOMk4eTOyiuwUpUYRiMpazBdMe0msnhuE2qlRvQC08QaDEUZMN+EWEX63wnjN6CfXw5qIdlAHoG9ZypCQy7G3mYVqYLfywMdFBKE7JY+u31XsYp7UNuRkKAN6VGQux6Qym64jGLBO5M5gvzIHmUluXR+y9D6SzcOtocea4Y9/YXggV1MWSmW2dq7hvV58ZYbix1wWwuv10uG8OIUwiaMet6vVag6bIK1RG+7yPB3caz9gCcqoXnU4zlHNYqu6Zcg3226k91SSDWcvy5fHoKSZOtSwkIEb0m+dJURp7QFJ1AeuWoy6oxD6xAM995YBRyLCX3N9gHGiJZ33BbKq85oGrzQN8SeXs6j8+FrglsRqcjvdk7vgZCLRl7qcWsmkFXCzikZsHPn2stZMJm7bVfILwdMTF4A42iV9wy1idF4qXYzAZHLdEP9BDpdGMKRiICY8avlTv0nYMW1qgBz4cXrdmSrBTPV4Ts5/3yDP44/foH/rju3wLoWprGkQMU1cNj66iCCuKnhExh/bRb40wLE1N6H86Le9WYBUbJEJA5Knx3ELAboZ2xK+e8zK2jPZdcv1AGGfPE7V6G7/7YCOepiP4cv+RTru77QaND/sf+eX1N+pb8WDxgTMPQ5/AJeibBWmEO7zw+L8CBY+rAphiofoUzY9U32dBwf82tdPDwvqrtik+HqZfG74h6We9fRJrfUjR3J/5g7P8IpcJAI7XQ6N7IvujSTMCtDtOd5Pf4mzuvFj/y3A5cLXuFT8wvqtm+BaIMLCe0lgWg4h6vtXEeKGmMsCVnZP16QiuaftHgo71UaXH18Z/rafUcV1TirxHs9ddST6hNPZ31IMPVt6L2Z8p3ucsMRPjlqY4SpYjQClVEiUc6R2FPbGstgmH/OU+uDx7oNhRgFV91/h3p/9klZ1PXOHWzTtPN91bKkITWttjft16yhKkY9Qi2vXG/f8BdyNenjFoUHATcsr4n9UtjNFBIptLX7UQFf4KkNnbyeKV1Cqdl3L+NEz8/gXBeAXJgEEHNRBjz9sQLiyj82rL4wgonrKDtxvVRCBVOc3g2BYdnqsKpe7be5GFrhxyYIufRfj64AVfn9tExQC4y7NoQcMUCXHcDXSQaO4DI5kh4hWftJhYRQciNx7okOXWgQakxRz0BLMquW2zr16Eh+a1wMV+RRRbnOQUrdSuOptLp0HeXxDPBmd23mb+o9EaBZopKJcsZ5uVRnRPG5MpSDZBX/dD+ZcFhNxAkwftTJGxbHU2FvDZxZMau4ORlvRpe0jQqK0KAPjVhxygj+efvJhwqE7SjMk92H8tSlUcJNKTPRWlbzC+nXIfQmrUKWHB9WkJYPkygDNksMh29qtDKBoTrPFKd8TjtqAmPPYOARdnuOZ5GBLvk29+HuyIxm1reGzc0gAVPFM4+a5KuvdXP5RDQsfOYhrjfhryXiSjnafEa4Vr8bQV4tCrvM1wB6GwJNUMUIOLnZMKC1Wpa42CVKIjTsED1U11qk0c/z2pdQSW8bkze+S96EspK6YwFRpG+l2w57H45pXKCM/OtEoUFAsNYp0aUI03VLX0vayOPXwZjxfm0Sbxw8GlVveOcDjxP9PubGwJWB3zThbP3mWiciTTtQYHzJ12nStPUWrHe09we4wUPO5jzfTMVhXA/IGP6+xomVdm6BR6Iffn12RP9G+HUeWBB/vSHCL6FMcBSGEKo8kX9sVT43WPthgSJGxH+5cxSVsRZSpa3WEwJI7W6R30TpkUmhLMOROdMF9Oh6+G+73HC6kdt27xFupu9ZkFRCBxpa/QAQxLUKMekm90PTVMdiWBALcRG/5a+GbCJsEwasen3e8NWD8CDFqPPeDNQEhkDNzaWbvtiNttHV9ESmFC5Ty642U6taS7g3yI/aeMBjh6zebr+UmXv17XeNyO6N6KJBOstv8Ry1f/TmkuuQm3fXu3n99fkb5gLZUHIvUuQ+Q3vTnWrPkCt2Ezbp125iAKvlRyhk1pXLvrr/EA1OhtaGnLqEeq5XqBpwh6StXPQXk9qfZT9wNzhylhcM929FxVeGolbk+68k//XdoJhQg4nxUqYBavhqCEpNTvL+tCJP/DOX4MSAH+3VYuzPQGp03X4exr4V3CKf9vCE6BUiBvHjDic5quOPsKCg8oYqU98UUr7f8aF1IwzW5woFt5CcScIS7mxk93T9ZB3WasKAPuMgV97OniMMOLqV1q6x5g1kHT67a7lQG3t1rPIFzDu/YvRh0ro/ldnLOAG7kgcZgBxG+GUlSMJMFzA51cKCE6zulbDK0U4lGyF+0fQzK5J7JGySCNyspkbL2KoioJJPWZ9kEggqZlKQk9ps0HQbBLNKkad1ZVIyuJHrQTddcr6SB8TnUI+FEH9/dyBpfXAx3XCL9xWWSqzEsQ9h24a+oRnfkm9lEQDrR9YpPyFavVP2QhljRuQJ6TXwqrrBe0LbEL7kn3st3w98B99u4MtdP/mbeSDjk5/8iYKLsilg30/mllHfbIv8kue12+JmZJo01gCc+Dehm0rlMPMxeqqrCKlXj5n5FerqqPfkNs/rKfXFFlgu5cl/cBKqP17G4xLPLOLA7wHfabHXZB0vQDeE9SpIAZPmzR9VjXx/quSDUV8p4ABFQIAAAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKY2xlYXJ0b21hcmsKgAM="; public static void main(String[] args) throws Exception { diff --git a/test/jdk/java/awt/geom/Arc2D/Arc2DGetBoundsTest.java b/test/jdk/java/awt/geom/Arc2D/Arc2DGetBoundsTest.java new file mode 100644 index 00000000000..983c4583708 --- /dev/null +++ b/test/jdk/java/awt/geom/Arc2D/Arc2DGetBoundsTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 1999, 2026, 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 4197755 + * @summary Verifies that Arc2D.getBounds() is similar to Arc2D.getBounds2D() + */ + +import java.awt.geom.Arc2D; +import java.awt.geom.Point2D; +import java.util.ArrayList; +import java.util.List; + +public class Arc2DGetBoundsTest { + public static void main(String[] args) { + // Imagine a circle that represents a compass. + // This arc represents the northern / top quarter. + Arc2D arc = new Arc2D.Double(0, 0, 1000, 1000, 45, 90, Arc2D.PIE); + + // Create 8 pie slices, and place a dot in the center of each + List samples = new ArrayList<>(); + for (int segment = 0; segment < 8; segment++) { + double theta = -(segment + .5) / 8.0 * 2 * Math.PI; + Point2D p = new Point2D.Double( + 500 + 100 * Math.cos(theta), + 500 + 100 * Math.sin(theta) + ); + samples.add(p); + } + + // these assertions have never been known to fail: + assertTrue(!arc.contains(samples.get(0))); + assertTrue(arc.contains(samples.get(1))); + assertTrue(arc.contains(samples.get(2))); + assertTrue(!arc.contains(samples.get(3))); + assertTrue(!arc.contains(samples.get(4))); + assertTrue(!arc.contains(samples.get(5))); + assertTrue(!arc.contains(samples.get(6))); + assertTrue(!arc.contains(samples.get(7))); + + assertTrue(arc.getBounds2D().contains(samples.get(0))); + assertTrue(arc.getBounds2D().contains(samples.get(1))); + assertTrue(arc.getBounds2D().contains(samples.get(2))); + assertTrue(arc.getBounds2D().contains(samples.get(3))); + assertTrue(!arc.getBounds2D().contains(samples.get(4))); + assertTrue(!arc.getBounds2D().contains(samples.get(5))); + assertTrue(!arc.getBounds2D().contains(samples.get(6))); + assertTrue(!arc.getBounds2D().contains(samples.get(7))); + + + assertTrue(arc.getBounds().contains(samples.get(0))); + assertTrue(arc.getBounds().contains(samples.get(1))); + assertTrue(arc.getBounds().contains(samples.get(2))); + assertTrue(arc.getBounds().contains(samples.get(3))); + + // these are the assertions that failed before resolving 4197755 + assertTrue(!arc.getBounds().contains(samples.get(4))); + assertTrue(!arc.getBounds().contains(samples.get(5))); + assertTrue(!arc.getBounds().contains(samples.get(6))); + assertTrue(!arc.getBounds().contains(samples.get(7))); + } + + private static void assertTrue(boolean b) { + if (!b) + throw new Error(); + } +} diff --git a/test/jdk/java/awt/image/XBMDecoder/XBMDecoderTest.java b/test/jdk/java/awt/image/XBMDecoder/XBMDecoderTest.java index 9694043d1bb..9d2a23bd29b 100644 --- a/test/jdk/java/awt/image/XBMDecoder/XBMDecoderTest.java +++ b/test/jdk/java/awt/image/XBMDecoder/XBMDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 8361748 + * @bug 8361748 8377924 * @summary Tests XBM image size limits and if XBMImageDecoder.produceImage() * throws appropriate error when parsing invalid XBM image data. * @run main XBMDecoderTest @@ -63,7 +63,9 @@ public class XBMDecoderTest { boolean isErrEmpty = errContent.toString().isEmpty(); if (!isErrEmpty) { - System.out.println("Expected ImageFormatException occurred."); + if (!validCase) { + System.out.println("Expected ImageFormatException occurred."); + } System.out.print(errContent); } if (validCase && !isErrEmpty) { @@ -91,9 +93,7 @@ public class XBMDecoderTest { g.drawImage(img, 0, 0, null); g.dispose(); int[] pixels = bi.getRGB(0, 0, w, h, null, 0, w); - if (Arrays.stream(pixels).allMatch(i -> i == 0)) { - return false; - } - return true; + return !Arrays.stream(pixels) + .allMatch(i -> i == 0); } } diff --git a/test/jdk/java/awt/image/XBMDecoder/XBMDecoderWidthHeight.java b/test/jdk/java/awt/image/XBMDecoder/XBMDecoderWidthHeight.java new file mode 100644 index 00000000000..7a9328b1554 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/XBMDecoderWidthHeight.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2026, 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.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.Objects; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import javax.swing.ImageIcon; + +/* + * @test + * @bug 8377924 + * @summary Verifies XBM decoder parses width and height in backward-compatible + * way: `-h` corresponds to width; `-ht` corresponds to height + * @run main XBMDecoderWidthHeight + */ +public final class XBMDecoderWidthHeight { + private static final PrintStream originalErr = System.err; + + private static final String dir = System.getProperty("test.src", "."); + + private static final int WIDTH = 8; + private static final int HEIGHT = 1; + + private static final Pattern glob = + Pattern.compile("valid_WH.?-.*\\.xbm"); + + private static boolean matchesGlob(final Path file) { + return glob.matcher(file.getFileName() + .toString()) + .matches(); + } + + public static void main(String[] args) throws Exception { + final List errors; + + try (Stream files = Files.list(Paths.get(dir))) { + errors = files.filter(XBMDecoderWidthHeight::matchesGlob) + .map(XBMDecoderWidthHeight::testFileWrapper) + .filter(Objects::nonNull) + .toList(); + } + + if (!errors.isEmpty()) { + errors.stream() + .map(Throwable::getMessage) + .forEach(System.err::println); + throw new RuntimeException("Errors found: " + errors.size() + ". " + + errors.get(0).getMessage()); + } + } + + private static Throwable testFileWrapper(final Path file) { + try { + testFile(file); + } catch (Throwable t) { + return t; + } + return null; + } + + private static void testFile(final Path file) throws IOException, Error { + try (ByteArrayOutputStream errContent = new ByteArrayOutputStream()) { + System.setErr(new PrintStream(errContent)); + + ImageIcon icon = new ImageIcon(Files.readAllBytes(file)); + + if (errContent.size() != 0) { + throw new Error(file.getFileName() + " " + + errContent.toString().split("\\n")[0]); + } + + if (icon.getIconWidth() != WIDTH || icon.getIconHeight() != HEIGHT) { + throw new Error(file.getFileName() + + " Unexpected size: " + + formatSize(icon.getIconWidth(), + icon.getIconHeight()) + + " vs " + formatSize(WIDTH, HEIGHT)); + } + } finally { + System.setErr(originalErr); + } + } + + private static String formatSize(int width, int height) { + return width + " x " + height; + } +} diff --git a/test/jdk/java/awt/image/XBMDecoder/invalid_WH1-no-height.xbm b/test/jdk/java/awt/image/XBMDecoder/invalid_WH1-no-height.xbm new file mode 100644 index 00000000000..09fcfe0d576 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/invalid_WH1-no-height.xbm @@ -0,0 +1,3 @@ +#define width 8 +#define width 1 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/invalid_WH2-no-width.xbm b/test/jdk/java/awt/image/XBMDecoder/invalid_WH2-no-width.xbm new file mode 100644 index 00000000000..fa2e6d9546b --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/invalid_WH2-no-width.xbm @@ -0,0 +1,3 @@ +#define height 8 +#define height 1 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/invalid_WH3-no-width-height.xbm b/test/jdk/java/awt/image/XBMDecoder/invalid_WH3-no-width-height.xbm new file mode 100644 index 00000000000..cf22314b055 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/invalid_WH3-no-width-height.xbm @@ -0,0 +1,3 @@ +#define test1 8 +#define test2 1 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/valid_WH1-th-ht.xbm b/test/jdk/java/awt/image/XBMDecoder/valid_WH1-th-ht.xbm new file mode 100644 index 00000000000..c287afe79b3 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/valid_WH1-th-ht.xbm @@ -0,0 +1,3 @@ +#define th 8 +#define ht 1 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/valid_WH2-h-ht.xbm b/test/jdk/java/awt/image/XBMDecoder/valid_WH2-h-ht.xbm new file mode 100644 index 00000000000..58605910d70 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/valid_WH2-h-ht.xbm @@ -0,0 +1,3 @@ +#define h 8 +#define ht 1 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/valid_WH3-ht-th.xbm b/test/jdk/java/awt/image/XBMDecoder/valid_WH3-ht-th.xbm new file mode 100644 index 00000000000..7d8bc74d1ec --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/valid_WH3-ht-th.xbm @@ -0,0 +1,3 @@ +#define ht 1 +#define th 8 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/valid_WH4-ht-h.xbm b/test/jdk/java/awt/image/XBMDecoder/valid_WH4-ht-h.xbm new file mode 100644 index 00000000000..94afe2c39b9 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/valid_WH4-ht-h.xbm @@ -0,0 +1,3 @@ +#define ht 1 +#define h 8 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/valid_WH5-w-h.xbm b/test/jdk/java/awt/image/XBMDecoder/valid_WH5-w-h.xbm new file mode 100644 index 00000000000..cf423b737a1 --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/valid_WH5-w-h.xbm @@ -0,0 +1,3 @@ +#define width 8 +#define height 1 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/image/XBMDecoder/valid_WH6-h-w.xbm b/test/jdk/java/awt/image/XBMDecoder/valid_WH6-h-w.xbm new file mode 100644 index 00000000000..d9641b9009f --- /dev/null +++ b/test/jdk/java/awt/image/XBMDecoder/valid_WH6-h-w.xbm @@ -0,0 +1,3 @@ +#define height 1 +#define width 8 +k[] = {0xAB}; diff --git a/test/jdk/java/awt/print/PrinterJob/ExceptionFromPrintableIsIgnoredTest.java b/test/jdk/java/awt/print/PrinterJob/ExceptionFromPrintableIsIgnoredTest.java index a62ae536e1b..4c2ff370cb8 100644 --- a/test/jdk/java/awt/print/PrinterJob/ExceptionFromPrintableIsIgnoredTest.java +++ b/test/jdk/java/awt/print/PrinterJob/ExceptionFromPrintableIsIgnoredTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,15 +21,16 @@ * questions. */ -/* @test - @bug 8262731 - @key headful printer - @summary Verify that "PrinterJob.print" throws the expected exception, - if "Printable.print" throws an exception. - @run main ExceptionFromPrintableIsIgnoredTest MAIN PE - @run main ExceptionFromPrintableIsIgnoredTest MAIN RE - @run main ExceptionFromPrintableIsIgnoredTest EDT PE - @run main ExceptionFromPrintableIsIgnoredTest EDT RE +/* + * @test + * @bug 8262731 8268675 + * @key printer + * @summary Verify that "PrinterJob.print" throws the expected exception, + * if "Printable.print" throws an exception. + * @run main ExceptionFromPrintableIsIgnoredTest MAIN PE + * @run main ExceptionFromPrintableIsIgnoredTest MAIN RE + * @run main ExceptionFromPrintableIsIgnoredTest EDT PE + * @run main ExceptionFromPrintableIsIgnoredTest EDT RE */ import java.awt.Graphics; @@ -64,14 +65,6 @@ public class ExceptionFromPrintableIsIgnoredTest { "Test started. threadType='%s', exceptionType='%s'", threadType, exceptionType)); - String osName = System.getProperty("os.name"); - boolean isOSX = osName.toLowerCase().startsWith("mac"); - if ((exceptionType == TestExceptionType.RE) && !isOSX) { - System.out.println( - "Currently this test scenario can be verified only on macOS."); - return; - } - printError = null; if (threadType == TestThreadType.MAIN) { diff --git a/test/jdk/java/io/FileDescriptor/Sharing.java b/test/jdk/java/io/FileDescriptor/Sharing.java index 24f4fb70b02..e4ceb2d6906 100644 --- a/test/jdk/java/io/FileDescriptor/Sharing.java +++ b/test/jdk/java/io/FileDescriptor/Sharing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2026, 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,7 +28,14 @@ * @run main/othervm Sharing */ -import java.io.*; +import java.io.File; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.io.Writer; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.util.concurrent.CountDownLatch; @@ -71,7 +78,7 @@ public class Sharing { // encourage gc System.gc(); // read from fis2 - when fis1 is gc'ed and finalizer is run, read will fail - System.out.print("."); + System.err.print("."); ret = fis2.read(); } } @@ -93,7 +100,7 @@ public class Sharing { * read from fis3 - when raf is gc'ed and finalizer is run, * fd should still be valid. */ - System.out.print("."); + System.err.print("."); ret = fis3.read(); } } finally { @@ -290,7 +297,7 @@ public class Sharing { FileInputStream fis = new FileInputStream(raf.getFD()); fis.close(); if (raf.getFD().valid()) { - throw new RuntimeException("FD should not be valid."); + throw new RuntimeException("FD should not be valid."); } // Test the suppressed exception handling - FileInputStream @@ -308,7 +315,7 @@ public class Sharing { ioe.printStackTrace(); if (ioe.getSuppressed().length != 2) { throw new RuntimeException("[FIS]Incorrect number of suppressed " + - "exceptions received : " + ioe.getSuppressed().length); + "exceptions received : " + ioe.getSuppressed().length); } } if (raf.getFD().valid()) { @@ -332,7 +339,7 @@ public class Sharing { ioe.printStackTrace(); if (ioe.getSuppressed().length != 2) { throw new RuntimeException("[FOS]Incorrect number of suppressed " + - "exceptions received : " + ioe.getSuppressed().length); + "exceptions received : " + ioe.getSuppressed().length); } } if (raf.getFD().valid()) { @@ -347,10 +354,8 @@ public class Sharing { * FileOutputStreams referencing the same native file descriptor. */ private static class OpenClose extends Thread { - private FileDescriptor fd = null; - private CountDownLatch done; - FileInputStream[] fisArray = new FileInputStream[numFiles]; - FileOutputStream[] fosArray = new FileOutputStream[numFiles]; + private final FileDescriptor fd; + private final CountDownLatch done; OpenClose(FileDescriptor filedescriptor, CountDownLatch done) { this.fd = filedescriptor; @@ -358,29 +363,32 @@ public class Sharing { } public void run() { - try { - for(int i=0;i 0) { System.err.println("Testing the hyperbolic functions incurred " @@ -1390,4 +1393,1096 @@ public class HyperbolicTests { failures += Tests.testUlpDiffWithAbsBound("StrictMath.tanh", -input, StrictMath::tanh, -expected, ulps, 1.0); return failures; } + + /** + * Test accuracy of {Math, StrictMath}.asinh. The specified + * accuracy is 2.5 ulps. + * + * The defintion of asinh(x) is + * + * asinh(sinh(x)) = x + * + * Can be also written as + * + * asinh(x) = ln(x + sqrt(x*x + 1)) + * + * The series expansion of asinh(x) = + * + * x - x^3/6 + 3x^5/40 - 15x^7/336 + ... + * + * Therefore, + * + * 1. For small values of x, asinh(x) ~= x. + * + * Additionally, asinh is an odd function; asinh(-x) = -asinh(x). + * + */ + static int testAsinh() { + int failures = 0; + /* + * Array elements below generated using a quad asinh + * implementation. Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double [][] testCases = { + // x asinh(x) + {+8.08576586004706676646947016706690192e+00 , +2.78705446940175084037519072068240843e+00 }, + {+5.71198448718283557923314219806343317e+00 , +2.44328951112537869179362382769224610e+00 }, + {+5.13969133196956207143557548988610506e+00 , +2.33947242588811531576718987896918712e+00 }, + {+2.95996078504353032911922127823345363e+00 , +1.80570832446450945675615676944433187e+00 }, + {+4.16200980791957864113328469102270901e+00 , +2.13327472868053919998765640756092875e+00 }, + {+3.69545071772785460595400763850193471e+00 , +2.01807302682646291458685219028816252e+00 }, + {+1.37724078256330018099617973348358646e+00 , +1.12468193910119796648577714130477538e+00 }, + {+8.42544369040329677034151245607063174e+00 , +2.82790657643842246518401899587920414e+00 }, + {+3.91229039061375782893037467147223651e+00 , +2.07321736531667549827684130235156669e+00 }, + {+5.73782778462038400846267904853448272e+00 , +2.44773637486997939825874893068408245e+00 }, + {+4.99855755102017340618658636230975389e+00 , +2.31215541451092776291779112133540281e+00 }, + {+8.10100320171622989562365546589717269e+00 , +2.78892295229049846951081695322303143e+00 }, + {+6.40711498894297992734436775208450854e+00 , +2.55659134739804960225496541857063844e+00 }, + {+4.25639664782793492037171745323576033e+00 , +2.15509221067754853744881157535735520e+00 }, + {+2.65061122655180847473843641637358814e+00 , +1.70175906719364776650786532519668576e+00 }, + {+3.14233404262031967846269253641366959e+00 , +1.86252059324271515969573278167449533e+00 }, + {+9.13083295141416328988270834088325500e+00 , +2.90778930976529177537743330080053959e+00 }, + {+9.34996922888940673601609887555241585e+00 , +2.93136773795688457445658002134152253e+00 }, + {+9.35132773574746245515143527882173657e+00 , +2.93151219897178112284587212807769745e+00 }, + {+1.47453686867873412502660812606336549e+00 , +1.18055530917929730380021873702412893e+00 }, + {+2.93708318858647077220780374773312360e+00 , +1.79836038745797816082436481350298220e+00 }, + {+4.09105467685985679793247982161119580e+00 , +2.11656320434131763040467250984368994e+00 }, + {+4.65121160775030162426446622703224421e+00 , +2.24163561547669988062740649953739512e+00 }, + {+8.83128600332669755346159945474937558e+00 , +2.87463799399744068863572725409458990e+00 }, + {+1.66240543263013162977870251779677346e+00 , +1.28160121300334421559587040333022048e+00 }, + {+4.58372145493984728403802364482544363e+00 , +2.22735027800562207352532152241704895e+00 }, + {+8.50271775332108248335316602606326342e+00 , +2.83697322459569158510957272430255446e+00 }, + {+8.82962635800362249938189052045345306e+00 , +2.87445124207064977822740131999732509e+00 }, + {+8.84552264926561093716372852213680744e+00 , +2.87623855339831018046947582541398439e+00 }, + {+3.12516324361785047258877057174686342e+00 , +1.85730059825198435603813107760370448e+00 }, + {+8.26480987017928114823916985187679529e+00 , +2.80879391905067271939218423695889677e+00 }, + {+9.68117403887023186825899756513535976e+00 , +2.96598712423961990106836581021055404e+00 }, + {+3.05372997660021550103692788979969919e+00 , +1.83530180662998049991392377010746750e+00 }, + {+4.40157829954937795946534606628119946e+00 , +2.18777148553475610871290743261274356e+00 }, + {+6.88055177977352627749496605247259140e+00 , +2.62708540897893209827881652490154282e+00 }, + {+5.98475681846005524988640900119207799e+00 , +2.48927078678959642161006322827411013e+00 }, + {+8.92994029487849694248779996996745467e+00 , +2.88567728733406656162446662917506943e+00 }, + {+3.12419716639021327608816136489622295e+00 , +1.85700613402604977963039277274730202e+00 }, + {+7.51161063055123179310612613335251808e+00 , +2.71399864345854847918135863803957037e+00 }, + {+1.17944590788822001314883891609497368e+00 , +1.00274792631001937429660854217557106e+00 }, + {+1.36421200272156672994583459512796253e+00 , +1.11700316010328101318941761315262905e+00 }, + {+6.88888479910741580169997178018093109e+00 , +2.62828320452398770553274423944254222e+00 }, + {+3.64699814082431839068476620013825595e+00 , +2.00533888971591775569462526134655508e+00 }, + {+1.41057156993997545590957543026888743e+00 , +1.14411132290221221244416446367286189e+00 }, + {+6.14945472638136703125155690941028297e+00 , +2.51605697935151660544323868421618014e+00 }, + {+6.02996213994895136067952989833429456e+00 , +2.49669366977555745163814756818745494e+00 }, + {+9.65271660518461160904735152143985033e+00 , +2.96305895992701909105343212587439308e+00 }, + {+3.48339981002946785793028539046645164e+00 , +1.96115002199047863383320140967526859e+00 }, + {+6.07995920803143352628694628947414458e+00 , +2.50484056235894688250578712446408489e+00 }, + {+6.00204567486939666309808671940118074e+00 , +2.49211610375224051369293822349155577e+00 }, + {+1.38833519546032624347731143643613905e+00 , +1.13118326188543957732445742827584178e+00 }, + {+4.52480967383013776839106867555528879e+00 , +2.21471559269073802833304398595496088e+00 }, + {+6.11810275538071746126433936296962202e+00 , +2.51101220932060589427300910397289711e+00 }, + {+7.50648056792778461954185331705957651e+00 , +2.71332143777867740825109248925661428e+00 }, + {+4.89658239129396388733539424720220268e+00 , +2.29195213807282224382341089459270833e+00 }, + {+2.79265817118974496446881516931171063e-02 , +2.79229530231546570990366385479747555e-02 }, + {+9.69315108025863381158160336781293154e+00 , +2.96721697176250274577477693915618144e+00 }, + {+7.83910637998812109827895255875773728e+00 , +2.75631566551255789285879320458504177e+00 }, + {+2.76576984498692324265789466153364629e+00 , +1.74165321687466923031477628544545184e+00 }, + {+4.99754435738235347486124737770296633e+00 , +2.31195663638515281361584735869808938e+00 }, + {+4.88922334987356776991873630322515965e+00 , +2.29047857490944287858591282873426921e+00 }, + {+2.78689754339832429508305722265504301e+00 , +1.74881289991707628903792141369254180e+00 }, + {+7.20931795462930935514123120810836554e+00 , +2.67329726418547732793921189411944602e+00 }, + {+8.33063517511005890980868571205064654e+00 , +2.81666990685356361031034871477442414e+00 }, + {+3.61188437237348836106320959515869617e+00 , +1.99601167970722876532263572785839092e+00 }, + {+5.32263649620131218398455530405044556e+00 , +2.37382580077770566473979021057511520e+00 }, + {+8.00366962656528002639788610395044088e+00 , +2.77692733912554343763823757722995583e+00 }, + {+4.59751681469834139193153532687574625e+00 , +2.23028654083102682106197643909523811e+00 }, + {+8.20253764279967612083055428229272366e+00 , +2.80128593985583624900402694440723735e+00 }, + {+8.81590969774593169461240904638543725e+00 , +2.87290644386803298326256037256286587e+00 }, + {+9.00323408655057377814046049024909735e+00 , +2.89380106762776953348709842638973283e+00 }, + {+7.21533058010746941590696224011480808e+00 , +2.67412302459536699184126235350224069e+00 }, + {+8.23695914498319758934030687669292092e+00 , +2.80544295419888555964661400747277886e+00 }, + {+9.66912482942344198022510681767016649e+00 , +2.96474834621717039972248353595994898e+00 }, + {+3.17602315814959101913927952409721911e+00 , +1.87268737666193382172385150977422494e+00 }, + {+6.90930101488594594627556944033131003e+00 , +2.63121186253032074408677485367709385e+00 }, + {+6.52386312488162189993090578354895115e+00 , +2.57443674633460769002260368508028529e+00 }, + {+8.33701897902340283152966549096163362e-01 , +7.58769250678348128717944053061372995e-01 }, + {+1.84073794668312284983358040335588157e+00 , +1.37005541332928719568137972151743439e+00 }, + {+3.74278586498477183752697783347684890e+00 , +2.03036413719335448282150464654423886e+00 }, + {+1.24005876679504356552286026271758601e+00 , +1.04136768247874493368196676622778561e+00 }, + {+5.46039591734140294931876269401982427e+00 , +2.39894972726732001224686289699275119e+00 }, + {+2.05576175637293001585703677847050130e+00 , +1.46829835554351749799178251325101620e+00 }, + {+8.14075272140118322283797169802710414e+00 , +2.79378100004325258561034629239868920e+00 }, + {+1.83236824312878154863426516385516152e+00 , +1.36605297794115641494849841805273118e+00 }, + {+3.75374287549383511830569659650791436e+00 , +2.03318857169224539730556063537088565e+00 }, + {+6.43073501869452779367009043198777363e-01 , +6.05407648939611618428355730173212664e-01 }, + {+3.48621711345758855671306264412123710e+00 , +1.96192711264291527976588288592889484e+00 }, + {+3.91549582965699016767757711932063103e+00 , +2.07401086477835132988304884524188567e+00 }, + {+8.71307615958979297943187702912837267e+00 , +2.86124897639861530832907097356321837e+00 }, + {+9.25125528837059185605085076531395316e+00 , +2.92081476128803069384228991876733421e+00 }, + {+1.39894257949993688905365729624463711e-01 , +1.39441932379308919610017101598940231e-01 }, + {+2.13018467023163493578863381117116660e+00 , +1.50038473636497909802939352641033551e+00 }, + {+9.11338663647286573166184098226949573e+00 , +2.90588816775704749530976417485641794e+00 }, + {+2.13672753800762960096903952944558114e+00 , +1.50316162138023144213989303271149548e+00 }, + {+1.84662954052762628975870029535144567e+00 , +1.37286438673796624203424974151164008e+00 }, + {+2.27538767726088808629469895095098764e+00 , +1.56042056675324794384613128836997008e+00 }, + {+2.25459809157452584216230206948239356e+00 , +1.55202382694053013875493092338973536e+00 }, + {+6.43951067826539436111943359719589353e+00 , +2.56157478187883218395455558699771338e+00 }, + {+2.38928979360439708301555583602748811e+00 , +1.60531075239512338397498990117642106e+00 } + }; + + + for (double [] testCase : testCases) { + failures += testAsinhCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + + + + for (double nan : Tests.NaNs) { + failures += testAsinhCaseWithUlpDiff(nan, NaNd, 0); + } + + + + double [][] specialTestCases = { + {0.0, 0.0}, + {-0.0, -0.0}, + {Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY}, + {Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY} + }; + + + + for (double [] specialTestCase : specialTestCases) { + failures += testAsinhCaseWithUlpDiff(specialTestCase[0], + specialTestCase[1], + 0.0); + } + + + + // For powers of 2 less than 2^(-27), the second and + // subsequent terms of the Taylor series expansion will get + // rounded away since |n-n^3| > 53, the binary precision of a + // double significand. + + for (int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) { + double d = Math.scalb(2.0, i); + + // Result and expected are the same. + failures += testAsinhCaseWithUlpDiff(d, d, 3.0); + } + + failures += testAsinhAdditionalTests(); + + return failures; + } + + /** + * Test accuracy of {Math, StrictMath}.asinh using quad precision + * asinh implementation as the reference. There are additional tests. + * The specified accuracy is 2.5 ulps. + * + */ + static int testAsinhAdditionalTests() { + int failures = 0; + /* + * Array elements below are generated using a quad precision asinh + * implementation (libquadmath). Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double[][] testCases = { + // x asinh(x) + {+9.29888520047217510822168407003118773e-03 , +9.29875119439016991620829879950089510e-03 }, + {+8.99606577522583765460506555200481671e-03 , +8.99594443891109052619951669093253709e-03 }, + {+1.14699795207729403345719987328266143e-03 , +1.14699770057820289010729363443748979e-03 }, + {-7.40424146583510897623447988280531717e-03 , -7.40417381397284073003520743847398090e-03 }, + {+5.49488608694304568602628791040842771e-03 , +5.49485843542812296005405619611903743e-03 }, + {-2.52116366329231764847884633695684897e-03 , -2.52116099243538701654807174519941378e-03 }, + {+8.06768422999586641564118139058336965e-03 , +8.06759671495411237747532966838824601e-03 }, + {+9.88178277836134454081840061689945287e-03 , +9.88162196002118907735979091611455166e-03 }, + {-9.74812907680771244256501262270830921e-03 , -9.74797469575697378811862965186905034e-03 }, + {+1.28957646989550853144912423431378556e-03 , +1.28957611246655855199674391222106077e-03 }, + {-3.58837408582282288427300898092653370e-03 , -3.58836638496033900344918006245058062e-03 }, + {+4.13062959563161372078532451723731356e-03 , +4.13061784951867272487598247250853139e-03 }, + {-2.51244549635140212301420703511212196e-03 , -2.51244285310613342444371438470610248e-03 }, + {+9.68636675928437156091188597883956390e-03 , +9.68621529398750501339156647788267837e-03 }, + {-5.46432162869262862125996349504930549e-03 , -5.46429443603366704988023092426655825e-03 }, + {-1.83386276898741575058782160567716346e-03 , -1.83386174109279550088776833959567103e-03 }, + {+4.29194713096967862819841599275605404e-03 , +4.29193395422167505495925421977757693e-03 }, + {-9.98345193989031744197237827620483586e-03 , -9.98328610669592860197569944928865818e-03 }, + {-2.77682511858849418590056146172173612e-03 , -2.77682155002991423153566829770018797e-03 }, + {-9.27080565792574341765774903478813940e-03 , -9.27067286211199059124030266083673465e-03 }, + {+2.13343832085455265001883162767626345e-03 , +2.13343670244611127381061946915639278e-03 }, + {+1.86531796573603282640707590189776965e-03 , +1.86531688403638317794548160776476123e-03 }, + {+7.59089952706850680519412577496041195e-03 , +7.59082662879913430594165031269929038e-03 }, + {-7.23221864571126256404642873576449347e-03 , -7.23215560034534649276205014022842148e-03 }, + {-4.85379569260787659124023463164121495e-03 , -4.85377663411205855718020189862812411e-03 }, + {+2.06427745583616026325834980070794700e-03 , +2.06427598977487382238201754110142048e-03 }, + {-9.05864273164906988466960058303811820e-03 , -9.05851884568408865775918913306811448e-03 }, + {+8.14126659074132334736884075709895114e-03 , +8.14117665926450847350600785486541236e-03 }, + {-1.18703607276676031956341716977476608e-03 , -1.18703579400048976745061906381442506e-03 }, + {-3.72556727069004237073990282169688726e-03 , -3.72555865235713390047416035972567655e-03 }, + {+3.20078632768614965153908258344017668e-03 , +3.20078086235102579132641956617880741e-03 }, + {-3.64652695868728470018904630478573381e-03 , -3.64651887732759812624780495337361570e-03 }, + {-4.37271109890237635181575726051050879e-03 , -4.37269716421058504020032749615645348e-03 }, + {-4.53954699201700607319454050525564526e-03 , -4.53953140071906668014572342681250395e-03 }, + {-7.71410922638161335174178390161614516e-03 , -7.71403272056205844933819193169521112e-03 }, + {-4.14748385016995048391041933655287721e-03 , -4.14747195968688563991362285984749351e-03 }, + {+2.16239643776180469336711809091866598e-03 , +2.16239475255273602474341490749538226e-03 }, + {+1.70867505939914857138184345330955693e-04 , +1.70867505108481996929933792720554316e-04 }, + {+4.45468038573873341412490134416657384e-03 , +4.45466565262570403928813346774794963e-03 }, + {+5.02848450175214997659445259614585666e-04 , +5.02848428983795534702560585886961806e-04 }, + {+3.27121347478520618778929929248988628e-03 , +3.27120764069260936386068328808026876e-03 }, + {-3.02035237923277844612757192521712568e-03 , -3.02034778704318937598236175985252813e-03 }, + {+1.83493544153568409471599665039320826e-03 , +1.83493441183628601773262459027151432e-03 }, + {-3.57742891707456961425393160425301176e-03 , -3.57742128646403200576149317708586166e-03 }, + {+4.07461518018882584701856330866576172e-04 , +4.07461506744091232910512108590665082e-04 }, + {+8.93213245095503781401102827430804609e-03 , +8.93201368317984717551252673740071605e-03 }, + {+4.83633433470810093768310622408534982e-03 , +4.83631548115857258701091393657125083e-03 }, + {+4.41941080408745669283465673515820527e-03 , +4.41939641815384450220145838057678415e-03 }, + {-7.40905574125878471636319488879962591e-03 , -7.40898795735011644277922058251845971e-03 }, + {+5.86417821400006013254913028731607483e-03 , +5.86414460438723375893640532030031887e-03 }, + {+6.40143962390532852979596611930901418e-04 , +6.40143918670384118303282950462728667e-04 }, + {-6.62414482978957927516994175221043406e-03 , -6.62409638694556116425732364897473820e-03 }, + {+2.32034013904017406837443360245742952e-03 , +2.32033805693503550464566970496041304e-03 }, + {-1.70037238711657177903102677873903303e-03 , -1.70037156774608724006177273975196346e-03 }, + {-2.41007559448008345376335270771051000e-03 , -2.41007326134647811152942503146226815e-03 }, + {-4.88371906557288470301925187300184916e-03 , -4.88369965241849364892773140816442366e-03 }, + {+5.45353417327115556900718473798406194e-03 , +5.45350714134116714399404074418610335e-03 }, + {+1.82127472834406854695910027430727496e-03 , +1.82127372147155402291508536733347481e-03 }, + {+3.08464771244317328968698177504847990e-03 , +3.08464282070047297125571891308421168e-03 }, + {+8.64099586698139320029010690404902562e-03 , +8.64088833799551442516038310825829002e-03 }, + {+5.55586600363066999974659410099775414e-03 , +5.55583742127587993316327594170344732e-03 }, + {+8.72688321697448303460031837630594964e-03 , +8.72677244972821936872995155020997092e-03 }, + {+8.67310115846320860144569309113649069e-03 , +8.67299242648623772707657889109267822e-03 }, + {-6.14210531791088872044515056813906995e-03 , -6.14206669961072319996743834488437463e-03 }, + {+8.88625749891074935560286718327915878e-03 , +8.88614055166480866111859091126682642e-03 }, + {-1.43504119833010382323301712403917918e-03 , -1.43504070579016156191011766070535043e-03 }, + {+8.88630021979499445938799340183322784e-04 , +8.88629905026452701546356648558325925e-04 }, + {+3.93780142608554303840229238176107174e-03 , +3.93779124938125782164719425287579139e-03 }, + {+5.97434710953371854447180311353804427e-03 , +5.97431156988517485964304752157241804e-03 }, + {-7.98875566707221360096546902695990866e-03 , -7.98867069549231529699110336543851522e-03 }, + {-7.35260998042218307663153709086145682e-03 , -7.35254373394740372183361138755444401e-03 }, + {-1.21452151194481779150624589647122775e-03 , -1.21452121336249242914680975845323467e-03 }, + {+4.98481949753720385287714123023761204e-04 , +4.98481929109570105039386663388380124e-04 }, + {+4.91985816350236880578616904813316069e-03 , +4.91983831618717601288972307767102048e-03 }, + {+7.68796449908712258014542584305672790e-03 , +7.68788876850302034489862036714171394e-03 }, + {-1.49188964399755812084702455422302592e-03 , -1.49188909057301843050666760106824645e-03 }, + {-6.73163270527497858974896871586679481e-03 , -6.73158186579155909561057079482268382e-03 }, + {+8.73326787816911150053034162965559517e-03 , +8.73315686763575988088834491175495305e-03 }, + {+7.81885100909627574206073319373899722e-03 , +7.81877134445315065535398733750043537e-03 }, + {+5.17883696377165365920536288513176260e-03 , +5.17881381434573686588090532152532759e-03 }, + {+5.94443020139156542980263253639350296e-03 , +5.94439519296920978949883610708856872e-03 }, + {+6.20408692607689153664107806207539397e-03 , +6.20404712683039987243003869674263039e-03 }, + {-4.13924636982772493898341537033047643e-03 , -4.13923455005213957426577773895357676e-03 }, + {-3.71140287747976152510354097557865316e-03 , -3.71139435707241790669973810798603847e-03 }, + {-8.37941685260259506995428324671593145e-03 , -8.37931879609631048090526043629803007e-03 }, + {+8.48517293301665094518160259440264781e-03 , +8.48507111684271940482025173385456325e-03 }, + {+8.52827781082153742187035305732933921e-03 , +8.52817443510010657036791986083451790e-03 }, + {-4.07416024108964158756407414330169559e-03 , -4.07414897015777394146227881635448891e-03 }, + {+4.33240979016216026797891913702187594e-03 , +4.33239623721743479728849041379241354e-03 }, + {-4.89052581083683143847729013486969052e-04 , -4.89052561589036445343259711601066150e-04 }, + {-9.62974650385375885441874288517283276e-05 , -9.62974648897066185792218187524452666e-05 }, + {-9.26529020589744040092838872624270152e-04 , -9.26528888025725086174151901318195528e-04 }, + {+1.39965317129459553002757132844635635e-03 , +1.39965271430147299997462291249440004e-03 }, + {-7.12079193844885119379917171045235591e-03 , -7.12073176239158986696262840488189056e-03 }, + {-3.62621830991397085114380516301935131e-03 , -3.62621036282602413990843595245483708e-03 }, + {-7.11170226471406416446363607519742800e-03 , -7.11164231880305326913177834599584014e-03 }, + {-1.07788116725225993630665755063091638e-04 , -1.07788116516507275261580974984359313e-04 }, + {-2.51343271020868386927960003163207148e-03 , -2.51343006384636979438035563375611134e-03 }, + {-9.70989675056706420808172453007500735e-03 , -9.70974417880563379443605277365308469e-03 }, + {+7.17488567146307328059595675995296915e-03 , +7.17482411358449384368065167506580475e-03 } + }; + + for (int i = 0; i < testCases.length; i++) { + double[] testCase = testCases[i]; + failures += testAsinhCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + + return failures; + } + + public static int testAsinhCaseWithTolerance(double input, + double expected, + double tolerance) { + int failures = 0; + failures += Tests.testTolerance("Math.asinh", input, Math::asinh, expected, tolerance); + failures += Tests.testTolerance("Math.asinh", -input, Math::asinh, -expected, tolerance); + + failures += Tests.testTolerance("StrictMath.asinh", input, StrictMath::asinh, expected, tolerance); + failures += Tests.testTolerance("StrictMath.asinh", -input, StrictMath::asinh, -expected, tolerance); + return failures; + } + + public static int testAsinhCaseWithUlpDiff(double input, + double expected, + double ulps) { + int failures = 0; + + failures += Tests.testUlpDiffWithAbsBound("Math.asinh", input, Math::asinh, expected, ulps, Double.POSITIVE_INFINITY); + failures += Tests.testUlpDiffWithAbsBound("Math.asinh", -input, Math::asinh, -expected, ulps, Double.NEGATIVE_INFINITY); + + failures += Tests.testUlpDiffWithAbsBound("StrictMath.asinh", input, StrictMath::asinh, expected, ulps, Double.POSITIVE_INFINITY); + failures += Tests.testUlpDiffWithAbsBound("StrictMath.asinh", -input, StrictMath::asinh, -expected, ulps, Double.NEGATIVE_INFINITY); + return failures; + } + + /** + * Test accuracy of {Math, StrictMath}.acosh. The specified + * accuracy is 2.5 ulps. + * + * The defintion of acosh(x) is + * + * acosh(cosh(x)) = x + * + * Can be also written as + * + * acosh(x) = ln(x + sqrt(x * x - 1)) + * + * The series expansion of acosh(x) = + * + * ln(2 * x) - (x^-2 / 4 + 3 * x^-4 / 32 + 15 * x^-6 / 288 ...) + * + * Therefore, + * + * 1. acosh(1) = 0. + * + * 2. The domain is x >= 1. + * + * 3. The function is neither odd nor even. + * + */ + static int testAcosh() { + int failures = 0; + /* + * Array elements below generated using a quad acosh + * implementation. Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double [][] testCases = { + // x acosh(x) + {1.0000, +0.00000000000000000000000000000000000e+00 }, + {1.0625, +3.51737390043260579770744786121122844e-01 }, + {1.1250, +4.94932923094526905889563099576718556e-01 }, + {1.1875, +6.03186598686334413155297365190676416e-01 }, + {1.2500, +6.93147180559945309417232121458176575e-01 }, + {1.3125, +7.71307459173256653700937951825817144e-01 }, + {1.3750, +8.41019322011445738489485196126304665e-01 }, + {1.4375, +9.04286762705515769042139988689583282e-01 }, + {1.5000, +9.62423650119206894995517826848736845e-01 }, + {1.5625, +1.01634809667840380541358127166594224e+00 }, + {1.6250, +1.06673243190143557362309154628644597e+00 }, + {1.6875, +1.11408700135293645158376433073169476e+00 }, + {1.7500, +1.15881036042994681173087299087873020e+00 }, + {1.8125, +1.20122101997969472087682270695675759e+00 }, + {1.8750, +1.24157842330772117651284669611837885e+00 }, + {1.9375, +1.28009731675807455651225000558265526e+00 }, + {2.0000, +1.31695789692481670862504634730796848e+00 }, + {2.0625, +1.35231316261931093541047819670045078e+00 }, + {2.1250, +1.38629436111989061883446424291635315e+00 }, + {2.1875, +1.41901510140371506613255066437684651e+00 }, + {2.2500, +1.45057451382258020872826178236677635e+00 }, + {2.3125, +1.48105971405608381331792780208719133e+00 }, + {2.3750, +1.51054775047320739150161777699985299e+00 }, + {2.4375, +1.53910716184424377297903295285722198e+00 }, + {2.5000, +1.56679923697241107866405686258048358e+00 }, + {2.5625, +1.59367904336440765353731339657532894e+00 }, + {2.6250, +1.61979627485649999465013597110633349e+00 }, + {2.6875, +1.64519595581279452177517379518794699e+00 }, + {2.7500, +1.66991903058776998677838891147712239e+00 }, + {2.8125, +1.69400286038199600062127876942753998e+00 }, + {2.8750, +1.71748164473336519458386901818676709e+00 }, + {2.9375, +1.74038678120611400701568860843885133e+00 }, + {3.0000, +1.76274717403908605046521864995958460e+00 }, + {3.0625, +1.78458950036205246630242932084698860e+00 }, + {3.1250, +1.80593844091928647006641838950547765e+00 }, + {3.1875, +1.82681688093354809536648865402886324e+00 }, + {3.2500, +1.84724608571383784130004129627716938e+00 }, + {3.3125, +1.86724585479221893347421970944127165e+00 }, + {3.3750, +1.88683465772058517690549455261749833e+00 }, + {3.4375, +1.90602975413127236084850555002346490e+00 }, + {3.5000, +1.92484730023841378999103565369747369e+00 }, + {3.5625, +1.94330244360892107348697778473632964e+00 }, + {3.6250, +1.96140940774674480423275041043129955e+00 }, + {3.6875, +1.97918156779907568924375778194574535e+00 }, + {3.7500, +1.99663151849857170393899871209510294e+00 }, + {3.8125, +2.01377113529382496280930762219993708e+00 }, + {3.8750, +2.03061162948500957172739654092925159e+00 }, + {3.9375, +2.04716359806812267677620352283230977e+00 }, + {4.0000, +2.06343706889556054672728117262013178e+00 }, + {4.0625, +2.07944154167983592825169636437452953e+00 }, + {4.1250, +2.09518602529851747179664246793750599e+00 }, + {4.1875, +2.11067907179990670152964344211957784e+00 }, + {4.2500, +2.12592880745889053593506179143141713e+00 }, + {4.3125, +2.14094296118944770996055814756135545e+00 }, + {4.3750, +2.15572889058331846311473049052403906e+00 }, + {4.4375, +2.17029360581243752070499251797833202e+00 }, + {4.5000, +2.18464379160510872667627813307212784e+00 }, + {4.5625, +2.19878582748192321247116242073983256e+00 }, + {4.6250, +2.21272580641655511554559532685274022e+00 }, + {4.6875, +2.22646955206835990390469193746457694e+00 }, + {4.7500, +2.24002263471777221819301091423172581e+00 }, + {4.8125, +2.25339038602153389445857144762743321e+00 }, + {4.8750, +2.26657791269250866199452039018610592e+00 }, + {4.9375, +2.27959010919802897270925407255393153e+00 }, + {5.0000, +2.29243166956117768780078731134801529e+00 }, + {5.0625, +2.30510709834096668441430402487399027e+00 }, + {5.1250, +2.31762072085989362346174598175746039e+00 }, + {5.1875, +2.32997669274071514661824152082627607e+00 }, + {5.2500, +2.34217900880836474718960439585388779e+00 }, + {5.3125, +2.35423151140767607019354831300009086e+00 }, + {5.3750, +2.36613789818286932753788120137389157e+00 }, + {5.4375, +2.37790172936055222645518871553565388e+00 }, + {5.5000, +2.38952643457421860822386165703818122e+00 }, + {5.5625, +2.40101531926484683717268315699636478e+00 }, + {5.6250, +2.41237157068916138816151585667001780e+00 }, + {5.6875, +2.42359826356438621752612199535640197e+00 }, + {5.7500, +2.43469836537585339202679859270163341e+00 }, + {5.8125, +2.44567474137160531324234100032920604e+00 }, + {5.8750, +2.45653015926611756205299063862500772e+00 }, + {5.9375, +2.46726729367344889723552955806057589e+00 }, + {6.0000, +2.47788873028847500481395074507450545e+00 }, + {6.0625, +2.48839696983336532007430913631752335e+00 }, + {6.1250, +2.49879443178510181484789673802222733e+00 }, + {6.1875, +2.50908345789860105234876846349648239e+00 }, + {6.2500, +2.51926631553887363826303725428234388e+00 }, + {6.3125, +2.52934520083462740598919885177286592e+00 }, + {6.3750, +2.53932224166478245066792464622248188e+00 }, + {6.4375, +2.54919950048850872717547586051387259e+00 }, + {6.5000, +2.55897897702861255144554182625683448e+00 }, + {6.5625, +2.56866261081738002442374329274624674e+00 }, + {6.6250, +2.57825228361332690085894009323471199e+00 }, + {6.6875, +2.58774982169670016849316580209717247e+00 }, + {6.7500, +2.59715699805102158059159611581476354e+00 }, + {6.8125, +2.60647553443745310075195298905494613e+00 }, + {6.8750, +2.61570710336829463210497297146055746e+00 }, + {6.9375, +2.62485332998549187571842397668306463e+00 }, + {7.0000, +2.63391579384963341725009269461593696e+00 }, + {7.0625, +2.64289603064454821939888620389440586e+00 }, + {7.1250, +2.65179553380227492960508448932353394e+00 }, + {7.1875, +2.66061575605286038291043830648413625e+00 }, + {7.2500, +2.66935811090315420323249076787858338e+00 }, + {7.3125, +2.67802397404849750222123152071366765e+00 }, + {7.3750, +2.68661468472095454727243455865687717e+00 }, + {7.4375, +2.69513154697750528856415868272675449e+00 }, + {7.5000, +2.70357583093140231733394963705451385e+00 }, + {7.5625, +2.71194877392969682611305770501597479e+00 }, + {7.6250, +2.72025158167975322903284501674667068e+00 }, + {7.6875, +2.72848542932740015820479864569947040e+00 }, + {7.7500, +2.73665146248920556040148045776356816e+00 }, + {7.8125, +2.74475079824121464549309272530654441e+00 }, + {7.8750, +2.75278452606635063332660947345292156e+00 }, + {7.9375, +2.76075370876254883072567909046267813e+00 }, + {8.0000, +2.76865938331357383273200140938374547e+00 }, + {8.0625, +2.77650256172435692961336760207948251e+00 }, + {8.1250, +2.78428423182258551535630273235901386e+00 }, + {8.1875, +2.79200535802817788553087801705861609e+00 }, + {8.2500, +2.79966688209218477865004528925200022e+00 }, + {8.3125, +2.80726972380657289240925980113428074e+00 }, + {8.3750, +2.81481478168626496869015857854363587e+00 }, + {8.4375, +2.82230293362473549711106510083524230e+00 }, + {8.5000, +2.82973503752439027536610108611637391e+00 }, + {8.5625, +2.83711193190289165307916749543060640e+00 }, + {8.6250, +2.84443443647652896774770544175385075e+00 }, + {8.6875, +2.85170335272167517356988163822694873e+00 }, + {8.7500, +2.85891946441531570520913194770155741e+00 }, + {8.8125, +2.86608353815558396737111566993889866e+00 }, + {8.8750, +2.87319632386318927416511462539646535e+00 }, + {8.9375, +2.88025855526457737300290165271813925e+00 }, + {9.0000, +2.88727095035762068498655348054621044e+00 }, + {9.0625, +2.89423421186059490016531823326821096e+00 }, + {9.1250, +2.90114902764516041745652356473355270e+00 }, + {9.1875, +2.90801607115403116308966232802812480e+00 }, + {9.2500, +2.91483600180397941677005500735563642e+00 }, + {9.3125, +2.92160946537479329008903038647778851e+00 }, + {9.3750, +2.92833709438477331505751565470704144e+00 }, + {9.4375, +2.93501950845332609861824133070706912e+00 }, + {9.5000, +2.94165731465118607612817277397561825e+00 }, + {9.5625, +2.94825110783877095494122437627939968e+00 }, + {9.6250, +2.95480147099315238696389016790268450e+00 }, + {9.6875, +2.96130897552410066125326263536732120e+00 }, + {9.7500, +2.96777418157964068500790378422486329e+00 }, + {9.8125, +2.97419763834153614964672155497739057e+00 }, + {9.8750, +2.98057988431109948901325801645778406e+00 }, + {9.9375, +2.98692144758570696460723739938555692e+00 }, + {10.0000, +2.99322284612638089791266771377418276e+00 }, + }; + + + for (double [] testCase : testCases) { + failures += testAcoshCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + + + + for (double nan : Tests.NaNs) { + failures += testAcoshCaseWithUlpDiff(nan, NaNd, 0); + } + + + + double [][] specialTestCases = { + {0.0, NaNd}, + {-0.0, NaNd}, + {1.0, 0.0}, + {Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY}, + {Double.NEGATIVE_INFINITY, NaNd} + }; + + + + for (double [] specialTestCase : specialTestCases) { + failures += testAcoshCaseWithUlpDiff(specialTestCase[0], + specialTestCase[1], + 0.0); + } + + + failures += testAcoshAdditionalTests(); + + return failures; + } + + /** + * Test accuracy of {Math, StrictMath}.acosh using quad precision + * acosh implementation as the reference. There are additional tests. + * The specified accuracy is 2.5 ulps. + * + */ + static int testAcoshAdditionalTests() { + int failures = 0; + /* + * Array elements below are generated using a quad precision acosh + * implementation (libquadmath). Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double[][] testCases = { + // x acosh(x) + {+1.40222409861373051853661308996379375e+01 , +3.33251799248457675610296187717275023e+00 }, + {+4.64063630702987595100239559542387724e+01 , +4.53046765794427717250009108708063951e+00 }, + {+2.26769594350354175560369185404852033e+01 , +3.81401008174403012773998497198756862e+00 }, + {+6.82076069573278687130368780344724655e+01 , +4.91564953670154039555101045371992145e+00 }, + {+9.35345967264471340740783489309251308e+01 , +5.23144999004817476451595194893686997e+00 }, + {+5.24222208302520016331982333213090897e+01 , +4.65238675892723943927493345614044802e+00 }, + {+4.42263893601989721560130419675260782e+00 , +2.16685013650055071552269762531726701e+00 }, + {+5.34403191209646664106003299821168184e+01 , +4.67162513077968730816736013866320559e+00 }, + {+1.76212042009831870714720025716815144e+00 , +1.16720688415256589829633745537084420e+00 }, + {+7.61738148899418732185040425974875689e+00 , +2.71924321506064362327407359954437453e+00 }, + {+6.89904985284954790358824538998305798e+01 , +4.92706344460967378866907640972706781e+00 }, + {+9.31132130019995969405499636195600033e+01 , +5.22693444138174309022758439394131022e+00 }, + {+5.31659489982307036370912101119756699e+01 , +4.66647685890886539018247877652269347e+00 }, + {+6.57379772558717405672723543830215931e+01 , +4.87876612392399046931262815776348806e+00 }, + {+7.04178688554184901704502408392727375e+01 , +4.94754380999195554008986754487841587e+00 }, + {+7.64576059598647788106973166577517986e+01 , +5.02984082858162069509313975886000718e+00 }, + {+5.69898682524488275902285749907605350e+00 , +2.42564775130097776080234839595030019e+00 }, + {+3.34951883898407629658322548493742943e+01 , +4.20432607363489310218001177932001376e+00 }, + {+7.58846381271260241874188068322837353e+01 , +5.02231803118503396528914607189891829e+00 }, + {+3.71685284182660993224089907016605139e+01 , +4.30842856158112686719805147741579474e+00 }, + {+9.82724783457824031529526109807193279e+01 , +5.28086530470046881951663865035216936e+00 }, + {+7.55822276853527057483006501570343971e+01 , +5.01832458735915146090685859231899627e+00 }, + {+8.19590239920287544350685493554919958e+00 , +2.79303880830104526461764198808709567e+00 }, + {+8.85860057527683011358021758496761322e+01 , +5.17708921820009272972577332594088089e+00 }, + {+4.42047291460483080527410493232309818e+01 , +4.48185099473614683233384262644114551e+00 }, + {+4.82954447467224099455052055418491364e+01 , +4.57037722443775069839008053496876858e+00 }, + {+2.82157771675713533454654680099338293e+01 , +4.03271430903366741210592839999395032e+00 }, + {+1.74842128192706276479384541744366288e+01 , +3.55362672330870909254873232512209322e+00 }, + {+8.98679723864892281426364206708967686e+01 , +5.19145784395917044408731940940225234e+00 }, + {+6.99586842581785273154082460678182542e+00 , +2.63331927275597158625520354348567456e+00 }, + {+5.09477665985264778214514080900698900e+01 , +4.62385177612510228171242777653641979e+00 }, + {+3.25842611674598501281252538319677114e+01 , +4.17674101901473628570827854743466486e+00 }, + {+4.99036918354616290116609889082610607e+01 , +4.60314176379122016396592518510391469e+00 }, + {+9.98255656348235120844947232399135828e+00 , +2.99146816849131388203109739268493125e+00 }, + {+8.30115844701927940718633180949836969e+00 , +2.80589439276611715849813780991570715e+00 }, + {+3.90300726488373044276158907450735569e+01 , +4.35731547033614744103231173076054669e+00 }, + {+9.14679267650316347726402455009520054e+01 , +5.20910568139874158502888666687786843e+00 }, + {+4.69801366698952662659394263755530119e+01 , +4.54275878054294975578025810303600533e+00 }, + {+5.95831438716205052941177200409583747e+00 , +2.47081727711668636777886134527797777e+00 }, + {+7.72502501531925105382470064796507359e+01 , +5.04015543904862200893429166398240913e+00 }, + {+1.34111721821950098387787875253707170e+01 , +3.28784240452352224920507313116967307e+00 }, + {+6.91570748043642566926791914738714695e+01 , +4.92947526860125472538045310739830979e+00 }, + {+6.33247983942767831422315794043242931e+01 , +4.84136184327272941501425426966065239e+00 }, + {+7.28157878674183933753738529048860073e+01 , +4.98103282444372675567185179132668151e+00 }, + {+8.89686491926590150569609249942004681e+01 , +5.18139964655774166552638928730792362e+00 }, + {+3.13258612573789463340290240012109280e+01 , +4.13733631620326521460511053592093813e+00 }, + {+5.18140965157089325998640561010688543e+01 , +4.64071629304849263117175976059711265e+00 }, + {+8.47521744710507647369013284333050251e+01 , +5.13284377741645310577993893073249440e+00 }, + {+8.43095533174532931752764852717518806e+01 , +5.12760719138905245783659501854598879e+00 }, + {+4.21240669274286076984026294667273760e+01 , +4.43362549935510675489581351410263443e+00 }, + {+4.73238194816935475728314486332237720e+01 , +4.55004928385543400029944037596031391e+00 }, + {+1.86544426645817758014800347154960036e+01 , +3.61851232034069491499592508470176552e+00 }, + {+5.75938262601410571051019360311329365e+01 , +4.74648718281138202967444216845950983e+00 }, + {+4.27232167589609090896374254953116179e+00 , +2.13131771884641485793724599940809626e+00 }, + {+5.03495317868001706074210233055055141e+01 , +4.61203786952239923442865869830624998e+00 }, + {+7.50809724725515792442820384167134762e+01 , +5.01166999309632169153897035236491293e+00 }, + {+8.91830106756043647919796057976782322e+01 , +5.18380630497515107426424373476548239e+00 }, + {+8.43619216604083419497328577563166618e+01 , +5.12822818585720472109565051928260461e+00 }, + {+2.20623999405381177041363116586580873e+01 , +3.78650797260310183157107999251647380e+00 }, + {+1.39122989185065399908580729970708489e+01 , +3.32462629189603078991830801184905350e+00 }, + {+2.81842266001629120353300095302984118e+01 , +4.03159479043564760795745665884328416e+00 }, + {+4.20150330398823186328627343755215406e+01 , +4.43103301227168439924256715079001048e+00 }, + {+7.12721396815986594219793914817273617e+01 , +4.95960346484961706088932387548050013e+00 }, + {+2.47511696812483386054282163968309760e+01 , +3.90161159523447275422094662483857801e+00 }, + {+3.24364140945400691862232633866369724e+01 , +4.17219116407069688318499622366971673e+00 }, + {+6.55538099356552947938325814902782440e+01 , +4.87596033055444598453664902130389245e+00 }, + {+6.84532751547124860280746361240744591e+01 , +4.91924522217897758728929410442650248e+00 }, + {+3.93848083647737539081390423234552145e+01 , +4.36636613965538581613443666385597861e+00 }, + {+1.56057673113820580823585260077379644e+01 , +3.43975961616459237301460093608428409e+00 }, + {+8.47119903068781923138885758817195892e+01 , +5.13236949468185791854133268753960238e+00 }, + {+9.55854738436600683826327440328896046e+01 , +5.25314067817929358802774910100252994e+00 }, + {+1.56670046394655830823694486753083766e+01 , +3.44368399001615451248068997740627574e+00 }, + {+4.14679026870443507846175634767860174e+01 , +4.41792146385299219920359657474436019e+00 }, + {+5.69249693750823269056127173826098442e+01 , +4.73480409586514749627990327668077645e+00 }, + {+4.93629403713561600852699484676122665e+01 , +4.59224451473128480136302652897840027e+00 }, + {+9.61484189551490686653778539039194584e+01 , +5.25901316478560252169572160735164898e+00 }, + {+2.07759627057374345326934417244046926e+01 , +3.72636417050318935004571518016144611e+00 }, + {+6.32976464844313539970244164578616619e+01 , +4.84093292566853424246928339764776273e+00 }, + {+6.54741204020067897317858296446502209e+01 , +4.87474381391982909784974793043917201e+00 }, + {+8.05042266117176978923453134484589100e+01 , +5.08141829115959617683933639313475601e+00 }, + {+4.81667484910552587962229154072701931e+01 , +4.56770832383321482034955903243661906e+00 }, + {+2.11217831158012465664342016680166125e+01 , +3.74289121691996804899454065396184575e+00 }, + {+9.02656763961261532358548720367252827e+01 , +5.19587377817524068279272963615894387e+00 }, + {+1.50600821596306779781571094645187259e+01 , +3.40409076820438745807924396441229869e+00 }, + {+4.16209905361957765990155166946351528e+01 , +4.42160745328229554045710868854157175e+00 }, + {+8.86791887429291563194055925123393536e+01 , +5.17814062516654447520446624771754712e+00 }, + {+1.70576566142218695176779874600470066e+01 , +3.52888602841986989717710320391598297e+00 }, + {+3.71685638271143758970538328867405653e+01 , +4.30842951458236820308439636796433560e+00 }, + {+1.43758274343816250251393284997902811e+01 , +3.35748343469042965382754422758946510e+00 }, + {+4.60754211385189549332608294207602739e+01 , +4.52330904257767828148397295029679237e+00 }, + {+4.57777167466274974572115752380341291e+01 , +4.51682530040123678433942314310447564e+00 }, + {+9.32357656650976593937230063602328300e+01 , +5.22824982009254837221678766114741857e+00 }, + {+2.23095900244694895775410259375348687e+01 , +3.79766114099573434402313460678612040e+00 }, + {+9.09832666680431856320865335874259472e+01 , +5.20379258533493176911574496349341434e+00 }, + {+8.62251237613208019183730357326567173e+01 , +5.15007514723643448859452771190406728e+00 }, + {+5.10896316393437928127241320908069611e+01 , +4.62663296015956482467254446322296917e+00 }, + {+8.19385868289117524909670464694499969e+01 , +5.09907996803279765921917143342322948e+00 }, + {+4.67622529628467802353952720295637846e+01 , +4.53810915071314717336273606975590283e+00 }, + {+6.36411313235143367705859418492764235e+01 , +4.84634542963631730817381276671897779e+00 }, + {+8.26450413110590460519233602099120617e+01 , +5.10766540264697663339669119714720544e+00 }, + }; + + for (double[] testCase : testCases) { + failures += testAcoshCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + + return failures; + } + + public static int testAcoshCaseWithTolerance(double input, + double expected, + double tolerance) { + int failures = 0; + failures += Tests.testTolerance("Math.acosh", input, Math::acosh, expected, tolerance); + failures += Tests.testTolerance("StrictMath.acosh", input, StrictMath::acosh, expected, tolerance); + return failures; + } + + public static int testAcoshCaseWithUlpDiff(double input, + double expected, + double ulps) { + int failures = 0; + failures += Tests.testUlpDiffWithAbsBound("Math.acosh", input, Math::acosh, expected, ulps, Double.POSITIVE_INFINITY); + failures += Tests.testUlpDiffWithAbsBound("StrictMath.acosh", input, StrictMath::acosh, expected, ulps, Double.POSITIVE_INFINITY); + return failures; + } + + /** + * Test accuracy of {Math, StrictMath}.atanh. The specified + * accuracy is 2.5 ulps. + * + * The defintion of atanh(x) is + * + * atanh(tanh(x)) = x + * + * Can be also written as + * + * 0.5 * log1p(2 * x / (1-x0)) + * + * Taylor expansion: + * + * x + x^3 / 3 + x^5 / 5 + ... + * + * Therefore, + * + * 1. For small values of x, tanh(x) ~= x. + * + * Additionally, atanh is an odd function; atanh(-x) = -atanh(x). + * + */ + static int testAtanh() { + int failures = 0; + /* + * Array elements below generated using a quad atanh + * implementation. Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double [][] testCases = { + // x atanh(x) + {+0.00000000000000000000000000000000000e+00 , +0.00000000000000000000000000000000000e+00 }, + {+2.00000000000000004163336342344337027e-02 , +2.00026673068495811335374182828113576e-02 }, + {+4.00000000000000008326672684688674053e-02 , +4.00213538367682137458906520059156020e-02 }, + {+5.99999999999999977795539507496869192e-02 , +6.00721559210316214332906986486015264e-02 }, + {+8.00000000000000016653345369377348106e-02 , +8.01713250375896933655527689248809233e-02 }, + {+1.00000000000000005551115123125782702e-01 , +1.00335347731075586242913545116385118e-01 }, + {+1.20000000000000009436895709313830594e-01 , +1.20581028408444044805093075807633198e-01 }, + {+1.40000000000000013322676295501878485e-01 , +1.40925576070493877554736186975308236e-01 }, + {+1.60000000000000003330669073875469621e-01 , +1.61386696131525518759511362898215609e-01 }, + {+1.79999999999999993338661852249060757e-01 , +1.81982688600705816490251036770517457e-01 }, + {+1.99999999999999983346654630622651894e-01 , +2.02732554054082173641771797964103718e-01 }, + {+2.19999999999999973354647408996243030e-01 , +2.23656109021832382650747515743625830e-01 }, + {+2.39999999999999963362640187369834166e-01 , +2.44774112659352854083413297101694196e-01 }, + {+2.59999999999999953370632965743425302e-01 , +2.66108406873654071753827618842061943e-01 }, + {+2.79999999999999971134201359745929949e-01 , +2.87682072451780896117822911968144088e-01 }, + {+2.99999999999999988897769753748434596e-01 , +3.09519604203111703273814331202206426e-01 }, + {+3.20000000000000006661338147750939243e-01 , +3.31647108705132085025104001081840030e-01 }, + {+3.40000000000000024424906541753443889e-01 , +3.54092528962242939723929765493171945e-01 }, + {+3.60000000000000042188474935755948536e-01 , +3.76885901188190124469133896689497444e-01 }, + {+3.80000000000000059952043329758453183e-01 , +4.00059650056056638206593741845596981e-01 }, + {+4.00000000000000077715611723760957830e-01 , +4.23648930193601899373639138690042112e-01 }, + {+4.20000000000000095479180117763462476e-01 , +4.47692023527420813002158901561072580e-01 }, + {+4.40000000000000113242748511765967123e-01 , +4.72230804420425833981180600242988051e-01 }, + {+4.60000000000000131006316905768471770e-01 , +4.97311287572031193620508878977899997e-01 }, + {+4.80000000000000148769885299770976417e-01 , +5.22984277591344047465367134186014130e-01 }, + {+5.00000000000000111022302462515654042e-01 , +5.49306144334054993727359235148812474e-01 }, + {+5.20000000000000128785870856518158689e-01 , +5.76339754969192906113997153691857594e-01 }, + {+5.40000000000000146549439250520663336e-01 , +6.04155602962267286054127265014583953e-01 }, + {+5.60000000000000164313007644523167983e-01 , +6.32833186665638181077146946128475799e-01 }, + {+5.80000000000000182076576038525672629e-01 , +6.62462707371799523213172030295196960e-01 }, + {+6.00000000000000199840144432528177276e-01 , +6.93147180559945621667457797283512021e-01 }, + {+6.20000000000000217603712826530681923e-01 , +7.25005087752999506268291290927001216e-01 }, + {+6.40000000000000235367281220533186570e-01 , +7.58173744684044609195455590065769225e-01 }, + {+6.60000000000000253130849614535691217e-01 , +7.92813631870191370108450047457113058e-01 }, + {+6.80000000000000270894418008538195863e-01 , +8.29114038301766692728933700083100051e-01 }, + {+7.00000000000000288657986402540700510e-01 , +8.67300527694053760423196460163172710e-01 }, + {+7.20000000000000306421554796543205157e-01 , +9.07644983319125195441126107009775370e-01 }, + {+7.40000000000000324185123190545709804e-01 , +9.50479380596524207852088721432242171e-01 }, + {+7.60000000000000341948691584548214450e-01 , +9.96215082345103890579587353760865510e-01 }, + {+7.80000000000000359712259978550719097e-01 , +1.04537054846688556569856922586455819e+00 }, + {+8.00000000000000377475828372553223744e-01 , +1.09861228866811073993921293846013796e+00 }, + {+8.20000000000000395239396766555728391e-01 , +1.15681746459031653565363995495937725e+00 }, + {+8.40000000000000413002965160558233038e-01 , +1.22117351768460359355809310163905228e+00 }, + {+8.60000000000000430766533554560737684e-01 , +1.29334467204897297035888921761818841e+00 }, + {+8.80000000000000448530101948563242331e-01 , +1.37576765652097643587819823310934128e+00 }, + {+9.00000000000000466293670342565746978e-01 , +1.47221948958322268418172604524275263e+00 }, + {+9.20000000000000484057238736568251625e-01 , +1.58902691517397596123778549185721945e+00 }, + {+9.40000000000000501820807130570756271e-01 , +1.73804934491764087653605718356588900e+00 }, + {+9.60000000000000519584375524573260918e-01 , +1.94591014905531993245708137324632564e+00 }, + {+9.80000000000000537347943918575765565e-01 , +2.29755992506730853281874022244325249e+00 }, + }; + + for(double [] testCase : testCases) { + failures += testAtanhCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + + for(double nan : Tests.NaNs) { + failures += testAtanhCaseWithUlpDiff(nan, NaNd, 0); + } + + double [][] specialTestCases = { + {0.0, 0.0}, + {-0.0, -0.0}, + {1.0, Double.POSITIVE_INFINITY}, + {-1.0, Double.NEGATIVE_INFINITY}, + {2.0, NaNd}, + {-2.0, NaNd}, + }; + + for(double [] specialTestCase : specialTestCases) { + failures += testAtanhCaseWithUlpDiff(specialTestCase[0], + specialTestCase[1], + 0.0); + } + + // For powers of 2 less than 2^(-27), the second and + // subsequent terms of the Taylor series expansion will get + // rounded away since |n-n^3| > 53, the binary precision of a + // double significand. + + for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) { + double d = Math.scalb(2.0, i); + + // Result and expected are the same. + failures += testAtanhCaseWithUlpDiff(d, d, 2.5); + } + + failures += testAtanhAdditionalTests(); + + return failures; + } + + /** + * Test accuracy of {Math, StrictMath}.tanh using quad precision + * tanh implementation as the reference. There are additional tests. + * The specified accuracy is 2.5 ulps. + * + */ + static int testAtanhAdditionalTests() { + int failures = 0; + /* + * Array elements below are generated using a quad precision tanh + * implementation (libquadmath). Rounded to a double, the quad result + * *should* be correctly rounded, unless we are quite unlucky. + * Assuming the quad value is a correctly rounded double, the + * allowed error is 3.0 ulps instead of 2.5 since the quad + * value rounded to double can have its own 1/2 ulp error. + */ + double[][] testCases = { + // x atanh(x) + {+9.39017107929201566562937841808889061e-01 , +1.72967155564501022599234830162276798e+00 }, + {+4.56590977869321346105380143853835762e-01 , +4.92995868916526654745557405930485720e-01 }, + {-6.57855028101722583144805867050308734e-01 , -7.89022676186288902931611202476188124e-01 }, + {+4.62405425240985490376033339998684824e-01 , +5.00366606474614321339885208418466006e-01 }, + {-9.83365261789753697385663144814316183e-01 , -2.39052856803141716223262787771779768e+00 }, + {-6.27582201138608741786129030515439808e-01 , -7.37417270574716377975381198846020522e-01 }, + {-9.83196938676588638728048863413278013e-01 , -2.38545217282555498582477166161511345e+00 }, + {+7.36681396907350904967870519612915814e-01 , +9.43183305171108845024940622694003154e-01 }, + {-7.68733978209885648880117514636367559e-01 , -1.01722532284268312448347897782273734e+00 }, + {-8.99650279001481090190850409271661192e-01 , -1.47038189478731874369381319202006168e+00 }, + {+6.23383381659472490810003364458680153e-02 , +6.24192773197774301522605242534216118e-02 }, + {-8.14139384718910008587045012973248959e-01 , -1.13918472673420532816505691112579313e+00 }, + {-4.89518635342238050967011986358556896e-01 , -5.35427075187260852558782518094419668e-01 }, + {-6.08295892536873550326959048106800765e-01 , -7.06211859359034873213744847874549993e-01 }, + {+9.36079053287340978606323460553539917e-01 , +1.70538649403259128938060088254525967e+00 }, + {+8.31593360663532843446432707423809916e-01 , +1.19328001443669418326658153597705593e+00 }, + {+6.56422583223821076714443734090309590e-01 , +7.86501511439435312578862353672697253e-01 }, + {-3.45789522181036979020518629113212228e-01 , -3.60653496973375779632391162421477716e-01 }, + {+5.32079052777165939502879155043046921e-01 , +5.93040792269778100045583612458499490e-01 }, + {-3.36182931512335247958844774984754622e-01 , -3.49782828626977949006925091676664461e-01 }, + {+6.13630231412017335124176042882027104e-01 , +7.14723430606319696079463920489037224e-01 }, + {+7.39217182016670415478643008100334555e-01 , +9.48751224833067617682882507817093541e-01 }, + {-7.64409441646018983362864673836156726e-03 , -7.64424330871250337925427639013540391e-03 }, + {-9.74816033382744917545892349153291434e-01 , -2.18101148933100542106171185218910695e+00 }, + {+5.52687515297161868765840608830330893e-01 , +6.22242584006598996817110126253907160e-01 }, + {+9.93416759200363430615254856093088165e-01 , +2.85653913150680081054657418761203993e+00 }, + {+9.07659865436335255850508474395610392e-01 , +1.51407684709244159021847264731507603e+00 }, + {+6.60272764758356833780794659105595201e-01 , +7.93297068812459385386864151954890303e-01 }, + {+9.63130814953695568725322573300218210e-01 , +1.98745986190671136058731587311090272e+00 }, + {-5.70877067883640121337407435930799693e-01 , -6.48822975697686437517619163352737241e-01 }, + {-8.11543971448019485492864077968988568e-01 , -1.13153503707350652581786706338031953e+00 }, + {+6.25363929368137561048968109389534220e-01 , +7.33765974893577300297563917687072047e-01 }, + {-2.98846490310910706256208868580870330e-01 , -3.08252492314447063039336121789383998e-01 }, + {-5.97049745291272859759601487894542515e-01 , -6.88550090030688204308547683807415861e-01 }, + {+8.32383827085564576009346637874841690e-01 , +1.19584817769769645815260824209818595e+00 }, + {-6.63715390745103883674005373904947191e-01 , -7.99425357382537999237287552090479860e-01 }, + {-3.94238412786191538828006741823628545e-01 , -4.16808558150307726736043589182851417e-01 }, + {-9.76759747274416945117536670295521617e-01 , -2.22166424268955747060822814557733573e+00 }, + {+8.57442746954987455865193624049425125e-01 , +1.28360612935435243492898897724236702e+00 }, + {-4.24565955117479187919116156990639865e-01 , -4.53248918353154620159372526887584647e-01 }, + {+3.42862260746481295470289296645205468e-01 , +3.57332492545316699435359810051341636e-01 }, + {+9.34459049867542246303742103918921202e-01 , +1.69245393271799745831802454769856267e+00 }, + {+7.64520478549035598092586951679550111e-01 , +1.00700514849153029184678063244721996e+00 }, + {-9.63864704576277597780631367641035467e-01 , -1.99769974929677935746994673118167405e+00 }, + {-1.63366842704400605512660149543080479e-01 , -1.64843919557971079920329622870569601e-01 }, + {+9.94878693411232140064726081618573517e-01 , +2.98246446127683966842287869896800818e+00 }, + {+7.97196021651951247655176757689332590e-01 , +1.09087153746565597453258159715989760e+00 }, + {+8.42371664350162419054868223611265421e-01 , +1.22928450632196951329839160548759750e+00 }, + {+6.96520087724423975217291626904625446e-01 , +8.60509501716176099565750762116593117e-01 }, + {+2.01836732473232416396058397367596626e-01 , +2.04646551779576522368238234135183581e-01 }, + {+5.05939365449320055390103334502782673e-01 , +5.57256946951148119219566387597645954e-01 }, + {-6.01430574320412913991162895399611443e-01 , -6.95385458565007214254554832195678104e-01 }, + {-4.47649318961238940062230540206655860e-01 , -4.81756612137591759595253632500957881e-01 }, + {+3.37215361458020113083478008775273338e-01 , +3.50947266793232870614512911957588554e-01 }, + {+5.14125575037364890285118690371746197e-01 , +5.68321583728012649428480801619053327e-01 }, + {-2.15214858343344861424384362180717289e-01 , -2.18633101430445893274568498462426012e-01 }, + {-9.20630621904034773805847180483397096e-01 , -1.59314811621779716899638118653946385e+00 }, + {+9.19047868224296293782060729427030310e-01 , +1.58286321290197920098639225270320808e+00 }, + {-2.90913484009795997309311132994480431e-01 , -2.99563914714840125917110413508169726e-01 }, + {+3.17993101000002553746526245959103107e-03 , +3.17994172851141737533171613593260162e-03 }, + {-7.16021961571153608971940229821484536e-01 , -8.99433586194582637259073931486986768e-01 }, + {+9.92926371376932737078391255636233836e-01 , +2.82049289268529672262432232518141968e+00 }, + {-7.42199723778889541847547661745920777e-01 , -9.55359320438959545982214260560204172e-01 }, + {+4.01228574786033020949105321051320061e-01 , +4.25112376436892578257996500834612471e-01 }, + {-4.41626489426403034954660142830107361e-01 , -4.74249574732580717257665801841627296e-01 }, + {-7.21334187852223251979921769816428423e-01 , -9.10420850885118135075313207007968241e-01 }, + {+2.82138790772897052328005429444601759e-01 , +2.90004322151609047453793285881602424e-01 }, + {+9.42986643599090679224161704041762277e-01 , +1.76434800601646585550841462860153977e+00 }, + {-5.29497382099672897481923428131267428e-01 , -5.89446464446382266025999977702386855e-01 }, + {+8.90579204675862490248050562513526529e-01 , +1.42471878072594370872155352848645131e+00 }, + {+7.91047774827229877026013582508312538e-01 , +1.07422521925289214702426279427778303e+00 }, + {+4.75836513423619322793456376530230045e-01 , +5.17588301409701923326927500834908347e-01 }, + {+9.32576831661000027473562568047782406e-01 , +1.67781041728427657120484424620161805e+00 }, + {+4.49528137196881449888508086587535217e-01 , +4.84108758524071045231641283604748208e-01 }, + {-6.26946229789648867836149292998015881e-01 , -7.36368746336877301544734566556181860e-01 }, + {+9.58777722962137812778848910966189578e-01 , +1.93054856596755898497650787204101231e+00 }, + {-9.52075725696122754371231167169753462e-01 , -1.85351320681716370080636444991087747e+00 }, + {+9.66628065084665144546249848644947633e-01 , +2.03818021917486263862909093415522483e+00 }, + {-9.90577960901121823411585864960215986e-01 , -2.67656438907628996596144534201915287e+00 }, + {-4.29129153811968588883019037893973291e-01 , -4.58828779570547333956754968138122237e-01 }, + {+9.21075240738198020018501210870454088e-01 , +1.59607267263080478465215862819487820e+00 }, + {-3.36155477527195101217216688382904977e-01 , -3.49751876782073295503516199927519371e-01 }, + {-4.48919523178084922676589485490694642e-01 , -4.83346273396370947315596684554195125e-01 }, + {-7.74714213440744980943009068141691387e-01 , -1.03201246185914269057125935805127686e+00 }, + {-9.33695607057150489538344118045642972e-01 , -1.68646605985566878841417421790327581e+00 }, + {-9.70495709947644780157816057908348739e-01 , -2.10075237060881671900628221642575807e+00 }, + {-9.36541591900329706277261720970273018e-01 , -1.70913713792726775520494333833202263e+00 }, + {+7.37812568478896091406227242259774357e-02 , +7.39155762025176670781318988781666040e-02 }, + {-5.04698425671640915624038825626485050e-01 , -5.55590478683141718256493322563558866e-01 }, + {+8.86920594265426132096763467416167259e-01 , +1.40730559326330763357753153399607213e+00 }, + {-5.34965721339583311078058613929897547e-01 , -5.97076103988724933820435448973192479e-01 }, + {-5.04547440425485049786402669269591570e-01 , -5.55387910636784813509136387661093775e-01 }, + {+6.29048733546408000982808061962714419e-01 , +7.39840413838973059800583747029269377e-01 }, + {-9.78682200705922600292296920088119805e-01 , -2.26532198777189725437096465346095003e+00 }, + {+2.38919916302204882185833412222564220e-03 , +2.38920370910435739436106539813089152e-03 }, + {+9.39119411473845255855508185049984604e-01 , +1.73053742845170764254605902984133442e+00 }, + {-6.12092729070447649775132958893664181e-01 , -7.12261063519474464072359286081706738e-01 }, + {-4.28286500855559193468025114270858467e-01 , -4.57796381674494452786278030205231882e-01 }, + {-3.27343597141078301859806742868386209e-01 , -3.39850137417994572135528032299471827e-01 }, + {+8.67784128381645536443045330088352785e-01 , +1.32403603565363914121499259355873480e+00 }, + {+7.52660015475228982850808279181364924e-01 , +9.79063037984556159433073554464697266e-01 }, + {+7.94013223397652012636172003112733364e-01 , +1.08219921900739052536746217766952318e+00 }, + {+7.09905313419819106179886603058548644e-01 , +8.86992950278189161084285873777251874e-01 }, + {-1.98448575704946783559989853529259562e-01 , -2.01117007840272246446085014680650093e-01 }, + {-5.42433878231522781376838793221395463e-01 , -6.07597742754044712584754611484481699e-01 }, + {-7.54416871023775081894768845813814551e-01 , -9.83128156322049799142775913826928208e-01 }, + {+3.79392548957375952412007791281212121e-01 , +3.99349870596906125894068556877626311e-01 }, + {-7.19279634651493138264299886941444129e-01 , -9.06150816136239309657351447814954486e-01 }, + {-7.23976590297829680764607473975047469e-01 , -9.15951596268038628402616624621418121e-01 }, + {+9.31431733675747830503155455517116934e-01 , +1.66909350005993386837360519102696526e+00 }, + {+5.37270796945802042721140878711594269e-01 , +6.00310952521635654514167563653463826e-01 }, + {+5.05516649275373541883027428411878645e-01 , +5.56688962620397076749424137775916558e-01 }, + {+6.47849417517198489235852321144193411e-01 , +7.71583729081504579676124881689567952e-01 }, + {-5.41124640015404612114480187301523983e-01 , -6.05744544146300297202878069447139070e-01 }, + {+8.08308086737189235293499223189428449e-01 , +1.12212873178291911884370700806026369e+00 }, + {-3.98280706273062445887944704736582935e-01 , -4.21603823445725768059979840445297322e-01 }, + {+8.21296094676341903451088910514954478e-01 , +1.16078669527372101102128788451037300e+00 }, + {+8.31294185704192667429879293194971979e-01 , +1.19231087346512905437819601187290515e+00 }, + {+7.75279686135698531401772015669848770e-01 , +1.03342833983253459558199442655538342e+00 }, + {+8.63016425798844855066249692754354328e-01 , +1.30504558255929258800082186193362940e+00 }, + {-4.01121200686206158536606380948796868e-01 , -4.24984406726507784951210586374028211e-01 }, + {-7.26296876814658931564849808637518436e-01 , -9.20844916340064967501644052845522852e-01 }, + {-6.51251452570346556214531119621824473e-01 , -7.77468783732375082858572957021836038e-01 }, + {-3.38884333978433982537126212264411151e-01 , -3.52831574304372263524860719607206882e-01 }, + {+1.72392299987310537723317338532069698e-01 , +1.74131195612490806064041759672764899e-01 }, + {-5.51462898378643817665079041034914553e-01 , -6.20481084171861782978180187043219425e-01 }, + {-9.64904165725041895740332620334811509e-01 , -2.01255815534358709601688745544440155e+00 }, + {+4.86038064330916674826710277557140216e-01 , +5.30859816325958819695652448239234798e-01 }, + {-1.71510111227157313606994648580439389e-01 , -1.73222128192418256096782313598032358e-01 }, + {-6.40878189659797481425584919634275138e-01 , -7.59662611746376207791374637040653373e-01 }, + {-9.21153045478257270772814990777987987e-01 , -1.59658607015886876829589111732687615e+00 }, + {+9.25949497320595948934851548983715475e-01 , +1.62921352070439068555146795332724838e+00 }, + {+6.67107753751613463677472282142844051e-02 , +6.68100020655284551850585715148980622e-02 }, + {-7.11704678755497255338013928849250078e-01 , -8.90629832677982628857274943637335499e-01 }, + {+2.35257760530820814182106914813630283e-01 , +2.39748052543229836539708777609029562e-01 }, + {-5.99809116170998191108765240642242134e-01 , -6.92848977932719794607448570102282265e-01 }, + {+2.36856137326988402946881251409649849e-02 , +2.36900444994942435090279187572837691e-02 }, + {+4.79753735068501274696473046788014472e-01 , +5.22664335906700767137176554743504717e-01 }, + {-6.67813223642592657114391840877942741e-02 , -6.68808647504004031806529934863158282e-02 }, + {+4.94668485437996574560770568496081978e-01 , +5.42222516993971658066335656775147071e-01 }, + {+9.22379519394591618208778527332469821e-01 , +1.60474385650308389567794994129179836e+00 }, + {+8.66971245297548764874306925776181743e-01 , +1.32075371812223257408713093011711133e+00 }, + {-4.12983669850965462444492004578933120e-01 , -4.39203093212737172928023065922190938e-01 }, + {-5.47462091173417153555647018947638571e-01 , -6.14749985698478964136871989998405650e-01 }, + {+1.94666780724803700763914093840867281e-02 , +1.94691376077079831895420594672983760e-02 }, + {+7.50017550413333511372115935955662280e-01 , +9.72995190965114870405588062706564568e-01 }, + {+4.63499306097077345967250039393547922e-01 , +5.01758888267043269595832923648429311e-01 }, + {-8.37886773978241183868931329925544560e-01 , -1.21403834050977292529923613488719174e+00 }, + {-8.44836969187467534680990866036154330e-01 , -1.23783490656982630833439816713451784e+00 }, + {-6.25239150214307315422956889960914850e-02 , -6.26055803188625957299760516982282628e-02 }, + {+9.22830248275150921699605532921850681e-01 , +1.60777295202485947753242989620181993e+00 }, + {-4.00102773592881266750964641687460244e-01 , -4.23771285697601852943736383483221011e-01 }, + {-2.14797176230649089490043479599989951e-01 , -2.18195175029126913051736730604906575e-01 }, + {+8.02345358196084879054410521348472685e-01 , +1.10516139904369984294917445650114715e+00 }, + {-4.71866662797370439719202295236755162e-01 , -5.12468964220618253719339326228366982e-01 }, + {-5.92911187960187158196845302882138640e-01 , -6.82143591940237868513886526048905163e-01 }, + {-8.76501962797874289989863427763339132e-01 , -1.36046970086086594286889855837180352e+00 }, + {-7.98090332703508265055347692396026105e-01 , -1.09333002432404366596746493295830794e+00 }, + {-9.95891457501823618159164652752224356e-01 , -3.09288886654198972890077598351970075e+00 }, + {+8.90238675794242206862350030860397965e-01 , +1.42307507755399321220435398978827125e+00 }, + {+2.65017376806080395823528306209482253e-01 , +2.71497140326271882216423312414093371e-01 }, + {-8.86140475954999118357591214589774609e-01 , -1.40366125031104099709908824399414822e+00 }, + {-2.77209688130732434530045793508179486e-01 , -2.84656945620440202957754725962273832e-01 }, + {-5.61942305274404585446745841181837022e-01 , -6.35667384226952551579962809234573845e-01 }, + {+5.85899688875965107826004896196536720e-01 , +6.71399455223037749672225055315941521e-01 }, + {+2.89700970360319720597885861934628338e-01 , +2.98239807343473574150289333944139019e-01 }, + {+6.75650398573335864149669305334100500e-01 , +8.21067357862862215855289466859201333e-01 }, + {+8.44595640831392491243434506031917408e-01 , +1.23699243938765398083225288313951255e+00 }, + {+7.51976945151026199276600436860462651e-01 , +9.77489203652249672733902415356008597e-01 }, + {+5.84881385823573185511747851705877110e-01 , +6.69850275691608515819691751205471169e-01 }, + {+1.23322570031297651382828917121514678e-01 , +1.23953519549355101274007946363965461e-01 }, + {-2.47363663564394764549092542438302189e-01 , -2.52602687864803306420298300961589174e-01 }, + {-8.72948142869468535209875881264451891e-01 , -1.34533684420626699711543794108336721e+00 }, + {+8.66853617575293000641067919787019491e-01 , +1.32028029629708106765994282266545478e+00 }, + {+9.65229404828656933901243064610753208e-02 , +9.68243850830075059690451893341587506e-02 }, + {-5.83777226707343555034412929671816528e-01 , -6.68173646565246900863367519530400319e-01 }, + {+9.94603681374665704595372517360374331e-01 , +2.95624183430168683072844226874046298e+00 }, + {+7.54573357889273710341626610897947103e-01 , +9.83491456493016558037612443042858735e-01 }, + {-8.72065566686865079049084670259617269e-01 , -1.34163989421242748094845640631675400e+00 }, + {-1.57050652646726351946426802896894515e-01 , -1.58361317756145752747805962366582739e-01 }, + {+9.07524513496185902816648649604758248e-01 , +1.51330900778040915728163457702896072e+00 }, + {+8.88013640284071148478517443436430767e-01 , +1.41245174788920614220523066982061669e+00 }, + {+5.25920210223992712350593592418590561e-01 , +5.84488641604906625861481645606402185e-01 }, + {-8.55361269493308373768059027497656643e-01 , -1.27579779541753266418749325433063584e+00 }, + {+7.52458416629113502338555008464027196e-01 , +9.78598154541206783526807546834975210e-01 }, + {+2.11594554867804984787937883083941415e-01 , +2.14840051580673426585151516223475322e-01 }, + {-8.77614995063785929829691667691804469e-01 , -1.36529288845779405074788706705067271e+00 }, + {-8.13140811836136734314095519948750734e-01 , -1.13623027343457311746522665305747518e+00 }, + {-9.09625945665704094267312029842287302e-03 , -9.09651034981903612229998860206266111e-03 }, + {+7.11723260837115345722736492461990565e-01 , +8.90667489144918362129731310184000150e-01 }, + {-8.83729688568336113618784111167769879e-01 , -1.39254560811946769303745792066561506e+00 }, + {+2.81119771587539202251093684026272967e-01 , +2.88897516488748428420498810336047168e-01 }, + {+8.67969571335847511761585337808355689e-01 , +1.32478745650884654793737485679177607e+00 }, + {+3.71711284421433640901000217127148062e-01 , +3.90407276521447439801268385319531263e-01 }, + {-5.53264526894389874200896883849054575e-01 , -6.23073752400105167233817313285610373e-01 }, + {-7.50972436681106358946635737083852291e-01 , -9.75181502145488477599896301261990367e-01 }, + {+6.22632428081477007353328190220054239e-01 , +7.29292680370939598849165484001382202e-01 }, + {-5.93039523143406244187758602492976934e-01 , -6.82341523923040079633725976448706286e-01 }, + {-6.21804927349977942796499519317876548e-01 , -7.27942416494347815893737620840227454e-01 }, + {-5.91667199221579398482617762056179345e-01 , -6.80227384371192279205589233595913495e-01 }, + }; + + for (double[] testCase : testCases) { + failures += testAtanhCaseWithUlpDiff(testCase[0], + testCase[1], + 3.0); + } + + return failures; + } + + public static int testAtanhCaseWithTolerance(double input, + double expected, + double tolerance) { + int failures = 0; + failures += Tests.testTolerance("Math.atanh", input, Math::atanh, expected, tolerance); + failures += Tests.testTolerance("Math.atanh", -input, Math::atanh, -expected, tolerance); + + failures += Tests.testTolerance("StrictMath.atanh", input, StrictMath::atanh, expected, tolerance); + failures += Tests.testTolerance("StrictMath.atanh", -input, StrictMath::atanh, -expected, tolerance); + return failures; + } + + public static int testAtanhCaseWithUlpDiff(double input, + double expected, + double ulps) { + int failures = 0; + + failures += Tests.testUlpDiffWithAbsBound("Math.atanh", input, Math::atanh, expected, ulps, Double.POSITIVE_INFINITY); + failures += Tests.testUlpDiffWithAbsBound("Math.atanh", -input, Math::atanh, -expected, ulps, Double.POSITIVE_INFINITY); + + failures += Tests.testUlpDiffWithAbsBound("StrictMath.atanh", input, StrictMath::atanh, expected, ulps, Double.POSITIVE_INFINITY); + failures += Tests.testUlpDiffWithAbsBound("StrictMath.atanh", -input, StrictMath::atanh, -expected, ulps, Double.POSITIVE_INFINITY); + return failures; + } } diff --git a/test/jdk/java/lang/ProcessBuilder/InheritIOClosed.java b/test/jdk/java/lang/ProcessBuilder/InheritIOClosed.java new file mode 100644 index 00000000000..3e96a49bd3b --- /dev/null +++ b/test/jdk/java/lang/ProcessBuilder/InheritIOClosed.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2026, 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 child process should not hang even if parent process has closed System.out/err + * @bug 8366736 + * @run main/othervm InheritIOClosed close dontclose + * @run main/othervm InheritIOClosed dontclose close + * @run main/othervm InheritIOClosed close close + */ + +import java.nio.file.Path; + +public class InheritIOClosed { + private final static Path JAVA_EXE = + Path.of(System.getProperty("java.home"), "bin", "java"); + + private static final String s = "1234567890".repeat(10); + + public static void main(String[] args) throws Exception { + if (args.length == 2) { + // Main test process + if (args[0].equals("close")) { + System.out.close(); + } + if (args[1].equals("close")) { + System.err.close(); + } + + ProcessBuilder pb = new ProcessBuilder().inheritIO() + .command(JAVA_EXE.toString(), + "-cp", + System.getProperty("java.class.path"), + InheritIOClosed.class.getName()); + Process process = pb.start(); + process.waitFor(); + + System.out.println("Done"); + } else { + // Child process -- print to System.out/err. Without the fix in + // JDK-8366736, this process will hang on Windows. + for (int i = 0; i < 100; i++) { + System.out.println(s); + } + for (int i = 0; i < 100; i++) { + System.err.println(s); + } + } + } +} diff --git a/test/jdk/java/lang/StrictMath/ExhaustingTests.java b/test/jdk/java/lang/StrictMath/ExhaustingTests.java index 0351caff70c..23b55a50bee 100644 --- a/test/jdk/java/lang/StrictMath/ExhaustingTests.java +++ b/test/jdk/java/lang/StrictMath/ExhaustingTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ -91,6 +91,10 @@ public class ExhaustingTests { new UnaryTestCase("asin", FdlibmTranslit::asin, StrictMath::asin, DEFAULT_SHIFT), new UnaryTestCase("acos", FdlibmTranslit::acos, StrictMath::acos, DEFAULT_SHIFT), new UnaryTestCase("atan", FdlibmTranslit::atan, StrictMath::atan, DEFAULT_SHIFT), + + new UnaryTestCase("asinh", FdlibmTranslit::asinh, StrictMath::asinh, DEFAULT_SHIFT), + new UnaryTestCase("acosh", FdlibmTranslit::acosh, StrictMath::acosh, DEFAULT_SHIFT), + new UnaryTestCase("atanh", FdlibmTranslit::atanh, StrictMath::atanh, DEFAULT_SHIFT), }; for (var testCase : testCases) { diff --git a/test/jdk/java/lang/StrictMath/FdlibmTranslit.java b/test/jdk/java/lang/StrictMath/FdlibmTranslit.java index f38ca68569b..ffa18676c90 100644 --- a/test/jdk/java/lang/StrictMath/FdlibmTranslit.java +++ b/test/jdk/java/lang/StrictMath/FdlibmTranslit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2026, 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 @@ -140,6 +140,18 @@ public class FdlibmTranslit { return Tanh.compute(x); } + public static double asinh(double x) { + return Asinh.compute(x); + } + + public static double acosh(double x) { + return Acosh.compute(x); + } + + public static double atanh(double x) { + return Atanh.compute(x); + } + public static double IEEEremainder(double f1, double f2) { return IEEEremainder.compute(f1, f2); } @@ -2752,4 +2764,131 @@ public class FdlibmTranslit { return x; /* exact output */ } } + + /* + * Return the Inverse Hyperbolic Sine of x + * + * Method : + * + * Based on + * asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ] + * we have + * asinh(x) := x if 1+x*x=1, + * := sign(x)*(log(x)+ln2)) for large |x|, else + * := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else + * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) + */ + private static final class Asinh { + private static final double one = 1.0; + private static final double ln2 = 6.93147180559945286227e-01; + private static final double huge = 1.0e300; + + static double compute(double x) { + double t,w; + int hx,ix; + hx = __HI(x); + ix = hx&0x7fffffff; + if(ix>=0x7ff00000) return x+x; /* x is inf or NaN */ + if(ix< 0x3e300000) { /* |x|<2**-28 */ + if(huge+x>one) return x; /* return x inexact except 0 */ + } + if(ix>0x41b00000) { /* |x| > 2**28 */ + w = log(Math.abs(x))+ln2; + } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */ + t = Math.abs(x); + w = log(2.0*t+one/(sqrt(x*x+one)+t)); + } else { /* 2.0 > |x| > 2**-28 */ + t = x*x; + w =log1p(Math.abs(x)+t/(one+sqrt(one+t))); + } + if(hx>0) return w; else return -w; + } + } + + /* + * Return the Inverse Hyperbolic Cosine of x + * + * Method : + * Based on + * acosh(x) = log [ x + sqrt(x*x-1) ] + * we have + * acosh(x) := log(x)+ln2, if x is large; else + * := log(2x-1/(sqrt(x*x-1)+x)) if x>2; else + * := log1p(t+sqrt(2.0*t+t*t)); where t=x-1. + * + * Special cases: + * acosh(x) is NaN with signal if x<1. + * acosh(NaN) is NaN without signal. + */ + private static final class Acosh { + private static final double one = 1.0; + private static final double ln2 = 6.93147180559945286227e-01; + static double compute(double x) { + double t; + int hx; + hx = __HI(x); + if(hx<0x3ff00000) { /* x < 1 */ + return (x-x)/(x-x); + } else if(hx >=0x41b00000) { /* x > 2**28 */ + if(hx >=0x7ff00000) { /* x is inf of NaN */ + return x+x; + } else + return log(x)+ln2; /* acosh(huge)=log(2x) */ + } else if(((hx-0x3ff00000)|__LO(x))==0) { + return 0.0; /* acosh(1) = 0 */ + } else if (hx > 0x40000000) { /* 2**28 > x > 2 */ + t=x*x; + return log(2.0*x-one/(x+sqrt(t-one))); + } else { /* 1=0.5 + * 1 2x x + * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) + * 2 1 - x 1 - x + * + * For x<0.5 + * atanh(x) = 0.5*log1p(2x+2x*x/(1-x)) + * + * Special cases: + * atanh(x) is NaN if |x| > 1 with signal; + * atanh(NaN) is that NaN with no signal; + * atanh(+-1) is +-INF with signal. + * + */ + private static final class Atanh { + private static final double zero = 0.0; + private static final double one = 1.0; + private static final double huge = 1.0e300; + + static double compute(double x) { + double t; + int hx,ix; + /*unsigned*/ int lx; + hx = __HI(x); /* high word */ + lx = __LO(x); /* low word */ + ix = hx&0x7fffffff; + if ((ix|((lx|(-lx))>>>31))>0x3ff00000) /* |x|>1 */ + return (x-x)/(x-x); + if(ix==0x3ff00000) + return x/zero; + if(ix<0x3e300000&&(huge+x)>zero) return x; /* x<2**-28 */ + x = __HI(x, ix); /* x <- |x| */ + if(ix<0x3fe00000) { /* x < 0.5 */ + t = x+x; + t = 0.5*log1p(t+t*x/(one-x)); + } else + t = 0.5*log1p((x+x)/(one-x)); + if(hx>=0) return t; else return -t; + } + } } diff --git a/test/jdk/java/lang/StrictMath/HyperbolicTests.java b/test/jdk/java/lang/StrictMath/HyperbolicTests.java index 1f570ce9efd..4be1b350c1d 100644 --- a/test/jdk/java/lang/StrictMath/HyperbolicTests.java +++ b/test/jdk/java/lang/StrictMath/HyperbolicTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,7 +26,7 @@ import java.util.function.DoubleUnaryOperator; /* * @test - * @bug 4851625 8301444 + * @bug 4851625 8301444 8331354 * @key randomness * @library /test/lib * @build jdk.test.lib.RandomFactory @@ -34,7 +34,7 @@ import java.util.function.DoubleUnaryOperator; * @build FdlibmTranslit * @build HyperbolicTests * @run main HyperbolicTests - * @summary Tests for StrictMath.{sinh, cosh, tanh} + * @summary Tests for StrictMath.{sinh, cosh, tanh, asinh, acosh, atanh} */ /** @@ -60,10 +60,14 @@ public class HyperbolicTests { failures += testAgainstTranslitSinh(); failures += testAgainstTranslitCosh(); failures += testAgainstTranslitTanh(); + failures += testAgainstTranslitAtanh(); failures += testSinh(); failures += testCosh(); failures += testTanh(); + failures += testAsinh(); + failures += testAcosh(); + failures += testAtanh(); if (failures > 0) { System.err.println("Testing the hyperbolics incurred " @@ -78,7 +82,10 @@ public class HyperbolicTests { private static enum HyperbolicTest { SINH(HyperbolicTests::testSinhCase, FdlibmTranslit::sinh), COSH(HyperbolicTests::testCoshCase, FdlibmTranslit::cosh), - TANH(HyperbolicTests::testTanhCase, FdlibmTranslit::tanh); + TANH(HyperbolicTests::testTanhCase, FdlibmTranslit::tanh), + ASINH(HyperbolicTests::testAsinhCase, FdlibmTranslit::asinh), + ACOSH(HyperbolicTests::testAcoshCase, FdlibmTranslit::acosh), + ATANH(HyperbolicTests::testAtanhCase, FdlibmTranslit::atanh); private DoubleDoubleToInt testCase; private DoubleUnaryOperator transliteration; @@ -212,6 +219,31 @@ public class HyperbolicTests { return failures; } + /** + * Test StrictMath.tanh against transliteration port of tanh + */ + private static int testAgainstTranslitAtanh() { + int failures = 0; + double x; + + // Probe near decision points in the FDLIBM algorithm. + double[] decisionPoints = { + 0.0, + + 0x1.0p-28, + -0x1.0p-28, + + 1.0, + -1.0, + }; + + for (double testPoint : decisionPoints) { + failures += testRangeMidpoint(testPoint, Math.ulp(testPoint), 1000, HyperbolicTest.ATANH); + } + + return failures; + } + private interface DoubleDoubleToInt { int apply(double x, double y); } @@ -253,6 +285,21 @@ public class HyperbolicTests { StrictMath::tanh, expected); } + private static int testAsinhCase(double input, double expected) { + return Tests.test("StrictMath.asinh(double)", input, + StrictMath::asinh, expected); + } + + private static int testAcoshCase(double input, double expected) { + return Tests.test("StrictMath.asinh(double)", input, + StrictMath::acosh, expected); + } + + private static int testAtanhCase(double input, double expected) { + return Tests.test("StrictMath.atanh(double)", input, + StrictMath::atanh, expected); + } + private static int testSinh() { int failures = 0; double [][] testCases = { @@ -484,4 +531,189 @@ public class HyperbolicTests { return failures; } + + private static int testAsinh() { + int failures = 0; + double [][] testCases = { + {0x1.5798ee2308c36p-27, 0x1.5798ee2308c35p-27}, + {0x1.ffffffffffffep-26, 0x1.ffffffffffffdp-26}, + {0x1.ffffffffffffep-25, 0x1.ffffffffffff9p-25}, + {0x1.ad7f29abcaf47p-24, 0x1.ad7f29abcaf3bp-24}, + {0x1.ad7f29abcaf48p-24, 0x1.ad7f29abcaf3cp-24}, + {0x1.ffffffffffffep-24, 0x1.fffffffffffe9p-24}, + {0x1.ffffffffffffep-23, 0x1.fffffffffffa9p-23}, + {0x1.ffffffffffffep-22, 0x1.ffffffffffea9p-22}, + {0x1.ffffffffffffep-21, 0x1.ffffffffffaa9p-21}, + {0x1.0c6f7a0b5ed8dp-20, 0x1.0c6f7a0b5ea7ap-20}, + {0x1.ffffffffffffep-20, 0x1.fffffffffeaa9p-20}, + {0x1.ffffffffffffep-19, 0x1.fffffffffaaa9p-19}, + {0x1.fffffffffffffp-18, 0x1.ffffffffeaaa9p-18}, + {0x1p-17, 0x1.ffffffffeaaabp-18}, + {0x1.4f8b588e368edp-17, 0x1.4f8b588e1e89ep-17}, + {0x1.fffffffffffffp-17, 0x1.ffffffffaaaa9p-17}, + {0x1.fffffffffffffp-16, 0x1.fffffffeaaaa9p-16}, + {0x1p-15, 0x1.fffffffeaaaabp-16}, + {0x1.fffffffffe5ddp-15, 0x1.fffffffaa9087p-15}, + {0x1.fffffffffffffp-15, 0x1.fffffffaaaaa9p-15}, + {0x1.a36e2eb1c432dp-14, 0x1.a36e2ea609cc8p-14}, + {0x1.ffffffffffffep-14, 0x1.ffffffeaaaaa9p-14}, + {0x1p-13, 0x1.ffffffeaaaaabp-14}, + {0x1.ffffffffffd51p-13, 0x1.ffffffaaaa7fdp-13}, + {0x1.fffffffffffffp-13, 0x1.ffffffaaaaaadp-13}, + {0x1.ffffffffffffep-12, 0x1.fffffeaaaaacfp-12}, + {0x1p-11, 0x1.fffffeaaaaad1p-12}, + {0x1.fffffffffff1p-11, 0x1.fffffaaaaac21p-11}, + {0x1p-10, 0x1.fffffaaaaad11p-11}, + {0x1.0624dd2f1a9c6p-10, 0x1.0624da5218b5fp-10}, + {0x1.0624dd2f1a9f8p-10, 0x1.0624da5218b91p-10}, + {0x1.fffffffffffddp-10, 0x1.ffffeaaaad0edp-10}, + {0x1.fffffffffffffp-10, 0x1.ffffeaaaad10fp-10}, + {0x1.ffffffffffffcp-9, 0x1.ffffaaaad110cp-9}, + {0x1.ffffffffffffep-9, 0x1.ffffaaaad110ep-9}, + {0x1.ffffffffffff8p-8, 0x1.fffeaaad110aep-8}, + {0x1.ffffffffffffep-8, 0x1.fffeaaad110b4p-8}, + {0x1.47ae147ae1458p-7, 0x1.47acae9508ae4p-7}, + {0x1.47ae147ae1464p-7, 0x1.47acae9508afp-7}, + {0x1.ffffffffffffep-7, 0x1.fffaaad10fa35p-7}, + {0x1.fffffffffffffp-7, 0x1.fffaaad10fa35p-7}, + {0x1.ffffffffffff9p-6, 0x1.ffeaad10b5b28p-6}, + {0x1.ffffffffffffep-6, 0x1.ffeaad10b5b2bp-6}, + {0x1.ffffffffffff9p-5, 0x1.ffaad0fa4525bp-5}, + {0x1.fffffffffffffp-5, 0x1.ffaad0fa45261p-5}, + {0x1.9999999999996p-4, 0x1.98eb9e7e5fc3ap-4}, + {0x1.9999999999997p-4, 0x1.98eb9e7e5fc3bp-4}, + {0x1.fffffffffffffp-4, 0x1.fead0b6996972p-4}, + {0x1p-3, 0x1.fead0b6996972p-4}, + {0x1.fffffffffffffp-3, 0x1.facfb2399e636p-3}, + {0x1.ffffffffffffcp-2, 0x1.ecc2caec51605p-2}, + {0x1.ffffffffffffep-2, 0x1.ecc2caec51608p-2}, + {0x1.ffffffffffffbp-1, 0x1.c34366179d423p-1}, + {0x1.ffffffffffffep-1, 0x1.c34366179d426p-1}, + {0x1.fffffffffffd3p+0, 0x1.719218313d073p+0}, + {0x1.fffffffffffe1p+0, 0x1.719218313d079p+0}, + {0x1.ffffffffffed8p+1, 0x1.0c1f8a6e80ea4p+1}, + {0x1.fffffffffff92p+1, 0x1.0c1f8a6e80edp+1}, + {0x1.0108b83c4bbc8p-1, 0x1.ee9c256f3947ep-2}, + {-0x1.c41e527b70f43p-3, -0x1.c0863c7dece22p-3}, + }; + + for (double[] testCase: testCases) { + failures += testAsinhCase(testCase[0], testCase[1]); + } + + return failures; + } + + private static int testAcosh() { + int failures = 0; + double [][] testCases = { + {0x1.00020000aaaabp+0, 0x1.fffffffff749fp-8}, + {0x1.000346de27853p+0, 0x1.47ae147ae274p-7}, + {0x1.0008000aaab05p+0, 0x1.fffffffffe9f1p-7}, + {0x1.0008000aaab05p+0, 0x1.fffffffffe9f1p-7}, + {0x1.002000aaac169p+0, 0x1.fffffffffe67bp-6}, + {0x1.002000aaac16bp+0, 0x1.ffffffffff679p-6}, + {0x1.00800aab05b1ep+0, 0x1.ffffffffffc9cp-5}, + {0x1.00800aab05b1fp+0, 0x1.ffffffffffe9bp-5}, + {0x1.0147f40224b2ep+0, 0x1.9999999999318p-4}, + {0x1.0147f40224b35p+0, 0x1.9999999999776p-4}, + {0x1.0200aac16db6cp+0, 0x1.ffffffffffe91p-4}, + {0x1.0200aac16db6ep+0, 0x1.fffffffffff91p-4}, + {0x1.080ab05ca613bp+0, 0x1.ffffffffffea5p-3}, + {0x1.080ab05ca6146p+0, 0x1.0000000000001p-2}, + {0x1.20ac1862ae8cep+0, 0x1.fffffffffffedp-2}, + {0x1.20ac1862ae8dp+0, 0x1.ffffffffffffdp-2}, + {0x1.8b07551d9f551p+0, 0x1p+0}, + {0x1.e18fa0df2d9b3p+1, 0x1.ffffffffffffbp+0}, + {0x1.e18fa0df2d9b8p+1, 0x1.ffffffffffffep+0}, + {0x1.e18fa0df2d9bap+1, 0x1.fffffffffffffp+0}, + {0x1.b4ee858de3e68p+4, 0x1.ffffffffffff9p+1}, + {0x1.b4ee858de3e7ap+4, 0x1.ffffffffffffep+1}, + {0x1.b4ee858de3e7dp+4, 0x1.fffffffffffffp+1}, + {0x1.749eaa93f4e5ep+10, 0x1.ffffffffffffcp+2}, + {0x1.749eaa93f4e64p+10, 0x1.ffffffffffffdp+2}, + {0x1.749eaa93f4e76p+10, 0x1p+3}, + {0x1.0f2ebd0a7fb9p+22, 0x1.fffffffffff6fp+3}, + {0x1.0f2ebd0a8005cp+22, 0x1p+4}, + {0x1.1f43fcc4b6316p+45, 0x1.fffffffffffd3p+4}, + {0x1.1f43fcc4b662cp+45, 0x1.fffffffffffffp+4}, + {0x1.fdf25fc26e7cp+1023, 0x1.633c654fee2bap+9}, + {0x1.fdf25fc26e7cp+1023, 0x1.633c654fee2bap+9}, + {0x1.e0976c8f0ebdfp+1, 0x1.ff76fb3f476d5p+0}, + {0x1.ff66e0de4dc6fp+1023, 0x1.633cc2ae1c934p+9}, + {0x1.f97ccb0aef314p+11, 0x1.1ff088806d82ep+3}, + {0x1.fdf28623ef923p+1021, 0x1.628af341989dap+9}, + }; + + for (double[] testCase: testCases) { + failures += testAcoshCase(testCase[0], testCase[1]); + } + + return failures; + } + + private static int testAtanh() { + int failures = 0; + double [][] testCases = { + {0x1.5798ee2308c36p-27, 0x1.5798ee2308c37p-27}, + {0x1.ffffffffffffep-26, 0x1p-25}, + {0x1.ffffffffffffep-25, 0x1.0000000000004p-24}, + {0x1.ad7f29abcaf47p-24, 0x1.ad7f29abcaf6p-24}, + {0x1.ad7f29abcaf48p-24, 0x1.ad7f29abcaf61p-24}, + {0x1.ffffffffffffep-24, 0x1.0000000000014p-23}, + {0x1.ffffffffffffep-23, 0x1.0000000000054p-22}, + {0x1.ffffffffffffep-22, 0x1.0000000000154p-21}, + {0x1.ffffffffffffep-21, 0x1.0000000000554p-20}, + {0x1.0c6f7a0b5ed8dp-20, 0x1.0c6f7a0b5f3b3p-20}, + {0x1.ffffffffffffep-20, 0x1.0000000001554p-19}, + {0x1.ffffffffffffep-19, 0x1.0000000005554p-18}, + {0x1.fffffffffffffp-18, 0x1.0000000015555p-17}, + {0x1p-17, 0x1.0000000015555p-17}, + {0x1.4f8b588e368edp-17, 0x1.4f8b588e6698bp-17}, + {0x1.fffffffffffffp-17, 0x1.0000000055555p-16}, + {0x1.fffffffffffffp-16, 0x1.0000000155555p-15}, + {0x1p-15, 0x1.0000000155555p-15}, + {0x1.fffffffffe5ddp-15, 0x1.0000000554844p-14}, + {0x1.fffffffffffffp-15, 0x1.0000000555555p-14}, + {0x1.a36e2eb1c432dp-14, 0x1.a36e2ec938ff8p-14}, + {0x1.ffffffffffffep-14, 0x1.0000001555555p-13}, + {0x1p-13, 0x1.0000001555556p-13}, + {0x1.ffffffffffd51p-13, 0x1.0000005555401p-12}, + {0x1.fffffffffffffp-13, 0x1.0000005555559p-12}, + {0x1.ffffffffffffep-12, 0x1.0000015555587p-11}, + {0x1p-11, 0x1.0000015555588p-11}, + {0x1.fffffffffff1p-11, 0x1.0000055555811p-10}, + {0x1p-10, 0x1.0000055555889p-10}, + {0x1.0624dd2f1a9c6p-10, 0x1.0624e2e91ece1p-10}, + {0x1.0624dd2f1a9f8p-10, 0x1.0624e2e91ed13p-10}, + {0x1.fffffffffffddp-10, 0x1.0000155558877p-9}, + {0x1.fffffffffffffp-10, 0x1.0000155558888p-9}, + {0x1.ffffffffffffcp-9, 0x1.0000555588889p-8}, + {0x1.ffffffffffffep-9, 0x1.000055558888ap-8}, + {0x1.ffffffffffff8p-8, 0x1.0001555888917p-7}, + {0x1.ffffffffffffep-8, 0x1.000155588891ap-7}, + {0x1.47ae147ae1458p-7, 0x1.47b0e059d0574p-7}, + {0x1.47ae147ae1464p-7, 0x1.47b0e059d058p-7}, + {0x1.ffffffffffffep-7, 0x1.000555888ad1bp-6}, + {0x1.fffffffffffffp-7, 0x1.000555888ad1cp-6}, + {0x1.ffffffffffff9p-6, 0x1.001558891aedep-5}, + {0x1.ffffffffffffep-6, 0x1.001558891aee1p-5}, + {0x1.ffffffffffff9p-5, 0x1.005588ad375a9p-4}, + {0x1.fffffffffffffp-5, 0x1.005588ad375acp-4}, + {0x1.9999999999996p-4, 0x1.9af93cd23440ep-4}, + {0x1.9999999999997p-4, 0x1.9af93cd23440fp-4}, + {0x1.fffffffffffffp-4, 0x1.015891c9eaef7p-3}, + {0x1p-3, 0x1.015891c9eaef7p-3}, + {0x1.fffffffffffffp-3, 0x1.058aefa811451p-2}, + {0x1.ffffffffffffcp-2, 0x1.193ea7aad0308p-1}, + {0x1.ffffffffffffep-2, 0x1.193ea7aad0309p-1}, + {0x1.ffffffffffffbp-1, 0x1.1e9067763b478p+4}, + {0x1.ffffffffffffep-1, 0x1.25e4f7b2737fap+4}, + }; + + for (double[] testCase: testCases) + failures += testAtanhCase(testCase[0], testCase[1]); + + return failures; + } } diff --git a/test/jdk/java/lang/Thread/virtual/stress/ParkAfterTimedPark.java b/test/jdk/java/lang/Thread/virtual/stress/ParkAfterTimedPark.java index 1b173271a79..7dd0ac6e5a2 100644 --- a/test/jdk/java/lang/Thread/virtual/stress/ParkAfterTimedPark.java +++ b/test/jdk/java/lang/Thread/virtual/stress/ParkAfterTimedPark.java @@ -53,7 +53,7 @@ public class ParkAfterTimedPark { for (int i = 1; i <= iterations; i++) { System.out.println(Instant.now() + " => " + i + " of " + iterations); for (int timeout = 1; timeout <= 10; timeout++) { - test(timeout, true); + test(timeout, pinned); } } } diff --git a/test/jdk/java/lang/constant/ClassDescTest.java b/test/jdk/java/lang/constant/ClassDescTest.java index ee76d27e8d0..7551edff11a 100644 --- a/test/jdk/java/lang/constant/ClassDescTest.java +++ b/test/jdk/java/lang/constant/ClassDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,23 +31,17 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.*; /* * @test * @bug 8215510 8283075 8338544 * @compile ClassDescTest.java - * @run testng ClassDescTest + * @run junit ClassDescTest * @summary unit tests for java.lang.constant.ClassDesc */ -@Test public class ClassDescTest extends SymbolicDescTest { private void testClassDesc(ClassDesc r) throws ReflectiveOperationException { @@ -73,7 +67,7 @@ public class ClassDescTest extends SymbolicDescTest { } if (!r.isClassOrInterface()) { - assertEquals(r.packageName(), ""); + assertEquals("", r.packageName()); } } @@ -97,18 +91,19 @@ public class ClassDescTest extends SymbolicDescTest { private void testClassDesc(ClassDesc r, Class c) throws ReflectiveOperationException { testClassDesc(r); - assertEquals(r.resolveConstantDesc(LOOKUP), c); - assertEquals(c.describeConstable().orElseThrow(), r); - assertEquals(ClassDesc.ofDescriptor(c.descriptorString()), r); + assertEquals(c, r.resolveConstantDesc(LOOKUP)); + assertEquals(r, c.describeConstable().orElseThrow()); + assertEquals(r, ClassDesc.ofDescriptor(c.descriptorString())); if (r.isArray()) { testClassDesc(r.componentType(), c.componentType()); } if (r.isClassOrInterface()) { - assertEquals(r.packageName(), c.getPackageName()); + assertEquals(c.getPackageName(), r.packageName()); } - assertEquals(r.displayName(), classDisplayName(c)); + assertEquals(classDisplayName(c), r.displayName()); } + @Test public void testSymbolicDescsConstants() throws ReflectiveOperationException { int tested = 0; Field[] fields = ConstantDescs.class.getDeclaredFields(); @@ -132,6 +127,7 @@ public class ClassDescTest extends SymbolicDescTest { assertTrue(tested > 0); } + @Test public void testPrimitiveClassDesc() throws ReflectiveOperationException { for (Primitives p : Primitives.values()) { List descs = List.of(ClassDesc.ofDescriptor(p.descriptor), @@ -140,26 +136,27 @@ public class ClassDescTest extends SymbolicDescTest { for (ClassDesc c : descs) { testClassDesc(c, p.clazz); assertTrue(c.isPrimitive()); - assertEquals(p.descriptor, c.descriptorString()); - assertEquals(p.name, c.displayName()); - descs.forEach(cc -> assertEquals(c, cc)); + assertEquals(c.descriptorString(), p.descriptor); + assertEquals(c.displayName(), p.name); + descs.forEach(cc -> assertEquals(cc, c)); if (p != Primitives.VOID) { testClassDesc(c.arrayType(), p.arrayClass); - assertEquals(c, p.arrayClass.describeConstable().orElseThrow().componentType()); - assertEquals(c, p.classDesc.arrayType().componentType()); + assertEquals(p.arrayClass.describeConstable().orElseThrow().componentType(), c); + assertEquals(p.classDesc.arrayType().componentType(), c); } } for (Primitives other : Primitives.values()) { ClassDesc otherDescr = ClassDesc.ofDescriptor(other.descriptor); if (p != other) - descs.forEach(c -> assertNotEquals(c, otherDescr)); + descs.forEach(c -> assertNotEquals(otherDescr, c)); else - descs.forEach(c -> assertEquals(c, otherDescr)); + descs.forEach(c -> assertEquals(otherDescr, c)); } } } + @Test public void testSimpleClassDesc() throws ReflectiveOperationException { List stringClassDescs = Arrays.asList(ClassDesc.ofDescriptor("Ljava/lang/String;"), @@ -175,22 +172,23 @@ public class ClassDescTest extends SymbolicDescTest { assertEquals("String", r.displayName()); testClassDesc(r.arrayType(), String[].class); testClassDesc(r.arrayType(3), String[][][].class); - stringClassDescs.forEach(rr -> assertEquals(r, rr)); + stringClassDescs.forEach(rr -> assertEquals(rr, r)); } testClassDesc(ClassDesc.of("java.lang.String").arrayType(), String[].class); testClassDesc(ClassDesc.of("java.util.Map").nested("Entry"), Map.Entry.class); - assertEquals(ClassDesc.of("java.lang.String"), ClassDesc.ofDescriptor("Ljava/lang/String;")); - assertEquals(ClassDesc.of("java.lang.String"), ClassDesc.ofInternalName("java/lang/String")); + assertEquals(ClassDesc.ofDescriptor("Ljava/lang/String;"), ClassDesc.of("java.lang.String")); + assertEquals(ClassDesc.ofInternalName("java/lang/String"), ClassDesc.of("java.lang.String")); ClassDesc thisClassDesc = ClassDesc.ofDescriptor("LClassDescTest;"); - assertEquals(thisClassDesc, ClassDesc.of("", "ClassDescTest")); - assertEquals(thisClassDesc, ClassDesc.of("ClassDescTest")); - assertEquals(thisClassDesc.displayName(), "ClassDescTest"); + assertEquals(ClassDesc.of("", "ClassDescTest"), thisClassDesc); + assertEquals(ClassDesc.of("ClassDescTest"), thisClassDesc); + assertEquals("ClassDescTest", thisClassDesc.displayName()); testClassDesc(thisClassDesc, ClassDescTest.class); } + @Test public void testPackageName() { assertEquals("com.foo", ClassDesc.of("com.foo.Bar").packageName()); assertEquals("com.foo", ClassDesc.of("com.foo.Bar").nested("Baz").packageName()); @@ -205,33 +203,19 @@ public class ClassDescTest extends SymbolicDescTest { } private void testBadArrayRank(ClassDesc cr) { - try { - cr.arrayType(-1); - fail(""); - } catch (IllegalArgumentException e) { - // good - } - try { - cr.arrayType(0); - fail(""); - } catch (IllegalArgumentException e) { - // good - } + assertThrows(IllegalArgumentException.class, () -> cr.arrayType(-1)); + assertThrows(IllegalArgumentException.class, () -> cr.arrayType(0)); } private void testArrayRankOverflow() { ClassDesc TwoDArrayDesc = String.class.describeConstable().get().arrayType().arrayType(); - try { - TwoDArrayDesc.arrayType(Integer.MAX_VALUE); - fail(""); - } catch (IllegalArgumentException iae) { - // Expected - } + assertThrows(IllegalArgumentException.class, () -> TwoDArrayDesc.arrayType(Integer.MAX_VALUE)); } + @Test public void testArrayClassDesc() throws ReflectiveOperationException { for (String d : basicDescs) { ClassDesc a0 = ClassDesc.ofDescriptor(d); @@ -246,36 +230,32 @@ public class ClassDescTest extends SymbolicDescTest { assertTrue(a2.isArray()); assertFalse(a1.isPrimitive()); assertFalse(a2.isPrimitive()); - assertEquals(a0.descriptorString(), d); - assertEquals(a1.descriptorString(), "[" + a0.descriptorString()); - assertEquals(a2.descriptorString(), "[[" + a0.descriptorString()); + assertEquals(d, a0.descriptorString()); + assertEquals("[" + a0.descriptorString(), a1.descriptorString()); + assertEquals("[[" + a0.descriptorString(), a2.descriptorString()); assertNull(a0.componentType()); - assertEquals(a0, a1.componentType()); - assertEquals(a1, a2.componentType()); + assertEquals(a1.componentType(), a0); + assertEquals(a2.componentType(), a1); - assertNotEquals(a0, a1); - assertNotEquals(a1, a2); + assertNotEquals(a1, a0); + assertNotEquals(a2, a1); - assertEquals(a1, ClassDesc.ofDescriptor("[" + d)); - assertEquals(a2, ClassDesc.ofDescriptor("[[" + d)); - assertEquals(classToDescriptor(a0.resolveConstantDesc(LOOKUP)), a0.descriptorString()); - assertEquals(classToDescriptor(a1.resolveConstantDesc(LOOKUP)), a1.descriptorString()); - assertEquals(classToDescriptor(a2.resolveConstantDesc(LOOKUP)), a2.descriptorString()); + assertEquals(ClassDesc.ofDescriptor("[" + d), a1); + assertEquals(ClassDesc.ofDescriptor("[[" + d), a2); + assertEquals(a0.descriptorString(), classToDescriptor(a0.resolveConstantDesc(LOOKUP))); + assertEquals(a1.descriptorString(), classToDescriptor(a1.resolveConstantDesc(LOOKUP))); + assertEquals(a2.descriptorString(), classToDescriptor(a2.resolveConstantDesc(LOOKUP))); testBadArrayRank(ConstantDescs.CD_int); testBadArrayRank(ConstantDescs.CD_String); testBadArrayRank(ClassDesc.of("Bar")); testArrayRankOverflow(); } - try { - ConstantDescs.CD_void.arrayType(); - fail("Should throw IAE"); - } catch (IllegalArgumentException iae) { - // Expected - } + assertThrows(IllegalArgumentException.class, () -> ConstantDescs.CD_void.arrayType()); } + @Test public void testBadClassDescs() { List badDescriptors = List.of("II", "I;", "Q", "L", "", "java.lang.String", "[]", "Ljava/lang/String", @@ -283,35 +263,19 @@ public class ClassDescTest extends SymbolicDescTest { "La//b;", "L/a;", "La/;"); for (String d : badDescriptors) { - try { - ClassDesc constant = ClassDesc.ofDescriptor(d); - fail(d); - } - catch (IllegalArgumentException e) { - // good - } + assertThrows(IllegalArgumentException.class, () -> ClassDesc.ofDescriptor(d), d); } List badBinaryNames = List.of("I;", "[]", "Ljava/lang/String", "Ljava.lang.String;", "java/lang/String", ""); for (String d : badBinaryNames) { - try { - ClassDesc constant = ClassDesc.of(d); - fail(d); - } catch (IllegalArgumentException e) { - // good - } + assertThrows(IllegalArgumentException.class, () -> ClassDesc.of(d), d); } List badInternalNames = List.of("I;", "[]", "[Ljava/lang/String;", "Ljava.lang.String;", "java.lang.String", ""); for (String d : badInternalNames) { - try { - ClassDesc constant = ClassDesc.ofInternalName(d); - fail(d); - } catch (IllegalArgumentException e) { - // good - } + assertThrows(IllegalArgumentException.class, () -> ClassDesc.ofInternalName(d), d); } for (Primitives p : Primitives.values()) { @@ -321,80 +285,48 @@ public class ClassDescTest extends SymbolicDescTest { ClassDesc stringDesc = ClassDesc.ofDescriptor("Ljava/lang/String;"); ClassDesc stringArrDesc = stringDesc.arrayType(255); - try { - ClassDesc arrGreaterThan255 = stringArrDesc.arrayType(); - fail("can't create an array type descriptor with more than 255 dimensions"); - } catch (IllegalStateException e) { - // good - } - String descWith255ArrayDims = new String(new char[255]).replace('\0', '['); - try { - ClassDesc arrGreaterThan255 = ClassDesc.ofDescriptor(descWith255ArrayDims + "[Ljava/lang/String;"); - fail("can't create an array type descriptor with more than 255 dimensions"); - } catch (IllegalArgumentException e) { - // good - } - try { - ClassDesc arrWith255Dims = ClassDesc.ofDescriptor(descWith255ArrayDims + "Ljava/lang/String;"); - arrWith255Dims.arrayType(1); - fail("can't create an array type descriptor with more than 255 dimensions"); - } catch (IllegalArgumentException e) { - // good - } + assertThrows(IllegalStateException.class, () -> stringArrDesc.arrayType(), + "can't create an array type descriptor with more than 255 dimensions"); + String descWith255ArrayDims = "[".repeat(255); + assertThrows(IllegalArgumentException.class, () -> ClassDesc.ofDescriptor(descWith255ArrayDims + "[Ljava/lang/String;"), + "can't create an array type descriptor with more than 255 dimensions"); + ClassDesc arrWith255Dims = ClassDesc.ofDescriptor(descWith255ArrayDims + "Ljava/lang/String;"); + assertThrows(IllegalArgumentException.class, () -> arrWith255Dims.arrayType(1), + "can't create an array type descriptor with more than 255 dimensions"); } private void testBadNestedClasses(ClassDesc cr, String firstNestedName, String... moreNestedNames) { - try { - cr.nested(firstNestedName, moreNestedNames); - fail(""); - } catch (IllegalStateException e) { - // good - } + assertThrows(IllegalStateException.class, () -> cr.nested(firstNestedName, moreNestedNames)); } + @Test public void testLangClasses() { Double d = 1.0; - assertEquals(d.resolveConstantDesc(LOOKUP), d); - assertEquals(d.describeConstable().get(), d); + assertEquals(d, d.resolveConstantDesc(LOOKUP)); + assertEquals(d, d.describeConstable().get()); Integer i = 1; - assertEquals(i.resolveConstantDesc(LOOKUP), i); - assertEquals(i.describeConstable().get(), i); + assertEquals(i, i.resolveConstantDesc(LOOKUP)); + assertEquals(i, i.describeConstable().get()); Float f = 1.0f; - assertEquals(f.resolveConstantDesc(LOOKUP), f); - assertEquals(f.describeConstable().get(), f); + assertEquals(f, f.resolveConstantDesc(LOOKUP)); + assertEquals(f, f.describeConstable().get()); Long l = 1L; - assertEquals(l.resolveConstantDesc(LOOKUP), l); - assertEquals(l.describeConstable().get(), l); + assertEquals(l, l.resolveConstantDesc(LOOKUP)); + assertEquals(l, l.describeConstable().get()); String s = ""; - assertEquals(s.resolveConstantDesc(LOOKUP), s); - assertEquals(s.describeConstable().get(), s); + assertEquals(s, s.resolveConstantDesc(LOOKUP)); + assertEquals(s, s.describeConstable().get()); } + @Test public void testNullNestedClasses() { ClassDesc cd = ClassDesc.of("Bar"); - try { - cd.nested(null); - fail(""); - } catch (NullPointerException e) { - // good - } - - try { - cd.nested("good", null); - fail(""); - } catch (NullPointerException e) { - // good - } - - try { - cd.nested("good", "goodToo", null); - fail(""); - } catch (NullPointerException e) { - // good - } + assertThrows(NullPointerException.class, () -> cd.nested(null)); + assertThrows(NullPointerException.class, () -> cd.nested("good", null)); + assertThrows(NullPointerException.class, () -> cd.nested("good", "goodToo", null)); } } diff --git a/test/jdk/java/lang/constant/CondyDescTest.java b/test/jdk/java/lang/constant/CondyDescTest.java index 08350f7748c..194c12527a2 100644 --- a/test/jdk/java/lang/constant/CondyDescTest.java +++ b/test/jdk/java/lang/constant/CondyDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,52 +33,50 @@ import java.lang.constant.DirectMethodHandleDesc; import java.lang.constant.DynamicConstantDesc; import java.lang.constant.MethodHandleDesc; -import org.testng.annotations.Test; - import static java.lang.constant.ConstantDescs.CD_MethodHandle; import static java.lang.constant.ConstantDescs.CD_Object; import static java.lang.constant.ConstantDescs.CD_String; import static java.lang.constant.ConstantDescs.CD_VarHandle; import static java.lang.constant.ConstantDescs.CD_int; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNotSame; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; /* * @test * @compile CondyDescTest.java - * @run testng CondyDescTest + * @run junit CondyDescTest * @summary unit tests for java.lang.constant.CondyDescTest */ -@Test public class CondyDescTest extends SymbolicDescTest { private final static ConstantDesc[] EMPTY_ARGS = new ConstantDesc[0]; private final static ClassDesc CD_ConstantBootstraps = ClassDesc.of("java.lang.invoke.ConstantBootstraps"); private static void testDCR(DynamicConstantDesc r, T c) throws ReflectiveOperationException { - assertEquals(r, DynamicConstantDesc.ofNamed(r.bootstrapMethod(), r.constantName(), r.constantType(), r.bootstrapArgs())); - assertEquals(r.resolveConstantDesc(LOOKUP), c); + assertEquals(DynamicConstantDesc.ofNamed(r.bootstrapMethod(), r.constantName(), r.constantType(), r.bootstrapArgs()), r); + assertEquals(c, r.resolveConstantDesc(LOOKUP)); } private void testVarHandleDesc(DynamicConstantDesc r, VarHandle vh) throws ReflectiveOperationException { testSymbolicDesc(r); - assertEquals(vh.describeConstable().orElseThrow(), r); + assertEquals(r, vh.describeConstable().orElseThrow()); } private static> void testEnumDesc(EnumDesc r, E e) throws ReflectiveOperationException { testSymbolicDesc(r); - assertEquals(r, EnumDesc.of(r.constantType(), r.constantName())); - assertEquals(r.resolveConstantDesc(LOOKUP), e); + assertEquals(EnumDesc.of(r.constantType(), r.constantName()), r); + assertEquals(e, r.resolveConstantDesc(LOOKUP)); } + @Test public void testNullConstant() throws ReflectiveOperationException { DynamicConstantDesc r = (DynamicConstantDesc) ConstantDescs.NULL; - assertEquals(r, DynamicConstantDesc.ofNamed(r.bootstrapMethod(), r.constantName(), r.constantType(), r.bootstrapArgs())); + assertEquals(DynamicConstantDesc.ofNamed(r.bootstrapMethod(), r.constantName(), r.constantType(), r.bootstrapArgs()), r); assertNull(r.resolveConstantDesc(LOOKUP)); } @@ -86,6 +84,7 @@ public class CondyDescTest extends SymbolicDescTest { return a + b; } + @Test public void testDynamicConstant() throws ReflectiveOperationException { DirectMethodHandleDesc bsmDesc = ConstantDescs.ofConstantBootstrap(ClassDesc.of("CondyDescTest"), "concatBSM", CD_String, CD_String, CD_String); @@ -93,6 +92,7 @@ public class CondyDescTest extends SymbolicDescTest { testDCR(r, "foobar"); } + @Test public void testNested() throws Throwable { DirectMethodHandleDesc invoker = ConstantDescs.ofConstantBootstrap(CD_ConstantBootstraps, "invoke", CD_Object, CD_MethodHandle, CD_Object.arrayType()); DirectMethodHandleDesc format = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.STATIC, CD_String, "format", @@ -101,7 +101,7 @@ public class CondyDescTest extends SymbolicDescTest { String s = (String) invoker.resolveConstantDesc(LOOKUP) .invoke(LOOKUP, "", String.class, format.resolveConstantDesc(LOOKUP), "%s%s", "moo", "cow"); - assertEquals(s, "moocow"); + assertEquals("moocow", s); DynamicConstantDesc desc = DynamicConstantDesc.of(invoker, format, "%s%s", "moo", "cow"); testDCR(desc, "moocow"); @@ -112,6 +112,7 @@ public class CondyDescTest extends SymbolicDescTest { enum MyEnum { A, B, C } + @Test public void testEnumDesc() throws ReflectiveOperationException { ClassDesc enumClass = ClassDesc.of("CondyDescTest").nested("MyEnum"); @@ -131,6 +132,7 @@ public class CondyDescTest extends SymbolicDescTest { int f; } + @Test public void testVarHandles() throws ReflectiveOperationException { ClassDesc testClass = ClassDesc.of("CondyDescTest").nested("MyClass"); MyClass instance = new MyClass(); @@ -140,20 +142,20 @@ public class CondyDescTest extends SymbolicDescTest { VarHandle varHandle = LOOKUP.findStaticVarHandle(MyClass.class, "sf", int.class); testVarHandleDesc(vhc, varHandle); - assertEquals(varHandle.varType(), int.class); + assertEquals(int.class, varHandle.varType()); varHandle.set(8); assertEquals(8, (int) varHandle.get()); - assertEquals(MyClass.sf, 8); + assertEquals(8, MyClass.sf); // static varHandle vhc = VarHandleDesc.ofField(testClass, "f", CD_int); varHandle = LOOKUP.findVarHandle(MyClass.class, "f", int.class); testVarHandleDesc(vhc, varHandle); - assertEquals(varHandle.varType(), int.class); + assertEquals(int.class, varHandle.varType()); varHandle.set(instance, 9); assertEquals(9, (int) varHandle.get(instance)); - assertEquals(instance.f, 9); + assertEquals(9, instance.f); vhc = VarHandleDesc.ofArray(CD_int.arrayType()); varHandle = MethodHandles.arrayElementVarHandle(int[].class); @@ -215,6 +217,7 @@ public class CondyDescTest extends SymbolicDescTest { } } + @Test public void testLifting() { DynamicConstantDesc unliftedNull = DynamicConstantDesc.ofNamed(ConstantDescs.BSM_NULL_CONSTANT, "_", CD_Object, EMPTY_ARGS); assertEquals(ConstantDescs.NULL, unliftedNull); diff --git a/test/jdk/java/lang/constant/ConstantDescsTest.java b/test/jdk/java/lang/constant/ConstantDescsTest.java index 9b0e73868b9..0d7a85f5425 100644 --- a/test/jdk/java/lang/constant/ConstantDescsTest.java +++ b/test/jdk/java/lang/constant/ConstantDescsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,9 +21,6 @@ * questions. */ -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; - import java.lang.constant.ClassDesc; import java.lang.constant.ConstantDesc; import java.lang.constant.ConstantDescs; @@ -47,18 +44,20 @@ import java.util.Set; import java.util.stream.Stream; import static java.lang.constant.ConstantDescs.*; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @compile ConstantDescsTest.java - * @run testng ConstantDescsTest + * @run junit ConstantDescsTest * @summary unit tests for java.lang.constant.ConstantDescs */ public class ConstantDescsTest { - @DataProvider(name = "validateFields") - public Object[][] knownFieldsData() { + public static Object[][] knownFieldsData() { return new Object[][]{ {CD_Object, Object.class}, {CD_String, String.class}, @@ -117,10 +116,11 @@ public class ConstantDescsTest { * constants. * @throws ReflectiveOperationException if the test fails */ - @Test(dataProvider = "validateFields") + @ParameterizedTest + @MethodSource("knownFieldsData") public void validateFields(ConstantDesc desc, Object value) throws ReflectiveOperationException { // Use a minimally-trusted lookup - assertEquals(desc.resolveConstantDesc(MethodHandles.publicLookup()), value); + assertEquals(value, desc.resolveConstantDesc(MethodHandles.publicLookup())); } /** diff --git a/test/jdk/java/lang/constant/boottest/java.base/jdk/internal/constant/ConstantUtilsTest.java b/test/jdk/java/lang/constant/ConstantUtilsTest.java similarity index 65% rename from test/jdk/java/lang/constant/boottest/java.base/jdk/internal/constant/ConstantUtilsTest.java rename to test/jdk/java/lang/constant/ConstantUtilsTest.java index 3afcc64bc4a..c614132c7e5 100644 --- a/test/jdk/java/lang/constant/boottest/java.base/jdk/internal/constant/ConstantUtilsTest.java +++ b/test/jdk/java/lang/constant/ConstantUtilsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,55 +21,41 @@ * questions. */ -package jdk.internal.constant; - import java.lang.constant.*; import java.util.*; -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.*; -import static org.testng.Assert.*; +import jdk.internal.constant.ConstantAccess; +import jdk.internal.constant.ConstantUtils; +import org.junit.jupiter.api.Test; -/** +/* * @test * @bug 8303930 + * @build java.base/jdk.internal.constant.* * @compile ConstantUtilsTest.java * @modules java.base/jdk.internal.constant - * @run testng ConstantUtilsTest + * @run junit ConstantUtilsTest * @summary unit tests for methods of java.lang.constant.ConstantUtils that are not covered by other unit tests */ -@Test public class ConstantUtilsTest { private static ClassDesc thisClass = ClassDesc.of("MethodHandleDescTest"); + @Test public void testValidateMemberName() { - try { - ConstantUtils.validateMemberName(null, false); - fail(""); - } catch (NullPointerException e) { - // good - } - - try { - ConstantUtils.validateMemberName("", false); - fail(""); - } catch (IllegalArgumentException e) { - // good - } + assertThrows(NullPointerException.class, () -> ConstantUtils.validateMemberName(null, false)); + assertThrows(IllegalArgumentException.class, () -> ConstantUtils.validateMemberName("", false)); List badNames = List.of(".", ";", "[", "/", "<", ">"); for (String n : badNames) { - try { - ConstantUtils.validateMemberName(n, true); - fail(n); - } catch (IllegalArgumentException e) { - // good - } + assertThrows(IllegalArgumentException.class, () -> ConstantUtils.validateMemberName(n, true), n); } } + @Test public void testSkipOverFieldSignatureVoid() { - int ret = ConstantUtils.skipOverFieldSignature("(V)V", 1, 4); - assertEquals(ret, 0, "Descriptor of (V)V starting at index 1, void disallowed"); + int ret = ConstantAccess.skipOverFieldSignature("(V)V", 1, 4); + assertEquals(0, ret, "Descriptor of (V)V starting at index 1, void disallowed"); } } diff --git a/test/jdk/java/lang/constant/DescribeResolveTest.java b/test/jdk/java/lang/constant/DescribeResolveTest.java index cc2a36dd3e2..7a9a11e64d0 100644 --- a/test/jdk/java/lang/constant/DescribeResolveTest.java +++ b/test/jdk/java/lang/constant/DescribeResolveTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,21 +23,19 @@ /* * @test - * @run testng DescribeResolveTest + * @run junit DescribeResolveTest */ -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; - import java.lang.constant.Constable; import java.lang.constant.ConstantDesc; import java.lang.invoke.MethodHandles; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class DescribeResolveTest { - @DataProvider public static Object[][] constables() { return new Object[][]{ { true }, @@ -48,7 +46,8 @@ public class DescribeResolveTest { }; } - @Test(dataProvider = "constables") + @ParameterizedTest + @MethodSource("constables") public void testDescribeResolve(Constable constable) throws ReflectiveOperationException { ConstantDesc desc = constable.describeConstable().orElseThrow(); Object resolved = desc.resolveConstantDesc(MethodHandles.lookup()); diff --git a/test/jdk/java/lang/constant/DynamicCallSiteDescTest.java b/test/jdk/java/lang/constant/DynamicCallSiteDescTest.java index 6f5e04efeb0..14d5fadbf01 100644 --- a/test/jdk/java/lang/constant/DynamicCallSiteDescTest.java +++ b/test/jdk/java/lang/constant/DynamicCallSiteDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,109 +21,71 @@ * questions. */ -import java.lang.invoke.MethodType; import java.lang.constant.*; -import java.util.Arrays; -import java.util.List; -import java.util.stream.IntStream; -import java.util.stream.Stream; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; -import static java.lang.constant.ConstantDescs.CD_int; -import static java.lang.constant.ConstantDescs.CD_void; -import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.*; -/** +/* * @test * @compile DynamicCallSiteDescTest.java - * @run testng DynamicCallSiteDescTest + * @run junit DynamicCallSiteDescTest * @summary unit tests for java.lang.constant.DynamicCallSiteDesc */ -@Test public class DynamicCallSiteDescTest extends SymbolicDescTest { /* note there is no unit test for method resolveCallSiteDesc as it is being tested in another test in this * suite, IndyDescTest */ + @Test public void testOf() throws ReflectiveOperationException { DirectMethodHandleDesc dmh = ConstantDescs.ofCallsiteBootstrap( ClassDesc.of("BootstrapAndTarget"), "bootstrap", ClassDesc.of("java.lang.invoke.CallSite") ); - try { - DynamicCallSiteDesc.of( - dmh, - "", - MethodTypeDesc.ofDescriptor("()I") - ); - fail("IllegalArgumentException expected"); - } catch (IllegalArgumentException iae) { - // good - } + assertThrows(IllegalArgumentException.class, () -> DynamicCallSiteDesc.of( + dmh, + "", + MethodTypeDesc.ofDescriptor("()I") + )); - try { - DynamicCallSiteDesc.of( - null, - "getTarget", - MethodTypeDesc.ofDescriptor("()I") - ); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } + assertThrows(NullPointerException.class, () -> DynamicCallSiteDesc.of( + null, + "getTarget", + MethodTypeDesc.ofDescriptor("()I") + )); - try { - DynamicCallSiteDesc.of( - dmh, - null, - MethodTypeDesc.ofDescriptor("()I") - ); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } + assertThrows(NullPointerException.class, () -> DynamicCallSiteDesc.of( + dmh, + null, + MethodTypeDesc.ofDescriptor("()I") + )); - try { - DynamicCallSiteDesc.of( - dmh, - "getTarget", - null - ); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } + assertThrows(NullPointerException.class, () -> DynamicCallSiteDesc.of( + dmh, + "getTarget", + null + )); - try { - DynamicCallSiteDesc.of( - dmh, - "getTarget", - MethodTypeDesc.ofDescriptor("()I"), - null - ); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } - try { - DynamicCallSiteDesc.of( - dmh, - "getTarget", - MethodTypeDesc.ofDescriptor("()I"), - new ConstantDesc[]{ null } - ); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } + assertThrows(NullPointerException.class, () -> DynamicCallSiteDesc.of( + dmh, + "getTarget", + MethodTypeDesc.ofDescriptor("()I"), + null + )); + + assertThrows(NullPointerException.class, () -> DynamicCallSiteDesc.of( + dmh, + "getTarget", + MethodTypeDesc.ofDescriptor("()I"), + new ConstantDesc[]{ null } + )); } + @Test public void testWithArgs() throws ReflectiveOperationException { DynamicCallSiteDesc desc = DynamicCallSiteDesc.of(ConstantDescs.ofCallsiteBootstrap( ClassDesc.of("BootstrapAndTarget"), @@ -134,21 +96,11 @@ public class DynamicCallSiteDescTest extends SymbolicDescTest { MethodTypeDesc.ofDescriptor("()I") ); - try { - desc.withArgs(null); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } - - try { - desc.withArgs(new ConstantDesc[]{ null }); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } + assertThrows(NullPointerException.class, () -> desc.withArgs(null)); + assertThrows(NullPointerException.class, () -> desc.withArgs(new ConstantDesc[]{ null })); } + @Test public void testWithNameAndType() throws ReflectiveOperationException { DynamicCallSiteDesc desc = DynamicCallSiteDesc.of(ConstantDescs.ofCallsiteBootstrap( ClassDesc.of("BootstrapAndTarget"), @@ -159,21 +111,11 @@ public class DynamicCallSiteDescTest extends SymbolicDescTest { MethodTypeDesc.ofDescriptor("()I") ); - try { - desc.withNameAndType(null, MethodTypeDesc.ofDescriptor("()I")); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } - - try { - desc.withNameAndType("bootstrap", null); - fail("NullPointerException expected"); - } catch (NullPointerException npe) { - // good - } + assertThrows(NullPointerException.class, () -> desc.withNameAndType(null, MethodTypeDesc.ofDescriptor("()I"))); + assertThrows(NullPointerException.class, () -> desc.withNameAndType("bootstrap", null)); } + @Test public void testAccessorsAndFactories() throws ReflectiveOperationException { DynamicCallSiteDesc desc = DynamicCallSiteDesc.of(ConstantDescs.ofCallsiteBootstrap( ClassDesc.of("BootstrapAndTarget"), diff --git a/test/jdk/java/lang/constant/IndyDescTest.java b/test/jdk/java/lang/constant/IndyDescTest.java index 13862fecd0b..9d635c0eb08 100644 --- a/test/jdk/java/lang/constant/IndyDescTest.java +++ b/test/jdk/java/lang/constant/IndyDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,19 +32,19 @@ import java.lang.constant.DynamicCallSiteDesc; import java.lang.constant.MethodHandleDesc; import java.lang.constant.MethodTypeDesc; -import org.testng.annotations.Test; import static java.lang.constant.ConstantDescs.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import org.junit.jupiter.api.Test; -/** +/* * @test * @compile IndyDescTest.java - * @run testng IndyDescTest + * @run junit IndyDescTest * @summary unit tests for java.lang.constant.IndyDescTest */ -@Test public class IndyDescTest { public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type, Object... args) { @@ -54,6 +54,7 @@ public class IndyDescTest { return new ConstantCallSite(MethodHandles.constant(String.class, (String) args[0])); } + @Test public void testIndyDesc() throws Throwable { ClassDesc c = ClassDesc.of("IndyDescTest"); MethodTypeDesc mt = MethodTypeDesc.of(CD_CallSite, CD_MethodHandles_Lookup, CD_String, CD_MethodType, CD_Object.arrayType()); @@ -96,6 +97,7 @@ public class IndyDescTest { assertEquals("foo", csd5.invocationName()); } + @Test public void testEqualsHashToString() throws Throwable { ClassDesc c = ClassDesc.of("IndyDescTest"); MethodTypeDesc mt = MethodTypeDesc.of(CD_CallSite, CD_MethodHandles_Lookup, CD_String, CD_MethodType, CD_Object.arrayType()); @@ -109,14 +111,14 @@ public class IndyDescTest { assertNotEquals(csd1, csd3); assertNotEquals(csd1.hashCode(), csd3.hashCode()); - assertEquals(csd1.toString(), "DynamicCallSiteDesc[IndyDescTest::bootstrap(wooga/):()String]"); + assertEquals("DynamicCallSiteDesc[IndyDescTest::bootstrap(wooga/):()String]", csd1.toString()); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test public void testEmptyInvocationName() throws Throwable { ClassDesc c = ClassDesc.of("IndyDescTest"); MethodTypeDesc mt = MethodTypeDesc.of(CD_CallSite, CD_MethodHandles_Lookup, CD_String, CD_MethodType, CD_Object.arrayType()); DirectMethodHandleDesc mh = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.STATIC, c, "bootstrap", mt); - DynamicCallSiteDesc csd1 = DynamicCallSiteDesc.of(mh, "", MethodTypeDesc.of(CD_String)); + Assertions.assertThrows(IllegalArgumentException.class, () -> DynamicCallSiteDesc.of(mh, "", MethodTypeDesc.of(CD_String))); } } diff --git a/test/jdk/java/lang/constant/MethodHandleDescTest.java b/test/jdk/java/lang/constant/MethodHandleDescTest.java index e8b66daa6b7..68d9dad045b 100644 --- a/test/jdk/java/lang/constant/MethodHandleDescTest.java +++ b/test/jdk/java/lang/constant/MethodHandleDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -37,7 +37,6 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Supplier; -import org.testng.annotations.Test; import static java.lang.constant.ConstantDescs.CD_Void; import static java.lang.constant.ConstantDescs.CD_boolean; @@ -54,20 +53,16 @@ import static java.lang.constant.ConstantDescs.CD_String; import static java.lang.constant.ConstantDescs.CD_int; import static java.lang.constant.ConstantDescs.CD_void; import static java.lang.invoke.MethodHandleInfo.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNotSame; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import org.junit.jupiter.api.Test; -/** +import static org.junit.jupiter.api.Assertions.*; + +/* * @test * @compile MethodHandleDescTest.java - * @run testng MethodHandleDescTest + * @run junit MethodHandleDescTest * @summary unit tests for java.lang.constant.MethodHandleDesc */ -@Test public class MethodHandleDescTest extends SymbolicDescTest { private static ClassDesc helperHolderClass = ClassDesc.of("TestHelpers"); private static ClassDesc testClass = helperHolderClass.nested("TestClass"); @@ -75,13 +70,13 @@ public class MethodHandleDescTest extends SymbolicDescTest { private static ClassDesc testSuperclass = helperHolderClass.nested("TestSuperclass"); - private static void assertMHEquals(MethodHandle a, MethodHandle b) { - MethodHandleInfo ia = LOOKUP.revealDirect(a); - MethodHandleInfo ib = LOOKUP.revealDirect(b); - assertEquals(ia.getDeclaringClass(), ib.getDeclaringClass()); - assertEquals(ia.getName(), ib.getName()); - assertEquals(ia.getMethodType(), ib.getMethodType()); - assertEquals(ia.getReferenceKind(), ib.getReferenceKind()); + private static void assertMHEquals(MethodHandle expected, MethodHandle actual) { + MethodHandleInfo expectedInfo = LOOKUP.revealDirect(expected); + MethodHandleInfo actualInfo = LOOKUP.revealDirect(actual); + assertEquals(expectedInfo.getDeclaringClass(), actualInfo.getDeclaringClass()); + assertEquals(expectedInfo.getName(), actualInfo.getName()); + assertEquals(expectedInfo.getMethodType(), actualInfo.getMethodType()); + assertEquals(expectedInfo.getReferenceKind(), actualInfo.getReferenceKind()); } private void testMethodHandleDesc(MethodHandleDesc r) throws ReflectiveOperationException { @@ -89,8 +84,8 @@ public class MethodHandleDescTest extends SymbolicDescTest { testSymbolicDesc(r); DirectMethodHandleDesc rr = (DirectMethodHandleDesc) r; - assertEquals(r, MethodHandleDesc.of(rr.kind(), rr.owner(), rr.methodName(), rr.lookupDescriptor())); - assertEquals(r.invocationType().resolveConstantDesc(LOOKUP), r.resolveConstantDesc(LOOKUP).type()); + assertEquals(MethodHandleDesc.of(rr.kind(), rr.owner(), rr.methodName(), rr.lookupDescriptor()), r); + assertEquals(r.resolveConstantDesc(LOOKUP).type(), r.invocationType().resolveConstantDesc(LOOKUP)); } else { testSymbolicDescForwardOnly(r); @@ -114,19 +109,20 @@ public class MethodHandleDescTest extends SymbolicDescTest { private void testMethodHandleDesc(MethodHandleDesc r, MethodHandle mh) throws ReflectiveOperationException { testMethodHandleDesc(r); - assertMHEquals(r.resolveConstantDesc(LOOKUP), mh); - assertEquals(mh.describeConstable().orElseThrow(), r); + assertMHEquals(mh, r.resolveConstantDesc(LOOKUP)); + assertEquals(r, mh.describeConstable().orElseThrow()); // compare extractable properties: refKind, owner, name, type MethodHandleInfo mhi = LOOKUP.revealDirect(mh); DirectMethodHandleDesc rr = (DirectMethodHandleDesc) r; - assertEquals(mhi.getDeclaringClass().descriptorString(), rr.owner().descriptorString()); - assertEquals(mhi.getName(), rr.methodName()); - assertEquals(mhi.getReferenceKind(), rr.kind().refKind); + assertEquals(rr.owner().descriptorString(), mhi.getDeclaringClass().descriptorString()); + assertEquals(rr.methodName(), mhi.getName()); + assertEquals(rr.kind().refKind, mhi.getReferenceKind()); MethodType type = mhi.getMethodType(); - assertEquals(type.toMethodDescriptorString(), lookupDescriptor(rr)); + assertEquals(lookupDescriptor(rr), type.toMethodDescriptorString()); } + @Test public void testSimpleMHs() throws ReflectiveOperationException { MethodHandle MH_String_isEmpty = LOOKUP.findVirtual(String.class, "isEmpty", MethodType.fromMethodDescriptorString("()Z", null)); testMethodHandleDesc(MethodHandleDesc.of(Kind.VIRTUAL, CD_String, "isEmpty", "()Z"), MH_String_isEmpty); @@ -147,33 +143,16 @@ public class MethodHandleDescTest extends SymbolicDescTest { MH_ArrayList_new); testMethodHandleDesc(MethodHandleDesc.ofConstructor(ClassDesc.of("java.util.ArrayList")), MH_ArrayList_new); - // bad constructor non void return type - try { - MethodHandleDesc.of(Kind.CONSTRUCTOR, ClassDesc.of("java.util.ArrayList"), "", "()I"); - fail("should have failed: non void return type for constructor"); - } catch (IllegalArgumentException ex) { - // good - } + assertThrows(IllegalArgumentException.class, () -> MethodHandleDesc.of(Kind.CONSTRUCTOR, ClassDesc.of("java.util.ArrayList"), "", "()I"), + "bad constructor non void return type"); + assertThrows(NullPointerException.class, () -> MethodHandleDesc.ofConstructor(ClassDesc.of("java.util.ArrayList", null)), + "null list of parameters"); - // null list of parameters - try { - MethodHandleDesc.ofConstructor(ClassDesc.of("java.util.ArrayList", null)); - fail("should have failed: null list of parameters"); - } catch (NullPointerException ex) { - // good - } - - // null elements in list of parameters - try { - ClassDesc[] paramList = new ClassDesc[1]; - paramList[0] = null; - MethodHandleDesc.ofConstructor(ClassDesc.of("java.util.ArrayList"), paramList); - fail("should have failed: null content in list of parameters"); - } catch (NullPointerException ex) { - // good - } + assertThrows(NullPointerException.class, () -> MethodHandleDesc.ofConstructor(ClassDesc.of("java.util.ArrayList"), new ClassDesc[] { null }), + "null elements in list of parameters"); } + @Test public void testAsType() throws Throwable { MethodHandleDesc mhr = MethodHandleDesc.ofMethod(Kind.STATIC, ClassDesc.of("java.lang.Integer"), "valueOf", MethodTypeDesc.of(CD_Integer, CD_int)); @@ -181,41 +160,33 @@ public class MethodHandleDescTest extends SymbolicDescTest { testMethodHandleDesc(takesInteger); MethodHandle mh1 = takesInteger.resolveConstantDesc(LOOKUP); assertEquals((Integer) 3, (Integer) mh1.invokeExact((Integer) 3)); - assertEquals(takesInteger.toString(), "MethodHandleDesc[STATIC/Integer::valueOf(int)Integer].asType(Integer)Integer"); + assertEquals("MethodHandleDesc[STATIC/Integer::valueOf(int)Integer].asType(Integer)Integer", takesInteger.toString()); - try { - Integer i = (Integer) mh1.invokeExact(3); - fail("Expected WMTE"); - } - catch (WrongMethodTypeException ignored) { } + assertThrows(WrongMethodTypeException.class, () -> { + Integer _ = (Integer) mh1.invokeExact(3); + }); MethodHandleDesc takesInt = takesInteger.asType(MethodTypeDesc.of(CD_Integer, CD_int)); testMethodHandleDesc(takesInt); MethodHandle mh2 = takesInt.resolveConstantDesc(LOOKUP); assertEquals((Integer) 3, (Integer) mh2.invokeExact(3)); - try { - Integer i = (Integer) mh2.invokeExact((Integer) 3); - fail("Expected WMTE"); - } - catch (WrongMethodTypeException ignored) { } + assertThrows(WrongMethodTypeException.class, () -> { + Integer _ = (Integer) mh2.invokeExact((Integer) 3); + }); // Short circuit optimization MethodHandleDesc same = mhr.asType(mhr.invocationType()); assertSame(mhr, same); - try { - mhr.asType(null); - fail("Expected NPE"); - } catch (NullPointerException ex) { - // good - } + assertThrows(NullPointerException.class, () -> mhr.asType(null)); // @@@ Test varargs adaptation // @@@ Test bad adaptations and assert runtime error on resolution // @@@ Test intrinsification of adapted MH } + @Test public void testMethodHandleDesc() throws Throwable { MethodHandleDesc ctorDesc = MethodHandleDesc.of(Kind.CONSTRUCTOR, testClass, "", "()V"); MethodHandleDesc staticMethodDesc = MethodHandleDesc.of(Kind.STATIC, testClass, "sm", "(I)I"); @@ -229,14 +200,14 @@ public class MethodHandleDescTest extends SymbolicDescTest { MethodHandleDesc privateStaticMethodDesc = MethodHandleDesc.of(Kind.STATIC, testClass, "psm", "(I)I"); MethodHandleDesc privateStaticIMethodDesc = MethodHandleDesc.of(Kind.INTERFACE_STATIC, testInterface, "psm", "(I)I"); - assertEquals(ctorDesc.invocationType(), MethodTypeDesc.of(testClass)); - assertEquals(((DirectMethodHandleDesc) ctorDesc).lookupDescriptor(), "()V"); + assertEquals(MethodTypeDesc.of(testClass), ctorDesc.invocationType()); + assertEquals("()V", ((DirectMethodHandleDesc) ctorDesc).lookupDescriptor()); - assertEquals(staticMethodDesc.invocationType().descriptorString(), "(I)I"); - assertEquals(((DirectMethodHandleDesc) staticMethodDesc).lookupDescriptor(), "(I)I"); + assertEquals("(I)I", staticMethodDesc.invocationType().descriptorString()); + assertEquals("(I)I", ((DirectMethodHandleDesc) staticMethodDesc).lookupDescriptor()); - assertEquals(instanceMethodDesc.invocationType().descriptorString(), "(" + testClass.descriptorString() + "I)I"); - assertEquals(((DirectMethodHandleDesc) instanceMethodDesc).lookupDescriptor(), "(I)I"); + assertEquals("(" + testClass.descriptorString() + "I)I", instanceMethodDesc.invocationType().descriptorString()); + assertEquals("(I)I", ((DirectMethodHandleDesc) instanceMethodDesc).lookupDescriptor()); for (MethodHandleDesc r : List.of(ctorDesc, staticMethodDesc, staticIMethodDesc, instanceMethodDesc, instanceIMethodDesc)) testMethodHandleDesc(r); @@ -257,29 +228,23 @@ public class MethodHandleDescTest extends SymbolicDescTest { assertEquals(5, (int) instanceIMethodDesc.resolveConstantDesc(LOOKUP).invokeExact(instanceI, 5)); assertEquals(5, (int) instanceIMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instanceI, 5)); - try { superMethodDesc.resolveConstantDesc(LOOKUP); fail(); } - catch (IllegalAccessException e) { /* expected */ } + assertThrows(IllegalAccessException.class, () -> superMethodDesc.resolveConstantDesc(LOOKUP)); assertEquals(-1, (int) superMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance, 5)); - try { superIMethodDesc.resolveConstantDesc(LOOKUP); fail(); } - catch (IllegalAccessException e) { /* expected */ } + assertThrows(IllegalAccessException.class, () -> superIMethodDesc.resolveConstantDesc(LOOKUP)); assertEquals(0, (int) superIMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance, 5)); - try { privateMethodDesc.resolveConstantDesc(LOOKUP); fail(); } - catch (IllegalAccessException e) { /* expected */ } + assertThrows(IllegalAccessException.class, () -> privateMethodDesc.resolveConstantDesc(LOOKUP)); assertEquals(5, (int) privateMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance, 5)); - try { privateIMethodDesc.resolveConstantDesc(LOOKUP); fail(); } - catch (IllegalAccessException e) { /* expected */ } + assertThrows(IllegalAccessException.class, () -> privateIMethodDesc.resolveConstantDesc(LOOKUP)); assertEquals(0, (int) privateIMethodDesc.resolveConstantDesc(TestHelpers.TestInterface.LOOKUP).invokeExact(instanceI, 5)); assertEquals(0, (int) privateIMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invoke(instanceI, 5)); - try { privateStaticMethodDesc.resolveConstantDesc(LOOKUP); fail(); } - catch (IllegalAccessException e) { /* expected */ } + assertThrows(IllegalAccessException.class, () -> privateStaticMethodDesc.resolveConstantDesc(LOOKUP)); assertEquals(5, (int) privateStaticMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(5)); - try { privateStaticIMethodDesc.resolveConstantDesc(LOOKUP); fail(); } - catch (IllegalAccessException e) { /* expected */ } + assertThrows(IllegalAccessException.class, () -> privateStaticIMethodDesc.resolveConstantDesc(LOOKUP)); assertEquals(0, (int) privateStaticIMethodDesc.resolveConstantDesc(TestHelpers.TestInterface.LOOKUP).invokeExact(5)); assertEquals(0, (int) privateStaticIMethodDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(5)); @@ -292,34 +257,29 @@ public class MethodHandleDescTest extends SymbolicDescTest { for (MethodHandleDesc r : List.of(staticSetterDesc, staticGetterDesc, staticGetterIDesc, setterDesc, getterDesc)) testMethodHandleDesc(r); - staticSetterDesc.resolveConstantDesc(LOOKUP).invokeExact(6); assertEquals(TestHelpers.TestClass.sf, 6); + staticSetterDesc.resolveConstantDesc(LOOKUP).invokeExact(6); assertEquals(6, TestHelpers.TestClass.sf); assertEquals(6, (int) staticGetterDesc.resolveConstantDesc(LOOKUP).invokeExact()); assertEquals(6, (int) staticGetterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact()); - staticSetterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(7); assertEquals(TestHelpers.TestClass.sf, 7); + staticSetterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(7); assertEquals(7, TestHelpers.TestClass.sf); assertEquals(7, (int) staticGetterDesc.resolveConstantDesc(LOOKUP).invokeExact()); assertEquals(7, (int) staticGetterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact()); assertEquals(3, (int) staticGetterIDesc.resolveConstantDesc(LOOKUP).invokeExact()); assertEquals(3, (int) staticGetterIDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact()); - setterDesc.resolveConstantDesc(LOOKUP).invokeExact(instance, 6); assertEquals(instance.f, 6); + setterDesc.resolveConstantDesc(LOOKUP).invokeExact(instance, 6); assertEquals(6, instance.f); assertEquals(6, (int) getterDesc.resolveConstantDesc(LOOKUP).invokeExact(instance)); assertEquals(6, (int) getterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance)); - setterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance, 7); assertEquals(instance.f, 7); + setterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance, 7); assertEquals(7, instance.f); assertEquals(7, (int) getterDesc.resolveConstantDesc(LOOKUP).invokeExact(instance)); assertEquals(7, (int) getterDesc.resolveConstantDesc(TestHelpers.TestClass.LOOKUP).invokeExact(instance)); } private void assertBadArgs(Supplier supplier, String s) { - try { - MethodHandleDesc r = supplier.get(); - fail("Expected failure for " + s); - } - catch (IllegalArgumentException e) { - // succeed - } + assertThrows(IllegalArgumentException.class, supplier::get, s); } + @Test public void testBadFieldMHs() { List badGetterDescs = List.of("()V", "(Ljava/lang/Object;)V", "(I)I", "(Ljava/lang/Object;I)I"); List badStaticGetterDescs = List.of("()V", "(Ljava/lang/Object;)I", "(I)I", "(Ljava/lang/Object;I)I"); @@ -332,11 +292,12 @@ public class MethodHandleDescTest extends SymbolicDescTest { badStaticSetterDescs.forEach(s -> assertBadArgs(() -> MethodHandleDesc.of(STATIC_SETTER, helperHolderClass, "x", s), s)); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test public void testBadOwners() { - MethodHandleDesc.ofMethod(VIRTUAL, ClassDesc.ofDescriptor("I"), "x", MethodTypeDesc.ofDescriptor("()I")); + assertThrows(IllegalArgumentException.class, () -> MethodHandleDesc.ofMethod(VIRTUAL, ClassDesc.ofDescriptor("I"), "x", MethodTypeDesc.ofDescriptor("()I"))); } + @Test public void testSymbolicDescsConstants() throws ReflectiveOperationException { int tested = 0; Field[] fields = ConstantDescs.class.getDeclaredFields(); @@ -359,10 +320,11 @@ public class MethodHandleDescTest extends SymbolicDescTest { assertTrue(tested > 0); } + @Test public void testKind() { for (Kind k : Kind.values()) { - assertEquals(Kind.valueOf(k.refKind), Kind.valueOf(k.refKind, k.refKind == MethodHandleInfo.REF_invokeInterface)); - assertEquals(Kind.valueOf(k.refKind, k.isInterface), k); + assertEquals(Kind.valueOf(k.refKind, k.refKind == MethodHandleInfo.REF_invokeInterface), Kind.valueOf(k.refKind)); + assertEquals(k, Kind.valueOf(k.refKind, k.isInterface)); } // let's now verify those cases for which the value of the isInterface parameter is ignored int[] isInterfaceIgnored = new int[] { @@ -374,15 +336,15 @@ public class MethodHandleDescTest extends SymbolicDescTest { REF_invokeInterface }; for (int refKind : isInterfaceIgnored) { - assertEquals(Kind.valueOf(refKind, false), Kind.valueOf(refKind, true)); + assertEquals(Kind.valueOf(refKind, true), Kind.valueOf(refKind, false)); } // some explicit tests for REF_invokeStatic and REF_invokeSpecial - assertNotEquals(Kind.valueOf(REF_invokeStatic, false), Kind.valueOf(REF_invokeStatic, true)); - assertNotEquals(Kind.valueOf(REF_invokeSpecial, false), Kind.valueOf(REF_invokeSpecial, true)); - assertEquals(Kind.valueOf(REF_invokeStatic, false), Kind.STATIC); - assertEquals(Kind.valueOf(REF_invokeStatic, true), Kind.INTERFACE_STATIC); - assertEquals(Kind.valueOf(REF_invokeSpecial, false), Kind.SPECIAL); - assertEquals(Kind.valueOf(REF_invokeSpecial, true), Kind.INTERFACE_SPECIAL); + assertNotEquals(Kind.valueOf(REF_invokeStatic, true), Kind.valueOf(REF_invokeStatic, false)); + assertNotEquals(Kind.valueOf(REF_invokeSpecial, true), Kind.valueOf(REF_invokeSpecial, false)); + assertEquals(Kind.STATIC, Kind.valueOf(REF_invokeStatic, false)); + assertEquals(Kind.INTERFACE_STATIC, Kind.valueOf(REF_invokeStatic, true)); + assertEquals(Kind.SPECIAL, Kind.valueOf(REF_invokeSpecial, false)); + assertEquals(Kind.INTERFACE_SPECIAL, Kind.valueOf(REF_invokeSpecial, true)); } } diff --git a/test/jdk/java/lang/constant/MethodTypeDescTest.java b/test/jdk/java/lang/constant/MethodTypeDescTest.java index 5f7a2fc691f..06a6d5055b8 100644 --- a/test/jdk/java/lang/constant/MethodTypeDescTest.java +++ b/test/jdk/java/lang/constant/MethodTypeDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,21 +32,20 @@ import java.util.List; import java.util.stream.IntStream; import java.util.stream.Stream; -import org.testng.annotations.Test; import static java.lang.constant.ConstantDescs.*; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; -import static org.testng.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; -/** +/* * @test * @bug 8304932 * @compile MethodTypeDescTest.java - * @run testng MethodTypeDescTest + * @run junit MethodTypeDescTest * @summary unit tests for java.lang.constant.MethodTypeDesc */ -@Test public class MethodTypeDescTest extends SymbolicDescTest { private void testMethodTypeDesc(MethodTypeDesc r) throws ReflectiveOperationException { @@ -75,16 +74,16 @@ public class MethodTypeDescTest extends SymbolicDescTest { private void testMethodTypeDesc(MethodTypeDesc r, MethodType mt) throws ReflectiveOperationException { testMethodTypeDesc(r); - assertEquals(r.resolveConstantDesc(LOOKUP), mt); - assertEquals(mt.describeConstable().get(), r); + assertEquals(mt, r.resolveConstantDesc(LOOKUP)); + assertEquals(r, mt.describeConstable().get()); - assertEquals(r.descriptorString(), mt.toMethodDescriptorString()); - assertEquals(r.parameterCount(), mt.parameterCount()); - assertEquals(r.parameterList(), mt.parameterList().stream().map(SymbolicDescTest::classToDesc).collect(toList())); - assertEquals(r.parameterArray(), Stream.of(mt.parameterArray()).map(SymbolicDescTest::classToDesc).toArray(ClassDesc[]::new)); + assertEquals(mt.toMethodDescriptorString(), r.descriptorString()); + assertEquals(mt.parameterCount(), r.parameterCount()); + assertEquals(mt.parameterList().stream().map(SymbolicDescTest::classToDesc).collect(toList()), r.parameterList()); + assertArrayEquals(Stream.of(mt.parameterArray()).map(SymbolicDescTest::classToDesc).toArray(ClassDesc[]::new), r.parameterArray()); for (int i=0; i { - MethodTypeDesc newDesc = mtDesc.changeReturnType(null); - }); + assertThrows(NullPointerException.class, () -> mtDesc.changeReturnType(null)); // changeParamType for (int i=0; i paramTypes[j]) .toArray(ClassDesc[]::new); MethodTypeDesc newDesc = mtDesc.dropParameterTypes(i, i + 1); - assertEquals(newDesc, MethodTypeDesc.of(returnType, ps)); + assertEquals(MethodTypeDesc.of(returnType, ps), newDesc); testMethodTypeDesc(newDesc, mt.dropParameterTypes(i, i+1)); // drop multiple params @@ -147,7 +144,7 @@ public class MethodTypeDescTest extends SymbolicDescTest { var t = new ArrayList<>(Arrays.asList(paramTypes)); t.subList(i, j).clear(); MethodTypeDesc multiDrop = mtDesc.dropParameterTypes(i, j); - assertEquals(multiDrop, MethodTypeDesc.of(returnType, t.toArray(ClassDesc[]::new))); + assertEquals(MethodTypeDesc.of(returnType, t.toArray(ClassDesc[]::new)), multiDrop); testMethodTypeDesc(multiDrop, mt.dropParameterTypes(i, j)); } } @@ -162,7 +159,7 @@ public class MethodTypeDescTest extends SymbolicDescTest { .mapToObj(j -> (j < k) ? paramTypes[j] : (j == k) ? p : paramTypes[j-1]) .toArray(ClassDesc[]::new); MethodTypeDesc newDesc = mtDesc.insertParameterTypes(i, p); - assertEquals(newDesc, MethodTypeDesc.of(returnType, ps)); + assertEquals(MethodTypeDesc.of(returnType, ps), newDesc); testMethodTypeDesc(newDesc, mt.insertParameterTypes(i, p.resolveConstantDesc(LOOKUP))); } @@ -172,7 +169,7 @@ public class MethodTypeDescTest extends SymbolicDescTest { a.addAll(i, Arrays.asList(addition)); MethodTypeDesc newDesc = mtDesc.insertParameterTypes(i, addition); - assertEquals(newDesc, MethodTypeDesc.of(returnType, a.toArray(ClassDesc[]::new))); + assertEquals(MethodTypeDesc.of(returnType, a.toArray(ClassDesc[]::new)), newDesc); testMethodTypeDesc(newDesc, mt.insertParameterTypes(i, Arrays.stream(addition).map(d -> { try { return (Class) d.resolveConstantDesc(LOOKUP); @@ -190,32 +187,28 @@ public class MethodTypeDescTest extends SymbolicDescTest { IntStream.rangeClosed(0, paramDescTypes.length - 1) .mapToObj(i -> ClassDesc.ofDescriptor(paramDescTypes[i])).toArray(ClassDesc[]::new); MethodTypeDesc mtDesc = MethodTypeDesc.of(returnType, paramTypes); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.insertParameterTypes(-1, paramTypes); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.insertParameterTypes(-1, paramTypes)); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.insertParameterTypes(paramTypes.length + 1, paramTypes); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.insertParameterTypes(paramTypes.length + 1, paramTypes)); - expectThrows(IllegalArgumentException.class, () -> { + { ClassDesc[] newParamTypes = new ClassDesc[1]; newParamTypes[0] = CD_void; MethodTypeDesc newDesc = MethodTypeDesc.of(returnType, CD_int); - newDesc = newDesc.insertParameterTypes(0, newParamTypes); - }); + assertThrows(IllegalArgumentException.class, () -> newDesc.insertParameterTypes(0, newParamTypes)); + } - expectThrows(NullPointerException.class, () -> { + { MethodTypeDesc newDesc = MethodTypeDesc.of(returnType, CD_int); - newDesc = newDesc.insertParameterTypes(0, null); - }); + assertThrows(NullPointerException.class, () -> newDesc.insertParameterTypes(0, null)); + } - expectThrows(NullPointerException.class, () -> { + { ClassDesc[] newParamTypes = new ClassDesc[1]; newParamTypes[0] = null; MethodTypeDesc newDesc = MethodTypeDesc.of(returnType, CD_int); - newDesc = newDesc.insertParameterTypes(0, newParamTypes); - }); + assertThrows(NullPointerException.class, () -> newDesc.insertParameterTypes(0, newParamTypes)); + } } private void badDropParametersTypes(ClassDesc returnType, String... paramDescTypes) { @@ -224,27 +217,18 @@ public class MethodTypeDescTest extends SymbolicDescTest { .mapToObj(i -> ClassDesc.ofDescriptor(paramDescTypes[i])).toArray(ClassDesc[]::new); MethodTypeDesc mtDesc = MethodTypeDesc.of(returnType, paramTypes); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.dropParameterTypes(-1, 0); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.dropParameterTypes(-1, 0)); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.dropParameterTypes(paramTypes.length, 0); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.dropParameterTypes(paramTypes.length, 0)); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.dropParameterTypes(paramTypes.length + 1, 0); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.dropParameterTypes(paramTypes.length + 1, 0)); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.dropParameterTypes(0, paramTypes.length + 1); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.dropParameterTypes(0, paramTypes.length + 1)); - expectThrows(IndexOutOfBoundsException.class, () -> { - MethodTypeDesc newDesc = mtDesc.dropParameterTypes(1, 0); - }); + assertThrows(IndexOutOfBoundsException.class, () -> mtDesc.dropParameterTypes(1, 0)); } + @Test public void testMethodTypeDesc() throws ReflectiveOperationException { for (String r : returnDescs) { assertMethodType(ClassDesc.ofDescriptor(r)); @@ -257,6 +241,7 @@ public class MethodTypeDescTest extends SymbolicDescTest { } } + @Test public void testBadMethodTypeRefs() { // ofDescriptor List badDescriptors = List.of("()II", "()I;", "(I;)", "(I)", "()L", "(V)V", @@ -283,29 +268,32 @@ public class MethodTypeDescTest extends SymbolicDescTest { assertThrows(IllegalArgumentException.class, () -> MethodTypeDesc.of(CD_int, List.of(CD_void))); } + @Test public void testOfArrayImmutability() { ClassDesc[] args = {CD_Object, CD_int}; var mtd = MethodTypeDesc.of(CD_void, args); args[1] = CD_void; - assertEquals(mtd, MethodTypeDesc.of(CD_void, CD_Object, CD_int)); + assertEquals(MethodTypeDesc.of(CD_void, CD_Object, CD_int), mtd); mtd.parameterArray()[1] = CD_void; - assertEquals(mtd, MethodTypeDesc.of(CD_void, CD_Object, CD_int)); + assertEquals(MethodTypeDesc.of(CD_void, CD_Object, CD_int), mtd); } + @Test public void testOfListImmutability() { List args = Arrays.asList(CD_Object, CD_int); var mtd = MethodTypeDesc.of(CD_void, args); args.set(1, CD_void); - assertEquals(mtd, MethodTypeDesc.of(CD_void, CD_Object, CD_int)); + assertEquals(MethodTypeDesc.of(CD_void, CD_Object, CD_int), mtd); assertThrows(UnsupportedOperationException.class, () -> mtd.parameterList().set(1, CD_void)); - assertEquals(mtd, MethodTypeDesc.of(CD_void, CD_Object, CD_int)); + assertEquals(MethodTypeDesc.of(CD_void, CD_Object, CD_int), mtd); } + @Test public void testMissingClass() { var mtd = MTD_void.insertParameterTypes(0, ClassDesc.of("does.not.exist.DoesNotExist")); assertThrows(ReflectiveOperationException.class, () -> mtd.resolveConstantDesc(MethodHandles.publicLookup())); diff --git a/test/jdk/java/lang/constant/NameValidationTest.java b/test/jdk/java/lang/constant/NameValidationTest.java index be266129370..96296ce290e 100644 --- a/test/jdk/java/lang/constant/NameValidationTest.java +++ b/test/jdk/java/lang/constant/NameValidationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,26 +21,22 @@ * questions. */ -/** +/* * @test * @bug 8215510 * @compile NameValidationTest.java - * @run testng NameValidationTest + * @run junit NameValidationTest * @summary unit tests for verifying member names */ import java.lang.constant.*; -import java.lang.invoke.*; - -import org.testng.annotations.Test; import static java.lang.constant.DirectMethodHandleDesc.*; import static java.lang.constant.ConstantDescs.*; -import static java.lang.constant.DirectMethodHandleDesc.Kind.VIRTUAL; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Test; -@Test public class NameValidationTest { private static final String[] badMemberNames = new String[] {"xx.xx", "zz;zz", "[l", "aa/aa", ""}; @@ -49,26 +45,17 @@ public class NameValidationTest { private static final String[] badClassNames = new String[] {"zz;zz", "[l", "aa/aa", ".", "a..b"}; private static final String[] goodClassNames = new String[] {"3", "~", "$", "qq", "a.a"}; + @Test public void testMemberNames() { DirectMethodHandleDesc mh = MethodHandleDesc.of(Kind.VIRTUAL, CD_String, "isEmpty", "()Z"); for (String badName : badMemberNames) { - try { - memberNamesHelper(badName, mh, CD_int, null); - fail("Expected failure for name " + badName); - } catch (IllegalArgumentException iae) { - // expected - } - try { - memberNamesHelper(badName, mh, CD_int, new ConstantDesc[0]); - fail("Expected failure for name " + badName); - } catch (IllegalArgumentException iae) { - // expected - } + assertThrows(IllegalArgumentException.class, () -> memberNamesHelper(badName, mh, CD_int, null), badName); + assertThrows(IllegalArgumentException.class, () -> memberNamesHelper(badName, mh, CD_int, new ConstantDesc[0]), badName); } - for (String badName : goodMemberNames) { - memberNamesHelper(badName, mh, CD_int, null); - memberNamesHelper(badName, mh, CD_int, new ConstantDesc[0]); + for (String goodName : goodMemberNames) { + memberNamesHelper(goodName, mh, CD_int, null); + memberNamesHelper(goodName, mh, CD_int, new ConstantDesc[0]); } } @@ -83,14 +70,10 @@ public class NameValidationTest { } } + @Test public void testClassNames() { for (String badName : badClassNames) { - try { - ClassDesc.of(badName); - fail("Expected failure for name " + badName); - } catch (IllegalArgumentException iae) { - // expected - } + assertThrows(IllegalArgumentException.class, () -> ClassDesc.of(badName), badName); } for (String goodName : goodClassNames) { diff --git a/test/jdk/java/lang/constant/SymbolicDescTest.java b/test/jdk/java/lang/constant/SymbolicDescTest.java index 5eb0ca10da6..8d4fcdf6a2c 100644 --- a/test/jdk/java/lang/constant/SymbolicDescTest.java +++ b/test/jdk/java/lang/constant/SymbolicDescTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +32,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Stream; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Base class for XxxDesc tests @@ -106,7 +106,7 @@ public abstract class SymbolicDescTest { if (desc instanceof Constable) { Optional opt = (Optional) ((Constable) desc).describeConstable(); ConstantDesc sr = (ConstantDesc) opt.orElseThrow().resolveConstantDesc(LOOKUP); - assertEquals(sr, desc); + assertEquals(desc, sr); } } } diff --git a/test/jdk/java/lang/constant/TypeDescriptorTest.java b/test/jdk/java/lang/constant/TypeDescriptorTest.java index 9ffbd886f41..9253462e223 100644 --- a/test/jdk/java/lang/constant/TypeDescriptorTest.java +++ b/test/jdk/java/lang/constant/TypeDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,37 +22,35 @@ */ import java.lang.invoke.TypeDescriptor; -import java.lang.constant.ClassDesc; - -import org.testng.annotations.Test; import static java.lang.constant.ConstantDescs.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; -/** +/* * @test * @compile TypeDescriptorTest.java - * @run testng TypeDescriptorTest + * @run junit TypeDescriptorTest * @summary unit tests for implementations of java.lang.invoke.TypeDescriptor */ -@Test public class TypeDescriptorTest { private> void testArray(F f, boolean isArray, F component, F array) { if (isArray) { assertTrue(f.isArray()); - assertEquals(f.arrayType(), array); - assertEquals(f.componentType(), component); + assertEquals(array, f.arrayType()); + assertEquals(component, f.componentType()); } else { assertFalse(f.isArray()); - assertEquals(f.arrayType(), array); + assertEquals(array, f.arrayType()); assertNull(f.componentType()); } } + @Test public void testClass() { testArray(int.class, false, null, int[].class); testArray(int[].class, true, int.class, int[][].class); @@ -67,6 +65,7 @@ public class TypeDescriptorTest { assertFalse(String[].class.isPrimitive()); } + @Test public void testClassDesc() { testArray(CD_int, false, null, CD_int.arrayType()); diff --git a/test/jdk/java/lang/constant/boottest/TEST.properties b/test/jdk/java/lang/constant/boottest/TEST.properties deleted file mode 100644 index 565242e959b..00000000000 --- a/test/jdk/java/lang/constant/boottest/TEST.properties +++ /dev/null @@ -1,4 +0,0 @@ -# This file identifies root(s) of the test-ng hierarchy. - -TestNG.dirs = . -lib.dirs = /lib/testlibrary/bootlib diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWb.java b/test/jdk/java/lang/constant/java.base/jdk/internal/constant/ConstantAccess.java similarity index 62% rename from test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWb.java rename to test/jdk/java/lang/constant/java.base/jdk/internal/constant/ConstantAccess.java index 755d64bf51b..a8d7c2f3f99 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWb.java +++ b/test/jdk/java/lang/constant/java.base/jdk/internal/constant/ConstantAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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 @@ -19,24 +19,12 @@ * 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.constant; -import jdk.test.whitebox.WhiteBox; - -public class SharedStringsWb { - public static void main(String[] args) throws Exception { - WhiteBox wb = WhiteBox.getWhiteBox(); - String s = "shared_test_string_unique_14325"; - s = s.intern(); - if (wb.areSharedStringsMapped()) { - if (wb.isSharedInternedString(s)) { - System.out.println("Found shared string."); - } else { - throw new RuntimeException("String is not shared."); - } - } +// Exposes package-private methods for testing. +public final class ConstantAccess { + public static int skipOverFieldSignature(String descriptor, int start, int end) { + return ConstantUtils.skipOverFieldSignature(descriptor, start, end); } } - - diff --git a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java index de1b22c4075..b093f086ba4 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java +++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2026, 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,18 +35,14 @@ * @test * @bug 4982128 * @summary Test low memory detection of non-heap memory pool - * - * @run main/othervm/timeout=600 -Xnoclassgc -XX:MaxMetaspaceSize=32m - * LowMemoryTest2 - */ - -/* - * @test - * @bug 4982128 - * @summary Test low memory detection of non-heap memory pool - * - * @run main/othervm/timeout=600 -Xnoclassgc -XX:MaxMetaspaceSize=16m - * -XX:CompressedClassSpaceSize=4m LowMemoryTest2 + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm/timeout=600 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xnoclassgc -XX:MaxMetaspaceSize=32m LowMemoryTest2 + * @run main/othervm/timeout=600 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xnoclassgc -XX:MaxMetaspaceSize=16m + * -XX:CompressedClassSpaceSize=4m LowMemoryTest2 */ import java.lang.management.*; @@ -54,6 +50,8 @@ import javax.management.*; import javax.management.openmbean.CompositeData; import java.util.*; +import jdk.test.whitebox.WhiteBox; + public class LowMemoryTest2 { private static volatile boolean listenerInvoked = false; @@ -177,7 +175,7 @@ public class LowMemoryTest2 { // If we don't force a GC we may get an // OutOfMemoryException before the counters are updated. System.out.println("Force GC"); - System.gc(); + WhiteBox.getWhiteBox().fullGC(); } isThresholdCountSet = isAnyThresholdCountSet(pools); } diff --git a/test/jdk/java/lang/management/RuntimeMXBean/InputArgument.java b/test/jdk/java/lang/management/RuntimeMXBean/InputArgument.java index 66c3d3f41f5..0e7609b86ed 100644 --- a/test/jdk/java/lang/management/RuntimeMXBean/InputArgument.java +++ b/test/jdk/java/lang/management/RuntimeMXBean/InputArgument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, 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,41 +62,60 @@ * @run main/othervm -Dprops=something InputArgument -Dprops=something */ +/* + * @test + * @bug 8378110 + * @summary RuntimeMXBean.getInputArguments() handling of flags from settings file. + * + * @run driver InputArgument generateFlagsFile + * @run main/othervm -XX:+UseFastJNIAccessors -XX:Flags=InputArgument.flags InputArgument + * -XX:+UseFastJNIAccessors -XX:-UseG1GC -XX:+UseParallelGC -XX:MaxHeapSize=100M + */ + import java.lang.management.*; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.List; import java.util.ListIterator; public class InputArgument { private static RuntimeMXBean rm = ManagementFactory.getRuntimeMXBean(); - private static String vmOption = null; public static void main(String args[]) throws Exception { - // set the expected input argument - if (args.length > 0) { - vmOption = args[0]; - } - - List options = rm.getInputArguments(); - if (vmOption == null) { + if (args.length == 1 && "generateFlagsFile".equals(args[0])) { + generateFlagsFile(); return; } - boolean testFailed = true; + String[] vmOptions = args; + List options = rm.getInputArguments(); System.out.println("Number of arguments = " + options.size()); int i = 0; for (String arg : options) { System.out.println("Input arg " + i + " = " + arg); i++; - if (arg.equals(vmOption)) { - testFailed = false; - break; - } } - if (testFailed) { - throw new RuntimeException("TEST FAILED: " + - "VM option " + vmOption + " not found"); + + for (String expected : vmOptions) { + boolean found = false; + for (String arg : options) { + if (arg.equals(expected)) { + found = true; + break; + } + } + if (!found) { + throw new RuntimeException("TEST FAILED: " + + "VM option " + expected + " not found"); + } } System.out.println("Test passed."); } + + private static void generateFlagsFile() throws Exception { + // 3 types of flag; both boolean cases and 1 numeric + Files.writeString(Paths.get("", "InputArgument.flags"), + String.format("-UseG1GC%n+UseParallelGC%nMaxHeapSize=100M%n")); + } } diff --git a/test/jdk/java/lang/runtime/ObjectMethodsTest.java b/test/jdk/java/lang/runtime/ObjectMethodsTest.java index 951d3b68383..d7ca5912273 100644 --- a/test/jdk/java/lang/runtime/ObjectMethodsTest.java +++ b/test/jdk/java/lang/runtime/ObjectMethodsTest.java @@ -36,11 +36,11 @@ import java.lang.invoke.MethodType; import java.lang.runtime.ObjectMethods; import static java.lang.invoke.MethodType.methodType; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.*; public class ObjectMethodsTest { @@ -144,8 +144,8 @@ public class ObjectMethodsTest { assertEquals("Empty[]", (String)handle.invokeExact(new Empty())); } - Class NPE = NullPointerException.class; - Class IAE = IllegalArgumentException.class; + private static final Class NPE = NullPointerException.class; + private static final Class IAE = IllegalArgumentException.class; @Test public void exceptions() { @@ -157,25 +157,60 @@ public class ObjectMethodsTest { assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, "toString", C.EQUALS_DESC, C.class, "x;y", C.ACCESSORS)); assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, "hashCode", C.TO_STRING_DESC, C.class, "x;y", C.ACCESSORS)); assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, "equals", C.HASHCODE_DESC, C.class, "x;y", C.ACCESSORS)); + } - record NamePlusType(String mn, MethodType mt) {} - List namePlusTypeList = List.of( + record NamePlusType(String name, MethodType type) {} + + static List namePlusTypeList() { + return List.of( new NamePlusType("toString", C.TO_STRING_DESC), new NamePlusType("equals", C.EQUALS_DESC), new NamePlusType("hashCode", C.HASHCODE_DESC) ); - - for (NamePlusType npt : namePlusTypeList) { - assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), npt.mt(), C.class, "x;y", null)); - assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), npt.mt(), C.class, "x;y", new MethodHandle[]{null})); - assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), npt.mt(), C.class, null, C.ACCESSORS)); - assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), npt.mt(), null, "x;y", C.ACCESSORS)); - assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), null, C.class, "x;y", C.ACCESSORS)); - assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, null, npt.mt(), C.class, "x;y", C.ACCESSORS)); - assertThrows(NPE, () -> ObjectMethods.bootstrap(null, npt.mn(), npt.mt(), C.class, "x;y", C.ACCESSORS)); - } } + @MethodSource("namePlusTypeList") + @ParameterizedTest + void commonExceptions(NamePlusType npt) { + String name = npt.name(); + MethodType type = npt.type(); + + // Null checks + assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, C.class, "x;y", null)); + assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, C.class, "x;y", new MethodHandle[]{null})); + assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, C.class, null, C.ACCESSORS)); + assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, null, "x;y", C.ACCESSORS)); + assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, name, null, C.class, "x;y", C.ACCESSORS)); + assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, null, type, C.class, "x;y", C.ACCESSORS)); + assertThrows(NPE, () -> ObjectMethods.bootstrap(null, name, type, C.class, "x;y", C.ACCESSORS)); + + // Bad indy call receiver type - change C to this test class + assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, name, type.changeParameterType(0, this.getClass()), C.class, "x;y", C.ACCESSORS)); + + // Bad getter types + var wrongReceiverGetter = assertDoesNotThrow(() -> MethodHandles.lookup().findGetter(this.getClass(), "y", int.class)); + assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, C.class, "x;y", + new MethodHandle[]{ + C.ACCESSORS[0], + wrongReceiverGetter, + })); + var extraArgGetter = MethodHandles.dropArguments(C.ACCESSORS[1], 1, int.class); + assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, C.class, "x;y", + new MethodHandle[]{ + C.ACCESSORS[0], + extraArgGetter, + })); + var voidReturnGetter = MethodHandles.empty(MethodType.methodType(void.class, C.class)); + assertThrows(IAE, () -> ObjectMethods.bootstrap(LOOKUP, name, type, C.class, "x;y", + new MethodHandle[]{ + C.ACCESSORS[0], + voidReturnGetter, + })); + } + + // same field name and type as C::y, for wrongReceiverGetter + private int y; + // Based on the ObjectMethods internal implementation private static int hashCombiner(int x, int y) { return x*31 + y; diff --git a/test/jdk/java/net/DatagramSocket/UnreferencedDatagramSockets.java b/test/jdk/java/net/DatagramSocket/UnreferencedDatagramSockets.java index dff8b38d3c1..e5bf0b3822d 100644 --- a/test/jdk/java/net/DatagramSocket/UnreferencedDatagramSockets.java +++ b/test/jdk/java/net/DatagramSocket/UnreferencedDatagramSockets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,11 +21,11 @@ * questions. */ -/** +/* * @test * @library /test/lib * @modules java.management java.base/java.io:+open java.base/java.net:+open - * java.base/sun.net java.base/sun.nio.ch:+open + * java.base/sun.nio.ch:+open * @run main/othervm/timeout=480 UnreferencedDatagramSockets * @run main/othervm/timeout=480 -Djava.net.preferIPv4Stack=true UnreferencedDatagramSockets * @summary Check that unreferenced datagram sockets are closed @@ -41,15 +41,12 @@ import java.io.IOException; import java.lang.reflect.Method; import java.net.DatagramPacket; import java.net.DatagramSocket; -import java.net.DatagramSocketImpl; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.channels.DatagramChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.ArrayDeque; import java.util.List; import java.util.Optional; @@ -59,7 +56,6 @@ import java.util.concurrent.CountDownLatch; import com.sun.management.UnixOperatingSystemMXBean; import jdk.test.lib.net.IPSupport; -import sun.net.NetProperties; public class UnreferencedDatagramSockets { @@ -191,48 +187,27 @@ public class UnreferencedDatagramSockets { : -1L; } - private static boolean usePlainDatagramSocketImpl() { - PrivilegedAction pa = () -> NetProperties.get("jdk.net.usePlainDatagramSocketImpl"); - String s = AccessController.doPrivileged(pa); - return (s != null) && (s.isEmpty() || s.equalsIgnoreCase("true")); - } - // Reflect to find references in the datagram implementation that will be gc'd private static void extractRefs(DatagramSocket s, String name) { try { Field datagramSocketField = DatagramSocket.class.getDeclaredField("delegate"); datagramSocketField.setAccessible(true); - if (!usePlainDatagramSocketImpl()) { - // DatagramSocket using DatagramSocketAdaptor - Object DatagramSocket = datagramSocketField.get(s); - assert DatagramSocket.getClass() == Class.forName("sun.nio.ch.DatagramSocketAdaptor"); + // DatagramSocket using DatagramSocketAdaptor + Object DatagramSocket = datagramSocketField.get(s); + assert DatagramSocket.getClass() == Class.forName("sun.nio.ch.DatagramSocketAdaptor"); - Method m = DatagramSocket.class.getDeclaredMethod("getChannel"); - m.setAccessible(true); - DatagramChannel datagramChannel = (DatagramChannel) m.invoke(DatagramSocket); + Method m = DatagramSocket.class.getDeclaredMethod("getChannel"); + m.setAccessible(true); + DatagramChannel datagramChannel = (DatagramChannel) m.invoke(DatagramSocket); - assert datagramChannel.getClass() == Class.forName("sun.nio.ch.DatagramChannelImpl"); + assert datagramChannel.getClass() == Class.forName("sun.nio.ch.DatagramChannelImpl"); - Field fileDescriptorField = datagramChannel.getClass().getDeclaredField("fd"); - fileDescriptorField.setAccessible(true); - FileDescriptor fileDescriptor = (FileDescriptor) fileDescriptorField.get(datagramChannel); - extractRefs(fileDescriptor, name); + Field fileDescriptorField = datagramChannel.getClass().getDeclaredField("fd"); + fileDescriptorField.setAccessible(true); + FileDescriptor fileDescriptor = (FileDescriptor) fileDescriptorField.get(datagramChannel); + extractRefs(fileDescriptor, name); - } else { - // DatagramSocket using PlainDatagramSocketImpl - Object DatagramSocket = datagramSocketField.get(s); - assert DatagramSocket.getClass() == Class.forName("java.net.NetMulticastSocket"); - - Method m = DatagramSocket.getClass().getDeclaredMethod("getImpl"); - m.setAccessible(true); - DatagramSocketImpl datagramSocketImpl = (DatagramSocketImpl) m.invoke(DatagramSocket); - - Field fileDescriptorField = DatagramSocketImpl.class.getDeclaredField("fd"); - fileDescriptorField.setAccessible(true); - FileDescriptor fileDescriptor = (FileDescriptor) fileDescriptorField.get(datagramSocketImpl); - extractRefs(fileDescriptor, name); - } } catch (Exception ex) { ex.printStackTrace(); throw new AssertionError("missing field", ex); diff --git a/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java b/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java index 2a87207c961..0f4faa4065b 100644 --- a/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java +++ b/test/jdk/java/net/MulticastSocket/UnreferencedMulticastSockets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,11 +21,11 @@ * questions. */ -/** +/* * @test * @library /test/lib * @modules java.management java.base/java.io:+open java.base/java.net:+open - * java.base/sun.net java.base/sun.nio.ch:+open + * java.base/sun.nio.ch:+open * @run main/othervm/timeout=480 -Djava.net.preferIPv4Stack=true UnreferencedMulticastSockets * @run main/othervm/timeout=480 UnreferencedMulticastSockets * @summary Check that unreferenced multicast sockets are closed @@ -41,7 +41,6 @@ import java.io.IOException; import java.lang.reflect.Method; import java.net.DatagramPacket; import java.net.DatagramSocket; -import java.net.DatagramSocketImpl; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.MulticastSocket; @@ -50,8 +49,6 @@ import java.nio.channels.DatagramChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.ArrayDeque; import java.util.List; import java.util.Optional; @@ -61,7 +58,6 @@ import java.util.concurrent.TimeUnit; import jdk.test.lib.net.IPSupport; import com.sun.management.UnixOperatingSystemMXBean; -import sun.net.NetProperties; public class UnreferencedMulticastSockets { @@ -229,12 +225,6 @@ public class UnreferencedMulticastSockets { : -1L; } - private static boolean usePlainDatagramSocketImpl() { - PrivilegedAction pa = () -> NetProperties.get("jdk.net.usePlainDatagramSocketImpl"); - String s = AccessController.doPrivileged(pa); - return (s != null) && (s.isEmpty() || s.equalsIgnoreCase("true")); - } - // Reflect to find references in the datagram implementation that will be gc'd private static void extractRefs(DatagramSocket s, String name) { @@ -242,35 +232,20 @@ public class UnreferencedMulticastSockets { Field datagramSocketField = DatagramSocket.class.getDeclaredField("delegate"); datagramSocketField.setAccessible(true); - if (!usePlainDatagramSocketImpl()) { - // MulticastSocket using DatagramSocketAdaptor - Object MulticastSocket = datagramSocketField.get(s); + // MulticastSocket using DatagramSocketAdaptor + Object MulticastSocket = datagramSocketField.get(s); - Method m = DatagramSocket.class.getDeclaredMethod("getChannel"); - m.setAccessible(true); - DatagramChannel datagramChannel = (DatagramChannel) m.invoke(MulticastSocket); + Method m = DatagramSocket.class.getDeclaredMethod("getChannel"); + m.setAccessible(true); + DatagramChannel datagramChannel = (DatagramChannel) m.invoke(MulticastSocket); - assert datagramChannel.getClass() == Class.forName("sun.nio.ch.DatagramChannelImpl"); + assert datagramChannel.getClass() == Class.forName("sun.nio.ch.DatagramChannelImpl"); - Field fileDescriptorField = datagramChannel.getClass().getDeclaredField("fd"); - fileDescriptorField.setAccessible(true); - FileDescriptor fileDescriptor = (FileDescriptor) fileDescriptorField.get(datagramChannel); - extractRefs(fileDescriptor, name); + Field fileDescriptorField = datagramChannel.getClass().getDeclaredField("fd"); + fileDescriptorField.setAccessible(true); + FileDescriptor fileDescriptor = (FileDescriptor) fileDescriptorField.get(datagramChannel); + extractRefs(fileDescriptor, name); - } else { - // MulticastSocket using PlainDatagramSocketImpl - Object MulticastSocket = datagramSocketField.get(s); - assert MulticastSocket.getClass() == Class.forName("java.net.NetMulticastSocket"); - - Method m = MulticastSocket.getClass().getDeclaredMethod("getImpl"); - m.setAccessible(true); - DatagramSocketImpl datagramSocketImpl = (DatagramSocketImpl) m.invoke(MulticastSocket); - - Field fileDescriptorField = DatagramSocketImpl.class.getDeclaredField("fd"); - fileDescriptorField.setAccessible(true); - FileDescriptor fileDescriptor = (FileDescriptor) fileDescriptorField.get(datagramSocketImpl); - extractRefs(fileDescriptor, name); - } } catch (Exception ex) { ex.printStackTrace(); throw new AssertionError("missing field", ex); diff --git a/test/jdk/java/net/URLClassLoader/HttpTest.java b/test/jdk/java/net/URLClassLoader/HttpTest.java index 620eb34dbaa..09ee6dcfa85 100644 --- a/test/jdk/java/net/URLClassLoader/HttpTest.java +++ b/test/jdk/java/net/URLClassLoader/HttpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2026, 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,233 +24,298 @@ /** * @test * @bug 4636331 + * @modules jdk.httpserver * @library /test/lib - * @summary Check that URLClassLoader doesn't create excessive http - * connections + * @summary Check that URLClassLoader with HTTP paths lookups produce the expected http requests + * @run junit HttpTest */ import java.net.*; import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Consumer; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.URIBuilder; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; public class HttpTest { - /* - * Simple http server to service http requests. Auto shutdown - * if "idle" (no requests) for 10 seconds. Forks worker thread - * to service persistent connections. Work threads shutdown if - * "idle" for 5 seconds. - */ - static class HttpServer implements Runnable { + // HTTP server used to track requests + static HttpServer server; - private static HttpServer svr = null; - private static Counters cnts = null; - private static ServerSocket ss; + // RequestLog for capturing requests + static class RequestLog { + List log = new ArrayList<>(); - private static Object counterLock = new Object(); - private static int getCount = 0; - private static int headCount = 0; - - class Worker extends Thread { - Socket s; - Worker(Socket s) { - this.s = s; - } - - public void run() { - InputStream in = null; - try { - in = s.getInputStream(); - for (;;) { - - // read entire request from client - byte b[] = new byte[1024]; - int n, total=0; - - // max 5 seconds to wait for new request - s.setSoTimeout(5000); - try { - do { - n = in.read(b, total, b.length-total); - // max 0.5 seconds between each segment - // of request. - s.setSoTimeout(500); - if (n > 0) total += n; - } while (n > 0); - } catch (SocketTimeoutException e) { } - - if (total == 0) { - s.close(); - return; - } - - boolean getRequest = false; - if (b[0] == 'G' && b[1] == 'E' && b[2] == 'T') - getRequest = true; - - synchronized (counterLock) { - if (getRequest) - getCount++; - else - headCount++; - } - - // response to client - PrintStream out = new PrintStream( - new BufferedOutputStream( - s.getOutputStream() )); - out.print("HTTP/1.1 200 OK\r\n"); - - out.print("Content-Length: 75000\r\n"); - out.print("\r\n"); - if (getRequest) { - for (int i=0; i<75*1000; i++) { - out.write( (byte)'.' ); - } - } - out.flush(); - - } // for - - } catch (Exception e) { - unexpected(e); - } finally { - if (in != null) { try {in.close(); } catch(IOException e) {unexpected(e);} } - } - } + // Add a request to the log + public synchronized void capture(String method, URI uri) { + log.add(new Request(method, uri)); } - HttpServer() throws Exception { - ss = new ServerSocket(); - ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); + // Clear requests + public synchronized void clear() { + log.clear(); } - public void run() { - try { - // shutdown if no request in 10 seconds. - ss.setSoTimeout(10000); - for (;;) { - Socket s = ss.accept(); - (new Worker(s)).start(); - } - } catch (Exception e) { - } + public synchronized List requests() { + return List.copyOf(log); } - - void unexpected(Exception e) { - System.out.println(e); - e.printStackTrace(); - } - - public static HttpServer create() throws Exception { - if (svr != null) - return svr; - cnts = new Counters(); - svr = new HttpServer(); - (new Thread(svr)).start(); - return svr; - } - - public static void shutdown() throws Exception { - if (svr != null) { - ss.close(); - svr = null; - } - } - - public int port() { - return ss.getLocalPort(); - } - - public static class Counters { - public void reset() { - synchronized (counterLock) { - getCount = 0; - headCount = 0; - } - } - - public int getCount() { - synchronized (counterLock) { - return getCount; - } - } - - public int headCount() { - synchronized (counterLock) { - return headCount; - } - } - - public String toString() { - synchronized (counterLock) { - return "GET count: " + getCount + "; " + - "HEAD count: " + headCount; - } - } - } - - public Counters counters() { - return cnts; - } - } - public static void main(String args[]) throws Exception { - boolean failed = false; + // Represents a single request + record Request(String method, URI path) {} - // create http server - HttpServer svr = HttpServer.create(); + // Request log for this test + static RequestLog log = new RequestLog(); - // create class loader - URL urls[] = { - URIBuilder.newBuilder().scheme("http").loopback().port(svr.port()) - .path("/dir1/").toURL(), - URIBuilder.newBuilder().scheme("http").loopback().port(svr.port()) - .path("/dir2/").toURL(), + // Handlers specific to tests + static Map handlers = new ConcurrentHashMap<>(); + + // URLClassLoader with HTTP URL class path + private static URLClassLoader loader; + + @BeforeAll + static void setup() throws Exception { + server = HttpServer.create(); + server.bind(new InetSocketAddress( + InetAddress.getLoopbackAddress(), 0), 0); + server.createContext("/", e -> { + // Capture request in the log + log.capture(e.getRequestMethod(), e.getRequestURI()); + // Check for custom handler + HttpHandler custom = handlers.get(e.getRequestURI()); + if (custom != null) { + custom.handle(e); + } else { + // Successful responses echo the request path in the body + byte[] response = e.getRequestURI().getPath() + .getBytes(StandardCharsets.UTF_8); + e.sendResponseHeaders(200, response.length); + try (var out = e.getResponseBody()) { + out.write(response); + } + } + e.close(); + }); + server.start(); + int port = server.getAddress().getPort(); + + // Create class loader with two HTTP URLs + URL[] searchPath = new URL[] { + getHttpUri("/dir1/", port), + getHttpUri("/dir2/", port) }; - URLClassLoader cl = new URLClassLoader(urls); + loader = new URLClassLoader(searchPath); + } - // Test 1 - check that getResource does single HEAD request - svr.counters().reset(); - URL url = cl.getResource("foo.gif"); - System.out.println(svr.counters()); + // Create an HTTP URL for the given path and port using the loopback address + private static URL getHttpUri(String path, int port) throws Exception { + return URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(port) + .path(path).toURL(); + } - if (svr.counters().getCount() > 0 || - svr.counters().headCount() > 1) { - failed = true; + // Add redirect handler for a given path + private static void redirect(String path, String target) { + handlers.put(URI.create(path), e -> { + e.getResponseHeaders().set("Location", target); + e.sendResponseHeaders(301, 0); + }); + } + + // Return 404 not found for a given path + private static void notFound(String path) { + handlers.put(URI.create(path), e -> + e.sendResponseHeaders(404, 0)); + } + + @AfterAll + static void shutdown() { + server.stop(2000); + } + + @BeforeEach + void reset() { + synchronized (log) { + log.clear(); + } + handlers.clear(); + } + + // Check that getResource does single HEAD request + @Test + void getResourceSingleHead() { + URL url = loader.getResource("foo.gif"); + // Expect one HEAD + assertRequests(e -> e + .request("HEAD", "/dir1/foo.gif") + ); + } + + // Check that getResource follows redirects + @Test + void getResourceShouldFollowRedirect() { + redirect("/dir1/foo.gif", "/dir1/target.gif"); + URL url = loader.getResource("foo.gif"); + // Expect extra HEAD for redirect target + assertRequests(e -> e + .request("HEAD", "/dir1/foo.gif") + .request("HEAD", "/dir1/target.gif") + ); + + /* + * Note: Long-standing behavior is that URLClassLoader:getResource + * returns a URL for the requested resource, not the location redirected to + */ + assertEquals("/dir1/foo.gif", url.getPath()); + + } + + // Check that getResource treats a redirect to a not-found resource as a not-found resource + @Test + void getResourceRedirectTargetNotFound() { + redirect("/dir1/foo.gif", "/dir1/target.gif"); + notFound("/dir1/target.gif"); + URL url = loader.getResource("foo.gif"); + // Expect extra HEAD for redirect target and next URL in search path + assertRequests(e -> e + .request("HEAD", "/dir1/foo.gif") + .request("HEAD", "/dir1/target.gif") + .request("HEAD", "/dir2/foo.gif") + + ); + // Should find URL for /dir2 + assertEquals("/dir2/foo.gif", url.getPath()); + } + + // Check that getResourceAsStream does one HEAD and one GET request + @Test + void getResourceAsStreamSingleGet() throws IOException { + // Expect content from the first path + try (var in = loader.getResourceAsStream("foo2.gif")) { + assertEquals("/dir1/foo2.gif", + new String(in.readAllBytes(), StandardCharsets.UTF_8)); + } + // Expect one HEAD, one GET + assertRequests( e -> e + .request("HEAD", "/dir1/foo2.gif") + .request("GET", "/dir1/foo2.gif") + ); + } + + // Check that getResourceAsStream follows redirects + @Test + void getResourceAsStreamFollowRedirect() throws IOException { + redirect("/dir1/foo.gif", "/dir1/target.gif"); + // Expect content from the redirected location + try (var in = loader.getResourceAsStream("foo.gif")) { + assertEquals("/dir1/target.gif", + new String(in.readAllBytes(), StandardCharsets.UTF_8)); } - // Test 2 - check that getResourceAsStream does at most - // one GET request - svr.counters().reset(); - InputStream in = cl.getResourceAsStream("foo2.gif"); - in.close(); - System.out.println(svr.counters()); - if (svr.counters().getCount() > 1) { - failed = true; + /* + * Note: Long standing behavior of URLClassLoader::getResourceAsStream + * is to use HEAD during the findResource resource discovery and to not + * "remember" the HEAD redirect location when performing the GET. This + * explains why we observe two redirects here, one for HEAD, one for GET. + */ + assertRequests( e -> e + .request("HEAD", "/dir1/foo.gif") + .request("HEAD", "/dir1/target.gif") + .request("GET", "/dir1/foo.gif") + .request("GET", "/dir1/target.gif") + ); + } + + // getResourceAsStream on a 404 should try next path + @Test + void getResourceTryNextPath() throws IOException { + // Make the first path return 404 + notFound("/dir1/foo.gif"); + // Expect content from the second path + try (var in = loader.getResourceAsStream("foo.gif")) { + assertEquals("/dir2/foo.gif", + new String(in.readAllBytes(), StandardCharsets.UTF_8)); } + // Expect two HEADs, one GET + assertRequests(e -> e + .request("HEAD", "/dir1/foo.gif") + .request("HEAD", "/dir2/foo.gif") + .request("GET", "/dir2/foo.gif") + ); + } - // Test 3 - check that getResources only does HEAD requests - svr.counters().reset(); - Enumeration e = cl.getResources("foos.gif"); - try { - for (;;) { - e.nextElement(); - } - } catch (NoSuchElementException exc) { } - System.out.println(svr.counters()); - if (svr.counters().getCount() > 1) { - failed = true; - } + // Check that getResources only does HEAD requests + @Test + void getResourcesOnlyHead() throws IOException { + Collections.list(loader.getResources("foos.gif")); + // Expect one HEAD for each path + assertRequests(e -> e + .request("HEAD", "/dir1/foos.gif") + .request("HEAD", "/dir2/foos.gif") + ); + } - // shutdown http server - svr.shutdown(); + // Check that getResources skips 404 URL + @Test + void getResourcesShouldSkipFailedHead() throws IOException { + // Make first path fail with 404 + notFound("/dir1/foos.gif"); + List resources = Collections.list(loader.getResources("foos.gif")); + // Expect one HEAD for each path + assertRequests(e -> e + .request("HEAD", "/dir1/foos.gif") + .request("HEAD", "/dir2/foos.gif") + ); - if (failed) { - throw new Exception("Excessive http connections established - Test failed"); + // Expect a single URL to be returned + assertEquals(1, resources.size()); + } + + // Utils for asserting requests + static class Expect { + List requests = new ArrayList<>(); + + Expect request(String method, String path) { + requests.add(new Request(method, URI.create(path))); + return this; } } + static void assertRequests(Consumer e) { + // Collect expected requests + Expect exp = new Expect(); + e.accept(exp); + List expected = exp.requests; + + // Actual requests + List requests = log.requests(); + + // Verify expected number of requests + assertEquals(expected.size(), requests.size(), "Unexpected request count"); + + // Verify expected requests in order + for (int i = 0; i < expected.size(); i++) { + Request ex = expected.get(i); + Request req = requests.get(i); + // Verify method + assertEquals(ex.method, req.method, + String.format("Request %s has unexpected method %s", i, ex.method) + ); + // Verify path + assertEquals(ex.path, req.path, + String.format("Request %s has unexpected request URI %s", i, ex.path) + ); + } + } } diff --git a/test/jdk/java/net/httpclient/AbstractConnectTimeout.java b/test/jdk/java/net/httpclient/AbstractConnectTimeout.java deleted file mode 100644 index 2c490919181..00000000000 --- a/test/jdk/java/net/httpclient/AbstractConnectTimeout.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2018, 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. - */ - -import java.net.ConnectException; -import java.net.InetSocketAddress; -import java.net.NoRouteToHostException; -import java.net.ProxySelector; -import java.net.URI; -import java.net.http.HttpClient; -import java.net.http.HttpClient.Version; -import java.net.http.HttpConnectTimeoutException; -import java.net.http.HttpRequest; -import java.net.http.HttpRequest.BodyPublishers; -import java.net.http.HttpResponse; -import java.net.http.HttpResponse.BodyHandlers; -import java.nio.channels.UnresolvedAddressException; -import java.time.Duration; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.CompletionException; -import org.testng.annotations.DataProvider; -import static java.lang.System.out; -import static java.net.http.HttpClient.Builder.NO_PROXY; -import static java.net.http.HttpClient.Version.HTTP_1_1; -import static java.net.http.HttpClient.Version.HTTP_2; -import static java.time.Duration.*; -import static java.util.concurrent.TimeUnit.NANOSECONDS; -import static org.testng.Assert.fail; - -public abstract class AbstractConnectTimeout { - - static final Duration NO_DURATION = null; - - static List> TIMEOUTS = List.of( - // connectTimeout HttpRequest timeout - Arrays.asList( NO_DURATION, ofMillis(100) ), - Arrays.asList( NO_DURATION, ofNanos(1) ), - - Arrays.asList( ofMillis(100), NO_DURATION ), - Arrays.asList( ofNanos(1), NO_DURATION ), - - Arrays.asList( ofMillis(100), ofMinutes(1) ), - Arrays.asList( ofNanos(1), ofMinutes(1) ) - ); - - static final List METHODS = List.of("GET", "POST"); - static final List VERSIONS = List.of(HTTP_2, HTTP_1_1); - static final List SCHEMES = List.of("https", "http"); - - @DataProvider(name = "variants") - public Object[][] variants() { - List l = new ArrayList<>(); - for (List timeouts : TIMEOUTS) { - Duration connectTimeout = timeouts.get(0); - Duration requestTimeout = timeouts.get(1); - for (String method: METHODS) { - for (String scheme : SCHEMES) { - for (Version requestVersion : VERSIONS) { - l.add(new Object[] {requestVersion, scheme, method, connectTimeout, requestTimeout}); - }}}} - return l.stream().toArray(Object[][]::new); - } - - static final ProxySelector EXAMPLE_DOT_COM_PROXY = ProxySelector.of( - InetSocketAddress.createUnresolved("example.com", 8080)); - - //@Test(dataProvider = "variants") - protected void timeoutNoProxySync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) - throws Exception - { - timeoutSync(requestVersion, scheme, method, connectTimeout, requestTimeout, NO_PROXY); - } - - //@Test(dataProvider = "variants") - protected void timeoutWithProxySync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) - throws Exception - { - timeoutSync(requestVersion, scheme, method, connectTimeout, requestTimeout, EXAMPLE_DOT_COM_PROXY); - } - - private void timeoutSync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout, - ProxySelector proxy) - throws Exception - { - out.printf("%ntimeoutSync(requestVersion=%s, scheme=%s, method=%s," - + " connectTimeout=%s, requestTimeout=%s, proxy=%s)%n", - requestVersion, scheme, method, connectTimeout, requestTimeout, proxy); - - HttpClient client = newClient(connectTimeout, proxy); - HttpRequest request = newRequest(scheme, requestVersion, method, requestTimeout); - - for (int i = 0; i < 2; i++) { - out.printf("iteration %d%n", i); - long startTime = System.nanoTime(); - try { - HttpResponse resp = client.send(request, BodyHandlers.ofString()); - printResponse(resp); - fail("Unexpected response: " + resp); - } catch (HttpConnectTimeoutException expected) { // blocking thread-specific exception - long elapsedTime = NANOSECONDS.toMillis(System.nanoTime() - startTime); - out.printf("Client: received in %d millis%n", elapsedTime); - assertExceptionTypeAndCause(expected.getCause()); - } catch (ConnectException e) { - long elapsedTime = NANOSECONDS.toMillis(System.nanoTime() - startTime); - out.printf("Client: received in %d millis%n", elapsedTime); - Throwable t = e.getCause().getCause(); // blocking thread-specific exception - if (!isAcceptableCause(t)) { // tolerate only NRTHE or UAE - e.printStackTrace(out); - fail("Unexpected exception:" + e); - } else { - out.printf("Caught ConnectException with " - + " cause: %s - skipping%n", t.getCause()); - } - } - } - } - - //@Test(dataProvider = "variants") - protected void timeoutNoProxyAsync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) { - timeoutAsync(requestVersion, scheme, method, connectTimeout, requestTimeout, NO_PROXY); - } - - //@Test(dataProvider = "variants") - protected void timeoutWithProxyAsync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) { - timeoutAsync(requestVersion, scheme, method, connectTimeout, requestTimeout, EXAMPLE_DOT_COM_PROXY); - } - - private void timeoutAsync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout, - ProxySelector proxy) { - out.printf("%ntimeoutAsync(requestVersion=%s, scheme=%s, method=%s, " - + "connectTimeout=%s, requestTimeout=%s, proxy=%s)%n", - requestVersion, scheme, method, connectTimeout, requestTimeout, proxy); - - HttpClient client = newClient(connectTimeout, proxy); - HttpRequest request = newRequest(scheme, requestVersion, method, requestTimeout); - for (int i = 0; i < 2; i++) { - out.printf("iteration %d%n", i); - long startTime = System.nanoTime(); - try { - HttpResponse resp = client.sendAsync(request, BodyHandlers.ofString()).join(); - printResponse(resp); - fail("Unexpected response: " + resp); - } catch (CompletionException e) { - long elapsedTime = NANOSECONDS.toMillis(System.nanoTime() - startTime); - out.printf("Client: received in %d millis%n", elapsedTime); - Throwable t = e.getCause(); - if (t instanceof ConnectException && isAcceptableCause(t.getCause())) { - // tolerate only NRTHE and UAE - out.printf("Caught ConnectException with " - + "cause: %s - skipping%n", t.getCause()); - } else { - assertExceptionTypeAndCause(t); - } - } - } - } - - static boolean isAcceptableCause(Throwable cause) { - if (cause instanceof NoRouteToHostException) return true; - if (cause instanceof UnresolvedAddressException) return true; - return false; - } - - static HttpClient newClient(Duration connectTimeout, ProxySelector proxy) { - HttpClient.Builder builder = HttpClient.newBuilder().proxy(proxy); - if (connectTimeout != NO_DURATION) - builder.connectTimeout(connectTimeout); - return builder.build(); - } - - static HttpRequest newRequest(String scheme, - Version reqVersion, - String method, - Duration requestTimeout) { - // Resolvable address. Most tested environments just ignore the TCP SYN, - // or occasionally return ICMP no route to host - URI uri = URI.create(scheme +"://example.com:81/"); - HttpRequest.Builder reqBuilder = HttpRequest.newBuilder(uri); - reqBuilder = reqBuilder.version(reqVersion); - switch (method) { - case "GET" : reqBuilder.GET(); break; - case "POST" : reqBuilder.POST(BodyPublishers.noBody()); break; - default: throw new AssertionError("Unknown method:" + method); - } - if (requestTimeout != NO_DURATION) - reqBuilder.timeout(requestTimeout); - return reqBuilder.build(); - } - - static void assertExceptionTypeAndCause(Throwable t) { - if (!(t instanceof HttpConnectTimeoutException)) { - t.printStackTrace(out); - fail("Expected HttpConnectTimeoutException, got:" + t); - } - Throwable connEx = t.getCause(); - if (!(connEx instanceof ConnectException)) { - t.printStackTrace(out); - fail("Expected ConnectException cause in:" + connEx); - } - out.printf("Caught expected HttpConnectTimeoutException with ConnectException" - + " cause: %n%s%n%s%n", t, connEx); - final String EXPECTED_MESSAGE = "HTTP connect timed out"; // impl dependent - if (!connEx.getMessage().equals(EXPECTED_MESSAGE)) - fail("Expected: \"" + EXPECTED_MESSAGE + "\", got: \"" + connEx.getMessage() + "\""); - - } - - static void printResponse(HttpResponse response) { - out.println("Unexpected response: " + response); - out.println("Headers: " + response.headers()); - out.println("Body: " + response.body()); - } -} diff --git a/test/jdk/java/net/httpclient/AbstractConnectTimeoutHandshake.java b/test/jdk/java/net/httpclient/AbstractConnectTimeoutHandshake.java index 3febe7145b4..d60fe4f8bcd 100644 --- a/test/jdk/java/net/httpclient/AbstractConnectTimeoutHandshake.java +++ b/test/jdk/java/net/httpclient/AbstractConnectTimeoutHandshake.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,24 +46,24 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import jdk.test.lib.net.URIBuilder; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.time.Duration.*; import static java.util.concurrent.TimeUnit.NANOSECONDS; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; abstract class AbstractConnectTimeoutHandshake { // The number of iterations each testXXXClient performs. static final int TIMES = 2; - Server server; - URI httpsURI; + private static Server server; + private static URI httpsURI; static final Duration NO_DURATION = null; @@ -79,8 +79,7 @@ abstract class AbstractConnectTimeoutHandshake { static final List METHODS = List.of("GET" , "POST"); static final List VERSIONS = List.of(HTTP_2, HTTP_1_1); - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { List l = new ArrayList<>(); for (List timeouts : TIMEOUTS) { Duration connectTimeout = timeouts.get(0); @@ -198,8 +197,8 @@ abstract class AbstractConnectTimeoutHandshake { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { server = new Server(); httpsURI = URIBuilder.newBuilder() .scheme("https") @@ -210,8 +209,8 @@ abstract class AbstractConnectTimeoutHandshake { out.println("HTTPS URI: " + httpsURI); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { server.close(); out.printf("%n--- teardown ---%n"); diff --git a/test/jdk/java/net/httpclient/AbstractNoBody.java b/test/jdk/java/net/httpclient/AbstractNoBody.java index d0908a6e4cd..43847a2eda1 100644 --- a/test/jdk/java/net/httpclient/AbstractNoBody.java +++ b/test/jdk/java/net/httpclient/AbstractNoBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,6 @@ import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; import static java.lang.System.err; import static java.lang.System.out; @@ -49,8 +46,16 @@ import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.assertEquals; +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; + +// Use TestInstance.Lifecycle.PER_CLASS because we need access +// to this.getClass() in methods that are called from +// @BeforeAll and @AfterAll +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class AbstractNoBody implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); @@ -76,7 +81,6 @@ public abstract class AbstractNoBody implements HttpServerAdapters { // a shared executor helps reduce the amount of threads created by the test static final ExecutorService executor = Executors.newFixedThreadPool(ITERATION_COUNT * 2); static final ExecutorService serverExecutor = Executors.newFixedThreadPool(ITERATION_COUNT * 4); - static final AtomicLong serverCount = new AtomicLong(); static final AtomicLong clientCount = new AtomicLong(); static final long start = System.nanoTime(); public static String now() { @@ -87,7 +91,6 @@ public abstract class AbstractNoBody implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - @DataProvider(name = "variants") public Object[][] variants() { return new Object[][]{ { http3URI_fixed, false,}, @@ -145,8 +148,8 @@ public abstract class AbstractNoBody implements HttpServerAdapters { var request = newRequestBuilder(http3URI_head) .HEAD().version(HTTP_2).build(); var response = client.send(request, BodyHandlers.ofString()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_2); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_2, response.version()); out.println("\n" + now() + "--- HEAD request succeeded ----\n"); err.println("\n" + now() + "--- HEAD request succeeded ----\n"); return response; @@ -182,7 +185,7 @@ public abstract class AbstractNoBody implements HttpServerAdapters { } } - @BeforeTest + @BeforeAll public void setup() throws Exception { printStamp(START, "setup"); HttpServerAdapters.enableServerLogging(); @@ -252,7 +255,7 @@ public abstract class AbstractNoBody implements HttpServerAdapters { printStamp(END,"setup"); } - @AfterTest + @AfterAll public void teardown() throws Exception { printStamp(START, "teardown"); sharedClient.close(); diff --git a/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java b/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java index ddd9c52fc58..1e8bc461d7f 100644 --- a/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java +++ b/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ */ -/** +/* * This is not a test. Actual tests are implemented by concrete subclasses. * The abstract class AbstractThrowingPushPromises provides a base framework * to test what happens when push promise handlers and their @@ -62,7 +62,6 @@ import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.PushPromiseHandler; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -104,7 +103,6 @@ import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.extension.TestWatcher; -@TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class AbstractThrowingPushPromises implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); @@ -193,14 +191,9 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters @AfterAll - static final void printFailedTests() { + static void printFailedTests() { out.println("\n========================="); try { - // Exceptions should already have been added to FAILURES - // var failed = context.getFailedTests().getAllResults().stream() - // .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - // FAILURES.putAll(failed); - out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); if (FAILURES.isEmpty()) return; @@ -339,7 +332,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters HttpRequest req = request(uri); BodyHandler> handler = - new ThrowingBodyHandler((w) -> {}, + new ThrowingBodyHandler<>((w) -> {}, BodyHandlers.ofLines()); Map>>> pushPromises = new ConcurrentHashMap<>(); @@ -387,9 +380,9 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters } // @Test(dataProvider = "variants") - protected void testThrowingAsStringImpl(String uri, - boolean sameClient, - Thrower thrower) + void testThrowingAsStringImpl(String uri, + boolean sameClient, + Thrower thrower) throws Exception { String test = format("testThrowingAsString(%s, %b, %s)", @@ -399,7 +392,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters } //@Test(dataProvider = "variants") - protected void testThrowingAsLinesImpl(String uri, + void testThrowingAsLinesImpl(String uri, boolean sameClient, Thrower thrower) throws Exception @@ -411,9 +404,9 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters } //@Test(dataProvider = "variants") - protected void testThrowingAsInputStreamImpl(String uri, - boolean sameClient, - Thrower thrower) + void testThrowingAsInputStreamImpl(String uri, + boolean sameClient, + Thrower thrower) throws Exception { String test = format("testThrowingAsInputStream(%s, %b, %s)", @@ -424,7 +417,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters private void testThrowing(String name, String uri, boolean sameClient, Supplier> handlers, - Finisher finisher, Thrower thrower) + Finisher finisher, Thrower thrower) throws Exception { out.printf("%n%s%s%n", now(), name); @@ -438,7 +431,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters private void testThrowing(String uri, boolean sameClient, Supplier> handlers, - Finisher finisher, Thrower thrower) + Finisher finisher, Thrower thrower) throws Exception { HttpClient client = null; @@ -452,7 +445,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters ConcurrentMap>> promiseMap = new ConcurrentHashMap<>(); Supplier> throwing = () -> - new ThrowingBodyHandler(where.select(thrower), handlers.get()); + new ThrowingBodyHandler<>(where.select(thrower), handlers.get()); PushPromiseHandler pushHandler = new ThrowingPromiseHandler<>( where.select(thrower), PushPromiseHandler.of((r) -> throwing.get(), promiseMap)); @@ -540,7 +533,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters return check(w, reqURI, resp, thrower, promises, extractor); } - private final List check(Where w, URI reqURI, + private List check(Where w, URI reqURI, HttpResponse resp, Thrower thrower, Map>> promises, @@ -697,7 +690,7 @@ public abstract class AbstractThrowingPushPromises implements HttpServerAdapters public BodySubscriber apply(HttpResponse.ResponseInfo rinfo) { throwing.accept(Where.BODY_HANDLER); BodySubscriber subscriber = bodyHandler.apply(rinfo); - return new ThrowingBodySubscriber(throwing, subscriber); + return new ThrowingBodySubscriber<>(throwing, subscriber); } } diff --git a/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java b/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java index 608b6489181..175e860c229 100644 --- a/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java +++ b/test/jdk/java/net/httpclient/AggregateRequestBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * ReferenceTracker AggregateRequestBodyTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,headers,frames * AggregateRequestBodyTest * @summary Tests HttpRequest.BodyPublishers::concat @@ -41,7 +41,6 @@ import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -70,40 +69,43 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; -import org.testng.Assert; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.expectThrows; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class AggregateRequestBodyTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer http1TestServer; // HTTP/1.1 ( http ) - HttpTestServer https1TestServer; // HTTPS/1.1 ( https ) - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - URI http1URI; - URI https1URI; - URI http2URI; - URI https2URI; - URI http3URI; + private static HttpTestServer http1TestServer; // HTTP/1.1 ( http ) + private static HttpTestServer https1TestServer; // HTTPS/1.1 ( https ) + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static URI http1URI; + private static URI https1URI; + private static URI http2URI; + private static URI https2URI; + private static URI http3URI; static final int RESPONSE_CODE = 200; static final int ITERATION_COUNT = 4; @@ -123,8 +125,8 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -150,40 +152,40 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { - var failed = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - FAILURES.putAll(failed); - out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); if (FAILURES.isEmpty()) return; @@ -201,7 +203,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { } } - private URI[] uris() { + private static URI[] uris() { return new URI[] { http1URI, https1URI, @@ -211,13 +213,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { }; } - static AtomicLong URICOUNT = new AtomicLong(); - - @DataProvider(name = "variants") - public Object[][] variants(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] variants() { URI[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -285,8 +281,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { return s; } - @DataProvider(name = "sparseContent") - Object[][] nulls() { + static Object[][] nulls() { return new Object[][] { {"null array", null}, {"null element", strings((String)null)}, @@ -304,8 +299,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { .collect(Collectors.toList()); } - @DataProvider(name = "contentLengths") - Object[][] contentLengths() { + static Object[][] contentLengths() { return new Object[][] { {-1, lengths(-1)}, {-42, lengths(-42)}, @@ -332,8 +326,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { }; } - @DataProvider(name="negativeRequests") - Object[][] negativeRequests() { + static Object[][] negativeRequests() { return new Object[][] { {0L}, {-1L}, {-2L}, {Long.MIN_VALUE + 1L}, {Long.MIN_VALUE} }; @@ -492,31 +485,33 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { () -> new AssertionError("Should not happen!")); } - @Test(dataProvider = "sparseContent") // checks that NPE is thrown + @ParameterizedTest // checks that NPE is thrown + @MethodSource("nulls") public void testNullPointerException(String description, String[] content) { - checkSkip(); + out.printf("%n%s-- testNullPointerException %s%n%n", now(), description); BodyPublisher[] publishers = publishers(content); - Assert.assertThrows(NullPointerException.class, () -> BodyPublishers.concat(publishers)); + Assertions.assertThrows(NullPointerException.class, () -> BodyPublishers.concat(publishers)); } // Verifies that an empty array creates a "noBody" publisher @Test public void testEmpty() { - checkSkip(); + out.printf("%n%s-- testEmpty%n%n", now()); BodyPublisher publisher = BodyPublishers.concat(); RequestSubscriber subscriber = new RequestSubscriber(); - assertEquals(publisher.contentLength(), 0); + assertEquals(0, publisher.contentLength()); publisher.subscribe(subscriber); subscriber.subscriptionCF.thenAccept(s -> s.request(1)); List result = subscriber.resultCF.join(); - assertEquals(result, List.of()); + assertEquals(List.of(), result); assertTrue(subscriber.items.isEmpty()); } // verifies that error emitted by upstream publishers are propagated downstream. - @Test(dataProvider = "sparseContent") // nulls are replaced with error publisher + @ParameterizedTest // nulls are replaced with error publisher + @MethodSource("nulls") public void testOnError(String description, String[] content) { - checkSkip(); + out.printf("%n%s-- testOnError %s%n%n", now(), description); final RequestSubscriber subscriber = new RequestSubscriber(); final PublishWithError errorPublisher; final BodyPublisher[] publishers; @@ -556,13 +551,13 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { publisher.subscribe(subscriber); subscriber.subscriptionCF.thenAccept(s -> s.request(Long.MAX_VALUE)); if (errorPublisher.hasErrors()) { - CompletionException ce = expectThrows(CompletionException.class, + CompletionException ce = Assertions.assertThrows(CompletionException.class, () -> subscriber.resultCF.join()); out.println(description + ": got expected " + ce); - assertEquals(ce.getCause().getClass(), Exception.class); - assertEquals(stringFromBytes(subscriber.items.stream()) + "", result); + assertEquals(Exception.class, ce.getCause().getClass()); + assertEquals(result, stringFromBytes(subscriber.items.stream()) + ""); } else { - assertEquals(stringFromBytes(subscriber.resultCF.join().stream()), result); + assertEquals(result, stringFromBytes(subscriber.resultCF.join().stream())); out.println(description + ": got expected result: " + result); } } @@ -570,9 +565,10 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { // Verifies that if an upstream publisher has an unknown length, the // aggregate publisher will have an unknown length as well. Otherwise // the length should be known. - @Test(dataProvider = "sparseContent") // nulls are replaced with unknown length + @ParameterizedTest // nulls are replaced with unknown length + @MethodSource("nulls") public void testUnknownContentLength(String description, String[] content) { - checkSkip(); + out.printf("%n%s-- testUnknownContentLength %s%n%n", now(), description); if (content == null) { content = BODIES.toArray(String[]::new); description = "BODIES (known length)"; @@ -598,9 +594,9 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { length += content[i].length(); } } - out.printf("testUnknownContentLength(%s): %d%n", description, length); + out.printf("%stestUnknownContentLength(%s): %d%n", now(), description, length); BodyPublisher publisher = BodyPublishers.concat(publishers); - assertEquals(publisher.contentLength(), length, + assertEquals(length, publisher.contentLength(), description.replace("null", "length(-1)")); } @@ -611,9 +607,10 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { return x.getCause(); } - @Test(dataProvider = "negativeRequests") + @ParameterizedTest + @MethodSource("negativeRequests") public void testNegativeRequest(long n) { - checkSkip(); + out.printf("%n%s-- testNegativeRequest %s%n%n", now(), n); assert n <= 0 : "test for negative request called with n > 0 : " + n; BodyPublisher[] publishers = ContentLengthPublisher.of(List.of(1L, 2L, 3L)); BodyPublisher publisher = BodyPublishers.concat(publishers); @@ -621,7 +618,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { publisher.subscribe(subscriber); Subscription subscription = subscriber.subscriptionCF.join(); subscription.request(n); - CompletionException expected = expectThrows(CE, () -> subscriber.resultCF.join()); + CompletionException expected = Assertions.assertThrows(CE, () -> subscriber.resultCF.join()); Throwable cause = completionCause(expected); if (cause instanceof IllegalArgumentException) { System.out.printf("Got expected IAE for %d: %s%n", n, cause); @@ -637,7 +634,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { @Test public void testPositiveRequests() { - checkSkip(); + out.printf("%n%s-- testPositiveRequests%n%n", now()); // A composite array of publishers BodyPublisher[] publishers = Stream.of( Stream.of(ofStrings("Lorem", " ", "ipsum", " ")), @@ -657,7 +654,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { List list1 = requestSubscriber1.resultCF().join(); assertTrue(requestSubscriber1.resultCF().isDone()); String result1 = stringFromBytes(list1.stream()); - assertEquals(result1, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."); + assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", result1); System.out.println("Got expected sentence with one request: \"%s\"".formatted(result1)); // Test that we can split our requests call any which way we want @@ -675,16 +672,17 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { List list2 = requestSubscriber2.resultCF().join(); assertTrue(requestSubscriber2.resultCF().isDone()); String result2 = stringFromBytes(list2.stream()); - assertEquals(result2, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."); + assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", result2); System.out.println("Got expected sentence with 4 requests: \"%s\"".formatted(result1)); } - @Test(dataProvider = "contentLengths") + @ParameterizedTest + @MethodSource("contentLengths") public void testContentLength(long expected, List lengths) { - checkSkip(); + out.printf("%n%s-- testContentLength expected=%s %s%n%n", now(), expected, lengths); BodyPublisher[] publishers = ContentLengthPublisher.of(lengths); BodyPublisher aggregate = BodyPublishers.concat(publishers); - assertEquals(aggregate.contentLength(), expected, + assertEquals(expected, aggregate.contentLength(), "Unexpected result for %s".formatted(lengths)); } @@ -692,14 +690,13 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { // publishers are no longer subscribed etc... @Test public void testCancel() { - checkSkip(); + out.printf("%n%s-- testCancel%n%n", now()); BodyPublisher[] publishers = BODIES.stream() .map(BodyPublishers::ofString) .toArray(BodyPublisher[]::new); BodyPublisher publisher = BodyPublishers.concat(publishers); - assertEquals(publisher.contentLength(), - BODIES.stream().mapToInt(String::length).sum()); + assertEquals(BODIES.stream().mapToInt(String::length).sum(), publisher.contentLength()); Map subscribers = new LinkedHashMap<>(); for (int n=0; n < BODIES.size(); n++) { @@ -731,7 +728,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { // subscription was cancelled, so nothing should be received... try { - TimeoutException x = Assert.expectThrows(TimeoutException.class, + TimeoutException x = Assertions.assertThrows(TimeoutException.class, () -> any.get(5, TimeUnit.SECONDS)); out.println("Got expected " + x); } finally { @@ -742,8 +739,8 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { subscribers.get(rs), rs.resultCF)); } Consumer check = (rs) -> { - Assert.assertTrue(rs.items.isEmpty(), subscribers.get(rs) + " has items"); - Assert.assertFalse(rs.resultCF.isDone(), subscribers.get(rs) + " was not cancelled"); + assertTrue(rs.items.isEmpty(), subscribers.get(rs) + " has items"); + assertFalse(rs.resultCF.isDone(), subscribers.get(rs) + " was not cancelled"); out.println(subscribers.get(rs) + ": PASSED"); }; subscribers.keySet().stream().forEach(check); @@ -752,13 +749,12 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { // Verifies that cancelling the subscription is propagated downstream @Test public void testCancelSubscription() { - checkSkip(); + out.printf("%n%s-- testCancelSubscription%n%n", now()); PublishWithError upstream = new PublishWithError(BODIES, BODIES.size(), () -> new AssertionError("should not come here")); BodyPublisher publisher = BodyPublishers.concat(upstream); - assertEquals(publisher.contentLength(), - BODIES.stream().mapToInt(String::length).sum()); + assertEquals(BODIES.stream().mapToInt(String::length).sum(), publisher.contentLength()); Map subscribers = new LinkedHashMap<>(); for (int n=0; n < BODIES.size(); n++) { @@ -793,7 +789,7 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { // subscription was cancelled, so nothing should be received... try { - TimeoutException x = Assert.expectThrows(TimeoutException.class, + TimeoutException x = Assertions.assertThrows(TimeoutException.class, () -> any.get(5, TimeUnit.SECONDS)); out.println("Got expected " + x); } finally { @@ -804,17 +800,19 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { subscribers.get(rs), rs.resultCF)); } Consumer check = (rs) -> { - Assert.assertTrue(rs.items.isEmpty(), subscribers.get(rs) + " has items"); - Assert.assertFalse(rs.resultCF.isDone(), subscribers.get(rs) + " was not cancelled"); + assertTrue(rs.items.isEmpty(), subscribers.get(rs) + " has items"); + assertFalse(rs.resultCF.isDone(), subscribers.get(rs) + " was not cancelled"); out.println(subscribers.get(rs) + ": PASSED"); }; subscribers.keySet().stream().forEach(check); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void test(URI uri, HttpClient.Version version, boolean sameClient) throws Exception { - checkSkip(); + out.printf("%n%s-- test sameClient=%s, version=%s, uri=%s%n%n", + now(), sameClient, version, uri); System.out.printf("Request to %s (sameClient: %s)%n", uri, sameClient); System.err.printf("Request to %s (sameClient: %s)%n", uri, sameClient); @@ -838,13 +836,13 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { int expectedResponse = RESPONSE_CODE; if (response.statusCode() != expectedResponse) throw new RuntimeException("wrong response code " + Integer.toString(response.statusCode())); - assertEquals(response.body(), BODIES.stream().collect(Collectors.joining())); + assertEquals(BODIES.stream().collect(Collectors.joining()), response.body()); } if (!sameClient) client.close(); System.out.println("test: DONE"); } - private URI buildURI(String scheme, String path, int port) { + private static URI buildURI(String scheme, String path, int port) { return URIBuilder.newBuilder() .scheme(scheme) .loopback() @@ -853,8 +851,8 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { .buildUnchecked(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { HttpTestHandler handler = new HttpTestEchoHandler(); http1TestServer = HttpTestServer.create(HTTP_1_1); http1TestServer.addHandler(handler, "/http1/echo/"); @@ -884,8 +882,8 @@ public class AggregateRequestBodyTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { String sharedClientName = sharedClient == null ? null : sharedClient.toString(); sharedClient.close(); diff --git a/test/jdk/java/net/httpclient/AltServiceUsageTest.java b/test/jdk/java/net/httpclient/AltServiceUsageTest.java index 41f3aef9bd1..59ad2179b90 100644 --- a/test/jdk/java/net/httpclient/AltServiceUsageTest.java +++ b/test/jdk/java/net/httpclient/AltServiceUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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 @@ -37,36 +37,37 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.net.SimpleSSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import org.testng.Assert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + /* * @test * @summary Verifies that the HTTP client correctly handles various alt-svc usages * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * AltServiceUsageTest */ public class AltServiceUsageTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - private HttpTestServer originServer; - private HttpTestServer altServer; + private static HttpTestServer originServer; + private static HttpTestServer altServer; - private DatagramChannel udpNotResponding; + private static DatagramChannel udpNotResponding; - @BeforeClass - public void beforeClass() throws Exception { + @BeforeAll + public static void beforeClass() throws Exception { // attempt to create an HTTP/3 server, an HTTP/2 server, and a // DatagramChannel bound to the same port as the HTTP/2 server int count = 0; @@ -99,7 +100,7 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.err.println("**** All servers started. Test will start shortly ****"); } - private void createServers() throws IOException { + private static void createServers() throws IOException { altServer = HttpTestServer.create(HTTP_3_URI_ONLY, sslContext); altServer.addHandler(new All200OKHandler(), "/foo/"); altServer.addHandler(new RequireAltUsedHeader(), "/bar/"); @@ -114,8 +115,8 @@ public class AltServiceUsageTest implements HttpServerAdapters { originServer.start(); } - @AfterClass - public void afterClass() throws Exception { + @AfterAll + public static void afterClass() throws Exception { safeStop(originServer); safeStop(altServer); safeClose(udpNotResponding); @@ -271,14 +272,14 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Issuing request " + reqURI); final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(response.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(response.body(), H3AltServicePublisher.RESPONSE_CONTENT, + Assertions.assertEquals(200, response.statusCode(), "Unexpected response code"); + Assertions.assertEquals(H3AltServicePublisher.RESPONSE_CONTENT, response.body(), "Unexpected response body"); final Optional altSvcHeader = response.headers().firstValue("alt-svc"); - Assert.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); + Assertions.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); System.out.println("Received alt-svc header value: " + altSvcHeader.get()); final String expectedHeader = "h3=\"" + toHostPort(altServer) + "\""; - Assert.assertTrue(altSvcHeader.get().contains(expectedHeader), + Assertions.assertTrue(altSvcHeader.get().contains(expectedHeader), "Unexpected alt-svc header value: " + altSvcHeader.get() + ", was expected to contain: " + expectedHeader); @@ -286,8 +287,8 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Again issuing request " + reqURI); final HttpResponse secondResponse = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(secondResponse.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(secondResponse.body(), All200OKHandler.RESPONSE_CONTENT, + Assertions.assertEquals(200, secondResponse.statusCode(), "Unexpected response code"); + Assertions.assertEquals(All200OKHandler.RESPONSE_CONTENT, secondResponse.body(), "Unexpected response body"); var TRACKER = ReferenceTracker.INSTANCE; var tracker = TRACKER.getTracker(client); @@ -318,14 +319,14 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Issuing request " + reqURI); final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(response.statusCode(), 421, "Unexpected response code"); - Assert.assertEquals(response.body(), H3AltServicePublisher.RESPONSE_CONTENT, + Assertions.assertEquals(421, response.statusCode(), "Unexpected response code"); + Assertions.assertEquals(H3AltServicePublisher.RESPONSE_CONTENT, response.body(), "Unexpected response body"); final Optional altSvcHeader = response.headers().firstValue("alt-svc"); - Assert.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); + Assertions.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); System.out.println("Received alt-svc header value: " + altSvcHeader.get()); final String expectedHeader = "h3=\"" + toHostPort(altServer) + "\""; - Assert.assertTrue(altSvcHeader.get().contains(expectedHeader), + Assertions.assertTrue(altSvcHeader.get().contains(expectedHeader), "Unexpected alt-svc header value: " + altSvcHeader.get() + ", was expected to contain: " + expectedHeader); @@ -333,8 +334,8 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Again issuing request " + reqURI); final HttpResponse secondResponse = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(secondResponse.statusCode(), 421, "Unexpected response code"); - Assert.assertEquals(response.body(), H3AltServicePublisher.RESPONSE_CONTENT, + Assertions.assertEquals(421, secondResponse.statusCode(), "Unexpected response code"); + Assertions.assertEquals(H3AltServicePublisher.RESPONSE_CONTENT, response.body(), "Unexpected response body"); var TRACKER = ReferenceTracker.INSTANCE; var tracker = TRACKER.getTracker(client); @@ -369,14 +370,14 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Issuing request " + reqURI); final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(response.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(response.body(), H3AltServicePublisher.RESPONSE_CONTENT, + Assertions.assertEquals(200, response.statusCode(), "Unexpected response code"); + Assertions.assertEquals(H3AltServicePublisher.RESPONSE_CONTENT, response.body(), "Unexpected response body"); final Optional altSvcHeader = response.headers().firstValue("alt-svc"); - Assert.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); + Assertions.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); System.out.println("Received alt-svc header value: " + altSvcHeader.get()); final String expectedHeader = "h3=\"" + toHostPort(altServer) + "\""; - Assert.assertTrue(altSvcHeader.get().contains(expectedHeader), + Assertions.assertTrue(altSvcHeader.get().contains(expectedHeader), "Unexpected alt-svc header value: " + altSvcHeader.get() + ", was expected to contain: " + expectedHeader); @@ -386,8 +387,8 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Again issuing request " + reqURI); final HttpResponse secondResponse = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(secondResponse.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(secondResponse.body(), RequireAltUsedHeader.RESPONSE_CONTENT, + Assertions.assertEquals(200, secondResponse.statusCode(), "Unexpected response code"); + Assertions.assertEquals(RequireAltUsedHeader.RESPONSE_CONTENT, secondResponse.body(), "Unexpected response body"); var TRACKER = ReferenceTracker.INSTANCE; var tracker = TRACKER.getTracker(client); @@ -424,14 +425,14 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Issuing request " + reqURI); final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(response.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(response.body(), H3AltServicePublisher.RESPONSE_CONTENT, + Assertions.assertEquals(200, response.statusCode(), "Unexpected response code"); + Assertions.assertEquals(H3AltServicePublisher.RESPONSE_CONTENT, response.body(), "Unexpected response body"); final Optional altSvcHeader = response.headers().firstValue("alt-svc"); - Assert.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); + Assertions.assertTrue(altSvcHeader.isPresent(), "alt-svc header is missing in response"); System.out.println("Received alt-svc header value: " + altSvcHeader.get()); final String expectedHeader = "h3=\"" + toHostPort(altServer) + "\""; - Assert.assertTrue(altSvcHeader.get().contains(expectedHeader), + Assertions.assertTrue(altSvcHeader.get().contains(expectedHeader), "Unexpected alt-svc header value: " + altSvcHeader.get() + ", was expected to contain: " + expectedHeader); @@ -439,8 +440,8 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Again issuing request " + reqURI); final HttpResponse secondResponse = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(secondResponse.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(secondResponse.body(), All200OKHandler.RESPONSE_CONTENT, + Assertions.assertEquals(200, secondResponse.statusCode(), "Unexpected response code"); + Assertions.assertEquals(All200OKHandler.RESPONSE_CONTENT, secondResponse.body(), "Unexpected response body"); // wait for alt-service to expire @@ -452,8 +453,8 @@ public class AltServiceUsageTest implements HttpServerAdapters { System.out.println("Issuing request for a third time " + reqURI); final HttpResponse thirdResponse = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(thirdResponse.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(thirdResponse.body(), H3AltServicePublisher.RESPONSE_CONTENT, + Assertions.assertEquals(200, thirdResponse.statusCode(), "Unexpected response code"); + Assertions.assertEquals(H3AltServicePublisher.RESPONSE_CONTENT, thirdResponse.body(), "Unexpected response body"); var TRACKER = ReferenceTracker.INSTANCE; var tracker = TRACKER.getTracker(client); diff --git a/test/jdk/java/net/httpclient/AsFileDownloadTest.java b/test/jdk/java/net/httpclient/AsFileDownloadTest.java index 88bf95dab02..6e9c4e676cf 100644 --- a/test/jdk/java/net/httpclient/AsFileDownloadTest.java +++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,19 +63,20 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestServer; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.net.http.HttpResponse.BodyHandlers.ofFileDownload; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.StandardOpenOption.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -86,24 +87,24 @@ import static org.testng.Assert.fail; * jdk.test.lib.Platform jdk.test.lib.util.FileUtils * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm/timeout=480 AsFileDownloadTest + * @run junit/othervm/timeout=480 AsFileDownloadTest */ public class AsFileDownloadTest { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpsServer httpsTestServer; // HTTPS/1.1 - Http2TestServer http2TestServer; // HTTP/2 ( h2c ) - Http2TestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h3TestServer; // HTTP/3 - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h3URI; + private static HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpsServer httpsTestServer; // HTTPS/1.1 + private static Http2TestServer http2TestServer; // HTTP/2 ( h2c ) + private static Http2TestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h3TestServer; // HTTP/3 + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h3URI; final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - Path tempDir; + static Path tempDir; static final String[][] contentDispositionValues = new String[][] { // URI query Content-Type header value Expected filename @@ -151,8 +152,7 @@ public class AsFileDownloadTest { { "041", "attachment; filename=\"foo/../../file12.txt\"", "file12.txt" }, }; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { List list = new ArrayList<>(); Arrays.asList(contentDispositionValues).stream() @@ -181,7 +181,8 @@ public class AsFileDownloadTest { return builder.sslContext(sslContext).proxy(Builder.NO_PROXY).build(); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, String contentDispositionValue, String expectedFilename, Optional requestVersion) throws Exception { out.printf("test(%s, %s, %s): starting", uriString, contentDispositionValue, expectedFilename); @@ -207,14 +208,13 @@ public class AsFileDownloadTest { String fileContents = new String(Files.readAllBytes(response.body()), UTF_8); out.println("Got body: " + fileContents); - assertEquals(response.statusCode(), 200); - assertEquals(body.getFileName().toString(), expectedFilename); + assertEquals(200, response.statusCode()); + assertEquals(expectedFilename, body.getFileName().toString()); assertTrue(response.headers().firstValue("Content-Disposition").isPresent()); - assertEquals(response.headers().firstValue("Content-Disposition").get(), - contentDispositionValue); - assertEquals(fileContents, "May the luck of the Irish be with you!"); + assertEquals( contentDispositionValue, response.headers().firstValue("Content-Disposition").get()); + assertEquals("May the luck of the Irish be with you!", fileContents); if (requestVersion.isPresent()) { - assertEquals(response.version(), requestVersion.get(), "unexpected HTTP version" + + assertEquals(requestVersion.get(), response.version(), "unexpected HTTP version" + " in response"); } @@ -254,8 +254,7 @@ public class AsFileDownloadTest { }; - @DataProvider(name = "negative") - public Object[][] negative() { + public static Object[][] negative() { List list = new ArrayList<>(); Arrays.asList(contentDispositionBADValues).stream() @@ -276,7 +275,8 @@ public class AsFileDownloadTest { return list.stream().toArray(Object[][]::new); } - @Test(dataProvider = "negative") + @ParameterizedTest + @MethodSource("negative") void negativeTest(String uriString, String contentDispositionValue, Optional requestVersion) throws Exception { out.printf("negativeTest(%s, %s): starting", uriString, contentDispositionValue); @@ -330,8 +330,8 @@ public class AsFileDownloadTest { return builder; } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { tempDir = Paths.get("asFileDownloadTest.tmp.dir"); if (Files.exists(tempDir)) throw new AssertionError("Unexpected test work dir existence: " + tempDir.toString()); @@ -380,8 +380,8 @@ public class AsFileDownloadTest { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(0); httpsTestServer.stop(0); http2TestServer.stop(); @@ -474,11 +474,11 @@ public class AsFileDownloadTest { for (String name : List.of(headerName.toUpperCase(Locale.ROOT), headerName.toLowerCase(Locale.ROOT))) { assertTrue(headers.firstValue(name).isPresent()); - assertEquals(headers.firstValue(name).get(), headerValue.get(0)); - assertEquals(headers.allValues(name).size(), headerValue.size()); - assertEquals(headers.allValues(name), headerValue); - assertEquals(headers.map().get(name).size(), headerValue.size()); - assertEquals(headers.map().get(name), headerValue); + assertEquals(headerValue.get(0), headers.firstValue(name).get()); + assertEquals(headerValue.size(), headers.allValues(name).size()); + assertEquals(headerValue, headers.allValues(name)); + assertEquals(headerValue.size(), headers.map().get(name).size()); + assertEquals(headerValue, headers.map().get(name)); } } } catch (Throwable t) { diff --git a/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java b/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java index 14ed4f63124..308288bb9bf 100644 --- a/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java +++ b/test/jdk/java/net/httpclient/AsyncExecutorShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * AsyncExecutorShutdown @@ -68,10 +68,6 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; @@ -81,9 +77,14 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class AsyncExecutorShutdown implements HttpServerAdapters { @@ -92,27 +93,26 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { } static final Random RANDOM = RandomFactory.getRandom(); - ExecutorService readerService; + private static ExecutorService readerService; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/2 ( h2+h3 ) - HttpTestServer h3TestServer; // HTTP/2 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h3URI; - String h2h3Head; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/2 ( h2+h3 ) + private static HttpTestServer h3TestServer; // HTTP/2 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h3URI; + private static String h2h3Head; static final String MESSAGE = "AsyncExecutorShutdown message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { h2h3URI, HTTP_3, h2h3TestServer.h3DiscoveryConfig() }, { h3URI, HTTP_3, h3TestServer.h3DiscoveryConfig() }, @@ -124,7 +124,7 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { } static final AtomicLong requestCounter = new AtomicLong(); - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static Throwable getCause(Throwable t) { while (t instanceof CompletionException || t instanceof ExecutionException) { @@ -165,7 +165,8 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { throw new AssertionError(what + ": Unexpected exception: " + cause, cause); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testConcurrent(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting (%s, %s, %s) ----%n%n", uriString, version, config); ExecutorService executorService = Executors.newCachedThreadPool(); @@ -206,14 +207,14 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { responseCF = client.sendAsync(request, BodyHandlers.ofInputStream()) .thenApply((response) -> { out.println(si + ": Got response: " + response); - assertEquals(response.statusCode(), 200); - if (si >= head) assertEquals(response.version(), version); + assertEquals(200, response.statusCode()); + if (si >= head) assertEquals(version, response.version()); return response; }); bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(AsyncExecutorShutdown::readBody) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); return s; }); } catch (RejectedExecutionException x) { @@ -275,7 +276,8 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { CompletableFuture.allOf(bodies.toArray(new CompletableFuture[0])).get(); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testSequential(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting (%s, %s, %s) ----%n%n", uriString, version, config); ExecutorService executorService = Executors.newCachedThreadPool(); @@ -316,13 +318,13 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { responseCF = client.sendAsync(request, BodyHandlers.ofInputStream()) .thenApply((response) -> { out.println(si + ": Got response: " + response); - assertEquals(response.statusCode(), 200); - if (si > 0) assertEquals(response.version(), version); + assertEquals(200, response.statusCode()); + if (si > 0) assertEquals(version, response.version()); return response; }); bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(AsyncExecutorShutdown::readBody) - .thenApply((s) -> {assertEquals(s, MESSAGE); return s;}) + .thenApply((s) -> {assertEquals(MESSAGE, s); return s;}) .thenApply((s) -> {out.println(si + ": Got body: " + s); return s;}); } catch (RejectedExecutionException x) { out.println(i + ": Got expected exception: " + x); @@ -397,7 +399,7 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } static void shutdown(ExecutorService executorService) { @@ -409,8 +411,8 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("\n**** Setup ****\n"); readerService = Executors.newCachedThreadPool(); @@ -445,8 +447,8 @@ public class AsyncExecutorShutdown implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.checkShutdown(5000); try { diff --git a/test/jdk/java/net/httpclient/AsyncShutdownNow.java b/test/jdk/java/net/httpclient/AsyncShutdownNow.java index 56b0378cf66..7dc13cf08e2 100644 --- a/test/jdk/java/net/httpclient/AsyncShutdownNow.java +++ b/test/jdk/java/net/httpclient/AsyncShutdownNow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * AsyncShutdownNow @@ -70,10 +70,6 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; @@ -84,10 +80,15 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class AsyncShutdownNow implements HttpServerAdapters { @@ -96,27 +97,26 @@ public class AsyncShutdownNow implements HttpServerAdapters { } static final Random RANDOM = RandomFactory.getRandom(); - ExecutorService readerService; + private static ExecutorService readerService; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) - HttpTestServer h3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h2h3Head; - String h3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) + private static HttpTestServer h3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h2h3Head; + private static String h3URI; static final String MESSAGE = "AsyncShutdownNow message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { h2h3URI, HTTP_3, h2h3TestServer.h3DiscoveryConfig()}, { h3URI, HTTP_3, h3TestServer.h3DiscoveryConfig()}, @@ -168,11 +168,11 @@ public class AsyncShutdownNow implements HttpServerAdapters { out.println(step + ": Got response: " + response); out.printf("%s: expect status 200 and version %s (%s) for %s%n", step, version, config, response.request().uri()); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); if (step == 0 && version == HTTP_3 && firstVersionMayNotMatch) { out.printf("%s: version not checked%n", step); } else { - assertEquals(response.version(), version); + assertEquals(version, response.version()); out.printf("%s: got expected version %s%n", step, response.version()); } return this; @@ -185,7 +185,7 @@ public class AsyncShutdownNow implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } static boolean hasExpectedMessage(IOException io) { @@ -223,7 +223,8 @@ public class AsyncShutdownNow implements HttpServerAdapters { throw new AssertionError(what + ": Unexpected exception: " + cause, cause); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testConcurrent(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting concurrent (%s, %s, %s) ----%n%n", uriString, version, config); HttpClient client = newClientBuilderForH3() @@ -260,7 +261,7 @@ public class AsyncShutdownNow implements HttpServerAdapters { bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(AsyncShutdownNow::readBody) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); return s; }); long sleep = RANDOM.nextLong(5); @@ -320,7 +321,8 @@ public class AsyncShutdownNow implements HttpServerAdapters { return failed; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testSequential(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting sequential (%s, %s, %s) ----%n%n", uriString, version, config); @@ -354,7 +356,7 @@ public class AsyncShutdownNow implements HttpServerAdapters { bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(AsyncShutdownNow::readBody) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); return s; }) .thenApply((s) -> { @@ -403,8 +405,8 @@ public class AsyncShutdownNow implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("\n**** Setup ****\n"); readerService = Executors.newCachedThreadPool(); @@ -439,8 +441,8 @@ public class AsyncShutdownNow implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.checkShutdown(5000); try { diff --git a/test/jdk/java/net/httpclient/AuthFilterCacheTest.java b/test/jdk/java/net/httpclient/AuthFilterCacheTest.java index 6d64caa1950..0d87055ff51 100644 --- a/test/jdk/java/net/httpclient/AuthFilterCacheTest.java +++ b/test/jdk/java/net/httpclient/AuthFilterCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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,6 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; import com.sun.net.httpserver.HttpsServer; import jdk.httpclient.test.lib.common.TestServerConfigurator; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; @@ -54,7 +50,12 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ANY; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.*; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -63,7 +64,7 @@ import static org.testng.Assert.*; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DigestEchoServer ReferenceTracker jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm -Dtest.requiresHost=true + * @run junit/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=requests,headers,errors,quic * -Djdk.internal.httpclient.debug=false * AuthFilterCacheTest @@ -81,29 +82,28 @@ public class AuthFilterCacheTest implements HttpServerAdapters { SSLContext.setDefault(context); } - HttpTestServer http1Server; - HttpTestServer http2Server; - HttpTestServer https1Server; - HttpTestServer https2Server; - HttpTestServer h3onlyServer; - HttpTestServer h3altSvcServer; - DigestEchoServer.TunnelingProxy proxy; - URI http1URI; - URI https1URI; - URI http2URI; - URI https2URI; - URI h3onlyURI; - URI h3altSvcURI; - InetSocketAddress proxyAddress; - ProxySelector proxySelector; - MyAuthenticator auth; - HttpClient client; - ExecutorService serverExecutor = Executors.newCachedThreadPool(); - ExecutorService virtualExecutor = Executors.newThreadPerTaskExecutor(Thread.ofVirtual() + private static HttpTestServer http1Server; + private static HttpTestServer http2Server; + private static HttpTestServer https1Server; + private static HttpTestServer https2Server; + private static HttpTestServer h3onlyServer; + private static HttpTestServer h3altSvcServer; + private static DigestEchoServer.TunnelingProxy proxy; + private static URI http1URI; + private static URI https1URI; + private static URI http2URI; + private static URI https2URI; + private static URI h3onlyURI; + private static URI h3altSvcURI; + private static InetSocketAddress proxyAddress; + private static ProxySelector proxySelector; + private static MyAuthenticator auth; + private static HttpClient client; + private static ExecutorService serverExecutor = Executors.newCachedThreadPool(); + private static ExecutorService virtualExecutor = Executors.newThreadPerTaskExecutor(Thread.ofVirtual() .name("HttpClient-Worker", 0).factory()); - @DataProvider(name = "uris") - Object[][] testURIs() { + static Object[][] testURIs() { Object[][] uris = new Object[][]{ {List.of(http1URI.resolve("direct/orig/"), https1URI.resolve("direct/orig/"), @@ -117,8 +117,8 @@ public class AuthFilterCacheTest implements HttpServerAdapters { return uris; } - public HttpClient newHttpClient(ProxySelector ps, Authenticator auth) { - HttpClient.Builder builder = newClientBuilderForH3() + public static HttpClient newHttpClient(ProxySelector ps, Authenticator auth) { + HttpClient.Builder builder = HttpServerAdapters.createClientBuilderForH3() .executor(virtualExecutor) .sslContext(context) .authenticator(auth) @@ -126,8 +126,8 @@ public class AuthFilterCacheTest implements HttpServerAdapters { return builder.build(); } - @BeforeClass - public void setUp() throws Exception { + @BeforeAll + public static void setUp() throws Exception { try { InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); @@ -189,8 +189,8 @@ public class AuthFilterCacheTest implements HttpServerAdapters { .version(HTTP_2).build(); System.out.println("Sending head request: " + headRequest); var headResponse = client.send(headRequest, BodyHandlers.ofString()); - assertEquals(headResponse.statusCode(), 200); - assertEquals(headResponse.version(), HTTP_2); + assertEquals(200, headResponse.statusCode()); + assertEquals(HTTP_2, headResponse.version()); System.out.println("Setup: done"); } catch (Exception x) { @@ -202,8 +202,8 @@ public class AuthFilterCacheTest implements HttpServerAdapters { } } - @AfterClass - public void tearDown() { + @AfterAll + public static void tearDown() { proxy = stop(proxy, DigestEchoServer.TunnelingProxy::stop); http1Server = stop(http1Server, HttpTestServer::stop); https1Server = stop(https1Server, HttpTestServer::stop); @@ -378,7 +378,8 @@ public class AuthFilterCacheTest implements HttpServerAdapters { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("testURIs") public void test(List uris) throws Exception { System.out.println("Servers listening at " + uris.stream().map(URI::toString) diff --git a/test/jdk/java/net/httpclient/BasicHTTP2Test.java b/test/jdk/java/net/httpclient/BasicHTTP2Test.java index 586673d62ab..4175aceea3d 100644 --- a/test/jdk/java/net/httpclient/BasicHTTP2Test.java +++ b/test/jdk/java/net/httpclient/BasicHTTP2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +27,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters * ReferenceTracker - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * BasicHTTP2Test * @summary Basic HTTP/2 test when HTTP/3 is requested @@ -44,37 +44,40 @@ import java.net.http.HttpRequest; import java.net.http.HttpRequest.Builder; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.time.Duration; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLContext; import jdk.test.lib.net.SimpleSSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import org.testng.ITestContext; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; public class BasicHTTP2Test implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - String https2URI; - DatagramSocket udp; + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static String https2URI; + private static DatagramSocket udp; // a shared executor helps reduce the amount of threads created by the test static final Executor executor = new TestExecutor(Executors.newCachedThreadPool()); @@ -91,8 +94,7 @@ public class BasicHTTP2Test implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -118,20 +120,37 @@ public class BasicHTTP2Test implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - var x = new SkipException("Skipping: some test failed"); - x.setStackTrace(new StackTraceElement[0]); - throw x; + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); } } - @AfterClass + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll static final void printFailedTests() { out.println("\n========================="); try { @@ -152,14 +171,6 @@ public class BasicHTTP2Test implements HttpServerAdapters { } } - private String[] uris() { - return new String[] { - https2URI, - }; - } - - static AtomicLong URICOUNT = new AtomicLong(); - private HttpClient makeNewClient() { clientCount.incrementAndGet(); HttpClient client = HttpClient.newBuilder() @@ -170,37 +181,6 @@ public class BasicHTTP2Test implements HttpServerAdapters { return TRACKER.track(client); } - HttpClient newHttpClient(boolean share) { - if (!share) return makeNewClient(); - HttpClient shared = sharedClient; - if (shared != null) return shared; - synchronized (this) { - shared = sharedClient; - if (shared == null) { - shared = sharedClient = makeNewClient(); - } - return shared; - } - } - - - static void checkStatus(int expected, int found) throws Exception { - if (expected != found) { - System.err.printf ("Test failed: wrong status code %d/%d\n", - expected, found); - throw new RuntimeException("Test failed"); - } - } - - static void checkStrings(String expected, String found) throws Exception { - if (!expected.equals(found)) { - System.err.printf ("Test failed: wrong string %s/%s\n", - expected, found); - throw new RuntimeException("Test failed"); - } - } - - @Test public void testH2() throws Exception { @@ -220,8 +200,8 @@ public class BasicHTTP2Test implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #1: " + response); out.println("Version #1: " + response.version()); - assertEquals(response.statusCode(), 200, "first response status"); - assertEquals(response.version(), HTTP_2, "first response version"); + assertEquals(200, response.statusCode(), "first response status"); + assertEquals(HTTP_2, response.version(), "first response version"); Thread.sleep(1000); @@ -232,16 +212,15 @@ public class BasicHTTP2Test implements HttpServerAdapters { response = client.send(request, BodyHandlers.ofString()); out.println("Response #2: " + response); out.println("Version #2: " + response.version()); - assertEquals(response.statusCode(), 200, "second response status"); - assertEquals(response.version(), HTTP_2, "second response version"); + assertEquals(200, response.statusCode(), "second response status"); + assertEquals(HTTP_2, response.version(), "second response version"); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/2 HttpTestHandler handler = new Handler(); - HttpTestHandler h3Handler = new Handler(); https2TestServer = HttpTestServer.create(HTTP_2, sslContext); https2TestServer.addHandler(handler, "/https2/test204/"); @@ -259,11 +238,8 @@ public class BasicHTTP2Test implements HttpServerAdapters { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { - String sharedClientName = - sharedClient == null ? null : sharedClient.toString(); - sharedClient = null; + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.check(500); try { @@ -271,10 +247,7 @@ public class BasicHTTP2Test implements HttpServerAdapters { https2TestServer.stop(); } finally { if (fail != null) { - if (sharedClientName != null) { - System.err.println("Shared client name is: " + sharedClientName); - } - throw fail; + throw fail; } } } diff --git a/test/jdk/java/net/httpclient/BasicHTTP3Test.java b/test/jdk/java/net/httpclient/BasicHTTP3Test.java index 4508b32e544..aec21e421f9 100644 --- a/test/jdk/java/net/httpclient/BasicHTTP3Test.java +++ b/test/jdk/java/net/httpclient/BasicHTTP3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,6 @@ import java.net.http.HttpRequest; import java.net.http.HttpRequest.Builder; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.time.Duration; import java.util.List; import java.util.Optional; import java.util.Set; @@ -40,28 +39,32 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.internal.net.quic.QuicVersion; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.*; + +import static org.junit.jupiter.api.Assertions.*; import static java.lang.System.out; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -70,7 +73,7 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; * jdk.httpclient.test.lib.common.HttpServerAdapters * ReferenceTracker * jdk.httpclient.test.lib.quic.QuicStandaloneServer - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djavax.net.debug=all * BasicHTTP3Test @@ -79,20 +82,20 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; public class BasicHTTP3Test implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - String https2URI; - HttpTestServer h3TestServer; // HTTP/2 ( h2 + h3) - String h3URI; - HttpTestServer h3qv2TestServer; // HTTP/2 ( h2 + h3 on Quic v2, incompatible nego) - String h3URIQv2; - HttpTestServer h3qv2CTestServer; // HTTP/2 ( h2 + h3 on Quic v2, compatible nego) - String h3URIQv2C; - HttpTestServer h3mtlsTestServer; // HTTP/2 ( h2 + h3), h3 requires client cert - String h3mtlsURI; - HttpTestServer h3TestServerWithRetry; // h3 - String h3URIRetry; - HttpTestServer h3TestServerWithTLSHelloRetry; // h3 - String h3URITLSHelloRetry; + static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + static String https2URI; + static HttpTestServer h3TestServer; // HTTP/2 ( h2 + h3) + static String h3URI; + static HttpTestServer h3qv2TestServer; // HTTP/2 ( h2 + h3 on Quic v2, incompatible nego) + static String h3URIQv2; + static HttpTestServer h3qv2CTestServer; // HTTP/2 ( h2 + h3 on Quic v2, compatible nego) + static String h3URIQv2C; + static HttpTestServer h3mtlsTestServer; // HTTP/2 ( h2 + h3), h3 requires client cert + static String h3mtlsURI; + static HttpTestServer h3TestServerWithRetry; // h3 + static String h3URIRetry; + static HttpTestServer h3TestServerWithTLSHelloRetry; // h3 + static String h3URITLSHelloRetry; static final int ITERATION_COUNT = 4; // a shared executor helps reduce the amount of threads created by the test @@ -109,8 +112,8 @@ public class BasicHTTP3Test implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -136,21 +139,38 @@ public class BasicHTTP3Test implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - var x = new SkipException("Skipping: some test failed"); - x.setStackTrace(new StackTraceElement[0]); - throw x; + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); } } - @AfterClass - static final void printFailedTests() { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { out.printf("%n%sCreated %d clients%n", @@ -170,18 +190,14 @@ public class BasicHTTP3Test implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { https2URI, h3URI }; } - @DataProvider(name = "variants") - public Object[][] variants(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2 * 2][]; int i = 0; @@ -196,11 +212,7 @@ public class BasicHTTP3Test implements HttpServerAdapters { return result; } - @DataProvider(name = "h3URIs") - public Object[][] versions(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] versions() { Object[][] result = { {h3URI}, {h3URIRetry}, {h3URIQv2}, {h3URIQv2C}, @@ -233,9 +245,11 @@ public class BasicHTTP3Test implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void test(String uri, boolean sameClient, Optional version) throws Exception { - System.out.println("Request to " + uri); + System.out.printf("%n%s-- test version=%s, sameClient=%s, uri=%s%n%n", + now(), version, sameClient, uri); HttpClient client = newHttpClient(sameClient); @@ -267,8 +281,10 @@ public class BasicHTTP3Test implements HttpServerAdapters { System.out.println("test: DONE"); } - @Test(dataProvider = "h3URIs") + @ParameterizedTest + @MethodSource("versions") public void testH3(final String h3URI) throws Exception { + System.out.printf("%n%s-- testH3 h3URI=%s%n%n", now(), h3URI); HttpClient client = makeNewClient(); URI uri = URI.create(h3URI); Builder builder = HttpRequest.newBuilder(uri) @@ -278,17 +294,17 @@ public class BasicHTTP3Test implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #1: " + response); out.println("Version #1: " + response.version()); - assertEquals(response.statusCode(), 200, "first response status"); - assertEquals(response.version(), HTTP_2, "first response version"); + assertEquals(200, response.statusCode(), "first response status"); + assertEquals(HTTP_2, response.version(), "first response version"); request = builder.version(Version.HTTP_3).build(); response = client.send(request, BodyHandlers.ofString()); out.println("Response #2: " + response); out.println("Version #2: " + response.version()); - assertEquals(response.statusCode(), 200, "second response status"); - assertEquals(response.version(), Version.HTTP_3, "second response version"); + assertEquals(200, response.statusCode(), "second response status"); + assertEquals(Version.HTTP_3, response.version(), "second response version"); - if (h3URI == h3mtlsURI) { + if (h3URI.equals(h3mtlsURI)) { assertNotNull(response.sslSession().get().getLocalCertificates()); } else { assertNull(response.sslSession().get().getLocalCertificates()); @@ -303,6 +319,7 @@ public class BasicHTTP3Test implements HttpServerAdapters { // verify that the client handles HTTP/3 reset stream correctly @Test public void testH3Reset() throws Exception { + System.out.printf("%n%s-- testH3Reset uri=%s%n%n", now(), h3URI); HttpClient client = makeNewClient(); URI uri = URI.create(h3URI); Builder builder = HttpRequest.newBuilder(uri) @@ -312,8 +329,8 @@ public class BasicHTTP3Test implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #1: " + response); out.println("Version #1: " + response.version()); - assertEquals(response.statusCode(), 200, "first response status"); - assertEquals(response.version(), HTTP_2, "first response version"); + assertEquals(200, response.statusCode(), "first response status"); + assertEquals(HTTP_2, response.version(), "first response version"); // instruct the server side handler to throw an exception // that then causes the test server to reset the stream @@ -341,8 +358,8 @@ public class BasicHTTP3Test implements HttpServerAdapters { if (error != null) throw error; } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { https2TestServer = HttpTestServer.create(HTTP_2, sslContext); https2TestServer.addHandler(new Handler(), "/https2/test/"); https2URI = "https://" + https2TestServer.serverAuthority() + "/https2/test/x"; @@ -360,7 +377,7 @@ public class BasicHTTP3Test implements HttpServerAdapters { .enableH3AltServiceOnEphemeralPortWithVersion(QuicVersion.QUIC_V2, false); h3qv2TestServer = HttpTestServer.of(h2q2Server); h3qv2TestServer.addHandler(h3Handler, "/h3/testH3/"); - h3URIQv2 = "https://" + h3qv2TestServer.serverAuthority() + "/h3/testH3/h3qv2";; + h3URIQv2 = "https://" + h3qv2TestServer.serverAuthority() + "/h3/testH3/h3qv2"; assertTrue(h3qv2TestServer.canHandle(HTTP_2, Version.HTTP_3), "Server was expected" + " to handle both HTTP2 and HTTP3, but doesn't"); @@ -369,7 +386,7 @@ public class BasicHTTP3Test implements HttpServerAdapters { .enableH3AltServiceOnEphemeralPortWithVersion(QuicVersion.QUIC_V2, true); h3qv2CTestServer = HttpTestServer.of(h2q2CServer); h3qv2CTestServer.addHandler(h3Handler, "/h3/testH3/"); - h3URIQv2C = "https://" + h3qv2CTestServer.serverAuthority() + "/h3/testH3/h3qv2c";; + h3URIQv2C = "https://" + h3qv2CTestServer.serverAuthority() + "/h3/testH3/h3qv2c"; assertTrue(h3qv2CTestServer.canHandle(HTTP_2, Version.HTTP_3), "Server was expected" + " to handle both HTTP2 and HTTP3, but doesn't"); @@ -411,8 +428,8 @@ public class BasicHTTP3Test implements HttpServerAdapters { h3TestServerWithTLSHelloRetry.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { System.err.println("======================================================="); System.err.println(" Tearing down test"); System.err.println("======================================================="); diff --git a/test/jdk/java/net/httpclient/BasicRedirectTest.java b/test/jdk/java/net/httpclient/BasicRedirectTest.java index d79c39fe47a..d873a64bb1b 100644 --- a/test/jdk/java/net/httpclient/BasicRedirectTest.java +++ b/test/jdk/java/net/httpclient/BasicRedirectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +26,7 @@ * @summary Basic test for redirect and redirect policies * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=trace,headers,requests * -Djdk.internal.httpclient.debug=true * BasicRedirectTest @@ -49,10 +49,6 @@ import java.util.Optional; import java.util.stream.Collectors; import javax.net.ssl.SSLContext; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -61,39 +57,42 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.ANY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class BasicRedirectTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpURIToMoreSecure; // redirects HTTP to HTTPS - String httpURIToH3MoreSecure; // redirects HTTP to HTTPS/3 - String httpsURI; - String httpsURIToLessSecure; // redirects HTTPS to HTTP - String http2URI; - String http2URIToMoreSecure; // redirects HTTP to HTTPS - String http2URIToH3MoreSecure; // redirects HTTP to HTTPS/3 - String https2URI; - String https2URIToLessSecure; // redirects HTTPS to HTTP - String https3URI; - String https3HeadURI; - String http3URIToLessSecure; // redirects HTTP3 to HTTP - String http3URIToH2cLessSecure; // redirects HTTP3 to h2c + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpURIToMoreSecure; // redirects HTTP to HTTPS + private static String httpURIToH3MoreSecure; // redirects HTTP to HTTPS/3 + private static String httpsURI; + private static String httpsURIToLessSecure; // redirects HTTPS to HTTP + private static String http2URI; + private static String http2URIToMoreSecure; // redirects HTTP to HTTPS + private static String http2URIToH3MoreSecure; // redirects HTTP to HTTPS/3 + private static String https2URI; + private static String https2URIToLessSecure; // redirects HTTPS to HTTP + private static String https3URI; + private static String https3HeadURI; + private static String http3URIToLessSecure; // redirects HTTP3 to HTTP + private static String http3URIToH2cLessSecure; // redirects HTTP3 to h2c static final String MESSAGE = "Is fearr Gaeilge briste, na Bearla cliste"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { httpURI, Redirect.ALWAYS, Optional.empty() }, { httpsURI, Redirect.ALWAYS, Optional.empty() }, @@ -121,8 +120,8 @@ public class BasicRedirectTest implements HttpServerAdapters { }; } - HttpClient createClient(Redirect redirectPolicy, Optional version) throws Exception { - var clientBuilder = newClientBuilderForH3() + static HttpClient createClient(Redirect redirectPolicy, Optional version) throws Exception { + var clientBuilder = HttpServerAdapters.createClientBuilderForH3() .followRedirects(redirectPolicy) .sslContext(sslContext); HttpClient client = version.map(clientBuilder::version) @@ -135,23 +134,24 @@ public class BasicRedirectTest implements HttpServerAdapters { var get = builder.copy().GET().build(); out.printf("%n---- sending initial head request (%s) -----%n", head.uri()); var resp = client.send(head, BodyHandlers.ofString()); - assertEquals(resp.statusCode(), 200); - assertEquals(resp.version(), HTTP_2); + assertEquals(200, resp.statusCode()); + assertEquals(HTTP_2, resp.version()); out.println("HEADERS: " + resp.headers()); var length = resp.headers().firstValueAsLong("Content-Length") .orElseThrow(AssertionError::new); if (length < 0) throw new AssertionError("negative length " + length); out.printf("%n---- sending initial HTTP/3 GET request (%s) -----%n", get.uri()); resp = client.send(get, BodyHandlers.ofString()); - assertEquals(resp.statusCode(), 200); - assertEquals(resp.version(), HTTP_3); - assertEquals(resp.body().getBytes(UTF_8).length, length, + assertEquals(200, resp.statusCode()); + assertEquals(HTTP_3, resp.version()); + assertEquals(length, resp.body().getBytes(UTF_8).length, "body \"" + resp.body() + "\": "); } return client; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, Redirect redirectPolicy, Optional clientVersion) throws Exception { out.printf("%n---- starting positive (%s, %s, %s) ----%n", uriString, redirectPolicy, clientVersion.map(Version::name).orElse("empty")); @@ -169,8 +169,8 @@ public class BasicRedirectTest implements HttpServerAdapters { out.println(" Got body Path: " + response.body()); out.println(" Got response.request: " + response.request()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); // asserts redirected URI in response.request().uri() assertTrue(response.uri().getPath().endsWith("message")); assertPreviousRedirectResponses(request, response, clientVersion); @@ -193,7 +193,7 @@ public class BasicRedirectTest implements HttpServerAdapters { versions.add(response.version()); assertTrue(300 <= response.statusCode() && response.statusCode() <= 309, "Expected 300 <= code <= 309, got:" + response.statusCode()); - assertEquals(response.body(), null, "Unexpected body: " + response.body()); + assertEquals(null, response.body(), "Unexpected body: " + response.body()); String locationHeader = response.headers().firstValue("Location") .orElseThrow(() -> new RuntimeException("no previous Location")); assertTrue(uri.toString().endsWith(locationHeader), @@ -202,7 +202,7 @@ public class BasicRedirectTest implements HttpServerAdapters { } while (response.previousResponse().isPresent()); // initial - assertEquals(initialRequest, response.request(), + assertEquals(response.request(), initialRequest, String.format("Expected initial request [%s] to equal last prev req [%s]", initialRequest, response.request())); if (clientVersion.stream().anyMatch(HTTP_3::equals)) { @@ -214,8 +214,7 @@ public class BasicRedirectTest implements HttpServerAdapters { // -- negatives - @DataProvider(name = "negative") - public Object[][] negative() { + public static Object[][] negative() { return new Object[][] { { httpURI, Redirect.NEVER, Optional.empty() }, { httpsURI, Redirect.NEVER, Optional.empty() }, @@ -238,7 +237,8 @@ public class BasicRedirectTest implements HttpServerAdapters { }; } - @Test(dataProvider = "negative") + @ParameterizedTest + @MethodSource("negative") void testNegatives(String uriString, Redirect redirectPolicy, Optional clientVersion) throws Exception { out.printf("%n---- starting negative (%s, %s, %s) ----%n", uriString, redirectPolicy, @@ -257,8 +257,8 @@ public class BasicRedirectTest implements HttpServerAdapters { out.println(" Got body Path: " + response.body()); out.println(" Got response.request: " + response.request()); - assertEquals(response.statusCode(), 302); - assertEquals(response.body(), "XY"); + assertEquals(302, response.statusCode()); + assertEquals("XY", response.body()); // asserts original URI in response.request().uri() assertTrue(response.uri().equals(uri)); assertFalse(response.previousResponse().isPresent()); @@ -268,8 +268,8 @@ public class BasicRedirectTest implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new BasicHttpRedirectHandler(), "/http1/same/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/same/redirect"; @@ -325,8 +325,8 @@ public class BasicRedirectTest implements HttpServerAdapters { createClient(Redirect.NEVER, Optional.of(HTTP_3)); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/BodySubscribersTest.java b/test/jdk/java/net/httpclient/BodySubscribersTest.java index 21aa4ce3b17..abd86693b83 100644 --- a/test/jdk/java/net/httpclient/BodySubscribersTest.java +++ b/test/jdk/java/net/httpclient/BodySubscribersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ * @test * @summary Basic test for the standard BodySubscribers default behavior * @bug 8225583 8334028 - * @run testng BodySubscribersTest + * @run junit BodySubscribersTest */ import java.net.http.HttpResponse.BodySubscriber; @@ -34,16 +34,18 @@ import java.nio.file.Path; import java.util.List; import java.util.concurrent.Flow; import java.util.function.Supplier; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpResponse.BodySubscribers.*; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.StandardOpenOption.CREATE; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.expectThrows; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class BodySubscribersTest { @@ -78,8 +80,7 @@ public class BodySubscribersTest { @Override public void onComplete() { fail(); } } - @DataProvider(name = "bodySubscriberSuppliers") - public Object[][] bodySubscriberSuppliers() { ; + public static Object[][] bodySubscriberSuppliers() { ; List>> list = List.of( BSSupplier.create("ofByteArray", () -> ofByteArray()), BSSupplier.create("ofInputStream", () -> ofInputStream()), @@ -102,7 +103,8 @@ public class BodySubscribersTest { return list.stream().map(x -> new Object[] { x }).toArray(Object[][]::new); } - @Test(dataProvider = "bodySubscriberSuppliers") + @ParameterizedTest + @MethodSource("bodySubscriberSuppliers") void nulls(Supplier> bodySubscriberSupplier) { BodySubscriber bodySubscriber = bodySubscriberSupplier.get(); boolean subscribed = false; @@ -111,18 +113,18 @@ public class BodySubscribersTest { assertNotNull(bodySubscriber.getBody()); assertNotNull(bodySubscriber.getBody()); assertNotNull(bodySubscriber.getBody()); - expectThrows(NPE, () -> bodySubscriber.onSubscribe(null)); - expectThrows(NPE, () -> bodySubscriber.onSubscribe(null)); - expectThrows(NPE, () -> bodySubscriber.onSubscribe(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onSubscribe(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onSubscribe(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onSubscribe(null)); - expectThrows(NPE, () -> bodySubscriber.onNext(null)); - expectThrows(NPE, () -> bodySubscriber.onNext(null)); - expectThrows(NPE, () -> bodySubscriber.onNext(null)); - expectThrows(NPE, () -> bodySubscriber.onNext(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onNext(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onNext(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onNext(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onNext(null)); - expectThrows(NPE, () -> bodySubscriber.onError(null)); - expectThrows(NPE, () -> bodySubscriber.onError(null)); - expectThrows(NPE, () -> bodySubscriber.onError(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onError(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onError(null)); + Assertions.assertThrows(NPE, () -> bodySubscriber.onError(null)); if (!subscribed) { out.println("subscribing"); @@ -138,7 +140,8 @@ public class BodySubscribersTest { } while (true); } - @Test(dataProvider = "bodySubscriberSuppliers") + @ParameterizedTest + @MethodSource("bodySubscriberSuppliers") void subscribeMoreThanOnce(Supplier> bodySubscriberSupplier) { BodySubscriber bodySubscriber = bodySubscriberSupplier.get(); bodySubscriber.onSubscribe(new Flow.Subscription() { diff --git a/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java b/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java index a4c5bab55dc..7813b8c3d7b 100644 --- a/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java +++ b/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,33 +32,34 @@ import java.util.concurrent.SubmissionPublisher; import java.util.function.IntSupplier; import java.util.stream.IntStream; import java.net.http.HttpResponse.BodySubscriber; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.Long.MAX_VALUE; import static java.lang.Long.MIN_VALUE; import static java.lang.System.out; import static java.nio.ByteBuffer.wrap; import static java.util.concurrent.TimeUnit.SECONDS; import static java.net.http.HttpResponse.BodySubscribers.buffering; -import static org.testng.Assert.*; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @summary Direct test for HttpResponse.BodySubscriber.buffering() cancellation - * @run testng/othervm BufferingSubscriberCancelTest + * @run junit/othervm BufferingSubscriberCancelTest */ public class BufferingSubscriberCancelTest { - @DataProvider(name = "bufferSizes") - public Object[][] bufferSizes() { + public static Object[][] bufferSizes() { return new Object[][]{ // bufferSize should be irrelevant {1}, {100}, {511}, {512}, {513}, {1024}, {2047}, {2048} }; } - @Test(dataProvider = "bufferSizes") + @ParameterizedTest + @MethodSource("bufferSizes") public void cancelWithoutAnyItemsPublished(int bufferSize) throws Exception { ExecutorService executor = Executors.newFixedThreadPool(1); SubmissionPublisher> publisher = @@ -85,8 +86,7 @@ public class BufferingSubscriberCancelTest { executor.shutdown(); } - @DataProvider(name = "sizeAndItems") - public Object[][] sizeAndItems() { + public static Object[][] sizeAndItems() { return new Object[][] { // bufferSize and item bytes must be equal to count onNext calls // bufferSize items @@ -103,7 +103,8 @@ public class BufferingSubscriberCancelTest { }; } - @Test(dataProvider = "sizeAndItems") + @ParameterizedTest + @MethodSource("sizeAndItems") public void cancelWithItemsPublished(int bufferSize, List items) throws Exception { @@ -125,12 +126,13 @@ public class BufferingSubscriberCancelTest { IntStream.range(0, ITERATION_TIMES+1).forEach(x -> publisher.submit(items)); assertEqualsWithRetry(publisher::getNumberOfSubscribers, 0); - assertEquals(exposingSubscriber.onNextInvocations, ITERATION_TIMES); + assertEquals(ITERATION_TIMES, exposingSubscriber.onNextInvocations); executor.shutdown(); } // same as above but with more racy conditions, do not wait on the gate - @Test(dataProvider = "sizeAndItems") + @ParameterizedTest + @MethodSource("sizeAndItems") public void cancelWithItemsPublishedNoWait(int bufferSize, List items) throws Exception { @@ -212,6 +214,6 @@ public class BufferingSubscriberCancelTest { return; Thread.sleep(100); } - assertEquals(actual, expected); // will fail with the usual testng message + assertEquals(expected, actual); // will fail with the usual testng message } } diff --git a/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java b/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java index 5292f4b9860..255946232be 100644 --- a/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java +++ b/test/jdk/java/net/httpclient/BufferingSubscriberErrorCompleteTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,30 +32,31 @@ import java.util.concurrent.Phaser; import java.util.concurrent.SubmissionPublisher; import java.util.stream.IntStream; import java.net.http.HttpResponse.BodySubscriber; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.Long.MAX_VALUE; import static java.lang.Long.MIN_VALUE; import static java.nio.ByteBuffer.wrap; import static java.net.http.HttpResponse.BodySubscribers.buffering; -import static org.testng.Assert.*; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @summary Test for HttpResponse.BodySubscriber.buffering() onError/onComplete - * @run testng/othervm BufferingSubscriberErrorCompleteTest + * @run junit/othervm BufferingSubscriberErrorCompleteTest */ public class BufferingSubscriberErrorCompleteTest { - @DataProvider(name = "illegalDemand") - public Object[][] illegalDemand() { + public static Object[][] illegalDemand() { return new Object[][]{ {0L}, {-1L}, {-5L}, {-100L}, {-101L}, {-100_001L}, {MIN_VALUE} }; } - @Test(dataProvider = "illegalDemand") + @ParameterizedTest + @MethodSource("illegalDemand") public void illegalRequest(long demand) throws Exception { ExecutorService executor = Executors.newFixedThreadPool(1); SubmissionPublisher> publisher = @@ -72,18 +73,17 @@ public class BufferingSubscriberErrorCompleteTest { s.request(demand); gate.arriveAndAwaitAdvance(); - assertEquals(previous + 1, exposingSubscriber.onErrorInvocations); + assertEquals(exposingSubscriber.onErrorInvocations, previous + 1); assertTrue(exposingSubscriber.throwable instanceof IllegalArgumentException, "Expected IAE, got:" + exposingSubscriber.throwable); furtherCancelsRequestsShouldBeNoOp(s); - assertEquals(exposingSubscriber.onErrorInvocations, 1); + assertEquals(1, exposingSubscriber.onErrorInvocations); executor.shutdown(); } - @DataProvider(name = "bufferAndItemSizes") - public Object[][] bufferAndItemSizes() { + public static Object[][] bufferAndItemSizes() { List values = new ArrayList<>(); for (int bufferSize : new int[] { 1, 5, 10, 100, 1000 }) @@ -93,7 +93,8 @@ public class BufferingSubscriberErrorCompleteTest { return values.stream().toArray(Object[][]::new); } - @Test(dataProvider = "bufferAndItemSizes") + @ParameterizedTest + @MethodSource("bufferAndItemSizes") public void onErrorFromPublisher(int bufferSize, int numberOfItems) throws Exception @@ -117,19 +118,19 @@ public class BufferingSubscriberErrorCompleteTest { Subscription s = exposingSubscriber.subscription; - assertEquals(exposingSubscriber.onErrorInvocations, 1); - assertEquals(exposingSubscriber.onCompleteInvocations, 0); - assertEquals(exposingSubscriber.throwable, t); - assertEquals(exposingSubscriber.throwable.getMessage(), - "a message from me to me"); + assertEquals(1, exposingSubscriber.onErrorInvocations); + assertEquals(0, exposingSubscriber.onCompleteInvocations); + assertEquals(t, exposingSubscriber.throwable); + assertEquals("a message from me to me", exposingSubscriber.throwable.getMessage()); furtherCancelsRequestsShouldBeNoOp(s); - assertEquals(exposingSubscriber.onErrorInvocations, 1); - assertEquals(exposingSubscriber.onCompleteInvocations, 0); + assertEquals(1, exposingSubscriber.onErrorInvocations); + assertEquals(0, exposingSubscriber.onCompleteInvocations); executor.shutdown(); } - @Test(dataProvider = "bufferAndItemSizes") + @ParameterizedTest + @MethodSource("bufferAndItemSizes") public void onCompleteFromPublisher(int bufferSize, int numberOfItems) throws Exception @@ -152,14 +153,14 @@ public class BufferingSubscriberErrorCompleteTest { Subscription s = exposingSubscriber.subscription; - assertEquals(exposingSubscriber.onErrorInvocations, 0); - assertEquals(exposingSubscriber.onCompleteInvocations, 1); - assertEquals(exposingSubscriber.throwable, null); + assertEquals(0, exposingSubscriber.onErrorInvocations); + assertEquals(1, exposingSubscriber.onCompleteInvocations); + assertEquals(null, exposingSubscriber.throwable); furtherCancelsRequestsShouldBeNoOp(s); - assertEquals(exposingSubscriber.onErrorInvocations, 0); - assertEquals(exposingSubscriber.onCompleteInvocations, 1); - assertEquals(exposingSubscriber.throwable, null); + assertEquals(0, exposingSubscriber.onErrorInvocations); + assertEquals(1, exposingSubscriber.onCompleteInvocations); + assertEquals(null, exposingSubscriber.throwable); executor.shutdown(); } diff --git a/test/jdk/java/net/httpclient/BufferingSubscriberTest.java b/test/jdk/java/net/httpclient/BufferingSubscriberTest.java index 6d15ba5d3a8..bb33b18ed9c 100644 --- a/test/jdk/java/net/httpclient/BufferingSubscriberTest.java +++ b/test/jdk/java/net/httpclient/BufferingSubscriberTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,14 +38,15 @@ import java.net.http.HttpResponse.BodyHandlers; import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.BodySubscribers; import jdk.test.lib.RandomFactory; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.Long.MAX_VALUE; -import static java.lang.Long.min; import static java.lang.System.out; import static java.util.concurrent.CompletableFuture.delayedExecutor; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.testng.Assert.*; + +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -54,7 +55,7 @@ import static org.testng.Assert.*; * @key randomness * @library /test/lib * @build jdk.test.lib.RandomFactory - * @run testng/othervm/timeout=480 -Djdk.internal.httpclient.debug=true BufferingSubscriberTest + * @run junit/othervm/timeout=480 -Djdk.internal.httpclient.debug=true BufferingSubscriberTest */ public class BufferingSubscriberTest { @@ -80,37 +81,41 @@ public class BufferingSubscriberTest { time = time + ms + "ms"; out.println(what + "\t ["+time+"]\t "+ String.format(fmt,args)); } - @DataProvider(name = "negatives") - public Object[][] negatives() { + public static Object[][] negatives() { return new Object[][] { { 0 }, { -1 }, { -1000 } }; } - @Test(dataProvider = "negatives", expectedExceptions = IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("negatives") public void subscriberThrowsIAE(int bufferSize) { - printStamp(START, "subscriberThrowsIAE(%d)", bufferSize); - try { - BodySubscriber bp = BodySubscribers.ofByteArray(); - BodySubscribers.buffering(bp, bufferSize); - } finally { - printStamp(END, "subscriberThrowsIAE(%d)", bufferSize); - } + Assertions.assertThrows(IllegalArgumentException.class, () -> { + printStamp(START, "subscriberThrowsIAE(%d)", bufferSize); + try { + BodySubscriber bp = BodySubscribers.ofByteArray(); + BodySubscribers.buffering(bp, bufferSize); + } finally { + printStamp(END, "subscriberThrowsIAE(%d)", bufferSize); + } + }); } - @Test(dataProvider = "negatives", expectedExceptions = IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("negatives") public void handlerThrowsIAE(int bufferSize) { - printStamp(START, "handlerThrowsIAE(%d)", bufferSize); - try { - BodyHandler bp = BodyHandlers.ofByteArray(); - BodyHandlers.buffering(bp, bufferSize); - } finally { - printStamp(END, "handlerThrowsIAE(%d)", bufferSize); - } + Assertions.assertThrows(IllegalArgumentException.class, () -> { + printStamp(START, "handlerThrowsIAE(%d)", bufferSize); + try { + BodyHandler bp = BodyHandlers.ofByteArray(); + BodyHandlers.buffering(bp, bufferSize); + } finally { + printStamp(END, "handlerThrowsIAE(%d)", bufferSize); + } + }); } // --- - @DataProvider(name = "config") - public Object[][] config() { + public static Object[][] config() { return new Object[][] { // iterations delayMillis numBuffers bufferSize maxBufferSize minBufferSize { 1, 0, 1, 1, 2, 1 }, @@ -129,7 +134,8 @@ public class BufferingSubscriberTest { }; } - @Test(dataProvider = "config") + @ParameterizedTest + @MethodSource("config") public void test(int iterations, int delayMillis, int numBuffers, @@ -282,8 +288,8 @@ public class BufferingSubscriberTest { } count++; onNextInvocations++; - assertNotEquals(sz, 0L, "Unexpected empty buffers"); - items.stream().forEach(b -> assertEquals(b.position(), 0)); + assertNotEquals(0L, sz, "Unexpected empty buffers"); + items.stream().forEach(b -> assertEquals(0, b.position())); assertFalse(noMoreOnNext); if (sz != bufferSize) { @@ -296,20 +302,20 @@ public class BufferingSubscriberTest { "Possibly received last buffer: sz=%d, accumulated=%d, total=%d", sz, totalBytesReceived, totalBytesReceived + sz); } else { - assertEquals(sz, bufferSize, "Expected to receive exactly bufferSize"); + assertEquals(bufferSize, sz, "Expected to receive exactly bufferSize"); } lastSeenSize = sz; // Ensure expected contents for (ByteBuffer b : items) { while (b.hasRemaining()) { - assertEquals(b.get(), (byte) (index % 100)); + assertEquals((byte) (index % 100), b.get()); index++; } } totalBytesReceived += sz; - assertEquals(totalBytesReceived, index); + assertEquals(index, totalBytesReceived); if (delayMillis > 0 && ((expectedTotalSize - totalBytesReceived) > bufferSize)) delayedExecutor.execute(this::requestMore); else diff --git a/test/jdk/java/net/httpclient/CancelRequestTest.java b/test/jdk/java/net/httpclient/CancelRequestTest.java index 2a0ec19a0ed..df808ad2dab 100644 --- a/test/jdk/java/net/httpclient/CancelRequestTest.java +++ b/test/jdk/java/net/httpclient/CancelRequestTest.java @@ -29,7 +29,7 @@ * @key randomness * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * ReferenceTracker CancelRequestTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.enableAllMethodRetry=true * CancelRequestTest */ @@ -38,15 +38,6 @@ import jdk.internal.net.http.common.OperationTrackers.Tracker; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -61,7 +52,6 @@ import java.net.http.HttpOption.Http3DiscoveryMode; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandler; import java.net.http.HttpResponse.BodyHandlers; -import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Objects; @@ -76,7 +66,6 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import jdk.httpclient.test.lib.common.HttpServerAdapters; import static java.lang.System.out; @@ -85,10 +74,21 @@ import static java.net.http.HttpClient.Version.*; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class CancelRequestTest implements HttpServerAdapters { @@ -97,19 +97,19 @@ public class CancelRequestTest implements HttpServerAdapters { = new ConcurrentHashMap<>(); private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) - HttpTestServer h3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h2h3Head; - String h3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) + private static HttpTestServer h3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h2h3Head; + private static String h3URI; static final long SERVER_LATENCY = 75; static final int MAX_CLIENT_DELAY = 75; @@ -130,8 +130,8 @@ public class CancelRequestTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -157,38 +157,39 @@ public class CancelRequestTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); - var failed = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(CancelRequestTest::name, ITestResult::getThrowable)); - FAILURES.putAll(failed); try { out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); @@ -206,7 +207,7 @@ public class CancelRequestTest implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { httpURI, httpsURI, @@ -217,8 +218,7 @@ public class CancelRequestTest implements HttpServerAdapters { }; } - @DataProvider(name = "asyncurls") - public Object[][] asyncurls() { + public static Object[][] asyncurls() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2 * 3][]; //Object[][] result = new Object[uris.length][]; @@ -238,8 +238,7 @@ public class CancelRequestTest implements HttpServerAdapters { return result; } - @DataProvider(name = "urls") - public Object[][] alltests() { + public static Object[][] alltests() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; //Object[][] result = new Object[uris.length][]; @@ -327,7 +326,7 @@ public class CancelRequestTest implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } private static void releaseLatches() { @@ -348,10 +347,10 @@ public class CancelRequestTest implements HttpServerAdapters { return latch; } - @Test(dataProvider = "asyncurls") + @ParameterizedTest + @MethodSource("asyncurls") public void testGetSendAsync(String uri, boolean sameClient, boolean mayInterruptIfRunning) throws Exception { - checkSkip(); HttpClient client = null; uri = uri + "/get"; out.printf("%n%s testGetSendAsync(%s, %b, %b)%n", now(), uri, sameClient, mayInterruptIfRunning); @@ -386,7 +385,7 @@ public class CancelRequestTest implements HttpServerAdapters { out.println("cf2 after cancel: " + cf2); try { String body = cf2.get().body(); - assertEquals(body, String.join("", BODY.split("\\|"))); + assertEquals(String.join("", BODY.split("\\|")), body); throw new AssertionError("Expected CancellationException not received"); } catch (ExecutionException x) { out.println(now() + "Got expected exception: " + x); @@ -409,7 +408,7 @@ public class CancelRequestTest implements HttpServerAdapters { // completed yet - so wait for it here... try { String body = response.get().body(); - assertEquals(body, String.join("", BODY.split("\\|"))); + assertEquals(String.join("", BODY.split("\\|")), body); if (mayInterruptIfRunning) { // well actually - this could happen... In which case we'll need to // increase the latency in the server handler... @@ -448,10 +447,10 @@ public class CancelRequestTest implements HttpServerAdapters { assertTrue(response.isDone()); assertFalse(response.isCancelled()); - assertEquals(cf1.isCancelled(), hasCancellationException); + assertEquals(hasCancellationException, cf1.isCancelled()); assertTrue(cf2.isDone()); assertFalse(cf2.isCancelled()); - assertEquals(latch.getCount(), 0); + assertEquals(0, latch.getCount()); var error = TRACKER.check(tracker, 1000, (t) -> t.getOutstandingOperations() > 0 || t.getOutstandingSubscribers() > 0, @@ -464,10 +463,10 @@ public class CancelRequestTest implements HttpServerAdapters { if (!sameClient) client.close(); } - @Test(dataProvider = "asyncurls") + @ParameterizedTest + @MethodSource("asyncurls") public void testPostSendAsync(String uri, boolean sameClient, boolean mayInterruptIfRunning) throws Exception { - checkSkip(); uri = uri + "/post"; HttpClient client = null; out.printf("%n%s testPostSendAsync(%s, %b, %b)%n", now(), uri, sameClient, mayInterruptIfRunning); @@ -521,7 +520,7 @@ public class CancelRequestTest implements HttpServerAdapters { out.println("cf2 after cancel: " + cf2); try { String body = cf2.get().body(); - assertEquals(body, String.join("", BODY.split("\\|"))); + assertEquals(String.join("", BODY.split("\\|")), body); throw new AssertionError("Expected CancellationException not received"); } catch (ExecutionException x) { out.println(now() + "Got expected exception: " + x); @@ -544,7 +543,7 @@ public class CancelRequestTest implements HttpServerAdapters { // completed yet - so wait for it here... try { String body = response.get().body(); - assertEquals(body, String.join("", BODY.split("\\|"))); + assertEquals(String.join("", BODY.split("\\|")), body); if (mayInterruptIfRunning) { // well actually - this could happen... In which case we'll need to // increase the latency in the server handler... @@ -577,10 +576,10 @@ public class CancelRequestTest implements HttpServerAdapters { assertTrue(response.isDone()); assertFalse(response.isCancelled()); - assertEquals(cf1.isCancelled(), hasCancellationException); + assertEquals(hasCancellationException, cf1.isCancelled()); assertTrue(cf2.isDone()); assertFalse(cf2.isCancelled()); - assertEquals(latch.getCount(), 0); + assertEquals(0, latch.getCount()); var error = TRACKER.check(tracker, 1000, (t) -> t.getOutstandingOperations() > 0 || t.getOutstandingSubscribers() > 0, @@ -593,10 +592,10 @@ public class CancelRequestTest implements HttpServerAdapters { if (!sameClient) client.close(); } - @Test(dataProvider = "urls") + @ParameterizedTest + @MethodSource("alltests") public void testPostInterrupt(String uri, boolean sameClient) throws Exception { - checkSkip(); HttpClient client = null; out.printf("%n%s testPostInterrupt(%s, %b)%n", now(), uri, sameClient); for (int i=0; i< ITERATION_COUNT; i++) { @@ -661,7 +660,7 @@ public class CancelRequestTest implements HttpServerAdapters { } else { assert failed == null; out.println(now() + req.uri() + ": got body: " + body); - assertEquals(body, String.join("", BODY.split("\\|"))); + assertEquals(String.join("", BODY.split("\\|")), body); } out.println(now() + "next iteration"); @@ -678,8 +677,8 @@ public class CancelRequestTest implements HttpServerAdapters { - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpTestHandler h1_chunkHandler = new HTTPSlowHandler(); httpTestServer = HttpTestServer.create(HTTP_1_1); @@ -721,8 +720,8 @@ public class CancelRequestTest implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { String sharedClientName = sharedClient == null ? null : sharedClient.toString(); sharedClient = null; diff --git a/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java b/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java index 0035a3f4302..48f23ebf370 100644 --- a/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java +++ b/test/jdk/java/net/httpclient/CancelStreamedBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,19 +29,10 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * ReferenceTracker CancelStreamedBodyTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * CancelStreamedBodyTest */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -53,7 +44,6 @@ import java.net.http.HttpClient; import java.net.http.HttpClient.Version; import java.net.http.HttpRequest; import java.net.http.HttpResponse.BodyHandlers; -import java.util.Arrays; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -61,7 +51,6 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import java.util.stream.Stream; import jdk.httpclient.test.lib.common.HttpServerAdapters; @@ -72,23 +61,34 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class CancelStreamedBodyTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String https3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String https3URI; static final long SERVER_LATENCY = 75; static final int ITERATION_COUNT = 3; @@ -108,8 +108,8 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -135,38 +135,40 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + + @AfterAll + static void printFailedTests() { out.println("\n========================="); - var failed = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - FAILURES.putAll(failed); try { out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); @@ -184,7 +186,7 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { https3URI, httpURI, @@ -195,8 +197,7 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { } - @DataProvider(name = "urls") - public Object[][] alltests() { + public static Object[][] alltests() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -265,10 +266,10 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { final static String BODY = "Some string |\n that ?\n can |\n be split ?\n several |\n ways."; - @Test(dataProvider = "urls") + @ParameterizedTest + @MethodSource("alltests") public void testAsLines(String uri, boolean sameClient) throws Exception { - checkSkip(); HttpClient client = null; uri = uri + "/testAsLines"; out.printf("%n%s testAsLines(%s, %b)%n", now(), uri, sameClient); @@ -284,8 +285,8 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { for (int j = 0; j < 2; j++) { try (Stream body = client.send(req, BodyHandlers.ofLines()).body()) { lines = body.limit(j).toList(); - assertEquals(lines, BODY.replaceAll("\\||\\?", "") - .lines().limit(j).toList()); + assertEquals(BODY.replaceAll("\\||\\?", "") + .lines().limit(j).toList(), lines); } // Only check our still alive client for outstanding operations // and outstanding subscribers here: it should have none. @@ -306,10 +307,10 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { } } - @Test(dataProvider = "urls") + @ParameterizedTest + @MethodSource("alltests") public void testInputStream(String uri, boolean sameClient) throws Exception { - checkSkip(); HttpClient client = null; uri = uri + "/testInputStream"; out.printf("%n%s testInputStream(%s, %b)%n", now(), uri, sameClient); @@ -326,7 +327,7 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { try (InputStream is = client.send(req, BodyHandlers.ofInputStream()).body()) { for (int k = 0; k < j; k++) { read = is.read(); - assertEquals(read, BODY.charAt(k)); + assertEquals(BODY.charAt(k), read); } } // Only check our still alive client for outstanding operations @@ -350,8 +351,8 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpTestHandler h1_chunkHandler = new HTTPSlowHandler(); httpTestServer = HttpTestServer.create(HTTP_1_1); @@ -385,8 +386,8 @@ public class CancelStreamedBodyTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { String sharedClientName = sharedClient == null ? null : sharedClient.toString(); sharedClient = null; diff --git a/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java b/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java index bb190cfc348..33df36100ad 100644 --- a/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java +++ b/test/jdk/java/net/httpclient/CancelledPartialResponseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,7 +28,7 @@ * @bug 8309118 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm/timeout=40 -Djdk.internal.httpclient.debug=false -Djdk.httpclient.HttpClient.log=trace,errors,headers + * @run junit/othervm/timeout=40 -Djdk.internal.httpclient.debug=false -Djdk.httpclient.HttpClient.log=trace,errors,headers * CancelledPartialResponseTest */ @@ -47,11 +47,6 @@ import jdk.internal.net.http.common.HttpHeadersBuilder; import jdk.internal.net.http.frame.ResetFrame; import jdk.internal.net.http.http3.Http3Error; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.TestException; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; @@ -74,16 +69,22 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import static org.junit.jupiter.api.Assertions.fail; + public class CancelledPartialResponseTest { - Http2TestServer http2TestServer; + private static Http2TestServer http2TestServer; - HttpTestServer http3TestServer; + private static HttpTestServer http3TestServer; // "NoError" urls complete with an exception. "NoError" or "Error" here refers to the error code in the RST_STREAM frame // and not the outcome of the test. - URI warmup, h2PartialResponseResetNoError, h2PartialResponseResetError, h2FullResponseResetNoError, h2FullResponseResetError; - URI h3PartialResponseStopSending, h3FullResponseStopSending; + private static URI warmup, h2PartialResponseResetNoError, h2PartialResponseResetError, h2FullResponseResetNoError, h2FullResponseResetError; + private static URI h3PartialResponseStopSending, h3FullResponseStopSending; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); @@ -91,8 +92,7 @@ public class CancelledPartialResponseTest { static PrintStream out = System.out; // TODO: Investigate further if checking against HTTP/3 Full Response is necessary - @DataProvider(name = "testData") - public Object[][] testData() { + public static Object[][] testData() { return new Object[][] { { HTTP_2, h2PartialResponseResetNoError }, { HTTP_2, h2PartialResponseResetError }, // Checks RST_STREAM is processed if client sees no END_STREAM @@ -104,7 +104,8 @@ public class CancelledPartialResponseTest { } - @Test(dataProvider = "testData") + @ParameterizedTest + @MethodSource("testData") public void test(Version version, URI uri) { out.printf("\nTesting with Version: %s, URI: %s\n", version, uri.toASCIIString()); err.printf("\nTesting with Version: %s, URI: %s\n", version, uri.toASCIIString()); @@ -161,8 +162,8 @@ public class CancelledPartialResponseTest { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { http2TestServer = new Http2TestServer(false, 0); http3TestServer = HttpTestServer.create(Http3DiscoveryMode.HTTP_3_URI_ONLY, sslContext); @@ -187,8 +188,8 @@ public class CancelledPartialResponseTest { http3TestServer.start(); } - @AfterTest - public void teardown() { + @AfterAll + public static void teardown() { http2TestServer.stop(); } @@ -246,10 +247,10 @@ public class CancelledPartialResponseTest { switch (exchange.getRequestURI().getPath()) { case "/partialResponse/codeNoError" -> testExchange.addResetToOutputQ(ResetFrame.NO_ERROR); case "/partialResponse/codeError" -> testExchange.addResetToOutputQ(ResetFrame.PROTOCOL_ERROR); - default -> throw new TestException("Invalid Request Path"); + default -> fail("Invalid Request Path"); } } else { - throw new TestException("Wrong Exchange type used"); + fail("Wrong Exchange type used"); } } } @@ -268,10 +269,10 @@ public class CancelledPartialResponseTest { switch (exchange.getRequestURI().getPath()) { case "/fullResponse/codeNoError" -> testExchange.addResetToOutputQ(ResetFrame.NO_ERROR); case "/fullResponse/codeError" -> testExchange.addResetToOutputQ(ResetFrame.PROTOCOL_ERROR); - default -> throw new TestException("Invalid Request Path"); + default -> fail("Invalid Request Path"); } } else { - throw new TestException("Wrong Exchange type used"); + fail("Wrong Exchange type used"); } } } diff --git a/test/jdk/java/net/httpclient/CancelledResponse2.java b/test/jdk/java/net/httpclient/CancelledResponse2.java index 48223e84135..6604fadea20 100644 --- a/test/jdk/java/net/httpclient/CancelledResponse2.java +++ b/test/jdk/java/net/httpclient/CancelledResponse2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,10 +25,6 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.internal.net.http.common.OperationTrackers.Tracker; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -57,15 +53,20 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * @compile ReferenceTracker.java - * @run testng/othervm -Djdk.internal.httpclient.debug=true CancelledResponse2 + * @run junit/othervm -Djdk.internal.httpclient.debug=true CancelledResponse2 */ // -Djdk.internal.httpclient.debug=true public class CancelledResponse2 implements HttpServerAdapters { @@ -74,17 +75,16 @@ public class CancelledResponse2 implements HttpServerAdapters { private static final Random RANDOM = RandomFactory.getRandom(); private static final int MAX_CLIENT_DELAY = 160; - HttpTestServer h2TestServer; - URI h2TestServerURI; - URI h2h3TestServerURI; - URI h2h3HeadTestServerURI; - URI h3TestServerURI; - HttpTestServer h2h3TestServer; - HttpTestServer h3TestServer; + private static HttpTestServer h2TestServer; + private static URI h2TestServerURI; + private static URI h2h3TestServerURI; + private static URI h2h3HeadTestServerURI; + private static URI h3TestServerURI; + private static HttpTestServer h2h3TestServer; + private static HttpTestServer h3TestServer; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - @DataProvider(name = "versions") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][]{ { HTTP_2, null, h2TestServerURI }, { HTTP_3, null, h2h3TestServerURI }, @@ -101,7 +101,8 @@ public class CancelledResponse2 implements HttpServerAdapters { out.println("Unexpected exception: " + x); } } - @Test(dataProvider = "versions") + @ParameterizedTest + @MethodSource("positive") public void test(Version version, Http3DiscoveryMode config, URI uri) throws Exception { for (int i = 0; i < 5; i++) { HttpClient httpClient = newClientBuilderForH3().sslContext(sslContext).version(version).build(); @@ -147,11 +148,11 @@ public class CancelledResponse2 implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, HttpResponse.BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } - @BeforeTest - public void setup() throws IOException { + @BeforeAll + public static void setup() throws IOException { h2TestServer = HttpTestServer.create(HTTP_2, sslContext); h2TestServer.addHandler(new CancelledResponseHandler(), "/h2"); h2TestServerURI = URI.create("https://" + h2TestServer.serverAuthority() + "/h2"); @@ -172,8 +173,8 @@ public class CancelledResponse2 implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() { + @AfterAll + public static void teardown() { h2TestServer.stop(); h2h3TestServer.stop(); h3TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/ConcurrentResponses.java b/test/jdk/java/net/httpclient/ConcurrentResponses.java index c44452bf4d2..53c85b8e383 100644 --- a/test/jdk/java/net/httpclient/ConcurrentResponses.java +++ b/test/jdk/java/net/httpclient/ConcurrentResponses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * ConcurrentResponses */ @@ -75,29 +75,30 @@ import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; import static java.net.http.HttpResponse.BodyHandlers.discarding; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ConcurrentResponses { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpsServer httpsTestServer; // HTTPS/1.1 - Http2TestServer http2TestServer; // HTTP/2 ( h2c ) - Http2TestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer https3TestServer; - String httpFixedURI, httpsFixedURI, httpChunkedURI, httpsChunkedURI; - String http2FixedURI, https2FixedURI, http2VariableURI, https2VariableURI; - String https3FixedURI, https3VariableURI; + private static HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpsServer httpsTestServer; // HTTPS/1.1 + private static Http2TestServer http2TestServer; // HTTP/2 ( h2c ) + private static Http2TestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer https3TestServer; + private static String httpFixedURI, httpsFixedURI, httpChunkedURI, httpsChunkedURI; + private static String http2FixedURI, https2FixedURI, http2VariableURI, https2VariableURI; + private static String https3FixedURI, https3VariableURI; static final int CONCURRENT_REQUESTS = 13; static final AtomicInteger IDS = new AtomicInteger(); @@ -131,7 +132,7 @@ public class ConcurrentResponses { */ static final CompletionStage> assert200ResponseCode(HttpResponse response) { - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); return CompletableFuture.completedFuture(response); } @@ -141,12 +142,11 @@ public class ConcurrentResponses { */ static final CompletionStage> assertbody(HttpResponse response, T body) { - assertEquals(response.body(), body); + assertEquals(body, response.body()); return CompletableFuture.completedFuture(response); } - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpFixedURI }, { httpsFixedURI }, @@ -164,7 +164,8 @@ public class ConcurrentResponses { // The ofString implementation accumulates data, below a certain threshold // into the byte buffers it is given. - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsString(String uri) throws Exception { int id = IDS.getAndIncrement(); ExecutorService virtualExecutor = Executors.newThreadPerTaskExecutor(Thread.ofVirtual() @@ -204,7 +205,8 @@ public class ConcurrentResponses { // The custom subscriber aggressively attacks any area, between the limit // and the capacity, in the byte buffers it is given, by writing 'X' into it. - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testWithCustomSubscriber(String uri) throws Exception { int id = IDS.getAndIncrement(); ExecutorService virtualExecutor = Executors.newThreadPerTaskExecutor(Thread.ofVirtual() @@ -301,8 +303,8 @@ public class ConcurrentResponses { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); httpTestServer = HttpServer.create(sa, 0); httpTestServer.createContext("/http1/fixed", new Http1FixedHandler()); @@ -342,8 +344,8 @@ public class ConcurrentResponses { https3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(0); httpsTestServer.stop(0); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/ConnectExceptionTest.java b/test/jdk/java/net/httpclient/ConnectExceptionTest.java index 29ffeca7d5e..0745e2af934 100644 --- a/test/jdk/java/net/httpclient/ConnectExceptionTest.java +++ b/test/jdk/java/net/httpclient/ConnectExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @test * @summary Expect ConnectException for all non-security related connect errors * @bug 8204864 - * @run testng/othervm -Djdk.net.hosts.file=HostFileDoesNotExist ConnectExceptionTest + * @run junit/othervm -Djdk.net.hosts.file=HostFileDoesNotExist ConnectExceptionTest */ import java.io.IOException; @@ -42,11 +42,12 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.util.List; import java.util.concurrent.ExecutionException; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ConnectExceptionTest { @@ -64,8 +65,7 @@ public class ConnectExceptionTest { @Override public String toString() { return "NO_PROXY"; } }; - @DataProvider(name = "uris") - public Object[][] uris() { + public static Object[][] uris() { return new Object[][]{ { "http://test.invalid/", NO_PROXY }, { "https://test.invalid/", NO_PROXY }, @@ -74,7 +74,8 @@ public class ConnectExceptionTest { }; } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("uris") void testSynchronousGET(String uriString, ProxySelector proxy) throws Exception { out.printf("%n---%ntestSynchronousGET starting uri:%s, proxy:%s%n", uriString, proxy); HttpClient client = HttpClient.newBuilder().proxy(proxy).build(); @@ -90,7 +91,8 @@ public class ConnectExceptionTest { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("uris") void testSynchronousPOST(String uriString, ProxySelector proxy) throws Exception { out.printf("%n---%ntestSynchronousPOST starting uri:%s, proxy:%s%n", uriString, proxy); HttpClient client = HttpClient.newBuilder().proxy(proxy).build(); @@ -108,7 +110,8 @@ public class ConnectExceptionTest { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("uris") void testAsynchronousGET(String uriString, ProxySelector proxy) throws Exception { out.printf("%n---%ntestAsynchronousGET starting uri:%s, proxy:%s%n", uriString, proxy); HttpClient client = HttpClient.newBuilder().proxy(proxy).build(); @@ -129,7 +132,8 @@ public class ConnectExceptionTest { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("uris") void testAsynchronousPOST(String uriString, ProxySelector proxy) throws Exception { out.printf("%n---%ntestAsynchronousPOST starting uri:%s, proxy:%s%n", uriString, proxy); HttpClient client = HttpClient.newBuilder().proxy(proxy).build(); diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java index 6cdaf594b1d..e1f4aee1d51 100644 --- a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java +++ b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeAsync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,9 @@ import java.net.http.HttpClient.Version; import java.time.Duration; -import org.testng.annotations.Test; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -31,14 +33,15 @@ import org.testng.annotations.Test; * @bug 8208391 * @library /test/lib * @build AbstractConnectTimeoutHandshake - * @run testng/othervm ConnectTimeoutHandshakeAsync + * @run junit/othervm ConnectTimeoutHandshakeAsync */ public class ConnectTimeoutHandshakeAsync extends AbstractConnectTimeoutHandshake { - @Test(dataProvider = "variants") @Override + @ParameterizedTest + @MethodSource("variants") public void timeoutAsync(Version requestVersion, String method, Duration connectTimeout, diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java index 17ea3041c5b..eb571b2d16c 100644 --- a/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java +++ b/test/jdk/java/net/httpclient/ConnectTimeoutHandshakeSync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,9 @@ import java.net.http.HttpClient.Version; import java.time.Duration; -import org.testng.annotations.Test; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -31,14 +33,15 @@ import org.testng.annotations.Test; * @bug 8208391 * @library /test/lib * @build AbstractConnectTimeoutHandshake - * @run testng/othervm ConnectTimeoutHandshakeSync + * @run junit/othervm ConnectTimeoutHandshakeSync */ public class ConnectTimeoutHandshakeSync extends AbstractConnectTimeoutHandshake { - @Test(dataProvider = "variants") @Override + @ParameterizedTest + @MethodSource("variants") public void timeoutSync(Version requestVersion, String method, Duration connectTimeout, diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutNoProxySync.java b/test/jdk/java/net/httpclient/ConnectTimeoutNoProxySync.java deleted file mode 100644 index f30dea6deea..00000000000 --- a/test/jdk/java/net/httpclient/ConnectTimeoutNoProxySync.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2018, 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.net.http.HttpClient.Version; -import java.time.Duration; -import org.testng.annotations.Test; - -/* - * @test - * @summary Tests for connection related timeouts - * @bug 8208391 - * @run testng/othervm ConnectTimeoutNoProxySync - */ - -public class ConnectTimeoutNoProxySync extends AbstractConnectTimeout { - - @Test(dataProvider = "variants") - @Override - public void timeoutNoProxySync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) - throws Exception - { - super.timeoutNoProxySync(requestVersion, scheme, method, connectTimeout, requestTimeout); - } -} diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutTest.java b/test/jdk/java/net/httpclient/ConnectTimeoutTest.java new file mode 100644 index 00000000000..c837071ae7c --- /dev/null +++ b/test/jdk/java/net/httpclient/ConnectTimeoutTest.java @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2018, 2026, 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.Utils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.IOException; +import java.io.PrintStream; +import java.net.ConnectException; +import java.net.InetAddress; +import java.net.Proxy; +import java.net.ProxySelector; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketTimeoutException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpClient.Version; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.net.http.HttpRequest.BodyPublishers; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletionException; +import java.util.stream.Stream; + +import static java.lang.Boolean.parseBoolean; +import static java.net.http.HttpClient.Builder.NO_PROXY; +import static java.net.http.HttpClient.Version.HTTP_1_1; +import static java.net.http.HttpClient.Version.HTTP_2; +import static java.time.Duration.*; +import static java.util.concurrent.TimeUnit.NANOSECONDS; +import static org.junit.jupiter.api.Assertions.fail; + +/* + * @test id=sync + * @bug 8208391 8375352 + * @summary Verifies behavior on `connect()` timeouts + * @requires os.family != "windows" + * @library /test/lib + * @run junit/othervm ${test.main.class} + */ + +/* + * @test id=sync-proxy + * @bug 8208391 8375352 + * @summary Verifies behavior on `connect()` timeouts + * @requires os.family != "windows" + * @library /test/lib + * @run junit/othervm -Dtest.proxy=true ${test.main.class} + */ + +/* + * @test id=async + * @bug 8208391 8375352 + * @summary Verifies behavior on `connect()` timeouts + * @requires os.family != "windows" + * @library /test/lib + * @run junit/othervm -Dtest.async=true ${test.main.class} + */ + +/* + * @test id=async-proxy + * @bug 8208391 8375352 + * @summary Verifies behavior on `connect()` timeouts + * @requires os.family != "windows" + * @library /test/lib + * @run junit/othervm -Dtest.async=true -Dtest.proxy=true ${test.main.class} + */ + +class ConnectTimeoutTest { + + // This test verifies the `HttpClient` behavior on `connect()` failures. + // + // Earlier, the test was trying to connect `example.com:8080` to trigger a `connect()` failure. + // This worked, until it doesn't — `example.com:8080` started responding in certain test environments. + // + // Now we create a `ServerSocket` and exhaust all its "SYN backlog" and "Accept queue". + // The expectation is that the platform socket in this state will block on `connect()`. + // Well... It doesn't on Windows, whereas it does on Linux and macOS. + // Windows doesn't block and immediately responds with `java.net.ConnectException: Connection refused: connect`. + // Neither it is deterministic how many connections are needed to exhaust a socket admission queue. + // Hence, we took the following decisions: + // + // 1. Skip this test on Windows + // 2. Exhaust server socket admission queue by going into a loop + + private static final PrintStream LOGGER = System.out; + + private static final int BACKLOG = 1; + + /** + * A {@link ServerSocket} whose admission will be blocked by exhausting all its "SYN backlog" and "Accept queue". + */ + private static final ServerSocket SERVER_SOCKET = createServerSocket(); + + /** + * Client sockets exhausting the admission to {@link #SERVER_SOCKET}. + */ + private static final List CLIENT_SOCKETS = createClientSocketsExhaustingServerSocketAdmission(); + + private static ServerSocket createServerSocket() { + try { + LOGGER.println("Creating server socket"); + return new ServerSocket(0, BACKLOG, InetAddress.getLoopbackAddress()); + } catch (Exception exception) { + throw new RuntimeException(exception); + } + } + + private static List createClientSocketsExhaustingServerSocketAdmission() { + List sockets = new ArrayList<>(); + int maxSocketCount = BACKLOG // To fill up the backlog + + 512; // Giving some slack, should be enough to exhaust the admission queue. + int connectTimeout = Math.toIntExact(Math.addExact(500, Utils.adjustTimeout(500))); + int socketIndex = 0; + for (; socketIndex < maxSocketCount; socketIndex++) { + try { + LOGGER.printf( + "Creating client socket %s/%s to exhaust the server socket admission%n", + (socketIndex + 1), maxSocketCount); + Socket socket = new Socket(); + socket.connect(SERVER_SOCKET.getLocalSocketAddress(), connectTimeout); + sockets.add(socket); + } catch (ConnectException | SocketTimeoutException exception) { + LOGGER.printf( + "Received expected `%s` while creating client socket %s/%s%n", + exception.getClass().getName(), (socketIndex + 1), maxSocketCount); + return sockets; + } catch (IOException ioe) { + String message = String.format( + "Received unexpected exception while creating client socket %s/%s", + (socketIndex + 1), maxSocketCount); + closeSockets(SERVER_SOCKET, sockets); + throw new RuntimeException(message, ioe); + } + } + String message = String.format( + "Connected %s sockets, but still could not exhaust the socket admission", + maxSocketCount); + closeSockets(SERVER_SOCKET, sockets); + throw new RuntimeException(message); + } + + @AfterAll + public static void closeSockets() { + closeSockets(SERVER_SOCKET, CLIENT_SOCKETS); + } + + private static void closeSockets(ServerSocket serverSocket, List clientSockets) { + Throwable[] throwable = {null}; + Stream.concat(clientSockets.stream(), Stream.of(serverSocket)).forEach(closeable -> { + try { + closeable.close(); + } catch (Exception exception) { + if (throwable[0] == null) { + throwable[0] = exception; + } else { + throwable[0].addSuppressed(exception); + } + } + }); + if (throwable[0] != null) { + throwable[0].printStackTrace(System.out); + } + } + + /** + * {@link ProxySelector} always pointing to {@link #SERVER_SOCKET}. + */ + private static final ProxySelector PROXY_SELECTOR = new ProxySelector() { + + private static final List PROXIES = + List.of(new Proxy(Proxy.Type.HTTP, SERVER_SOCKET.getLocalSocketAddress())); + + @Override + public List select(URI uri) { + return PROXIES; + } + + @Override + public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { + // Do nothing + } + + }; + + private static final Duration NO_DURATION = null; + + private static List> TIMEOUTS = List.of( + // connectTimeout HttpRequest timeout + Arrays.asList( NO_DURATION, ofMillis(100) ), + Arrays.asList( NO_DURATION, ofNanos(1) ), + + Arrays.asList( ofMillis(100), NO_DURATION ), + Arrays.asList( ofNanos(1), NO_DURATION ), + + Arrays.asList( ofMillis(100), ofMinutes(1) ), + Arrays.asList( ofNanos(1), ofMinutes(1) ) + ); + + private static final List METHODS = List.of("GET", "POST"); + private static final List VERSIONS = List.of(HTTP_2, HTTP_1_1); + private static final List SCHEMES = List.of("https", "http"); + + static Object[][] variants() { + List l = new ArrayList<>(); + for (List timeouts : TIMEOUTS) { + Duration connectTimeout = timeouts.get(0); + Duration requestTimeout = timeouts.get(1); + for (String method: METHODS) { + for (String scheme : SCHEMES) { + for (Version requestVersion : VERSIONS) { + l.add(new Object[] {requestVersion, scheme, method, connectTimeout, requestTimeout}); + }}}} + return l.stream().toArray(Object[][]::new); + } + + @ParameterizedTest + @MethodSource("variants") + void test( + Version requestVersion, + String scheme, + String method, + Duration connectTimeout, + Duration requestTimeout) + throws Exception { + ProxySelector proxySelector = parseBoolean(System.getProperty("test.proxy")) ? PROXY_SELECTOR : NO_PROXY; + boolean async = parseBoolean(System.getProperty("test.async")); + if (async) { + timeoutAsync(requestVersion, scheme, method, connectTimeout, requestTimeout, proxySelector); + } else { + timeoutSync(requestVersion, scheme, method, connectTimeout, requestTimeout, proxySelector); + } + } + + private void timeoutSync(Version requestVersion, + String scheme, + String method, + Duration connectTimeout, + Duration requestTimeout, + ProxySelector proxy) + throws Exception + { + HttpClient client = newClient(connectTimeout, proxy); + HttpRequest request = newRequest(scheme, requestVersion, method, requestTimeout); + + for (int i = 0; i < 2; i++) { + LOGGER.printf("iteration %d%n", i); + long startTime = System.nanoTime(); + try { + HttpResponse resp = client.send(request, BodyHandlers.ofString()); + printResponse(resp); + fail("Unexpected response: " + resp); + } catch (HttpConnectTimeoutException expected) { // blocking thread-specific exception + long elapsedTime = NANOSECONDS.toMillis(System.nanoTime() - startTime); + LOGGER.printf("Client: received in %d millis%n", elapsedTime); + assertExceptionTypeAndCause(expected.getCause()); + } catch (ConnectException e) { + long elapsedTime = NANOSECONDS.toMillis(System.nanoTime() - startTime); + LOGGER.printf("Client: received in %d millis%n", elapsedTime); + Throwable t = e.getCause().getCause(); // blocking thread-specific exception + e.printStackTrace(LOGGER); + fail("Unexpected exception:" + e); + } + } + } + + private void timeoutAsync(Version requestVersion, + String scheme, + String method, + Duration connectTimeout, + Duration requestTimeout, + ProxySelector proxy) { + HttpClient client = newClient(connectTimeout, proxy); + HttpRequest request = newRequest(scheme, requestVersion, method, requestTimeout); + for (int i = 0; i < 2; i++) { + LOGGER.printf("iteration %d%n", i); + long startTime = System.nanoTime(); + try { + HttpResponse resp = client.sendAsync(request, BodyHandlers.ofString()).join(); + printResponse(resp); + fail("Unexpected response: " + resp); + } catch (CompletionException e) { + long elapsedTime = NANOSECONDS.toMillis(System.nanoTime() - startTime); + LOGGER.printf("Client: received in %d millis%n", elapsedTime); + Throwable t = e.getCause(); + assertExceptionTypeAndCause(t); + } + } + } + + private static HttpClient newClient(Duration connectTimeout, ProxySelector proxy) { + HttpClient.Builder builder = HttpClient.newBuilder().proxy(proxy); + if (connectTimeout != NO_DURATION) + builder.connectTimeout(connectTimeout); + return builder.build(); + } + + private static HttpRequest newRequest(String scheme, + Version reqVersion, + String method, + Duration requestTimeout) { + String hostAddress = SERVER_SOCKET.getInetAddress().getHostAddress(); + int hostPort = SERVER_SOCKET.getLocalPort(); + URI uri = URI.create(scheme + "://" + hostAddress + ':' + hostPort); + HttpRequest.Builder reqBuilder = HttpRequest.newBuilder(uri); + reqBuilder = reqBuilder.version(reqVersion); + switch (method) { + case "GET" : reqBuilder.GET(); break; + case "POST" : reqBuilder.POST(BodyPublishers.noBody()); break; + default: throw new AssertionError("Unknown method:" + method); + } + if (requestTimeout != NO_DURATION) + reqBuilder.timeout(requestTimeout); + return reqBuilder.build(); + } + + private static void assertExceptionTypeAndCause(Throwable t) { + if (!(t instanceof HttpConnectTimeoutException)) { + t.printStackTrace(LOGGER); + fail("Expected HttpConnectTimeoutException, got:" + t); + } + Throwable connEx = t.getCause(); + if (!(connEx instanceof ConnectException)) { + t.printStackTrace(LOGGER); + fail("Expected ConnectException cause in:" + connEx); + } + LOGGER.printf("Caught expected HttpConnectTimeoutException with ConnectException" + + " cause: %n%s%n%s%n", t, connEx); + final String EXPECTED_MESSAGE = "HTTP connect timed out"; // impl dependent + if (!connEx.getMessage().equals(EXPECTED_MESSAGE)) + fail("Expected: \"" + EXPECTED_MESSAGE + "\", got: \"" + connEx.getMessage() + "\""); + + } + + private static void printResponse(HttpResponse response) { + LOGGER.println("Unexpected response: " + response); + LOGGER.println("Headers: " + response.headers()); + LOGGER.println("Body: " + response.body()); + } + +} diff --git a/test/jdk/java/net/httpclient/ConnectTimeoutWithProxySync.java b/test/jdk/java/net/httpclient/ConnectTimeoutWithProxySync.java deleted file mode 100644 index a61fdc48bcf..00000000000 --- a/test/jdk/java/net/httpclient/ConnectTimeoutWithProxySync.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2018, 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.net.http.HttpClient.Version; -import java.time.Duration; -import org.testng.annotations.Test; - -/* - * @test - * @summary Tests for connection related timeouts - * @bug 8208391 - * @run testng/othervm ConnectTimeoutWithProxySync - */ - -public class ConnectTimeoutWithProxySync extends AbstractConnectTimeout { - - @Test(dataProvider = "variants") - @Override - public void timeoutWithProxySync(Version requestVersion, - String scheme, - String method, - Duration connectTimeout, - Duration requestTimeout) - throws Exception - { - super.timeoutWithProxySync(requestVersion, scheme, method, connectTimeout, requestTimeout); - } -} diff --git a/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java b/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java index 75c7c984a6b..01c166dcb1b 100644 --- a/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java +++ b/test/jdk/java/net/httpclient/ContentLengthHeaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +30,7 @@ * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters * @bug 8283544 8358942 - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.allowRestrictedHeaders=content-length * -Djdk.internal.httpclient.debug=true * ContentLengthHeaderTest @@ -39,10 +39,6 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.io.IOException; import java.io.InputStream; @@ -59,19 +55,22 @@ import java.util.Optional; import javax.net.ssl.SSLContext; import jdk.test.lib.net.URIBuilder; - import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ContentLengthHeaderTest implements HttpServerAdapters { - final String NO_BODY_PATH = "/no_body"; - final String BODY_PATH = "/body"; + static final String NO_BODY_PATH = "/no_body"; + static final String BODY_PATH = "/body"; static HttpTestServer testContentLengthServerH1; static HttpTestServer testContentLengthServerH2; @@ -79,13 +78,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { static PrintStream testLog = System.err; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpClient hc; - URI testContentLengthURIH1; - URI testContentLengthURIH2; - URI testContentLengthURIH3; + private static HttpClient hc; + private static URI testContentLengthURIH1; + private static URI testContentLengthURIH2; + private static URI testContentLengthURIH3; - @BeforeTest - public void setup() throws IOException, URISyntaxException, InterruptedException { + @BeforeAll + public static void setup() throws IOException, URISyntaxException, InterruptedException { testContentLengthServerH1 = HttpTestServer.create(HTTP_1_1); testContentLengthServerH2 = HttpTestServer.create(HTTP_2, sslContext); testContentLengthServerH3 = HttpTestServer.create(HTTP_3, sslContext); @@ -128,7 +127,7 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { + testContentLengthServerH3.getH3AltService().get().getAddress()); testLog.println("Request URI for Client: " + testContentLengthURIH3); - hc = newClientBuilderForH3() + hc = HttpServerAdapters.createClientBuilderForH3() .proxy(HttpClient.Builder.NO_PROXY) .sslContext(sslContext) .build(); @@ -139,12 +138,12 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .build(); // populate alt-service registry var resp = hc.send(firstReq, BodyHandlers.ofString()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); testLog.println("**** setup done ****"); } - @AfterTest - public void teardown() { + @AfterAll + public static void teardown() { testLog.println("**** tearing down ****"); if (testContentLengthServerH1 != null) testContentLengthServerH1.stop(); @@ -154,8 +153,7 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { testContentLengthServerH3.stop(); } - @DataProvider(name = "bodies") - Object[][] bodies() { + static Object[][] bodies() { return new Object[][]{ {HTTP_1_1, URI.create(testContentLengthURIH1 + BODY_PATH)}, {HTTP_2, URI.create(testContentLengthURIH2 + BODY_PATH)}, @@ -163,15 +161,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { }; } - @DataProvider(name = "h1body") - Object[][] h1body() { + static Object[][] h1body() { return new Object[][]{ {HTTP_1_1, URI.create(testContentLengthURIH1 + BODY_PATH)} }; } - @DataProvider(name = "nobodies") - Object[][] nobodies() { + static Object[][] nobodies() { return new Object[][]{ {HTTP_1_1, URI.create(testContentLengthURIH1 + NO_BODY_PATH)}, {HTTP_2, URI.create(testContentLengthURIH2 + NO_BODY_PATH)}, @@ -179,8 +175,9 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { }; } - @Test(dataProvider = "nobodies") + @ParameterizedTest // A GET request with no request body should have no Content-length header + @MethodSource("nobodies") public void getWithNoBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking GET with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -189,12 +186,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "nobodies") + @ParameterizedTest // A GET request with empty request body should have no Content-length header + @MethodSource("nobodies") public void getWithEmptyBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking GET with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -203,12 +201,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "bodies") + @ParameterizedTest // A GET request with empty request body and explicitly added Content-length header + @MethodSource("bodies") public void getWithZeroContentLength(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking GET with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -218,13 +217,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "bodies") + @ParameterizedTest // A GET request with a request body should have a Content-length header // in HTTP/1.1 + @MethodSource("bodies") public void getWithBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking GET with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -233,12 +233,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "nobodies") + @ParameterizedTest // A DELETE request with no request body should have no Content-length header + @MethodSource("nobodies") public void deleteWithNoBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking DELETE with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -247,12 +248,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "nobodies") + @ParameterizedTest // A DELETE request with empty request body should have no Content-length header + @MethodSource("nobodies") public void deleteWithEmptyBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking DELETE with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -261,13 +263,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "bodies") + @ParameterizedTest // A DELETE request with a request body should have a Content-length header // in HTTP/1.1 + @MethodSource("bodies") public void deleteWithBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking DELETE with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -276,12 +279,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "nobodies") + @ParameterizedTest // A HEAD request with no request body should have no Content-length header + @MethodSource("nobodies") public void headWithNoBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking HEAD with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -290,12 +294,13 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "nobodies") + @ParameterizedTest // A HEAD request with empty request body should have no Content-length header + @MethodSource("nobodies") public void headWithEmptyBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking HEAD with no request body"); HttpRequest req = HttpRequest.newBuilder() @@ -304,13 +309,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "bodies") + @ParameterizedTest // A HEAD request with a request body should have a Content-length header // in HTTP/1.1 + @MethodSource("bodies") public void headWithBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking HEAD with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -321,13 +327,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { // Sending this request invokes sendResponseHeaders which emits a warning about including // a Content-length header with a HEAD request HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "h1body") + @ParameterizedTest // A POST request with empty request body should have a Content-length header // in HTTP/1.1 + @MethodSource("h1body") public void postWithEmptyBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking POST with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -336,13 +343,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "bodies") + @ParameterizedTest // A POST request with a request body should have a Content-length header // in HTTP/1.1 + @MethodSource("bodies") public void postWithBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking POST with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -351,13 +359,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "h1body") + @ParameterizedTest // A PUT request with empty request body should have a Content-length header // in HTTP/1.1 + @MethodSource("h1body") public void putWithEmptyBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking PUT with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -366,13 +375,14 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } - @Test(dataProvider = "bodies") + @ParameterizedTest // A PUT request with a request body should have a Content-length header // in HTTP/1.1 + @MethodSource("bodies") public void putWithBody(Version version, URI uri) throws IOException, InterruptedException { testLog.println(version + " Checking PUT with request body"); HttpRequest req = HttpRequest.newBuilder() @@ -381,8 +391,8 @@ public class ContentLengthHeaderTest implements HttpServerAdapters { .uri(uri) .build(); HttpResponse resp = hc.send(req, HttpResponse.BodyHandlers.ofString(UTF_8)); - assertEquals(resp.statusCode(), 200, resp.body()); - assertEquals(resp.version(), version); + assertEquals(200, resp.statusCode(), resp.body()); + assertEquals(version, resp.version()); } public static void handleResponse(long expected, HttpTestExchange ex, String body, int rCode) throws IOException { diff --git a/test/jdk/java/net/httpclient/CookieHeaderTest.java b/test/jdk/java/net/httpclient/CookieHeaderTest.java index cd47262825c..62e62680e03 100644 --- a/test/jdk/java/net/httpclient/CookieHeaderTest.java +++ b/test/jdk/java/net/httpclient/CookieHeaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,17 +27,13 @@ * @summary Test for multiple vs single cookie header for HTTP/2 vs HTTP/1.1 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.tls.acknowledgeCloseNotify=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * CookieHeaderTest */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLContext; @@ -78,26 +74,31 @@ import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class CookieHeaderTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - DummyServer httpDummyServer; - DummyServer httpsDummyServer; - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; - String httpDummy; - String httpsDummy; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static DummyServer httpDummyServer; + private static DummyServer httpsDummyServer; + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; + private static String httpDummy; + private static String httpsDummy; static final String MESSAGE = "Basic CookieHeaderTest message body"; static final int ITERATIONS = 3; @@ -110,8 +111,7 @@ public class CookieHeaderTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { httpURI, HTTP_1_1 }, { httpsURI, HTTP_1_1 }, @@ -129,7 +129,8 @@ public class CookieHeaderTest implements HttpServerAdapters { static final AtomicLong requestCounter = new AtomicLong(); - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, HttpClient.Version version) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); ConcurrentHashMap> cookieHeaders @@ -169,14 +170,15 @@ public class CookieHeaderTest implements HttpServerAdapters { + ", version=" + response.version()); out.println(" Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); - assertEquals(response.headers().allValues("X-Request-Cookie"), - cookies.stream() - .filter(s -> !s.startsWith("LOC")) - .collect(Collectors.toList())); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); + List expectedCookieList = cookies.stream() + .filter(s -> !s.startsWith("LOC")).toList(); + List actualCookieList = response.headers() + .allValues("X-Request-Cookie"); + assertEquals(expectedCookieList, actualCookieList); if (version == HTTP_3 && i > 0) { - assertEquals(response.version(), HTTP_3); + assertEquals(HTTP_3, response.version()); } requestBuilder = HttpRequest.newBuilder(uri) .header("X-uuid", "uuid-" + requestCounter.incrementAndGet()); @@ -192,8 +194,8 @@ public class CookieHeaderTest implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new CookieValidationHandler(), "/http1/cookie/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/cookie/retry"; @@ -228,8 +230,8 @@ public class CookieHeaderTest implements HttpServerAdapters { httpsDummyServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/CustomRequestPublisher.java b/test/jdk/java/net/httpclient/CustomRequestPublisher.java index f26def9a44c..c8d22419852 100644 --- a/test/jdk/java/net/httpclient/CustomRequestPublisher.java +++ b/test/jdk/java/net/httpclient/CustomRequestPublisher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,7 +26,7 @@ * @summary Checks correct handling of Publishers that call onComplete without demand * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm CustomRequestPublisher + * @run junit/othervm CustomRequestPublisher */ import java.net.InetAddress; @@ -51,10 +51,6 @@ import java.net.http.HttpResponse; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -62,27 +58,31 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.net.http.HttpResponse.BodyHandlers.ofString; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class CustomRequestPublisher implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { Supplier fixedSupplier = () -> new FixedLengthBodyPublisher(); Supplier unknownSupplier = () -> new UnknownLengthBodyPublisher(); @@ -114,12 +114,12 @@ public class CustomRequestPublisher implements HttpServerAdapters { /** Asserts HTTP Version, and SSLSession presence when applicable. */ static void assertVersionAndSession(int step, HttpResponse response, String uri) { if (uri.contains("http2") || uri.contains("https2")) { - assertEquals(response.version(), HTTP_2); + assertEquals(HTTP_2, response.version()); } else if (uri.contains("http1") || uri.contains("https1")) { - assertEquals(response.version(), HTTP_1_1); + assertEquals(HTTP_1_1, response.version()); } else if (uri.contains("http3")) { - if (step == 0) assertNotEquals(response.version(), HTTP_1_1); - else assertEquals(response.version(), HTTP_3, + if (step == 0) assertNotEquals(HTTP_1_1, response.version()); + else assertEquals(HTTP_3, response.version(), "unexpected response version on step " + step); } else { fail("Unknown HTTP version in test for: " + uri); @@ -160,7 +160,8 @@ public class CustomRequestPublisher implements HttpServerAdapters { return builder; } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void test(String uri, Supplier bpSupplier, boolean sameClient) throws Exception { @@ -180,13 +181,14 @@ public class CustomRequestPublisher implements HttpServerAdapters { out.println("Got body: " + resp.body()); assertTrue(resp.statusCode() == 200, "Expected 200, got:" + resp.statusCode()); - assertEquals(resp.body(), bodyPublisher.bodyAsString()); + assertEquals(bodyPublisher.bodyAsString(), resp.body()); assertVersionAndSession(i, resp, uri); } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void testAsync(String uri, Supplier bpSupplier, boolean sameClient) throws Exception { @@ -207,7 +209,7 @@ public class CustomRequestPublisher implements HttpServerAdapters { out.println("Got body: " + resp.body()); assertTrue(resp.statusCode() == 200, "Expected 200, got:" + resp.statusCode()); - assertEquals(resp.body(), bodyPublisher.bodyAsString()); + assertEquals(bodyPublisher.bodyAsString(), resp.body()); assertVersionAndSession(0, resp, uri); } @@ -337,8 +339,8 @@ public class CustomRequestPublisher implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new HttpTestEchoHandler(), "/http1/echo"); @@ -367,8 +369,8 @@ public class CustomRequestPublisher implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/CustomResponseSubscriber.java b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java index c581491a214..b2695271035 100644 --- a/test/jdk/java/net/httpclient/CustomResponseSubscriber.java +++ b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm CustomResponseSubscriber + * @run junit/othervm CustomResponseSubscriber */ import java.io.IOException; @@ -59,37 +59,37 @@ import jdk.httpclient.test.lib.http2.Http2Handler; import javax.net.ssl.SSLContext; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class CustomResponseSubscriber { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpsServer httpsTestServer; // HTTPS/1.1 - Http2TestServer http2TestServer; // HTTP/2 ( h2c ) - Http2TestServer https2TestServer; // HTTP/2 ( h2 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; + private static HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpsServer httpsTestServer; // HTTPS/1.1 + private static Http2TestServer http2TestServer; // HTTP/2 ( h2c ) + private static Http2TestServer https2TestServer; // HTTP/2 ( h2 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; static final int ITERATION_COUNT = 10; // a shared executor helps reduce the amount of threads created by the test static final Executor executor = Executors.newCachedThreadPool(); - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpURI_fixed, false }, { httpURI_chunk, false }, @@ -118,7 +118,8 @@ public class CustomResponseSubscriber { .build(); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsString(String uri, boolean sameClient) throws Exception { HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { @@ -130,14 +131,14 @@ public class CustomResponseSubscriber { BodyHandler handler = new CRSBodyHandler(); HttpResponse response = client.send(req, handler); String body = response.body(); - assertEquals(body, ""); + assertEquals("", body); } } static class CRSBodyHandler implements BodyHandler { @Override public BodySubscriber apply(HttpResponse.ResponseInfo rinfo) { - assertEquals(rinfo.statusCode(), 200); + assertEquals(200, rinfo.statusCode()); return new CRSBodySubscriber(); } } @@ -185,8 +186,8 @@ public class CustomResponseSubscriber { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpHandler h1_fixedLengthHandler = new HTTP1_FixedLengthHandler(); HttpHandler h1_chunkHandler = new HTTP1_ChunkedHandler(); @@ -226,8 +227,8 @@ public class CustomResponseSubscriber { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(0); httpsTestServer.stop(0); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/DependentActionsTest.java b/test/jdk/java/net/httpclient/DependentActionsTest.java index 9a77d377497..fcfbb393e5a 100644 --- a/test/jdk/java/net/httpclient/DependentActionsTest.java +++ b/test/jdk/java/net/httpclient/DependentActionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DependentActionsTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.quic.maxPtoBackoff=9 * DependentActionsTest */ @@ -39,12 +39,6 @@ import java.io.InputStreamReader; import java.lang.StackWalker.StackFrame; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.SkipException; -import org.testng.annotations.AfterTest; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -89,28 +83,35 @@ import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.util.stream.Collectors.toList; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class DependentActionsTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; - String http3URI_fixed; - String http3URI_chunk; - String http3URI_head; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; + private static String http3URI_fixed; + private static String http3URI_chunk; + private static String http3URI_head; static final StackWalker WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); @@ -132,7 +133,7 @@ public class DependentActionsTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - private volatile HttpClient sharedClient; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -158,7 +159,7 @@ public class DependentActionsTest implements HttpServerAdapters { } } - @AfterClass + @AfterAll static final void printFailedTests() { out.println("\n========================="); try { @@ -179,7 +180,7 @@ public class DependentActionsTest implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { httpURI_fixed, httpURI_chunk, @@ -206,8 +207,7 @@ public class DependentActionsTest implements HttpServerAdapters { } } - @DataProvider(name = "noStalls") - public Object[][] noThrows() { + public static Object[][] noThrows() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -220,8 +220,7 @@ public class DependentActionsTest implements HttpServerAdapters { return result; } - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -237,20 +236,21 @@ public class DependentActionsTest implements HttpServerAdapters { return result; } - private HttpClient makeNewClient() { + private static HttpClient makeNewClient() { clientCount.incrementAndGet(); - return newClientBuilderForH3() + return HttpServerAdapters.createClientBuilderForH3() .proxy(Builder.NO_PROXY) .executor(executor) .sslContext(sslContext) .build(); } - HttpClient newHttpClient(boolean share) { + private static final Object zis = new Object(); + static HttpClient newHttpClient(boolean share) { if (!share) return makeNewClient(); HttpClient shared = sharedClient; if (shared != null) return shared; - synchronized (this) { + synchronized (zis) { shared = sharedClient; if (shared == null) { shared = sharedClient = makeNewClient(); @@ -259,7 +259,8 @@ public class DependentActionsTest implements HttpServerAdapters { } } - @Test(dataProvider = "noStalls") + @ParameterizedTest + @MethodSource("noThrows") public void testNoStalls(String uri, boolean sameClient) throws Exception { HttpClient client = null; @@ -279,11 +280,12 @@ public class DependentActionsTest implements HttpServerAdapters { BodyHandlers.ofString()); HttpResponse response = client.send(req, handler); String body = response.body(); - assertEquals(URI.create(body).getPath(), URI.create(uri).getPath()); + assertEquals(URI.create(uri).getPath(), URI.create(body).getPath()); } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsStringAsync(String uri, boolean sameClient, Supplier s) @@ -296,7 +298,8 @@ public class DependentActionsTest implements HttpServerAdapters { this::finish, this::extractString, staller); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsLinesAsync(String uri, boolean sameClient, Supplier s) @@ -309,7 +312,8 @@ public class DependentActionsTest implements HttpServerAdapters { this::finish, this::extractStream, staller); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsInputStreamAsync(String uri, boolean sameClient, Supplier s) @@ -329,11 +333,8 @@ public class DependentActionsTest implements HttpServerAdapters { Staller staller) throws Exception { - if (errorRef.get() != null) { - SkipException sk = new SkipException("skipping due to previous failure: " + name); - sk.setStackTrace(new StackTraceElement[0]); - throw sk; - } + Assumptions.assumeTrue(errorRef.get() == null, + "skipping due to previous failure: " + name); out.printf("%n%s%s%n", now(), name); try { testDependent(uri, sameClient, handlers, finisher, extractor, staller); @@ -376,7 +377,7 @@ public class DependentActionsTest implements HttpServerAdapters { // it's possible that the first request still went through HTTP/2 // if the config was HTTP3_ANY. Retry it - the next time we should // have HTTP/3 - assertEquals(resp.version(), HTTP_3, + assertEquals(HTTP_3, resp.version(), "expected second request to go through HTTP/3 (serverConfig=" + http3TestServer.h3DiscoveryConfig() + ")"); } @@ -479,10 +480,10 @@ public class DependentActionsTest implements HttpServerAdapters { throw new RuntimeException("Test failed in " + w + ": " + response, error); } - assertEquals(result, List.of(response.request().uri().getPath())); + assertEquals(List.of(response.request().uri().getPath()), result); var uriStr = response.request().uri().toString(); if (HTTP_3 != version(uriStr) || http3TestServer.h3DiscoveryConfig() != Http3DiscoveryMode.ANY) { - assertEquals(response.version(), version(uriStr), uriStr); + assertEquals(version(uriStr), response.version(), uriStr); } return response; } finally { @@ -619,7 +620,7 @@ public class DependentActionsTest implements HttpServerAdapters { return null; } - HttpRequest.Builder newRequestBuilder(String uri) { + static HttpRequest.Builder newRequestBuilder(String uri) { var builder = HttpRequest.newBuilder(URI.create(uri)); if (version(uri) == HTTP_3) { builder.version(HTTP_3); @@ -628,21 +629,21 @@ public class DependentActionsTest implements HttpServerAdapters { return builder; } - HttpResponse headRequest(HttpClient client) + static HttpResponse headRequest(HttpClient client) throws IOException, InterruptedException { var request = newRequestBuilder(http3URI_head) .HEAD().version(HTTP_2).build(); var response = client.send(request, BodyHandlers.ofString()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_2); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_2, response.version()); System.out.println("\n--- HEAD request succeeded ----\n"); System.err.println("\n--- HEAD request succeeded ----\n"); return response; } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpTestHandler h1_fixedLengthHandler = new HTTP_FixedLengthHandler(); HttpTestHandler h1_chunkHandler = new HTTP_ChunkedHandler(); @@ -703,8 +704,8 @@ public class DependentActionsTest implements HttpServerAdapters { headRequest(newHttpClient(true)); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sharedClient = null; httpTestServer.stop(); httpsTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java index f1b07f7abce..e045f4e22f1 100644 --- a/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java +++ b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * DependentPromiseActionsTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true DependentPromiseActionsTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true DependentPromiseActionsTest */ import java.io.BufferedReader; @@ -37,11 +37,6 @@ import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import java.lang.StackWalker.StackFrame; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -93,21 +88,26 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class DependentPromiseActionsTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; - String http3URI_fixed; - String http3URI_chunk; + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; + private static String http3URI_fixed; + private static String http3URI_chunk; static final StackWalker WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); @@ -129,7 +129,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - private volatile HttpClient sharedClient; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -155,7 +155,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { } } - @AfterClass + @AfterAll static final void printFailedTests() { out.println("\n========================="); try { @@ -176,7 +176,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { http3URI_fixed, http3URI_chunk, @@ -201,8 +201,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { } } - @DataProvider(name = "noStalls") - public Object[][] noThrows() { + public static Object[][] noThrows() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -215,8 +214,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { return result; } - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -271,7 +269,8 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { return builder.build(); } - @Test(dataProvider = "noStalls") + @ParameterizedTest + @MethodSource("noThrows") public void testNoStalls(String rootUri, boolean sameClient) throws Exception { if (!FAILURES.isEmpty()) return; @@ -287,7 +286,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { HttpRequest req = request(uri); BodyHandler> handler = - new StallingBodyHandler((w) -> {}, + new StallingBodyHandler<>((w) -> {}, BodyHandlers.ofLines()); Map>>> pushPromises = new ConcurrentHashMap<>(); @@ -304,13 +303,13 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { HttpResponse> response = client.sendAsync(req, BodyHandlers.ofLines(), pushHandler).get(); String body = response.body().collect(Collectors.joining("|")); - assertEquals(URI.create(body).getPath(), URI.create(uri).getPath()); + assertEquals(URI.create(uri).getPath(), URI.create(body).getPath()); for (HttpRequest promised : pushPromises.keySet()) { out.printf("%s Received promise: %s%n\tresponse: %s%n", now(), promised, pushPromises.get(promised).get()); String promisedBody = pushPromises.get(promised).get().body() .collect(Collectors.joining("|")); - assertEquals(promisedBody, promised.uri().toASCIIString()); + assertEquals(promised.uri().toASCIIString(), promisedBody); } assertEquals(3, pushPromises.size()); } @@ -321,8 +320,9 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testAsStringAsync(String uri, + @ParameterizedTest + @MethodSource("variants") + void testAsStringAsync(String uri, boolean sameClient, Supplier stallers) throws Exception @@ -334,8 +334,9 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { SubscriberType.EAGER); } - @Test(dataProvider = "variants") - public void testAsLinesAsync(String uri, + @ParameterizedTest + @MethodSource("variants") + void testAsLinesAsync(String uri, boolean sameClient, Supplier stallers) throws Exception @@ -347,8 +348,9 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { SubscriberType.LAZZY); } - @Test(dataProvider = "variants") - public void testAsInputStreamAsync(String uri, + @ParameterizedTest + @MethodSource("variants") + void testAsInputStreamAsync(String uri, boolean sameClient, Supplier stallers) throws Exception @@ -362,7 +364,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { private void testDependent(String name, String uri, boolean sameClient, Supplier> handlers, - Finisher finisher, + Finisher finisher, Extractor extractor, Supplier stallers, SubscriberType subscriberType) @@ -384,7 +386,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { private void testDependent(String rootUri, boolean sameClient, Supplier> handlers, - Finisher finisher, + Finisher finisher, Extractor extractor, Supplier stallers, SubscriberType subscriberType) @@ -424,7 +426,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { enum Where { ON_PUSH_PROMISE, BODY_HANDLER, ON_SUBSCRIBE, ON_NEXT, ON_COMPLETE, ON_ERROR, GET_BODY, BODY_CF; public Consumer select(Consumer consumer) { - return new Consumer() { + return new Consumer<>() { @Override public void accept(Where where) { if (Where.this == where) { @@ -475,10 +477,10 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { staller.acquire(); assert staller.willStall(); try { - BodyHandler handler = new StallingBodyHandler<>( + BodyHandler handler = new StallingBodyHandler<>( where.select(staller), handlers.get()); CompletableFuture> cf = acceptor.apply(handler); - Tuple tuple = new Tuple(failed, cf, staller); + Tuple tuple = new Tuple<>(failed, cf, staller); promiseMap.putIfAbsent(pushPromiseRequest, tuple); CompletableFuture done = cf.whenComplete( (r, t) -> checkThreadAndStack(thread, failed, r, t)); @@ -567,7 +569,7 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { throw new RuntimeException("Test failed in " + w + ": " + uri, error); } - assertEquals(result, List.of(response.request().uri().toASCIIString())); + assertEquals(List.of(response.request().uri().toASCIIString()), result); } finally { staller.reset(); } @@ -582,10 +584,10 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { for (HttpRequest req : ph.promiseMap.keySet()) { finish(w, ph.promiseMap.get(req), extractor); } - assertEquals(ph.promiseMap.size(), 3, + assertEquals(3, ph.promiseMap.size(), "Expected 3 push promises for " + w + " in " + response.request().uri()); - assertEquals(result, List.of(response.request().uri().toASCIIString())); + assertEquals(List.of(response.request().uri().toASCIIString()), result); } @@ -699,8 +701,8 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/2 HttpTestHandler fixedLengthHandler = new HTTP_FixedLengthHandler(); HttpTestHandler chunkedHandler = new HTTP_ChunkedHandler(); @@ -729,8 +731,8 @@ public class DependentPromiseActionsTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { if (sharedClient != null) { sharedClient.close(); } diff --git a/test/jdk/java/net/httpclient/EchoHandler.java b/test/jdk/java/net/httpclient/EchoHandler.java deleted file mode 100644 index 9fd86083801..00000000000 --- a/test/jdk/java/net/httpclient/EchoHandler.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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 com.sun.net.httpserver.*; -import java.net.*; -import java.net.http.*; -import java.io.*; -import java.util.concurrent.*; -import javax.net.ssl.*; -import java.nio.file.*; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Random; -import jdk.test.lib.net.SimpleSSLContext; -import static java.net.http.HttpRequest.*; -import static java.net.http.HttpResponse.*; -import java.util.logging.ConsoleHandler; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class EchoHandler implements HttpHandler { - static final Path CWD = Paths.get("."); - public EchoHandler() {} - - @Override - public void handle(HttpExchange t) - throws IOException { - try { - System.err.println("EchoHandler received request to " + t.getRequestURI()); - InputStream is = t.getRequestBody(); - Headers map = t.getRequestHeaders(); - Headers map1 = t.getResponseHeaders(); - map1.add("X-Hello", "world"); - map1.add("X-Bye", "universe"); - String fixedrequest = map.getFirst("XFixed"); - File outfile = Files.createTempFile(CWD, "foo", "bar").toFile(); - FileOutputStream fos = new FileOutputStream(outfile); - int count = (int) is.transferTo(fos); - is.close(); - fos.close(); - InputStream is1 = new FileInputStream(outfile); - OutputStream os = null; - // return the number of bytes received (no echo) - String summary = map.getFirst("XSummary"); - if (fixedrequest != null && summary == null) { - t.sendResponseHeaders(200, count); - os = t.getResponseBody(); - is1.transferTo(os); - } else { - t.sendResponseHeaders(200, 0); - os = t.getResponseBody(); - is1.transferTo(os); - - if (summary != null) { - String s = Integer.toString(count); - os.write(s.getBytes()); - } - } - outfile.delete(); - os.close(); - is1.close(); - } catch (Throwable e) { - e.printStackTrace(); - throw new IOException(e); - } - } -} diff --git a/test/jdk/java/net/httpclient/EncodedCharsInURI.java b/test/jdk/java/net/httpclient/EncodedCharsInURI.java index eab9a29b172..19b0a1d651b 100644 --- a/test/jdk/java/net/httpclient/EncodedCharsInURI.java +++ b/test/jdk/java/net/httpclient/EncodedCharsInURI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * EncodedCharsInURI - * @run testng/othervm + * @run junit/othervm * -Djdk.tls.acknowledgeCloseNotify=true * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=headers,errors EncodedCharsInURI @@ -38,11 +38,6 @@ import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLContext; @@ -83,32 +78,37 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; import static java.net.http.HttpClient.Builder.NO_PROXY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class EncodedCharsInURI implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - DummyServer httpDummyServer; // HTTP/1.1 [ 2 servers ] - DummyServer httpsDummyServer; // HTTPS/1.1 - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; - String http3URI_fixed; - String http3URI_chunk; - String http3URI_head; - String httpDummy; - String httpsDummy; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static DummyServer httpDummyServer; // HTTP/1.1 [ 2 servers ] + private static DummyServer httpsDummyServer; // HTTPS/1.1 + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; + private static String http3URI_fixed; + private static String http3URI_chunk; + private static String http3URI_head; + private static String httpDummy; + private static String httpsDummy; static final int ITERATION_COUNT = 1; // a shared executor helps reduce the amount of threads created by the test @@ -126,7 +126,7 @@ public class EncodedCharsInURI implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - private volatile HttpClient sharedClient; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -152,7 +152,7 @@ public class EncodedCharsInURI implements HttpServerAdapters { } } - @AfterClass + @AfterAll static final void printFailedTests() { out.println("\n========================="); try { @@ -172,7 +172,7 @@ public class EncodedCharsInURI implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { httpDummy, httpsDummy, @@ -189,8 +189,7 @@ public class EncodedCharsInURI implements HttpServerAdapters { }; } - @DataProvider(name = "noThrows") - public Object[][] noThrows() { + public static Object[][] noThrows() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; //Object[][] result = new Object[uris.length][]; @@ -216,7 +215,7 @@ public class EncodedCharsInURI implements HttpServerAdapters { return null; } - HttpRequest.Builder newRequestBuilder(String uri) { + static HttpRequest.Builder newRequestBuilder(String uri) { var builder = HttpRequest.newBuilder(URI.create(uri)); if (version(uri) == HTTP_3) { builder.version(HTTP_3); @@ -225,7 +224,7 @@ public class EncodedCharsInURI implements HttpServerAdapters { return builder; } - HttpResponse headRequest(HttpClient client) + static HttpResponse headRequest(HttpClient client) throws IOException, InterruptedException { out.println("\n" + now() + "--- Sending HEAD request ----\n"); @@ -234,27 +233,28 @@ public class EncodedCharsInURI implements HttpServerAdapters { var request = newRequestBuilder(http3URI_head) .HEAD().version(HTTP_2).build(); var response = client.send(request, BodyHandlers.ofString()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_2); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_2, response.version()); out.println("\n" + now() + "--- HEAD request succeeded ----\n"); err.println("\n" + now() + "--- HEAD request succeeded ----\n"); return response; } - private HttpClient makeNewClient() { + private static HttpClient makeNewClient() { clientCount.incrementAndGet(); - return newClientBuilderForH3() + return HttpServerAdapters.createClientBuilderForH3() .executor(executor) .proxy(NO_PROXY) .sslContext(sslContext) .build(); } - HttpClient newHttpClient(boolean share) { + private static final Object zis = new Object(); + static HttpClient newHttpClient(boolean share) { if (!share) return makeNewClient(); HttpClient shared = sharedClient; if (shared != null) return shared; - synchronized (this) { + synchronized (zis) { shared = sharedClient; if (shared == null) { shared = sharedClient = makeNewClient(); @@ -273,7 +273,8 @@ public class EncodedCharsInURI implements HttpServerAdapters { } } - @Test(dataProvider = "noThrows") + @ParameterizedTest + @MethodSource("noThrows") public void testEncodedChars(String uri, boolean sameClient) throws Exception { HttpClient client = null; @@ -302,13 +303,13 @@ public class EncodedCharsInURI implements HttpServerAdapters { } else { out.println("Found expected " + body + " in " + uri); } - assertEquals(response.version(), version(uri)); + assertEquals(version(uri), response.version()); } } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println(now() + "begin setup"); // HTTP/1.1 @@ -387,8 +388,8 @@ public class EncodedCharsInURI implements HttpServerAdapters { err.println(now() + "setup done"); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sharedClient.close(); httpTestServer.stop(); httpsTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/EscapedOctetsInURI.java b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java index abb0d7d8541..6ef71b7d22d 100644 --- a/test/jdk/java/net/httpclient/EscapedOctetsInURI.java +++ b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * @bug 8198716 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=reqeusts,headers * EscapedOctetsInURI */ @@ -52,10 +52,6 @@ import java.util.List; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.err; import static java.lang.System.out; @@ -65,24 +61,29 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.net.http.HttpClient.Builder.NO_PROXY; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class EscapedOctetsInURI implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; - String http3URI_head; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; + private static String http3URI_head; - private volatile HttpClient sharedClient; + private static volatile HttpClient sharedClient; static final String[][] pathsAndQueryStrings = new String[][] { // partial-path URI query @@ -95,8 +96,7 @@ public class EscapedOctetsInURI implements HttpServerAdapters { { "/012/with%20space", "?target=http%3A%2F%2Fwww.w3.org%2Fns%2Foa%23hasBody" }, }; - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { List list = new ArrayList<>(); for (boolean sameClient : new boolean[] { false, true }) { @@ -140,7 +140,7 @@ public class EscapedOctetsInURI implements HttpServerAdapters { return null; } - HttpRequest.Builder newRequestBuilder(String uri) { + static HttpRequest.Builder newRequestBuilder(String uri) { var builder = HttpRequest.newBuilder(URI.create(uri)); if (version(uri) == HTTP_3) { builder.version(HTTP_3); @@ -149,7 +149,7 @@ public class EscapedOctetsInURI implements HttpServerAdapters { return builder; } - HttpResponse headRequest(HttpClient client) + static HttpResponse headRequest(HttpClient client) throws IOException, InterruptedException { out.println("\n" + now() + "--- Sending HEAD request ----\n"); @@ -158,25 +158,26 @@ public class EscapedOctetsInURI implements HttpServerAdapters { var request = newRequestBuilder(http3URI_head) .HEAD().version(HTTP_2).build(); var response = client.send(request, BodyHandlers.ofString()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_2); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_2, response.version()); out.println("\n" + now() + "--- HEAD request succeeded ----\n"); err.println("\n" + now() + "--- HEAD request succeeded ----\n"); return response; } - private HttpClient makeNewClient() { - return newClientBuilderForH3() + private static HttpClient makeNewClient() { + return HttpServerAdapters.createClientBuilderForH3() .proxy(NO_PROXY) .sslContext(sslContext) .build(); } - HttpClient newHttpClient(boolean share) { + private static final Object zis = new Object(); + static HttpClient newHttpClient(boolean share) { if (!share) return makeNewClient(); HttpClient shared = sharedClient; if (shared != null) return shared; - synchronized (this) { + synchronized (zis) { shared = sharedClient; if (shared == null) { shared = sharedClient = makeNewClient(); @@ -193,7 +194,8 @@ public class EscapedOctetsInURI implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void test(String uriString, boolean sameClient) throws Exception { System.out.println("\n--- Starting "); @@ -217,19 +219,20 @@ public class EscapedOctetsInURI implements HttpServerAdapters { out.println("Got response: " + resp); out.println("Got body: " + resp.body()); - assertEquals(resp.statusCode(), 200, + assertEquals(200, resp.statusCode(), "Expected 200, got:" + resp.statusCode()); // the response body should contain the exact escaped request URI URI retrievedURI = URI.create(resp.body()); - assertEquals(retrievedURI.getRawPath(), uri.getRawPath()); - assertEquals(retrievedURI.getRawQuery(), uri.getRawQuery()); - assertEquals(resp.version(), version(uriString)); + assertEquals(uri.getRawPath(), retrievedURI.getRawPath()); + assertEquals(uri.getRawQuery(), retrievedURI.getRawQuery()); + assertEquals(version(uriString), resp.version()); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void testAsync(String uriString, boolean sameClient) throws Exception { System.out.println("\n--- Starting "); URI uri = URI.create(uriString); @@ -249,22 +252,22 @@ public class EscapedOctetsInURI implements HttpServerAdapters { .thenApply(response -> { out.println("Got response: " + response); out.println("Got body: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uriString)); + assertEquals(200, response.statusCode()); + assertEquals(version(uriString), response.version()); return response.body(); }) .thenApply(body -> URI.create(body)) .thenAccept(retrievedURI -> { // the body should contain the exact escaped request URI - assertEquals(retrievedURI.getRawPath(), uri.getRawPath()); - assertEquals(retrievedURI.getRawQuery(), uri.getRawQuery()); + assertEquals(uri.getRawPath(), retrievedURI.getRawPath()); + assertEquals(uri.getRawQuery(), retrievedURI.getRawQuery()); }).join(); } } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println(now() + "begin setup"); InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); @@ -311,8 +314,8 @@ public class EscapedOctetsInURI implements HttpServerAdapters { err.println(now() + "setup done"); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sharedClient.close(); httpTestServer.stop(); httpsTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/ExecutorShutdown.java b/test/jdk/java/net/httpclient/ExecutorShutdown.java index a7cfd56b282..a46ea66f3ae 100644 --- a/test/jdk/java/net/httpclient/ExecutorShutdown.java +++ b/test/jdk/java/net/httpclient/ExecutorShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * ExecutorShutdown @@ -65,10 +65,6 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; @@ -78,8 +74,13 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ExecutorShutdown implements HttpServerAdapters { @@ -89,25 +90,24 @@ public class ExecutorShutdown implements HttpServerAdapters { static final Random RANDOM = RandomFactory.getRandom(); private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/2 ( h2+h3 ) - HttpTestServer h3TestServer; // HTTP/2 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h3URI; - String h2h3Head; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/2 ( h2+h3 ) + private static HttpTestServer h3TestServer; // HTTP/2 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h3URI; + private static String h2h3Head; static final String MESSAGE = "ExecutorShutdown message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { h2h3URI, HTTP_3, h2h3TestServer.h3DiscoveryConfig() }, { h3URI, HTTP_3, h3TestServer.h3DiscoveryConfig() }, @@ -119,7 +119,7 @@ public class ExecutorShutdown implements HttpServerAdapters { } static final AtomicLong requestCounter = new AtomicLong(); - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static Throwable getCause(Throwable t) { while (t instanceof CompletionException || t instanceof ExecutionException) { @@ -158,7 +158,8 @@ public class ExecutorShutdown implements HttpServerAdapters { throw new AssertionError(what + ": Unexpected exception: " + cause, cause); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testConcurrent(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); ExecutorService executorService = Executors.newCachedThreadPool(); @@ -209,9 +210,9 @@ public class ExecutorShutdown implements HttpServerAdapters { var cf = responseCF.thenApply((response) -> { out.println(si + ": Got response: " + response); out.println(si + ": Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - if (si >= head) assertEquals(response.version(), version); - assertEquals(response.body(), MESSAGE); + assertEquals(200, response.statusCode()); + if (si >= head) assertEquals(version, response.version()); + assertEquals(MESSAGE, response.body()); return response; }).exceptionally((t) -> { Throwable cause = getCause(t); @@ -228,7 +229,8 @@ public class ExecutorShutdown implements HttpServerAdapters { } } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testSequential(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting (%s, %s, %s) ----%n%n", uriString, version, config); ExecutorService executorService = Executors.newCachedThreadPool(); @@ -272,9 +274,9 @@ public class ExecutorShutdown implements HttpServerAdapters { responseCF.thenApply((response) -> { out.println(si + ": Got response: " + response); out.println(si + ": Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - if (si > 0) assertEquals(response.version(), version); - assertEquals(response.body(), MESSAGE); + assertEquals(200, response.statusCode()); + if (si > 0) assertEquals(version, response.version()); + assertEquals(MESSAGE, response.body()); return response; }).handle((r,t) -> { if (t != null) { @@ -305,11 +307,11 @@ public class ExecutorShutdown implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("\n**** Setup ****\n"); httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new ServerRequestHandler(), "/http1/exec/"); @@ -342,8 +344,8 @@ public class ExecutorShutdown implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.check(5000); try { diff --git a/test/jdk/java/net/httpclient/ExpectContinue.java b/test/jdk/java/net/httpclient/ExpectContinue.java index a2d928e6f41..e9ae894f3e1 100644 --- a/test/jdk/java/net/httpclient/ExpectContinue.java +++ b/test/jdk/java/net/httpclient/ExpectContinue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator * @modules java.net.http/jdk.internal.net.http.common * jdk.httpserver - * @run testng/othervm ExpectContinue + * @run junit/othervm ExpectContinue */ import com.sun.net.httpserver.HttpExchange; @@ -51,23 +51,24 @@ import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ExpectContinue { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServer httpTestServer; // HTTP/1.1 [ 2 servers ] - HttpsServer httpsTestServer; // HTTPS/1.1 - String httpURI; - String httpsURI; + private static HttpServer httpTestServer; // HTTP/1.1 [ 2 servers ] + private static HttpsServer httpsTestServer; // HTTPS/1.1 + private static String httpURI; + private static String httpsURI; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { httpURI, false, "Billy" }, { httpURI, false, "Bob" }, @@ -76,7 +77,8 @@ public class ExpectContinue { }; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, boolean expectedContinue, String data) throws Exception { @@ -94,17 +96,18 @@ public class ExpectContinue { HttpResponse response = client.send(request, BodyHandlers.ofString()); System.out.println("First response: " + response); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), data); + assertEquals(200, response.statusCode()); + assertEquals(data, response.body()); // again with the same request, to ensure no Expect header duplication response = client.send(request, BodyHandlers.ofString()); System.out.println("Second response: " + response); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), data); + assertEquals(200, response.statusCode()); + assertEquals(data, response.body()); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testAsync(String uriString, boolean expectedContinue, String data) { out.printf("test(%s, %s, %s): starting%n", uriString, expectedContinue, data); HttpClient client = HttpClient.newBuilder() @@ -120,14 +123,14 @@ public class ExpectContinue { HttpResponse response = client.sendAsync(request, BodyHandlers.ofString()).join(); System.out.println("First response: " + response); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), data); + assertEquals(200, response.statusCode()); + assertEquals(data, response.body()); // again with the same request, to ensure no Expect header duplication response = client.sendAsync(request, BodyHandlers.ofString()).join(); System.out.println("Second response: " + response); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), data); + assertEquals(200, response.statusCode()); + assertEquals(data, response.body()); } // -- Infrastructure @@ -137,8 +140,8 @@ public class ExpectContinue { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); httpTestServer = HttpServer.create(sa, 0); httpTestServer.createContext("/http1/ec", new Http1ExpectContinueHandler()); @@ -153,8 +156,8 @@ public class ExpectContinue { httpsTestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(0); httpsTestServer.stop(0); } diff --git a/test/jdk/java/net/httpclient/ExpectContinueTest.java b/test/jdk/java/net/httpclient/ExpectContinueTest.java index a703fbfaacf..56fa363870a 100644 --- a/test/jdk/java/net/httpclient/ExpectContinueTest.java +++ b/test/jdk/java/net/httpclient/ExpectContinueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +27,7 @@ * @bug 8286171 8307648 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=errors ExpectContinueTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=errors ExpectContinueTest */ @@ -40,11 +40,6 @@ import jdk.httpclient.test.lib.http2.Http2TestServerConnection; import jdk.httpclient.test.lib.http2.Http2TestServerConnection.ResponseHeaders; import jdk.internal.net.http.common.HttpHeadersBuilder; import jdk.internal.net.http.frame.HeaderFrame; -import org.testng.TestException; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLSession; @@ -79,23 +74,29 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.*; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ExpectContinueTest implements HttpServerAdapters { - HttpTestServer http1TestServer; // HTTP/1.1 - Http1HangServer http1HangServer; - Http2TestServer http2TestServer; // HTTP/2 + private static HttpTestServer http1TestServer; // HTTP/1.1 + private static Http1HangServer http1HangServer; + private static Http2TestServer http2TestServer; // HTTP/2 - URI getUri, postUri, forcePostUri, hangUri; - URI h2postUri, h2forcePostUri, h2hangUri, h2endStreamUri, h2warmupURI; + private static URI getUri, postUri, forcePostUri, hangUri; + private static URI h2postUri, h2forcePostUri, h2hangUri, h2endStreamUri, h2warmupURI; static PrintStream err = new PrintStream(System.err); static PrintStream out = new PrintStream(System.out); static final String EXPECTATION_FAILED_417 = "417 Expectation Failed"; - @DataProvider(name = "uris") - public Object[][] urisData() { + public static Object[][] urisData() { return new Object[][]{ // URI, Expected Status Code, Will finish with Exception, Protocol Version { postUri, 200, false, HTTP_1_1 }, @@ -107,7 +108,8 @@ public class ExpectContinueTest implements HttpServerAdapters { { h2endStreamUri, 200, true, HTTP_2 }, // Error }; } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("urisData") public void test(URI uri, int expectedStatusCode, boolean exceptionally, HttpClient.Version version) throws CancellationException, InterruptedException, ExecutionException, IOException { @@ -135,8 +137,8 @@ public class ExpectContinueTest implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { InetSocketAddress saHang = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); http1TestServer = HttpTestServer.create(HTTP_1_1); http1TestServer.addHandler(new GetHandler(), "/http1/get"); @@ -173,8 +175,8 @@ public class ExpectContinueTest implements HttpServerAdapters { http1HangServer.start(); http2TestServer.start(); } - @AfterTest - public void teardown() throws IOException { + @AfterAll + public static void teardown() throws IOException { http1TestServer.stop(); http1HangServer.close(); http2TestServer.stop(); @@ -372,11 +374,11 @@ public class ExpectContinueTest implements HttpServerAdapters { } if (exceptionally && testThrowable != null) { err.println("Finished exceptionally Test throwable: " + testThrowable); - assertEquals(testThrowable.getClass(), ProtocolException.class); + assertEquals(ProtocolException.class, testThrowable.getClass()); } else if (exceptionally) { - throw new TestException("Expected case to finish with an IOException but testException is null"); + fail("Expected case to finish with an IOException but testException is null"); } else if (resp != null) { - assertEquals(resp.statusCode(), expectedStatusCode); + assertEquals(expectedStatusCode, resp.statusCode()); err.println("Request completed successfully for path " + path); err.println("Response Headers: " + resp.headers()); err.println("Response Status Code: " + resp.statusCode()); diff --git a/test/jdk/java/net/httpclient/FilePublisherTest.java b/test/jdk/java/net/httpclient/FilePublisherTest.java index 9501e8054cc..292f770fc30 100644 --- a/test/jdk/java/net/httpclient/FilePublisherTest.java +++ b/test/jdk/java/net/httpclient/FilePublisherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,14 +29,10 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm FilePublisherTest + * @run junit/othervm FilePublisherTest */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -58,22 +54,27 @@ import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class FilePublisherTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServerAdapters.HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpServerAdapters.HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpServerAdapters.HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpServerAdapters.HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; - FileSystem zipFs; - Path defaultFsPath; - Path zipFsPath; + private static FileSystem zipFs; + private static Path defaultFsPath; + private static Path zipFsPath; // Default file system set up static final String DEFAULT_FS_MSG = "default fs"; @@ -84,12 +85,11 @@ public class FilePublisherTest implements HttpServerAdapters { Files.createFile(file); Files.writeString(file, DEFAULT_FS_MSG); } - assertEquals(Files.readString(file), DEFAULT_FS_MSG); + assertEquals(DEFAULT_FS_MSG, Files.readString(file)); return file; } - @DataProvider(name = "defaultFsData") - public Object[][] defaultFsData() { + public static Object[][] defaultFsData() { return new Object[][]{ { httpURI, defaultFsPath, DEFAULT_FS_MSG, true }, { httpsURI, defaultFsPath, DEFAULT_FS_MSG, true }, @@ -102,7 +102,8 @@ public class FilePublisherTest implements HttpServerAdapters { }; } - @Test(dataProvider = "defaultFsData") + @ParameterizedTest + @MethodSource("defaultFsData") public void testDefaultFs(String uriString, Path path, String expectedMsg, @@ -126,12 +127,11 @@ public class FilePublisherTest implements HttpServerAdapters { Files.createFile(file); Files.writeString(file, ZIP_FS_MSG); } - assertEquals(Files.readString(file), ZIP_FS_MSG); + assertEquals(ZIP_FS_MSG, Files.readString(file)); return file; } - @DataProvider(name = "zipFsData") - public Object[][] zipFsData() { + public static Object[][] zipFsData() { return new Object[][]{ { httpURI, zipFsPath, ZIP_FS_MSG, true }, { httpsURI, zipFsPath, ZIP_FS_MSG, true }, @@ -144,7 +144,8 @@ public class FilePublisherTest implements HttpServerAdapters { }; } - @Test(dataProvider = "zipFsData") + @ParameterizedTest + @MethodSource("zipFsData") public void testZipFs(String uriString, Path path, String expectedMsg, @@ -176,13 +177,13 @@ public class FilePublisherTest implements HttpServerAdapters { var resp = client.send(req, HttpResponse.BodyHandlers.ofString()); out.println("Got response: " + resp); out.println("Got body: " + resp.body()); - assertEquals(resp.statusCode(), 200); - assertEquals(resp.body(), expectedMsg); + assertEquals(200, resp.statusCode()); + assertEquals(expectedMsg, resp.body()); } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { defaultFsPath = defaultFsFile(); zipFs = newZipFs(); zipFsPath = zipFsFile(zipFs); @@ -209,8 +210,8 @@ public class FilePublisherTest implements HttpServerAdapters { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java index ef9dc7b3077..7fd3061aa3c 100644 --- a/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java +++ b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,6 @@ import java.net.http.HttpResponse; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import static java.net.http.HttpOption.H3_DISCOVERY; @@ -53,8 +49,14 @@ import static java.util.stream.Collectors.joining; import static java.nio.charset.StandardCharsets.UTF_8; import static java.net.http.HttpRequest.BodyPublishers.fromPublisher; import static java.net.http.HttpResponse.BodyHandlers.ofString; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -62,25 +64,24 @@ import static org.testng.Assert.fail; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.internal.httpclient.debug=err FlowAdapterPublisherTest + * @run junit/othervm -Djdk.internal.httpclient.debug=err FlowAdapterPublisherTest */ public class FlowAdapterPublisherTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpURI }, { httpsURI }, @@ -120,7 +121,8 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { return builder; } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testByteBufferPublisherUnknownLength(String uri) { String[] body = new String[] { "You know ", "it's summer ", "in Ireland ", "when the ", "rain gets ", "warmer." }; @@ -131,13 +133,14 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { HttpResponse response = client.sendAsync(request, ofString(UTF_8)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, Arrays.stream(body).collect(joining())); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals(Arrays.stream(body).collect(joining()), text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testByteBufferPublisherFixedLength(String uri) { String[] body = new String[] { "You know ", "it's summer ", "in Ireland ", "when the ", "rain gets ", "warmer." }; @@ -149,15 +152,16 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { HttpResponse response = client.sendAsync(request, ofString(UTF_8)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, Arrays.stream(body).collect(joining())); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals(Arrays.stream(body).collect(joining()), text); } } // Flow.Publisher - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testMappedByteBufferPublisherUnknownLength(String uri) { String[] body = new String[] { "God invented ", "whiskey to ", "keep the ", "Irish from ", "ruling the ", "world." }; @@ -168,13 +172,14 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { HttpResponse response = client.sendAsync(request, ofString(UTF_8)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, Arrays.stream(body).collect(joining())); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals(Arrays.stream(body).collect(joining()), text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testMappedByteBufferPublisherFixedLength(String uri) { String[] body = new String[] { "God invented ", "whiskey to ", "keep the ", "Irish from ", "ruling the ", "world." }; @@ -186,9 +191,9 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { HttpResponse response = client.sendAsync(request, ofString(UTF_8)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, Arrays.stream(body).collect(joining())); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals(Arrays.stream(body).collect(joining()), text); } } @@ -196,7 +201,8 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { // not ideal, but necessary to discern correct behavior. They should be // updated if the exception message is updated. - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testPublishTooFew(String uri) throws InterruptedException { String[] body = new String[] { "You know ", "it's summer ", "in Ireland ", "when the ", "rain gets ", "warmer." }; @@ -214,7 +220,8 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testPublishTooMany(String uri) throws InterruptedException { String[] body = new String[] { "You know ", "it's summer ", "in Ireland ", "when the ", "rain gets ", "warmer." }; @@ -356,8 +363,8 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(Version.HTTP_1_1); httpTestServer.addHandler(new HttpEchoHandler(), "/http1/echo"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/echo"; @@ -385,8 +392,8 @@ public class FlowAdapterPublisherTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java index 0e175cf0f52..32003023d7f 100644 --- a/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java +++ b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -53,17 +53,19 @@ import java.net.http.HttpResponse.BodySubscribers; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +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; /* * @test @@ -72,22 +74,22 @@ import static org.testng.Assert.assertTrue; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.internal.httpclient.debug=true FlowAdapterSubscriberTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true FlowAdapterSubscriberTest */ public class FlowAdapterSubscriberTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; static final StackWalker WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); @@ -101,8 +103,7 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpURI }, { httpsURI }, @@ -154,7 +155,7 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { assertThrows(NPE, () -> BodySubscribers.fromSubscriber(new ListSubscriber(), null)); assertThrows(NPE, () -> BodySubscribers.fromSubscriber(null, null)); - Subscriber subscriber = BodySubscribers.fromSubscriber(new ListSubscriber()); + Subscriber subscriber = BodySubscribers.fromSubscriber(new ListSubscriber()); assertThrows(NPE, () -> subscriber.onSubscribe(null)); assertThrows(NPE, () -> subscriber.onNext(null)); assertThrows(NPE, () -> subscriber.onError(null)); @@ -162,7 +163,8 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { // List - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testListWithFinisher(String uri) { System.out.printf(now() + "testListWithFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -174,13 +176,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, Supplier::get)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "May the luck of the Irish be with you!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("May the luck of the Irish be with you!", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testListWithoutFinisher(String uri) { System.out.printf(now() + "testListWithoutFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -192,13 +195,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)).join(); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "May the luck of the Irish be with you!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("May the luck of the Irish be with you!", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testListWithFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testListWithFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -210,13 +214,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, Supplier::get)); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "May the luck of the Irish be with you!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("May the luck of the Irish be with you!", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testListWithoutFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testListWithoutFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -228,15 +233,16 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "May the luck of the Irish be with you!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("May the luck of the Irish be with you!", text); } } // Collection - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testCollectionWithFinisher(String uri) { System.out.printf(now() + "testCollectionWithFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -248,13 +254,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, CollectionSubscriber::get)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "What's the craic?"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("What's the craic?", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testCollectionWithoutFinisher(String uri) { System.out.printf(now() + "testCollectionWithoutFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -266,13 +273,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)).join(); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "What's the craic?"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("What's the craic?", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testCollectionWithFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testCollectionWithFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -284,13 +292,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, CollectionSubscriber::get)); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "What's the craic?"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("What's the craic?", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testCollectionWithoutFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testCollectionWithoutFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -302,15 +311,16 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "What's the craic?"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("What's the craic?", text); } } // Iterable - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testIterableWithFinisher(String uri) { System.out.printf(now() + "testIterableWithFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -322,13 +332,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, Supplier::get)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "We're sucking diesel now!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("We're sucking diesel now!", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testIterableWithoutFinisher(String uri) { System.out.printf(now() + "testIterableWithoutFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -340,13 +351,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)).join(); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "We're sucking diesel now!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("We're sucking diesel now!", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testIterableWithFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testIterableWithFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -358,13 +370,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, Supplier::get)); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "We're sucking diesel now!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("We're sucking diesel now!", text); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testIterableWithoutFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testIterableWithoutFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -376,15 +389,16 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); - assertEquals(text, "We're sucking diesel now!"); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); + assertEquals("We're sucking diesel now!", text); } } // Subscriber - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithFinisher(String uri) { System.out.printf(now() + "testObjectWithFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -396,13 +410,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, ObjectSubscriber::get)).join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); assertTrue(text.length() != 0); // what else can be asserted! } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithoutFinisher(String uri) { System.out.printf(now() + "testObjectWithoutFinisher(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -414,13 +429,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)).join(); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); assertTrue(text.length() != 0); // what else can be asserted! } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testObjectWithFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -432,13 +448,14 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber, ObjectSubscriber::get)); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); assertTrue(text.length() != 0); // what else can be asserted! } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithoutFinisherBlocking(String uri) throws Exception { System.out.printf(now() + "testObjectWithoutFinisherBlocking(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -450,8 +467,8 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { BodyHandlers.fromSubscriber(subscriber)); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uri)); + assertEquals(200, response.statusCode()); + assertEquals(version(uri), response.version()); assertTrue(text.length() != 0); // what else can be asserted! } } @@ -459,7 +476,8 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { // -- mapping using convenience handlers - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void mappingFromByteArray(String uri) throws Exception { System.out.printf(now() + "mappingFromByteArray(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -470,12 +488,13 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { bas -> new String(bas.getBody().toCompletableFuture().join(), UTF_8))) .thenApply(FlowAdapterSubscriberTest::assert200ResponseCode) .thenApply(HttpResponse::body) - .thenAccept(body -> assertEquals(body, "We're sucking diesel now!")) + .thenAccept(body -> assertEquals("We're sucking diesel now!", body)) .join(); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void mappingFromInputStream(String uri) throws Exception { System.out.printf(now() + "mappingFromInputStream(%s) starting%n", uri); try (HttpClient client = newHttpClient(uri)) { @@ -512,7 +531,7 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { finisher)) .thenApply(FlowAdapterSubscriberTest::assert200ResponseCode) .thenApply(HttpResponse::body) - .thenAccept(body -> assertEquals(body, "May the wind always be at your back.")) + .thenAccept(body -> assertEquals("May the wind always be at your back.", body)) .join(); var error = failed.get(); if (error != null) throw error; @@ -626,13 +645,13 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { } static final HttpResponse assert200ResponseCode(HttpResponse response) { - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(response.request().uri().toString())); + assertEquals(200, response.statusCode()); + assertEquals(version(response.request().uri().toString()), response.version()); return response; } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(Version.HTTP_1_1); httpTestServer.addHandler(new HttpEchoHandler(), "/http1/echo"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/echo"; @@ -660,8 +679,8 @@ public class FlowAdapterSubscriberTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/ForbiddenHeadTest.java b/test/jdk/java/net/httpclient/ForbiddenHeadTest.java index 57fd627b2b0..f2011766b2b 100644 --- a/test/jdk/java/net/httpclient/ForbiddenHeadTest.java +++ b/test/jdk/java/net/httpclient/ForbiddenHeadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +28,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build DigestEchoServer ForbiddenHeadTest jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.http.auth.tunneling.disabledSchemes * -Djdk.httpclient.HttpClient.log=headers,requests * -Djdk.internal.httpclient.debug=true @@ -36,15 +36,6 @@ */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -61,7 +52,6 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; @@ -81,27 +71,40 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; + +import static jdk.httpclient.test.lib.common.HttpServerAdapters.createClientBuilderForH3; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ForbiddenHeadTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - DigestEchoServer.TunnelingProxy proxy; - DigestEchoServer.TunnelingProxy authproxy; - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String https3URI; - HttpClient authClient; - HttpClient noAuthClient; + private static HttpTestServer httpTestServer; // HTTP/1.1 + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static DigestEchoServer.TunnelingProxy proxy; + private static DigestEchoServer.TunnelingProxy authproxy; + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String https3URI; + private static HttpClient authClient; + private static HttpClient noAuthClient; - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static final long SLEEP_AFTER_TEST = 0; // milliseconds static final int ITERATIONS = 3; static final Executor executor = new TestExecutor(Executors.newCachedThreadPool()); @@ -142,34 +145,39 @@ public class ForbiddenHeadTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { // Exceptions should already have been added to FAILURES @@ -201,8 +209,7 @@ public class ForbiddenHeadTest implements HttpServerAdapters { static final String MESSAGE = "Unauthorized"; - @DataProvider(name = "all") - public Object[][] allcases() { + public static Object[][] allcases() { List result = new ArrayList<>(); for (boolean useAuth : List.of(true, false)) { for (boolean async : List.of(true, false)) { @@ -226,8 +233,6 @@ public class ForbiddenHeadTest implements HttpServerAdapters { return result.toArray(new Object[0][0]); } - static final AtomicLong requestCounter = new AtomicLong(); - static final Authenticator authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { @@ -237,9 +242,9 @@ public class ForbiddenHeadTest implements HttpServerAdapters { static final AtomicLong sleepCount = new AtomicLong(); - @Test(dataProvider = "all") + @ParameterizedTest + @MethodSource("allcases") void test(String uriString, int code, boolean async, boolean useAuth) throws Throwable { - checkSkip(); HttpClient client = useAuth ? authClient : noAuthClient; var name = String.format("test(%s, %d, %s, %s)", uriString, code, async ? "async" : "sync", client.authenticator().isPresent() ? "authClient" : "noAuthClient"); @@ -318,23 +323,23 @@ public class ForbiddenHeadTest implements HttpServerAdapters { out.println(" Got response: " + response); - assertEquals(response.statusCode(), forbidden? FORBIDDEN : code); - assertEquals(response.body(), expectedValue == null ? null : ""); - assertEquals(response.headers().firstValue("X-value"), Optional.ofNullable(expectedValue)); + assertEquals(forbidden? FORBIDDEN : code, response.statusCode()); + assertEquals(expectedValue == null ? null : "", response.body()); + assertEquals(Optional.ofNullable(expectedValue), response.headers().firstValue("X-value")); // when the CONNECT request fails, its body is discarded - but // the response header may still contain its content length. // don't check content length in that case. if (expectedValue != null) { String clen = String.valueOf(expectedValue.getBytes(UTF_8).length); - assertEquals(response.headers().firstValue("Content-Length"), Optional.of(clen)); + assertEquals(Optional.of(clen), response.headers().firstValue("Content-Length")); } } // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new UnauthorizedHandler(), "/http1/"); httpTestServer.addHandler(new UnauthorizedHandler(), "/http2/proxy/"); @@ -357,7 +362,7 @@ public class ForbiddenHeadTest implements HttpServerAdapters { proxy = DigestEchoServer.createHttpsProxyTunnel(DigestEchoServer.HttpAuthSchemeType.NONE); authproxy = DigestEchoServer.createHttpsProxyTunnel(DigestEchoServer.HttpAuthSchemeType.BASIC); - authClient = TRACKER.track(newClientBuilderForH3() + authClient = TRACKER.track(createClientBuilderForH3() .proxy(TestProxySelector.of(proxy, authproxy, httpTestServer)) .sslContext(sslContext) .executor(executor) @@ -365,7 +370,7 @@ public class ForbiddenHeadTest implements HttpServerAdapters { .build()); clientCount.incrementAndGet(); - noAuthClient = TRACKER.track(newClientBuilderForH3() + noAuthClient = TRACKER.track(createClientBuilderForH3() .proxy(TestProxySelector.of(proxy, authproxy, httpTestServer)) .sslContext(sslContext) .executor(executor) @@ -384,8 +389,8 @@ public class ForbiddenHeadTest implements HttpServerAdapters { serverCount.incrementAndGet(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { authClient = noAuthClient = null; Thread.sleep(100); AssertionError fail = TRACKER.check(1500); diff --git a/test/jdk/java/net/httpclient/GZIPInputStreamTest.java b/test/jdk/java/net/httpclient/GZIPInputStreamTest.java index 948ecd4d7cc..1cbb24d81ce 100644 --- a/test/jdk/java/net/httpclient/GZIPInputStreamTest.java +++ b/test/jdk/java/net/httpclient/GZIPInputStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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,15 +27,11 @@ * @summary Tests that you can map an InputStream to a GZIPInputStream * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters ReferenceTracker - * @run testng/othervm GZIPInputStreamTest + * @run junit/othervm GZIPInputStreamTest */ import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -46,7 +42,6 @@ import java.net.InetAddress; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; -import java.net.http.HttpOption.Http3DiscoveryMode; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandler; import java.net.http.HttpResponse.BodyHandlers; @@ -68,21 +63,26 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class GZIPInputStreamTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer https3TestServer; // HTTP/3 - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String https3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer https3TestServer; // HTTP/3 + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String https3URI; static final int ITERATION_COUNT = 3; // a shared executor helps reduce the amount of threads created by the test @@ -154,8 +154,7 @@ public class GZIPInputStreamTest implements HttpServerAdapters { - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpURI, false }, { httpURI, true }, @@ -170,7 +169,7 @@ public class GZIPInputStreamTest implements HttpServerAdapters { }; } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; HttpClient newHttpClient() { return TRACKER.track(newClientBuilderForH3() .executor(executor) @@ -192,7 +191,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { .build()); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testPlainSyncAsString(String uri, boolean sameClient) throws Exception { out.println("\nSmoke test: verify that the result we get from the server is correct."); out.println("Uses plain send() and `asString` to get the plain string."); @@ -209,7 +209,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testPlainSyncAsInputStream(String uri, boolean sameClient) throws Exception { out.println("Uses plain send() and `asInputStream` - calls readAllBytes() from main thread"); out.println("Uses single threaded executor"); @@ -225,7 +226,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testGZIPSyncAsInputStream(String uri, boolean sameClient) throws Exception { out.println("Uses plain send() and `asInputStream` - " + "creates GZIPInputStream and calls readAllBytes() from main thread"); @@ -243,7 +245,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testGZIPSyncAsGZIPInputStream(String uri, boolean sameClient) throws Exception { out.println("Uses plain send() and a mapping subscriber to "+ "create the GZIPInputStream. Calls readAllBytes() from main thread"); @@ -262,7 +265,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testGZIPSyncAsGZIPInputStreamSupplier(String uri, boolean sameClient) throws Exception { out.println("Uses plain send() and a mapping subscriber to "+ "create a Supplier. Calls Supplier.get() " + @@ -276,7 +280,7 @@ public class GZIPInputStreamTest implements HttpServerAdapters { HttpRequest req = buildRequest(URI.create(uri + "/gz/LoremIpsum.txt.gz")); // This is dangerous, because the finisher will block. // We support this, but the executor must have enough threads. - BodyHandler> handler = new BodyHandler>() { + BodyHandler> handler = new BodyHandler<>() { public HttpResponse.BodySubscriber> apply( HttpResponse.ResponseInfo responseInfo) { @@ -304,7 +308,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testPlainAsyncAsInputStreamBlocks(String uri, boolean sameClient) throws Exception { out.println("Uses sendAsync() and `asInputStream`. Registers a dependent action "+ "that calls readAllBytes()"); @@ -331,7 +336,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testGZIPAsyncAsGZIPInputStreamBlocks(String uri, boolean sameClient) throws Exception { out.println("Uses sendAsync() and a mapping subscriber to create a GZIPInputStream. " + "Registers a dependent action that calls readAllBytes()"); @@ -358,7 +364,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testGZIPSyncAsGZIPInputStreamBlocks(String uri, boolean sameClient) throws Exception { out.println("Uses sendAsync() and a mapping subscriber to create a GZIPInputStream," + "which is mapped again using a mapping subscriber " + @@ -386,7 +393,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testGZIPSyncAsGZIPInputStreamSupplierInline(String uri, boolean sameClient) throws Exception { out.println("Uses plain send() and a mapping subscriber to "+ "create a Supplier. Calls Supplier.get() " + @@ -432,7 +440,7 @@ public class GZIPInputStreamTest implements HttpServerAdapters { if (!LOREM_IPSUM.equals(responseBody)) { out.println("Response doesn't match"); out.println("[" + LOREM_IPSUM + "] != [" + responseBody + "]"); - assertEquals(LOREM_IPSUM, responseBody); + assertEquals(responseBody, LOREM_IPSUM); } else { out.println("Received expected response."); } @@ -487,8 +495,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { HttpTestHandler plainHandler = new LoremIpsumPlainHandler(); HttpTestHandler gzipHandler = new LoremIpsumGZIPHandler(); @@ -526,8 +534,8 @@ public class GZIPInputStreamTest implements HttpServerAdapters { https3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.check(500); try { diff --git a/test/jdk/java/net/httpclient/HeadTest.java b/test/jdk/java/net/httpclient/HeadTest.java index 3e05442faf5..3a52cd101b8 100644 --- a/test/jdk/java/net/httpclient/HeadTest.java +++ b/test/jdk/java/net/httpclient/HeadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,14 +27,10 @@ * @summary Tests Client handles HEAD and 304 responses correctly. * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.httpclient.HttpClient.log=trace,headers,requests HeadTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=trace,headers,requests HeadTest */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -55,19 +51,24 @@ import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static jdk.httpclient.test.lib.common.HttpServerAdapters.createClientBuilderForH3; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class HeadTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer https3TestServer; // HTTP/3 - String httpURI, httpsURI; - String http2URI, https2URI; - String https3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer https3TestServer; // HTTP/3 + private static String httpURI, httpsURI; + private static String http2URI, https2URI; + private static String https3URI; static final String CONTENT_LEN = "300"; @@ -80,8 +81,7 @@ public class HeadTest implements HttpServerAdapters { static final int HTTP_OK = 200; static final PrintStream out = System.out; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { // HTTP/1.1 { httpURI, "GET", HTTP_NOT_MODIFIED, HTTP_1_1 }, @@ -103,7 +103,8 @@ public class HeadTest implements HttpServerAdapters { }; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, String method, int expResp, Version version) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); @@ -136,17 +137,17 @@ public class HeadTest implements HttpServerAdapters { out.println(" Got response: " + response); - assertEquals(response.statusCode(), expResp); - assertEquals(response.body(), ""); - assertEquals(response.headers().firstValue("Content-length").get(), CONTENT_LEN); - assertEquals(response.version(), request.version().get()); + assertEquals(expResp, response.statusCode()); + assertEquals("", response.body()); + assertEquals(CONTENT_LEN, response.headers().firstValue("Content-length").get()); + assertEquals(request.version().get(), response.version()); } } // -- Infrastructure // TODO: See if test performs better with Vthreads, see H3SimplePost and H3SimpleGet - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new HeadHandler(), "/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/"; @@ -173,8 +174,8 @@ public class HeadTest implements HttpServerAdapters { https3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java b/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java index b1e4e569010..00a709a3387 100644 --- a/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java +++ b/test/jdk/java/net/httpclient/HeadersLowerCaseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ -43,7 +43,6 @@ import jdk.internal.net.http.common.Utils; import jdk.test.lib.net.SimpleSSLContext; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -63,19 +62,18 @@ import static org.junit.jupiter.api.Assertions.assertThrows; * jdk.httpclient.test.lib.common.HttpServerAdapters * @run junit/othervm -Djdk.internal.httpclient.debug=true HeadersLowerCaseTest */ -@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class HeadersLowerCaseTest implements HttpServerAdapters { private static Set REQUEST_HEADERS; - private HttpTestServer h2server; - private HttpTestServer h3server; - private String h2ReqURIBase; - private String h3ReqURIBase; + private static HttpTestServer h2server; + private static HttpTestServer h3server; + private static String h2ReqURIBase; + private static String h3ReqURIBase; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); @BeforeAll - public void beforeAll() throws Exception { + public static void beforeAll() throws Exception { h2server = HttpTestServer.create(HTTP_2, sslContext); h2server.start(); h2ReqURIBase = "https://" + h2server.serverAuthority(); @@ -100,7 +98,7 @@ public class HeadersLowerCaseTest implements HttpServerAdapters { } @AfterAll - public void afterAll() throws Exception { + public static void afterAll() throws Exception { if (h2server != null) { h2server.stop(); } @@ -157,14 +155,14 @@ public class HeadersLowerCaseTest implements HttpServerAdapters { } } - private Stream params() throws Exception { + private static Stream params() throws Exception { return Stream.of( Arguments.of(HTTP_2, new URI(h2ReqURIBase + "/h2verifyReqHeaders")), Arguments.of(Version.HTTP_3, new URI(h3ReqURIBase + "/h3verifyReqHeaders"))); } /** - * Issues a HTTP/2 or HTTP/3 request with header names of varying case (some in lower, + * Issues an HTTP/2 or HTTP/3 request with header names of varying case (some in lower, * some mixed, some upper case) and expects that the client internally converts them * to lower case before encoding and sending to the server. The server side handler verifies * that it receives the header names in lower case and if it doesn't then it returns a diff --git a/test/jdk/java/net/httpclient/HeadersTest1.java b/test/jdk/java/net/httpclient/HeadersTest1.java index 79932dfc92f..26733c1c928 100644 --- a/test/jdk/java/net/httpclient/HeadersTest1.java +++ b/test/jdk/java/net/httpclient/HeadersTest1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 +26,7 @@ * @bug 8153142 8195138 * @modules java.net.http * jdk.httpserver - * @run testng/othervm HeadersTest1 + * @run junit/othervm HeadersTest1 */ import java.io.IOException; @@ -48,13 +48,13 @@ import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; -import org.testng.annotations.Test; import static java.net.http.HttpResponse.BodyHandlers.ofString; import static java.nio.charset.StandardCharsets.US_ASCII; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; public class HeadersTest1 { @@ -106,7 +106,7 @@ public class HeadersTest1 { for (String headerName : headernames) { List v2 = hd.allValues(headerName); assertNotNull(v2); - assertEquals(new HashSet<>(v2), Set.of("resp1", "resp2")); + assertEquals(Set.of("resp1", "resp2"), new HashSet<>(v2)); TestKit.assertUnmodifiableList(v2); } @@ -130,7 +130,7 @@ public class HeadersTest1 { // quote List quote = hd.allValues("X-Quote-Response"); - assertEquals(quote, List.of(QUOTED)); + assertEquals(List.of(QUOTED), quote); } finally { server.stop(0); e.shutdownNow(); diff --git a/test/jdk/java/net/httpclient/HttpClientBuilderTest.java b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java index 9f7d2ade62f..a5fb1a39e66 100644 --- a/test/jdk/java/net/httpclient/HttpClientBuilderTest.java +++ b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,9 +51,10 @@ import java.net.http.HttpClient.Version; import java.util.concurrent.atomic.AtomicInteger; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.Test; import static java.time.Duration.*; -import static org.testng.Assert.*; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; /* * @test @@ -61,7 +62,7 @@ import static org.testng.Assert.*; * @summary HttpClient[.Builder] API and behaviour checks * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run testng HttpClientBuilderTest + * @run junit HttpClientBuilderTest */ public class HttpClientBuilderTest { @@ -83,10 +84,10 @@ public class HttpClientBuilderTest { assertFalse(client.connectTimeout().isPresent()); assertFalse(client.executor().isPresent()); assertFalse(client.proxy().isPresent()); - assertTrue(client.sslParameters() != null); - assertTrue(client.followRedirects().equals(HttpClient.Redirect.NEVER)); - assertTrue(client.sslContext() == SSLContext.getDefault()); - assertTrue(client.version().equals(HttpClient.Version.HTTP_2)); + assertNotNull(client.sslParameters()); + assertEquals(Redirect.NEVER, client.followRedirects()); + assertSame(SSLContext.getDefault(), client.sslContext()); + assertEquals(Version.HTTP_2, client.version()); } } } @@ -133,18 +134,18 @@ public class HttpClientBuilderTest { Authenticator a = new TestAuthenticator(); builder.authenticator(a); try (var closer = closeable(builder)) { - assertTrue(closer.build().authenticator().get() == a); + assertSame(a, closer.build().authenticator().get()); } Authenticator b = new TestAuthenticator(); builder.authenticator(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().authenticator().get() == b); + assertSame(b, closer.build().authenticator().get()); } assertThrows(NPE, () -> builder.authenticator(null)); Authenticator c = new TestAuthenticator(); builder.authenticator(c); try (var closer = closeable(builder)) { - assertTrue(closer.build().authenticator().get() == c); + assertSame(c, closer.build().authenticator().get()); } } @@ -154,18 +155,18 @@ public class HttpClientBuilderTest { CookieHandler a = new CookieManager(); builder.cookieHandler(a); try (var closer = closeable(builder)) { - assertTrue(closer.build().cookieHandler().get() == a); + assertSame(a, closer.build().cookieHandler().get()); } CookieHandler b = new CookieManager(); builder.cookieHandler(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().cookieHandler().get() == b); + assertSame(b, closer.build().cookieHandler().get()); } assertThrows(NPE, () -> builder.cookieHandler(null)); CookieManager c = new CookieManager(); builder.cookieHandler(c); try (var closer = closeable(builder)) { - assertTrue(closer.build().cookieHandler().get() == c); + assertSame(c, closer.build().cookieHandler().get()); } } @@ -175,18 +176,18 @@ public class HttpClientBuilderTest { Duration a = Duration.ofSeconds(5); builder.connectTimeout(a); try (var closer = closeable(builder)) { - assertTrue(closer.build().connectTimeout().get() == a); + assertSame(a, closer.build().connectTimeout().get()); } Duration b = Duration.ofMinutes(1); builder.connectTimeout(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().connectTimeout().get() == b); + assertSame(b, closer.build().connectTimeout().get()); } assertThrows(NPE, () -> builder.cookieHandler(null)); Duration c = Duration.ofHours(100); builder.connectTimeout(c); try (var closer = closeable(builder)) { - assertTrue(closer.build().connectTimeout().get() == c); + assertSame(c, closer.build().connectTimeout().get()); } assertThrows(IAE, () -> builder.connectTimeout(ZERO)); @@ -205,18 +206,18 @@ public class HttpClientBuilderTest { TestExecutor a = new TestExecutor(); builder.executor(a); try (var closer = closeable(builder)) { - assertTrue(closer.build().executor().get() == a); + assertSame(a, closer.build().executor().get()); } TestExecutor b = new TestExecutor(); builder.executor(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().executor().get() == b); + assertSame(b, closer.build().executor().get()); } assertThrows(NPE, () -> builder.executor(null)); TestExecutor c = new TestExecutor(); builder.executor(c); try (var closer = closeable(builder)) { - assertTrue(closer.build().executor().get() == c); + assertSame(c, closer.build().executor().get()); } } @@ -226,18 +227,18 @@ public class HttpClientBuilderTest { ProxySelector a = ProxySelector.of(null); builder.proxy(a); try (var closer = closeable(builder)) { - assertTrue(closer.build().proxy().get() == a); + assertSame(a, closer.build().proxy().get()); } ProxySelector b = ProxySelector.of(InetSocketAddress.createUnresolved("foo", 80)); builder.proxy(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().proxy().get() == b); + assertSame(b, closer.build().proxy().get()); } assertThrows(NPE, () -> builder.proxy(null)); ProxySelector c = ProxySelector.of(InetSocketAddress.createUnresolved("bar", 80)); builder.proxy(c); try (var closer = closeable(builder)) { - assertTrue(closer.build().proxy().get() == c); + assertSame(c, closer.build().proxy().get()); } } @@ -249,16 +250,16 @@ public class HttpClientBuilderTest { builder.sslParameters(a); a.setCipherSuites(new String[] { "Z" }); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslParameters() != (a)); + assertNotSame(a, closer.build().sslParameters()); } try (var closer = closeable(builder)) { - assertTrue(closer.build().sslParameters().getCipherSuites()[0].equals("A")); + assertEquals("A", closer.build().sslParameters().getCipherSuites()[0]); } SSLParameters b = new SSLParameters(); b.setEnableRetransmissions(true); builder.sslParameters(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslParameters() != b); + assertNotSame(b, closer.build().sslParameters()); } try (var closer = closeable(builder)) { assertTrue(closer.build().sslParameters().getEnableRetransmissions()); @@ -269,21 +270,21 @@ public class HttpClientBuilderTest { builder.sslParameters(c); c.setProtocols(new String[] { "D" }); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslParameters().getProtocols()[0].equals("C")); + assertEquals("C", closer.build().sslParameters().getProtocols()[0]); } SSLParameters d = new SSLParameters(); d.setSignatureSchemes(new String[] { "C" }); builder.sslParameters(d); d.setSignatureSchemes(new String[] { "D" }); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslParameters().getSignatureSchemes()[0].equals("C")); + assertEquals("C", closer.build().sslParameters().getSignatureSchemes()[0]); } SSLParameters e = new SSLParameters(); e.setNamedGroups(new String[] { "C" }); builder.sslParameters(e); e.setNamedGroups(new String[] { "D" }); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslParameters().getNamedGroups()[0].equals("C")); + assertEquals("C", closer.build().sslParameters().getNamedGroups()[0]); } // test defaults for needClientAuth and wantClientAuth builder.sslParameters(new SSLParameters()); @@ -321,18 +322,18 @@ public class HttpClientBuilderTest { SSLContext a = SimpleSSLContext.findSSLContext(); builder.sslContext(a); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslContext() == a); + assertSame(a, closer.build().sslContext()); } SSLContext b = SimpleSSLContext.findSSLContext(); builder.sslContext(b); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslContext() == b); + assertSame(b, closer.build().sslContext()); } assertThrows(NPE, () -> builder.sslContext(null)); SSLContext c = SimpleSSLContext.findSSLContext(); builder.sslContext(c); try (var closer = closeable(builder)) { - assertTrue(closer.build().sslContext() == c); + assertSame(c, closer.build().sslContext()); } } @@ -341,16 +342,16 @@ public class HttpClientBuilderTest { HttpClient.Builder builder = HttpClient.newBuilder(); builder.followRedirects(Redirect.ALWAYS); try (var closer = closeable(builder)) { - assertTrue(closer.build().followRedirects() == Redirect.ALWAYS); + assertSame(Redirect.ALWAYS, closer.build().followRedirects()); } builder.followRedirects(Redirect.NEVER); try (var closer = closeable(builder)) { - assertTrue(closer.build().followRedirects() == Redirect.NEVER); + assertSame(Redirect.NEVER, closer.build().followRedirects()); } assertThrows(NPE, () -> builder.followRedirects(null)); builder.followRedirects(Redirect.NORMAL); try (var closer = closeable(builder)) { - assertTrue(closer.build().followRedirects() == Redirect.NORMAL); + assertSame(Redirect.NORMAL, closer.build().followRedirects()); } } @@ -358,37 +359,37 @@ public class HttpClientBuilderTest { public void testVersion() { HttpClient.Builder builder = HttpClient.newBuilder(); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_2); + assertSame(Version.HTTP_2, closer.build().version()); } builder.version(Version.HTTP_3); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_3); + assertSame(Version.HTTP_3, closer.build().version()); } builder.version(Version.HTTP_2); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_2); + assertSame(Version.HTTP_2, closer.build().version()); } builder.version(Version.HTTP_1_1); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_1_1); + assertSame(Version.HTTP_1_1, closer.build().version()); } assertThrows(NPE, () -> builder.version(null)); builder.version(Version.HTTP_3); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_3); + assertSame(Version.HTTP_3, closer.build().version()); } builder.version(Version.HTTP_2); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_2); + assertSame(Version.HTTP_2, closer.build().version()); } builder.version(Version.HTTP_1_1); try (var closer = closeable(builder)) { - assertTrue(closer.build().version() == Version.HTTP_1_1); + assertSame(Version.HTTP_1_1, closer.build().version()); } } @Test - static void testPriority() throws Exception { + void testPriority() throws Exception { HttpClient.Builder builder = HttpClient.newBuilder(); assertThrows(IAE, () -> builder.priority(-1)); assertThrows(IAE, () -> builder.priority(0)); @@ -489,7 +490,7 @@ public class HttpClientBuilderTest { static final URI uri = URI.create("http://foo.com/"); @Test - static void testHttpClientSendArgs() throws Exception { + void testHttpClientSendArgs() throws Exception { try (HttpClient client = HttpClient.newHttpClient()) { HttpRequest request = HttpRequest.newBuilder(uri).build(); @@ -527,21 +528,21 @@ public class HttpClientBuilderTest { // --- @Test - static void testUnsupportedWebSocket() throws Exception { + void testUnsupportedWebSocket() throws Exception { // @implSpec The default implementation of this method throws // {@code UnsupportedOperationException}. assertThrows(UOE, () -> (new MockHttpClient()).newWebSocketBuilder()); } @Test - static void testDefaultShutdown() throws Exception { + void testDefaultShutdown() throws Exception { try (HttpClient client = new MockHttpClient()) { client.shutdown(); // does nothing } } @Test - static void testDefaultShutdownNow() throws Exception { + void testDefaultShutdownNow() throws Exception { try (HttpClient client = new MockHttpClient()) { client.shutdownNow(); // calls shutdown, doesn't wait } @@ -559,18 +560,18 @@ public class HttpClientBuilderTest { } // once from shutdownNow(), and once from close() - assertEquals(shutdownCalled.get(), 2); + assertEquals(2, shutdownCalled.get()); } @Test - static void testDefaultIsTerminated() throws Exception { + void testDefaultIsTerminated() throws Exception { try (HttpClient client = new MockHttpClient()) { assertFalse(client.isTerminated()); } } @Test - static void testDefaultAwaitTermination() throws Exception { + void testDefaultAwaitTermination() throws Exception { try (HttpClient client = new MockHttpClient()) { assertTrue(client.awaitTermination(Duration.ofDays(1))); } @@ -581,7 +582,7 @@ public class HttpClientBuilderTest { } @Test - static void testDefaultClose() { + void testDefaultClose() { AtomicInteger shutdownCalled = new AtomicInteger(); AtomicInteger awaitTerminationCalled = new AtomicInteger(); AtomicInteger shutdownNowCalled = new AtomicInteger(); @@ -616,9 +617,9 @@ public class HttpClientBuilderTest { // awaitTermination() 0->1 -> false // awaitTermination() 1->2 -> true try (HttpClient client = mock) { } - assertEquals(shutdownCalled.get(), 1); // called by close() - assertEquals(shutdownNowCalled.get(), 0); // not called - assertEquals(awaitTerminationCalled.get(), 2); // called by close() twice + assertEquals(1, shutdownCalled.get()); // called by close() + assertEquals(0, shutdownNowCalled.get()); // not called + assertEquals(2, awaitTerminationCalled.get()); // called by close() twice assertFalse(Thread.currentThread().isInterrupted()); // second time around: @@ -629,9 +630,9 @@ public class HttpClientBuilderTest { // calls shutdown() 2->3 // awaitTermination() 3->4 -> true try (HttpClient client = mock) { } - assertEquals(shutdownCalled.get(), 3); // called by close() and shutdownNow() - assertEquals(shutdownNowCalled.get(), 1); // called by close() due to interrupt - assertEquals(awaitTerminationCalled.get(), 4); // called by close twice + assertEquals(3, shutdownCalled.get()); // called by close() and shutdownNow() + assertEquals(1, shutdownNowCalled.get()); // called by close() due to interrupt + assertEquals(4, awaitTerminationCalled.get()); // called by close twice assertTrue(Thread.currentThread().isInterrupted()); assertTrue(Thread.interrupted()); } diff --git a/test/jdk/java/net/httpclient/HttpClientClose.java b/test/jdk/java/net/httpclient/HttpClientClose.java index e71faa8fe4e..0a3fc03424a 100644 --- a/test/jdk/java/net/httpclient/HttpClientClose.java +++ b/test/jdk/java/net/httpclient/HttpClientClose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * HttpClientClose @@ -70,10 +70,6 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; @@ -84,10 +80,15 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class HttpClientClose implements HttpServerAdapters { @@ -96,27 +97,26 @@ public class HttpClientClose implements HttpServerAdapters { } static final Random RANDOM = RandomFactory.getRandom(); - ExecutorService readerService; + private static ExecutorService readerService; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) - HttpTestServer h3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h2h3Head; - String h3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) + private static HttpTestServer h3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h2h3Head; + private static String h3URI; static final String MESSAGE = "HttpClientClose message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { h2h3URI, HTTP_3, h2h3TestServer.h3DiscoveryConfig()}, { h3URI, HTTP_3, h3TestServer.h3DiscoveryConfig()}, @@ -128,7 +128,7 @@ public class HttpClientClose implements HttpServerAdapters { } static final AtomicLong requestCounter = new AtomicLong(); - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static String readBody(InputStream body) { try (InputStream in = body) { @@ -138,7 +138,7 @@ public class HttpClientClose implements HttpServerAdapters { } } - private static record CancellingSubscriber(ExchangeResult result) + private record CancellingSubscriber(ExchangeResult result) implements Subscriber { @Override public void onSubscribe(Subscription subscription) { @@ -176,15 +176,15 @@ public class HttpClientClose implements HttpServerAdapters { boolean firstVersionMayNotMatch) { static ExchangeResult afterHead(int step, Version version, Http3DiscoveryMode config) { - return new ExchangeResult(step, version, config, null, false); + return new ExchangeResult<>(step, version, config, null, false); } static ExchangeResult ofSequential(int step, Version version, Http3DiscoveryMode config) { - return new ExchangeResult(step, version, config, null, true); + return new ExchangeResult<>(step, version, config, null, true); } ExchangeResult withResponse(HttpResponse response) { - return new ExchangeResult(step(), version(), config(), response, firstVersionMayNotMatch()); + return new ExchangeResult<>(step(), version(), config(), response, firstVersionMayNotMatch()); } // Ensures that the input stream gets closed in case of assertion @@ -193,11 +193,11 @@ public class HttpClientClose implements HttpServerAdapters { try { out.printf("%s: expect status 200 and version %s (%s) for %s%n", step, version, config, response.request().uri()); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); if (step == 0 && version == HTTP_3 && firstVersionMayNotMatch) { out.printf("%s: version not checked%n", step); } else { - assertEquals(response.version(), version); + assertEquals(version, response.version()); out.printf("%s: got expected version %s%n", step, response.version()); } } catch (AssertionError error) { @@ -227,10 +227,11 @@ public class HttpClientClose implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testConcurrent(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting concurrent (%s, %s, %s) ----%n%n", uriString, version, config); Throwable failed = null; @@ -266,7 +267,7 @@ public class HttpClientClose implements HttpServerAdapters { bodyCF = responseCF .thenApplyAsync((resp) -> readBody(si, resp), readerService) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); return s; }); long sleep = RANDOM.nextLong(5); @@ -289,7 +290,8 @@ public class HttpClientClose implements HttpServerAdapters { failed == null ? "done" : failed.toString()); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testSequential(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting sequential (%s, %s, %s) ----%n%n", uriString, version, config); Throwable failed = null; @@ -320,7 +322,7 @@ public class HttpClientClose implements HttpServerAdapters { bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(HttpClientClose::readBody) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); return s; }) .thenApply((s) -> { @@ -340,8 +342,8 @@ public class HttpClientClose implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("\n**** Setup ****\n"); readerService = Executors.newCachedThreadPool(); @@ -376,8 +378,8 @@ public class HttpClientClose implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.checkShutdown(5000); try { diff --git a/test/jdk/java/net/httpclient/HttpClientExceptionTest.java b/test/jdk/java/net/httpclient/HttpClientExceptionTest.java index f9c585d955e..dff7219c0c8 100644 --- a/test/jdk/java/net/httpclient/HttpClientExceptionTest.java +++ b/test/jdk/java/net/httpclient/HttpClientExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,8 +21,6 @@ * questions. */ -import org.testng.Assert; -import org.testng.annotations.Test; import java.io.IOException; import java.net.ProtocolFamily; import java.net.http.HttpClient; @@ -34,12 +32,15 @@ import java.nio.channels.Channel; import java.nio.channels.spi.AbstractSelector; import java.nio.channels.spi.SelectorProvider; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + /* * @test * @bug 8248006 * @summary The test checks if UncheckedIOException is thrown * @build HttpClientExceptionTest - * @run testng/othervm -Djava.nio.channels.spi.SelectorProvider=HttpClientExceptionTest$CustomSelectorProvider + * @run junit/othervm -Djava.nio.channels.spi.SelectorProvider=HttpClientExceptionTest$CustomSelectorProvider * HttpClientExceptionTest */ @@ -50,8 +51,8 @@ public class HttpClientExceptionTest { @Test public void testHttpClientException() { for(int i = 0; i < ITERATIONS; i++) { - Assert.assertThrows(HttpClient.newBuilder()::build); - Assert.assertThrows(HttpClient::newHttpClient); + Assertions.assertThrows(Throwable.class, HttpClient.newBuilder()::build); + Assertions.assertThrows(Throwable.class, HttpClient::newHttpClient); } } diff --git a/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java b/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java index 10cca697231..f1e8aecbaa4 100644 --- a/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java +++ b/test/jdk/java/net/httpclient/HttpClientLocalAddrTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,11 +23,6 @@ import jdk.test.lib.net.IPSupport; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.Assert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.Closeable; @@ -50,6 +45,12 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + /* * @test * @summary Tests HttpClient usage when configured with a local address to bind @@ -60,7 +61,7 @@ import static java.net.http.HttpClient.Version.HTTP_2; * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.net.IPSupport * jdk.httpclient.test.lib.common.HttpServerAdapters * - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=frames,ssl,requests,responses,errors * -Djdk.internal.httpclient.debug=true * -Dsun.net.httpserver.idleInterval=50000 @@ -81,7 +82,7 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { private static final AtomicInteger IDS = new AtomicInteger(); // start various HTTP/HTTPS servers that will be invoked against in the tests - @BeforeClass + @BeforeAll public static void beforeClass() throws Exception { HttpServerAdapters.HttpTestHandler handler = (exchange) -> { // the handler receives a request and sends back a 200 response with the @@ -126,7 +127,7 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { } // stop each of the started servers - @AfterClass + @AfterAll public static void afterClass() throws Exception { // stop each of the server and accumulate any exception // that might happen during stop and finally throw @@ -166,8 +167,7 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { return prevException; } - @DataProvider(name = "params") - private Object[][] paramsProvider() throws Exception { + private static Object[][] paramsProvider() throws Exception { final List testMethodParams = new ArrayList<>(); final URI[] requestURIs = new URI[]{httpURI, httpsURI, http2URI, https2URI}; final Predicate requiresSSLContext = (uri) -> uri.getScheme().equals("https"); @@ -224,7 +224,7 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { // An object that holds a client and that can be closed // Used when closing the client might require closing additional // resources, such as an executor - sealed interface ClientCloseable extends Closeable { + public sealed interface ClientCloseable extends Closeable { HttpClient client(); @@ -261,7 +261,7 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { } // A supplier of ClientCloseable - sealed interface ClientProvider extends Supplier { + public sealed interface ClientProvider extends Supplier { ClientCloseable get(); @@ -323,7 +323,8 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { * seen by the server side handler is the same one as that is set on the * {@code client} */ - @Test(dataProvider = "params") + @ParameterizedTest + @MethodSource("paramsProvider") public void testSend(ClientProvider clientProvider, URI requestURI, InetAddress localAddress) throws Exception { try (var c = clientProvider.get()) { HttpClient client = c.client(); @@ -332,10 +333,10 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { // GET request var req = HttpRequest.newBuilder(requestURI).build(); var resp = client.send(req, HttpResponse.BodyHandlers.ofByteArray()); - Assert.assertEquals(resp.statusCode(), 200, "Unexpected status code"); + Assertions.assertEquals(200, resp.statusCode(), "Unexpected status code"); // verify the address only if a specific one was set on the client if (localAddress != null && !localAddress.isAnyLocalAddress()) { - Assert.assertEquals(resp.body(), localAddress.getAddress(), + Assertions.assertArrayEquals(localAddress.getAddress(), resp.body(), "Unexpected client address seen by the server handler"); } } @@ -347,7 +348,8 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { * seen by the server side handler is the same one as that is set on the * {@code client} */ - @Test(dataProvider = "params") + @ParameterizedTest + @MethodSource("paramsProvider") public void testSendAsync(ClientProvider clientProvider, URI requestURI, InetAddress localAddress) throws Exception { try (var c = clientProvider.get()) { HttpClient client = c.client(); @@ -359,10 +361,10 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { var cf = client.sendAsync(req, HttpResponse.BodyHandlers.ofByteArray()); var resp = cf.get(); - Assert.assertEquals(resp.statusCode(), 200, "Unexpected status code"); + Assertions.assertEquals(200, resp.statusCode(), "Unexpected status code"); // verify the address only if a specific one was set on the client if (localAddress != null && !localAddress.isAnyLocalAddress()) { - Assert.assertEquals(resp.body(), localAddress.getAddress(), + Assertions.assertArrayEquals(localAddress.getAddress(), resp.body(), "Unexpected client address seen by the server handler"); } } @@ -374,7 +376,8 @@ public class HttpClientLocalAddrTest implements HttpServerAdapters { * is used when multiple concurrent threads are involved in sending requests from * the {@code client} */ - @Test(dataProvider = "params") + @ParameterizedTest + @MethodSource("paramsProvider") public void testMultiSendRequests(ClientProvider clientProvider, URI requestURI, InetAddress localAddress) throws Exception { diff --git a/test/jdk/java/net/httpclient/HttpClientShutdown.java b/test/jdk/java/net/httpclient/HttpClientShutdown.java index 4a5583782cb..8532146c1e2 100644 --- a/test/jdk/java/net/httpclient/HttpClientShutdown.java +++ b/test/jdk/java/net/httpclient/HttpClientShutdown.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,7 +32,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * HttpClientShutdown @@ -74,10 +74,6 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; @@ -88,10 +84,15 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class HttpClientShutdown implements HttpServerAdapters { @@ -100,27 +101,26 @@ public class HttpClientShutdown implements HttpServerAdapters { } static final Random RANDOM = RandomFactory.getRandom(); - ExecutorService readerService; + private static ExecutorService readerService; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) - HttpTestServer h3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h2h3Head; - String h3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) + private static HttpTestServer h3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h2h3Head; + private static String h3URI; static final String MESSAGE = "HttpClientShutdown message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { h2h3URI, HTTP_3, h2h3TestServer.h3DiscoveryConfig()}, { h3URI, HTTP_3, h3TestServer.h3DiscoveryConfig()}, @@ -216,11 +216,11 @@ public class HttpClientShutdown implements HttpServerAdapters { try { out.printf(now() + "%s: expect status 200 and version %s (%s) for %s%n", step, version, config, response.request().uri()); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); if (step == 0 && version == HTTP_3 && firstVersionMayNotMatch) { out.printf(now() + "%s: version not checked%n", step); } else { - assertEquals(response.version(), version); + assertEquals(version, response.version()); out.printf(now() + "%s: got expected version %s%n", step, response.version()); } } catch (AssertionError error) { @@ -238,7 +238,7 @@ public class HttpClientShutdown implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } static boolean hasExpectedMessage(IOException io) { @@ -272,7 +272,8 @@ public class HttpClientShutdown implements HttpServerAdapters { throw new AssertionError(what + ": Unexpected exception: " + cause, cause); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testConcurrent(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- %sstarting concurrent (%s, %s, %s) ----%n%n", now(), uriString, version, config); @@ -310,7 +311,7 @@ public class HttpClientShutdown implements HttpServerAdapters { bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(HttpClientShutdown::readBody) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); out.println(now() + si +": Got expected message: " + s); return s; }); @@ -375,7 +376,8 @@ public class HttpClientShutdown implements HttpServerAdapters { return failed; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testSequential(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- %sstarting sequential (%s, %s, %s) ----%n%n", now(), uriString, version, config); @@ -409,7 +411,7 @@ public class HttpClientShutdown implements HttpServerAdapters { bodyCF = responseCF.thenApplyAsync(HttpResponse::body, readerService) .thenApply(HttpClientShutdown::readBody) .thenApply((s) -> { - assertEquals(s, MESSAGE); + assertEquals(MESSAGE, s); return s; }) .thenApply((s) -> { @@ -461,8 +463,8 @@ public class HttpClientShutdown implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("\n**** Setup ****\n"); readerService = Executors.newCachedThreadPool(); @@ -498,8 +500,8 @@ public class HttpClientShutdown implements HttpServerAdapters { start = System.nanoTime(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.checkShutdown(5000); try { diff --git a/test/jdk/java/net/httpclient/HttpEchoHandler.java b/test/jdk/java/net/httpclient/HttpEchoHandler.java deleted file mode 100644 index 319a5b901f9..00000000000 --- a/test/jdk/java/net/httpclient/HttpEchoHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2015, 2018, 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 com.sun.net.httpserver.*; -import java.net.*; -import java.net.http.*; -import java.io.*; -import java.util.concurrent.*; -import javax.net.ssl.*; -import java.nio.file.*; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Random; -import jdk.test.lib.net.SimpleSSLContext; -import static java.net.http.HttpRequest.*; -import static java.net.http.HttpResponse.*; -import java.util.logging.ConsoleHandler; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class HttpEchoHandler implements HttpHandler { - static final Path CWD = Paths.get("."); - - public HttpEchoHandler() {} - - @Override - public void handle(HttpExchange t) - throws IOException { - try { - System.err.println("EchoHandler received request to " + t.getRequestURI()); - InputStream is = t.getRequestBody(); - Headers map = t.getRequestHeaders(); - Headers map1 = t.getResponseHeaders(); - map1.add("X-Hello", "world"); - map1.add("X-Bye", "universe"); - String fixedrequest = map.getFirst("XFixed"); - File outfile = Files.createTempFile(CWD, "foo", "bar").toFile(); - FileOutputStream fos = new FileOutputStream(outfile); - int count = (int) is.transferTo(fos); - is.close(); - fos.close(); - InputStream is1 = new FileInputStream(outfile); - OutputStream os = null; - // return the number of bytes received (no echo) - String summary = map.getFirst("XSummary"); - if (fixedrequest != null && summary == null) { - t.sendResponseHeaders(200, count); - os = t.getResponseBody(); - is1.transferTo(os); - } else { - t.sendResponseHeaders(200, 0); - os = t.getResponseBody(); - is1.transferTo(os); - - if (summary != null) { - String s = Integer.toString(count); - os.write(s.getBytes()); - } - } - outfile.delete(); - os.close(); - is1.close(); - } catch (Throwable e) { - e.printStackTrace(); - throw new IOException(e); - } - } -} diff --git a/test/jdk/java/net/httpclient/HttpHeadersOf.java b/test/jdk/java/net/httpclient/HttpHeadersOf.java index 6194ab0a472..77a800b7cf2 100644 --- a/test/jdk/java/net/httpclient/HttpHeadersOf.java +++ b/test/jdk/java/net/httpclient/HttpHeadersOf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 @@ /* * @test * @summary Tests for HttpHeaders.of factory method - * @run testng HttpHeadersOf + * @run junit HttpHeadersOf */ import java.net.http.HttpHeaders; @@ -33,13 +33,16 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.function.BiPredicate; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class HttpHeadersOf { @@ -59,12 +62,12 @@ public class HttpHeadersOf { @Override public String toString() { return "REJECT_ALL"; } }; - @DataProvider(name = "predicates") - public Object[][] predicates() { + public static Object[][] predicates() { return new Object[][] { { ACCEPT_ALL }, { REJECT_ALL } }; } - @Test(dataProvider = "predicates") + @ParameterizedTest + @MethodSource("predicates") public void testNull(BiPredicate filter) { assertThrows(NPE, () -> HttpHeaders.of(null, null)); assertThrows(NPE, () -> HttpHeaders.of(null, filter)); @@ -80,8 +83,7 @@ public class HttpHeadersOf { } - @DataProvider(name = "filterMaps") - public Object[][] filterMaps() { + public static Object[][] filterMaps() { List>> maps = List.of( Map.of("A", List.of("B"), "X", List.of("Y", "Z")), Map.of("A", List.of("B", "C"), "X", List.of("Y", "Z")), @@ -90,33 +92,33 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "filterMaps") + @ParameterizedTest + @MethodSource("filterMaps") public void testFilter(Map> map) { HttpHeaders headers = HttpHeaders.of(map, REJECT_ALL); - assertEquals(headers.map().size(), 0); + assertEquals(0, headers.map().size()); assertFalse(headers.firstValue("A").isPresent()); - assertEquals(headers.allValues("A").size(), 0); + assertEquals(0, headers.allValues("A").size()); headers = HttpHeaders.of(map, (name, value) -> { if (name.equals("A")) return true; else return false; }); - assertEquals(headers.map().size(), 1); + assertEquals(1, headers.map().size()); assertTrue(headers.firstValue("A").isPresent()); - assertEquals(headers.allValues("A"), map.get("A")); - assertEquals(headers.allValues("A").size(), map.get("A").size()); + assertEquals(map.get("A"), headers.allValues("A")); + assertEquals(map.get("A").size(), headers.allValues("A").size()); assertFalse(headers.firstValue("X").isPresent()); headers = HttpHeaders.of(map, (name, value) -> { if (name.equals("X")) return true; else return false; }); - assertEquals(headers.map().size(), 1); + assertEquals(1, headers.map().size()); assertTrue(headers.firstValue("X").isPresent()); - assertEquals(headers.allValues("X"), map.get("X")); - assertEquals(headers.allValues("X").size(), map.get("X").size()); + assertEquals(map.get("X"), headers.allValues("X")); + assertEquals(map.get("X").size(), headers.allValues("X").size()); assertFalse(headers.firstValue("A").isPresent()); } - @DataProvider(name = "mapValues") - public Object[][] mapValues() { + public static Object[][] mapValues() { List>> maps = List.of( Map.of("A", List.of("B")), Map.of("A", List.of("B", "C")), @@ -137,18 +139,19 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "mapValues") + @ParameterizedTest + @MethodSource("mapValues") public void testMapValues(Map> map) { HttpHeaders headers = HttpHeaders.of(map, ACCEPT_ALL); - assertEquals(headers.map().size(), map.size()); + assertEquals(map.size(), headers.map().size()); assertTrue(headers.firstValue("A").isPresent()); assertTrue(headers.firstValue("a").isPresent()); - assertEquals(headers.firstValue("A").get(), "B"); - assertEquals(headers.firstValue("a").get(), "B"); - assertEquals(headers.allValues("A"), map.get("A")); - assertEquals(headers.allValues("a"), map.get("A")); - assertEquals(headers.allValues("F").size(), 0); + assertEquals("B", headers.firstValue("A").get()); + assertEquals("B", headers.firstValue("a").get()); + assertEquals(map.get("A"), headers.allValues("A")); + assertEquals(map.get("A"), headers.allValues("a")); + assertEquals(0, headers.allValues("F").size()); assertTrue(headers.map().get("A").contains("B")); assertFalse(headers.map().get("A").contains("F")); assertThrows(NFE, () -> headers.firstValueAsLong("A")); @@ -167,8 +170,7 @@ public class HttpHeadersOf { } - @DataProvider(name = "caseInsensitivity") - public Object[][] caseInsensitivity() { + public static Object[][] caseInsensitivity() { List>> maps = List.of( Map.of("Accept-Encoding", List.of("gzip, deflate")), Map.of("accept-encoding", List.of("gzip, deflate")), @@ -179,7 +181,8 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "caseInsensitivity") + @ParameterizedTest + @MethodSource("caseInsensitivity") public void testCaseInsensitivity(Map> map) { HttpHeaders headers = HttpHeaders.of(map, ACCEPT_ALL); @@ -187,11 +190,11 @@ public class HttpHeadersOf { "aCCept-EnCODing", "accepT-encodinG")) { assertTrue(headers.firstValue(name).isPresent()); assertTrue(headers.allValues(name).contains("gzip, deflate")); - assertEquals(headers.firstValue(name).get(), "gzip, deflate"); - assertEquals(headers.allValues(name).size(), 1); - assertEquals(headers.map().size(), 1); - assertEquals(headers.map().get(name).size(), 1); - assertEquals(headers.map().get(name).get(0), "gzip, deflate"); + assertEquals("gzip, deflate", headers.firstValue(name).get()); + assertEquals(1, headers.allValues(name).size()); + assertEquals(1, headers.map().size()); + assertEquals(1, headers.map().get(name).size()); + assertEquals("gzip, deflate", headers.map().get(name).get(0)); } } @@ -212,8 +215,8 @@ public class HttpHeadersOf { HttpHeaders h2 = HttpHeaders.of(m2, ACCEPT_ALL); if (!m1.equals(m2)) mapDiffer++; if (m1.hashCode() != m2.hashCode()) mapHashDiffer++; - assertEquals(h1, h2, "HttpHeaders differ"); - assertEquals(h1.hashCode(), h2.hashCode(), + assertEquals(h2, h1, "HttpHeaders differ"); + assertEquals(h2.hashCode(), h1.hashCode(), "hashCode differ for " + List.of(m1,m2)); } } @@ -221,8 +224,7 @@ public class HttpHeadersOf { assertTrue(mapHashDiffer > 0, "all maps had same hashCode!"); } - @DataProvider(name = "valueAsLong") - public Object[][] valueAsLong() { + public static Object[][] valueAsLong() { return new Object[][] { new Object[] { Map.of("Content-Length", List.of("10")), 10l }, new Object[] { Map.of("Content-Length", List.of("101")), 101l }, @@ -232,15 +234,15 @@ public class HttpHeadersOf { }; } - @Test(dataProvider = "valueAsLong") + @ParameterizedTest + @MethodSource("valueAsLong") public void testValueAsLong(Map> map, long expected) { HttpHeaders headers = HttpHeaders.of(map, ACCEPT_ALL); - assertEquals(headers.firstValueAsLong("Content-Length").getAsLong(), expected); + assertEquals(expected, headers.firstValueAsLong("Content-Length").getAsLong()); } - @DataProvider(name = "duplicateNames") - public Object[][] duplicateNames() { + public static Object[][] duplicateNames() { List>> maps = List.of( Map.of("X-name", List.of(), "x-name", List.of()), @@ -262,7 +264,8 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "duplicateNames") + @ParameterizedTest + @MethodSource("duplicateNames") public void testDuplicates(Map> map) { HttpHeaders headers; try { @@ -275,8 +278,7 @@ public class HttpHeadersOf { } - @DataProvider(name = "noSplittingJoining") - public Object[][] noSplittingJoining() { + public static Object[][] noSplittingJoining() { List>> maps = List.of( Map.of("A", List.of("B")), Map.of("A", List.of("B", "C")), @@ -296,24 +298,24 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "noSplittingJoining") + @ParameterizedTest + @MethodSource("noSplittingJoining") public void testNoSplittingJoining(Map> map) { HttpHeaders headers = HttpHeaders.of(map, ACCEPT_ALL); Map> headersMap = headers.map(); - assertEquals(headers.map().size(), map.size()); + assertEquals(map.size(), headers.map().size()); for (Map.Entry> entry : map.entrySet()) { String headerName = entry.getKey(); List headerValues = entry.getValue(); - assertEquals(headerValues, headersMap.get(headerName)); - assertEquals(headerValues, headers.allValues(headerName)); - assertEquals(headerValues.get(0), headers.firstValue(headerName).get()); + assertEquals(headersMap.get(headerName), headerValues); + assertEquals(headers.allValues(headerName), headerValues); + assertEquals(headers.firstValue(headerName).get(), headerValues.get(0)); } } - @DataProvider(name = "trimming") - public Object[][] trimming() { + public static Object[][] trimming() { List>> maps = List.of( Map.of("A", List.of("B")), Map.of(" A", List.of("B")), @@ -331,23 +333,23 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "trimming") + @ParameterizedTest + @MethodSource("trimming") public void testTrimming(Map> map) { HttpHeaders headers = HttpHeaders.of(map, (name, value) -> { - assertEquals(name, "A"); - assertEquals(value, "B"); + assertEquals("A", name); + assertEquals("B", value); return true; }); - assertEquals(headers.map().size(), 1); - assertEquals(headers.firstValue("A").get(), "B"); - assertEquals(headers.allValues("A"), List.of("B")); - assertTrue(headers.map().get("A").equals(List.of("B"))); + assertEquals(1, headers.map().size()); + assertEquals("B", headers.firstValue("A").get()); + assertEquals(List.of("B"), headers.allValues("A")); + assertEquals(List.of("B"), headers.map().get("A")); } - @DataProvider(name = "emptyKey") - public Object[][] emptyKey() { + public static Object[][] emptyKey() { List>> maps = List.of( Map.of("", List.of("B")), Map.of(" ", List.of("B")), @@ -358,7 +360,8 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "emptyKey") + @ParameterizedTest + @MethodSource("emptyKey") public void testEmptyKey(Map> map) { HttpHeaders headers; try { @@ -371,8 +374,7 @@ public class HttpHeadersOf { } - @DataProvider(name = "emptyValue") - public Object[][] emptyValue() { + public static Object[][] emptyValue() { List>> maps = List.of( Map.of("A", List.of("")), Map.of("A", List.of("", "")), @@ -383,40 +385,41 @@ public class HttpHeadersOf { return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "emptyValue") + @ParameterizedTest + @MethodSource("emptyValue") public void testEmptyValue(Map> map) { HttpHeaders headers = HttpHeaders.of(map, (name, value) -> { - assertEquals(value, ""); + assertEquals("", value); return true; }); - assertEquals(headers.map().size(), map.size()); - assertEquals(headers.map().get("A").get(0), ""); - headers.allValues("A").forEach(v -> assertEquals(v, "")); - assertEquals(headers.firstValue("A").get(), ""); + assertEquals(map.size(), headers.map().size()); + assertEquals("", headers.map().get("A").get(0)); + headers.allValues("A").forEach(v -> assertEquals("", v)); + assertEquals("", headers.firstValue("A").get()); } - @DataProvider(name = "noValues") - public Object[][] noValues() { + public static Object[][] noValues() { List>> maps = List.of( Map.of("A", List.of()), Map.of("A", List.of(), "B", List.of()), Map.of("A", List.of(), "B", List.of(), "C", List.of()), - Map.of("A", new ArrayList()), - Map.of("A", new LinkedList()) + Map.of("A", new ArrayList<>()), + Map.of("A", new LinkedList<>()) ); return maps.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); } - @Test(dataProvider = "noValues") + @ParameterizedTest + @MethodSource("noValues") public void testNoValues(Map> map) { HttpHeaders headers = HttpHeaders.of(map, (name, value) -> { fail("UNEXPECTED call to filter"); return true; }); - assertEquals(headers.map().size(), 0); - assertEquals(headers.map().get("A"), null); - assertEquals(headers.allValues("A").size(), 0); + assertEquals(0, headers.map().size()); + assertNull(headers.map().get("A")); + assertEquals(0, headers.allValues("A").size()); assertFalse(headers.firstValue("A").isPresent()); } } diff --git a/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java b/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java index 5cca88716b6..99897a69a8c 100644 --- a/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java +++ b/test/jdk/java/net/httpclient/HttpInputStreamAvailableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,7 +21,7 @@ * questions. */ -/** +/* * @test * @bug 8306040 * @summary HttpResponseInputStream.available() returns 1 on empty stream @@ -47,19 +47,17 @@ import java.net.http.HttpResponse; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; import static org.junit.jupiter.api.Assertions.assertEquals; -@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class HttpInputStreamAvailableTest { - private HttpServer server; - private int port; - static final String TEST_MESSAGE = "This is test message"; - static final int ZERO = 0; + private static HttpServer server; + private static int port; + private static final String TEST_MESSAGE = "This is test message"; + private static final int ZERO = 0; @BeforeAll - void setup() throws Exception { + static void setup() throws Exception { InetAddress loopback = InetAddress.getLoopbackAddress(); InetSocketAddress addr = new InetSocketAddress(loopback, 0); server = HttpServer.create(addr, 0); @@ -72,69 +70,71 @@ public class HttpInputStreamAvailableTest { } @AfterAll - void teardown() throws Exception { + static void teardown() throws Exception { server.stop(0); } @Test public void test() throws Exception { - HttpClient client = HttpClient + try (HttpClient client = HttpClient .newBuilder() .proxy(HttpClient.Builder.NO_PROXY) - .build(); + .build()) { - URI uri = URIBuilder.newBuilder() - .scheme("http") - .loopback() - .port(port) - .path("/NonZeroResponse/") - .build(); + URI uri = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(port) + .path("/NonZeroResponse/") + .build(); - HttpRequest request = HttpRequest - .newBuilder(uri) - .GET() - .build(); + HttpRequest request = HttpRequest + .newBuilder(uri) + .GET() + .build(); - // Send a httpRequest and assert the bytes available - HttpResponse response = client.send(request, - HttpResponse.BodyHandlers.ofInputStream()); - try ( InputStream in = response.body()) { - in.readNBytes(2); - // this is not guaranteed, but a failure here would be surprising - assertEquals(TEST_MESSAGE.length() - 2, in.available()); - //read the remaining data - in.readAllBytes(); - //available should return 0 - assertEquals(ZERO, in.available()); + // Send a httpRequest and assert the bytes available + HttpResponse response = client.send(request, + HttpResponse.BodyHandlers.ofInputStream()); + try (InputStream in = response.body()) { + in.readNBytes(2); + // this is not guaranteed, but a failure here would be surprising + assertEquals(TEST_MESSAGE.length() - 2, in.available()); + //read the remaining data + in.readAllBytes(); + //available should return 0 + assertEquals(ZERO, in.available()); + } } } @Test public void test1() throws Exception { - HttpClient client = HttpClient + try (HttpClient client = HttpClient .newBuilder() .proxy(HttpClient.Builder.NO_PROXY) - .build(); + .build()) { - URI uri = URIBuilder.newBuilder() - .scheme("http") - .loopback() - .port(port) - .path("/ZeroResponse/") - .build(); + URI uri = URIBuilder.newBuilder() + .scheme("http") + .loopback() + .port(port) + .path("/ZeroResponse/") + .build(); - HttpRequest request = HttpRequest - .newBuilder(uri) - .GET() - .build(); + HttpRequest request = HttpRequest + .newBuilder(uri) + .GET() + .build(); - // Send a httpRequest and assert the bytes available - HttpResponse response = client.send(request, - HttpResponse.BodyHandlers.ofInputStream()); - try ( InputStream in = response.body()) { - assertEquals(ZERO, in.available()); - in.readAllBytes(); - assertEquals(ZERO, in.available()); + // Send a httpRequest and assert the bytes available + HttpResponse response = client.send(request, + HttpResponse.BodyHandlers.ofInputStream()); + try (InputStream in = response.body()) { + assertEquals(ZERO, in.available()); + in.readAllBytes(); + assertEquals(ZERO, in.available()); + } } } diff --git a/test/jdk/java/net/httpclient/HttpRedirectTest.java b/test/jdk/java/net/httpclient/HttpRedirectTest.java index e03a12a049c..2bf90bbe02c 100644 --- a/test/jdk/java/net/httpclient/HttpRedirectTest.java +++ b/test/jdk/java/net/httpclient/HttpRedirectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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,16 +23,13 @@ import com.sun.net.httpserver.HttpsServer; import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.AfterClass; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.*; + +import static org.junit.jupiter.api.Assertions.*; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -63,7 +60,12 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import jdk.httpclient.test.lib.common.HttpServerAdapters; -/** +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +/* * @test * @bug 8232625 * @summary This test verifies that the HttpClient works correctly when redirecting a post request. @@ -71,7 +73,7 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer HttpRedirectTest * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm -Dtest.requiresHost=true + * @run junit/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.debug=false * HttpRedirectTest @@ -85,33 +87,30 @@ public class HttpRedirectTest implements HttpServerAdapters { SSLContext.setDefault(context); } - final AtomicLong requestCounter = new AtomicLong(); - final AtomicLong responseCounter = new AtomicLong(); - HttpTestServer http1Server; - HttpTestServer http2Server; - HttpTestServer https1Server; - HttpTestServer https2Server; - HttpTestServer http3Server; - DigestEchoServer.TunnelingProxy proxy; + static final AtomicLong requestCounter = new AtomicLong(); + private static HttpTestServer http1Server; + private static HttpTestServer http2Server; + private static HttpTestServer https1Server; + private static HttpTestServer https2Server; + private static HttpTestServer http3Server; + private static DigestEchoServer.TunnelingProxy proxy; - URI http1URI; - URI https1URI; - URI http2URI; - URI https2URI; - URI http3URI; - InetSocketAddress proxyAddress; - ProxySelector proxySelector; - HttpClient client; - List> futures = new CopyOnWriteArrayList<>(); - Set pending = new CopyOnWriteArraySet<>(); + private static URI http1URI; + private static URI https1URI; + private static URI http2URI; + private static URI https2URI; + private static URI http3URI; + private static InetSocketAddress proxyAddress; + private static ProxySelector proxySelector; + private static HttpClient client; - final ExecutorService executor = new ThreadPoolExecutor(12, 60, 10, + static final ExecutorService executor = new ThreadPoolExecutor(12, 60, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); // Shared by HTTP/1.1 servers - final ExecutorService clientexec = new ThreadPoolExecutor(6, 12, 1, + static final ExecutorService clientexec = new ThreadPoolExecutor(6, 12, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); // Used by the client - public HttpClient newHttpClient(ProxySelector ps) { - HttpClient.Builder builder = newClientBuilderForH3() + public static HttpClient newHttpClient(ProxySelector ps) { + HttpClient.Builder builder = HttpServerAdapters.createClientBuilderForH3() .sslContext(context) .executor(clientexec) .followRedirects(HttpClient.Redirect.ALWAYS) @@ -119,8 +118,7 @@ public class HttpRedirectTest implements HttpServerAdapters { return builder.build(); } - @DataProvider(name="uris") - Object[][] testURIs() throws URISyntaxException { + static Object[][] testURIs() { List uris = List.of( http3URI.resolve("direct/orig/"), http1URI.resolve("direct/orig/"), @@ -144,12 +142,11 @@ public class HttpRedirectTest implements HttpServerAdapters { ); Object[][] tests = new Object[redirects.size() * uris.size()][3]; int count = 0; - for (int i=0; i < uris.size(); i++) { - URI u = uris.get(i); - for (int j=0; j < redirects.size() ; j++) { - int code = redirects.get(j).getKey(); - String m = redirects.get(j).getValue(); - tests[count][0] = u.resolve(code +"/"); + for (URI u : uris) { + for (Map.Entry redirect : redirects) { + int code = redirect.getKey(); + String m = redirect.getValue(); + tests[count][0] = u.resolve(code + "/"); tests[count][1] = code; tests[count][2] = m; count++; @@ -158,8 +155,8 @@ public class HttpRedirectTest implements HttpServerAdapters { return tests; } - @BeforeClass - public void setUp() throws Exception { + @BeforeAll + public static void setUp() throws Exception { try { InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); @@ -208,10 +205,8 @@ public class HttpRedirectTest implements HttpServerAdapters { proxySelector = new HttpProxySelector(proxyAddress); client = newHttpClient(proxySelector); System.out.println("Setup: done"); - } catch (Exception x) { + } catch (Exception | Error x) { tearDown(); throw x; - } catch (Error e) { - tearDown(); throw e; } } @@ -222,19 +217,19 @@ public class HttpRedirectTest implements HttpServerAdapters { client.sendAsync(request, HttpResponse.BodyHandlers.ofString()); HttpResponse resp = respCf.join(); if (method.equals("DO_NOT_FOLLOW")) { - assertEquals(resp.statusCode(), code, u + ": status code"); + assertEquals(code, resp.statusCode(), u + ": status code"); } else { - assertEquals(resp.statusCode(), 200, u + ": status code"); + assertEquals(200, resp.statusCode(), u + ": status code"); } if (method.equals("POST")) { - assertEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertEquals(REQUEST_BODY, resp.body(), u + ": body"); } else if (code == 304) { - assertEquals(resp.body(), "", u + ": body"); + assertEquals("", resp.body(), u + ": body"); } else if (method.equals("DO_NOT_FOLLOW")) { - assertNotEquals(resp.body(), GET_RESPONSE_BODY, u + ": body"); - assertNotEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertNotEquals(GET_RESPONSE_BODY, resp.body(), u + ": body"); + assertNotEquals(REQUEST_BODY, resp.body(), u + ": body"); } else { - assertEquals(resp.body(), GET_RESPONSE_BODY, u + ": body"); + assertEquals(GET_RESPONSE_BODY, resp.body(), u + ": body"); } } @@ -244,21 +239,21 @@ public class HttpRedirectTest implements HttpServerAdapters { client.sendAsync(request, HttpResponse.BodyHandlers.ofString()); HttpResponse resp = respCf.join(); if (method.equals("DO_NOT_FOLLOW")) { - assertEquals(resp.statusCode(), code, u + ": status code"); + assertEquals(code, resp.statusCode(), u + ": status code"); } else { - assertEquals(resp.statusCode(), 200, u + ": status code"); + assertEquals(200, resp.statusCode(), u + ": status code"); } if (method.equals("POST")) { - assertEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertEquals(REQUEST_BODY, resp.body(), u + ": body"); } else if (code == 304) { - assertEquals(resp.body(), "", u + ": body"); + assertEquals("", resp.body(), u + ": body"); } else if (method.equals("DO_NOT_FOLLOW")) { - assertNotEquals(resp.body(), GET_RESPONSE_BODY, u + ": body"); - assertNotEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertNotEquals(GET_RESPONSE_BODY, resp.body(), u + ": body"); + assertNotEquals(REQUEST_BODY, resp.body(), u + ": body"); } else if (code == 303) { - assertEquals(resp.body(), GET_RESPONSE_BODY, u + ": body"); + assertEquals(GET_RESPONSE_BODY, resp.body(), u + ": body"); } else { - assertEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertEquals(REQUEST_BODY, resp.body(), u + ": body"); } } @@ -270,7 +265,8 @@ public class HttpRedirectTest implements HttpServerAdapters { return builder; } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("testURIs") public void testPOST(URI uri, int code, String method) throws Exception { URI u = uri.resolve("foo?n=" + requestCounter.incrementAndGet()); HttpRequest request = newRequestBuilder(u) @@ -279,7 +275,8 @@ public class HttpRedirectTest implements HttpServerAdapters { testNonIdempotent(u, request, code, method); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("testURIs") public void testPUT(URI uri, int code, String method) throws Exception { URI u = uri.resolve("foo?n=" + requestCounter.incrementAndGet()); System.out.println("Testing with " + u); @@ -289,7 +286,8 @@ public class HttpRedirectTest implements HttpServerAdapters { testIdempotent(u, request, code, method); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("testURIs") public void testFoo(URI uri, int code, String method) throws Exception { URI u = uri.resolve("foo?n=" + requestCounter.incrementAndGet()); System.out.println("Testing with " + u); @@ -300,7 +298,8 @@ public class HttpRedirectTest implements HttpServerAdapters { testIdempotent(u, request, code, method); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("testURIs") public void testGet(URI uri, int code, String method) throws Exception { URI u = uri.resolve("foo?n=" + requestCounter.incrementAndGet()); System.out.println("Testing with " + u); @@ -312,24 +311,24 @@ public class HttpRedirectTest implements HttpServerAdapters { HttpResponse resp = respCf.join(); // body will be preserved except for 304 and 303: this is a GET. if (method.equals("DO_NOT_FOLLOW")) { - assertEquals(resp.statusCode(), code, u + ": status code"); + assertEquals(code, resp.statusCode(), u + ": status code"); } else { - assertEquals(resp.statusCode(), 200, u + ": status code"); + assertEquals(200, resp.statusCode(), u + ": status code"); } if (code == 304) { - assertEquals(resp.body(), "", u + ": body"); + assertEquals("", resp.body(), u + ": body"); } else if (method.equals("DO_NOT_FOLLOW")) { - assertNotEquals(resp.body(), GET_RESPONSE_BODY, u + ": body"); - assertNotEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertNotEquals(GET_RESPONSE_BODY, resp.body(), u + ": body"); + assertNotEquals(REQUEST_BODY, resp.body(), u + ": body"); } else if (code == 303) { - assertEquals(resp.body(), GET_RESPONSE_BODY, u + ": body"); + assertEquals(GET_RESPONSE_BODY, resp.body(), u + ": body"); } else { - assertEquals(resp.body(), REQUEST_BODY, u + ": body"); + assertEquals(REQUEST_BODY, resp.body(), u + ": body"); } } - @AfterClass - public void tearDown() { + @AfterAll + public static void tearDown() { proxy = stop(proxy, DigestEchoServer.TunnelingProxy::stop); http1Server = stop(http1Server, HttpTestServer::stop); https1Server = stop(https1Server, HttpTestServer::stop); @@ -355,7 +354,7 @@ public class HttpRedirectTest implements HttpServerAdapters { private interface Stoppable { public void stop(T service) throws Exception; } static T stop(T service, Stoppable stop) { - try { if (service != null) stop.stop(service); } catch (Throwable x) { }; + try { if (service != null) stop.stop(service); } catch (Throwable x) { } return null; } diff --git a/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java b/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java index d7598ede3be..19afbfbd99b 100644 --- a/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java +++ b/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2021, 2026, 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,19 +44,21 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import org.testng.annotations.Test; -import org.testng.annotations.DataProvider; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -/** +/* * @test * @bug 8252304 8276559 * @summary HttpRequest.newBuilder(HttpRequest) API and behaviour checks -* @run testng/othervm HttpRequestNewBuilderTest +* @run junit/othervm HttpRequestNewBuilderTest */ public class HttpRequestNewBuilderTest { static final Class NPE = NullPointerException.class; @@ -64,21 +66,19 @@ public class HttpRequestNewBuilderTest { record NamedAssertion(String name, BiConsumer test) { } - List REQUEST_ASSERTIONS = List.of( - new NamedAssertion("uri", (r1, r2) -> assertEquals(r1.uri(), r2.uri())), - new NamedAssertion("timeout", (r1, r2) -> assertEquals(r1.timeout(), r2.timeout())), - new NamedAssertion("version", (r1, r2) -> assertEquals(r1.version(), r2.version())), - new NamedAssertion("headers", (r1, r2) -> assertEquals(r1.headers(), r2.headers())), - new NamedAssertion("options", (r1, r2) -> assertEquals(r1.getOption(H3_DISCOVERY), r2.getOption(H3_DISCOVERY))), - new NamedAssertion("expectContinue", (r1, r2) -> assertEquals(r1.expectContinue(), r2.expectContinue())), + static List REQUEST_ASSERTIONS = List.of(new NamedAssertion("uri", (r1, r2) -> assertEquals(r2.uri(), r1.uri())), + new NamedAssertion("timeout", (r1, r2) -> assertEquals(r2.timeout(), r1.timeout())), + new NamedAssertion("version", (r1, r2) -> assertEquals(r2.version(), r1.version())), + new NamedAssertion("headers", (r1, r2) -> assertEquals(r2.headers(), r1.headers())), + new NamedAssertion("options", (r1, r2) -> assertEquals(r2.getOption(H3_DISCOVERY), r1.getOption(H3_DISCOVERY))), + new NamedAssertion("expectContinue", (r1, r2) -> assertEquals(r2.expectContinue(), r1.expectContinue())), new NamedAssertion("method", (r1, r2) -> { - assertEquals(r1.method(), r2.method()); + assertEquals(r2.method(), r1.method()); assertBodyPublisherEqual(r1, r2); }) ); - @DataProvider(name = "testRequests") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { HttpRequest.newBuilder(URI.create("https://uri-1/")).build() }, { HttpRequest.newBuilder(URI.create("https://version-1/")).version(HTTP_1_1).build() }, @@ -152,14 +152,14 @@ public class HttpRequestNewBuilderTest { } // test methods - void assertBodyPublisherEqual(HttpRequest r1, HttpRequest r2) { + static void assertBodyPublisherEqual(HttpRequest r1, HttpRequest r2) { if (r1.bodyPublisher().isPresent()) { assertTrue(r2.bodyPublisher().isPresent()); var bp1 = r1.bodyPublisher().get(); var bp2 = r2.bodyPublisher().get(); - assertEquals(bp1.getClass(), bp2.getClass()); - assertEquals(bp1.contentLength(), bp2.contentLength()); + assertEquals(bp2.getClass(), bp1.getClass()); + assertEquals(bp2.contentLength(), bp1.contentLength()); final class TestSubscriber implements Flow.Subscriber { final BodySubscriber s; @@ -181,7 +181,7 @@ public class HttpRequestNewBuilderTest { bp2.subscribe(new TestSubscriber(bs2)); var b2 = bs2.getBody().toCompletableFuture().join().getBytes(); - assertEquals(b1, b2); + Assertions.assertArrayEquals(b2, b1); } else { assertFalse(r2.bodyPublisher().isPresent()); } @@ -199,9 +199,9 @@ public class HttpRequestNewBuilderTest { var r = HttpRequest.newBuilder(request, (n, v) -> true) .method(methodName, HttpRequest.BodyPublishers.ofString("testData")) .build(); - assertEquals(r.method(), methodName); + assertEquals(methodName, r.method()); assertTrue(r.bodyPublisher().isPresent()); - assertEquals(r.bodyPublisher().get().contentLength(), 8); + assertEquals(8, r.bodyPublisher().get().contentLength()); assertAllOtherElementsEqual(r, request, "method"); // method w/o body @@ -209,9 +209,9 @@ public class HttpRequestNewBuilderTest { var r1 = HttpRequest.newBuilder(request, (n, v) -> true) .method(methodName, noBodyPublisher) .build(); - assertEquals(r1.method(), methodName); + assertEquals(methodName, r1.method()); assertTrue(r1.bodyPublisher().isPresent()); - assertEquals(r1.bodyPublisher().get(), noBodyPublisher); + assertEquals(noBodyPublisher, r1.bodyPublisher().get()); assertAllOtherElementsEqual(r1, request, "method"); } @@ -223,113 +223,125 @@ public class HttpRequestNewBuilderTest { assertThrows(NPE, () -> HttpRequest.newBuilder(null, null)); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") void testBuilder(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true).build(); - assertEquals(r, request); + assertEquals(request, r); assertAllOtherElementsEqual(r, request); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testURI(HttpRequest request) { URI newURI = URI.create("http://www.newURI.com/"); var r = HttpRequest.newBuilder(request, (n, v) -> true).uri(newURI).build(); - assertEquals(r.uri(), newURI); + assertEquals(newURI, r.uri()); assertAllOtherElementsEqual(r, request, "uri"); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testTimeout(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true).timeout(Duration.ofSeconds(2)).build(); - assertEquals(r.timeout().get().getSeconds(), 2); + assertEquals(2, r.timeout().get().getSeconds()); assertAllOtherElementsEqual(r, request, "timeout"); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testVersion(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true).version(HTTP_1_1).build(); - assertEquals(r.version().get(), HTTP_1_1); + assertEquals(HTTP_1_1, r.version().get()); assertAllOtherElementsEqual(r, request, "version"); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testGET(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true) .GET() .build(); - assertEquals(r.method(), "GET"); + assertEquals("GET", r.method()); assertTrue(r.bodyPublisher().isEmpty()); assertAllOtherElementsEqual(r, request, "method"); testBodyPublisher("GET", request); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testDELETE(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true) .DELETE() .build(); - assertEquals(r.method(), "DELETE"); + assertEquals("DELETE", r.method()); assertTrue(r.bodyPublisher().isEmpty()); assertAllOtherElementsEqual(r, request, "method"); testBodyPublisher("DELETE", request); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testPOST(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true) .POST(HttpRequest.BodyPublishers.ofString("testData")) .build(); - assertEquals(r.method(), "POST"); + assertEquals("POST", r.method()); assertTrue(r.bodyPublisher().isPresent()); - assertEquals(r.bodyPublisher().get().contentLength(), 8); + assertEquals(8, r.bodyPublisher().get().contentLength()); assertAllOtherElementsEqual(r, request, "method"); testBodyPublisher("POST", request); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testPUT(HttpRequest request) { var r = HttpRequest.newBuilder(request, (n, v) -> true) .PUT(HttpRequest.BodyPublishers.ofString("testData")) .build(); - assertEquals(r.method(), "PUT"); + assertEquals("PUT", r.method()); assertTrue(r.bodyPublisher().isPresent()); - assertEquals(r.bodyPublisher().get().contentLength(), 8); + assertEquals(8, r.bodyPublisher().get().contentLength()); assertAllOtherElementsEqual(r, request, "method"); testBodyPublisher("PUT", request); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testUserDefinedMethod(HttpRequest request) { testBodyPublisher("TEST", request); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testAddHeader(HttpRequest request) { BiPredicate filter = (n, v) -> true; var r = HttpRequest.newBuilder(request, filter).headers("newName", "newValue").build(); - assertEquals(r.headers().firstValue("newName").get(), "newValue"); - assertEquals(r.headers().allValues("newName").size(), 1); + assertEquals("newValue", r.headers().firstValue("newName").get()); + assertEquals(1, r.headers().allValues("newName").size()); assertAllOtherElementsEqual(r, request, "headers"); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testSetOption(HttpRequest request) { BiPredicate filter = (n, v) -> true; var r = HttpRequest.newBuilder(request, filter).setOption(H3_DISCOVERY, ALT_SVC).build(); - assertEquals(r.getOption(H3_DISCOVERY).get(), ALT_SVC); + assertEquals(ALT_SVC, r.getOption(H3_DISCOVERY).get()); assertAllOtherElementsEqual(r, request, "options"); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testRemoveHeader(HttpRequest request) { if(!request.headers().map().isEmpty()) { assertTrue(request.headers().map().containsKey("testName1")); @@ -338,13 +350,14 @@ public class HttpRequestNewBuilderTest { var r = HttpRequest.newBuilder(request, filter).build(); assertFalse(r.headers().map().containsKey("testName1")); - assertEquals(r.headers().map(), HttpHeaders.of(request.headers().map(), filter).map()); + assertEquals(HttpHeaders.of(request.headers().map(), filter).map(), r.headers().map()); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testRemoveOption(HttpRequest request) { if(!request.getOption(H3_DISCOVERY).isEmpty()) { - assertEquals(request.getOption(H3_DISCOVERY).get(), ANY); + assertEquals(ANY, request.getOption(H3_DISCOVERY).get()); } var r = HttpRequest.newBuilder(request, (a, b) -> true) @@ -353,7 +366,8 @@ public class HttpRequestNewBuilderTest { assertAllOtherElementsEqual(r, request, "options"); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testRemoveSingleHeaderValue(HttpRequest request) { if(!request.headers().map().isEmpty()) { assertTrue(request.headers().allValues("testName1").contains("testValue1")); @@ -363,10 +377,12 @@ public class HttpRequestNewBuilderTest { var r = HttpRequest.newBuilder(request, filter).build(); assertFalse(r.headers().map().containsValue("testValue1")); - assertEquals(r.headers().map(), HttpHeaders.of(request.headers().map(), filter).map()); + assertFalse(r.headers().allValues("testName1").contains("testValue1")); + assertEquals(HttpHeaders.of(request.headers().map(), filter).map(), r.headers().map()); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testRemoveMultipleHeaders(HttpRequest request) { BiPredicate isTestName1Value1 = (n ,v) -> n.equalsIgnoreCase("testName1") && v.equals("testValue1"); @@ -375,34 +391,36 @@ public class HttpRequestNewBuilderTest { var filter = (isTestName1Value1.or(isTestName2Value2)).negate(); var r = HttpRequest.newBuilder(request, filter).build(); - assertEquals(r.headers().map(), HttpHeaders.of(request.headers().map(), filter).map()); + assertEquals(HttpHeaders.of(request.headers().map(), filter).map(), r.headers().map()); BiPredicate filter1 = (n, v) -> !(n.equalsIgnoreCase("testName1") && (v.equals("testValue1") || v.equals("testValue2"))); var r1 = HttpRequest.newBuilder(request, filter1).build(); - assertEquals(r1.headers().map(), HttpHeaders.of(request.headers().map(), filter1).map()); + assertEquals(HttpHeaders.of(request.headers().map(), filter1).map(), r1.headers().map()); } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testRemoveAllHeaders(HttpRequest request) { if (!request.headers().map().isEmpty()) { BiPredicate filter = (n, v) -> false; var r = HttpRequest.newBuilder(request, filter).build(); assertTrue(r.headers().map().isEmpty()); - assertEquals(r.headers().map(), HttpHeaders.of(request.headers().map(), filter).map()); + assertEquals(HttpHeaders.of(request.headers().map(), filter).map(), r.headers().map()); } } - @Test(dataProvider = "testRequests") + @ParameterizedTest + @MethodSource("variants") public void testRetainAllHeaders(HttpRequest request) { if (!request.headers().map().isEmpty()) { BiPredicate filter = (n, v) -> true; var r = HttpRequest.newBuilder(request, filter).build(); assertFalse(r.headers().map().isEmpty()); - assertEquals(r.headers().map(), HttpHeaders.of(request.headers().map(), filter).map()); + assertEquals(HttpHeaders.of(request.headers().map(), filter).map(), r.headers().map()); } } @@ -414,7 +432,7 @@ public class HttpRequestNewBuilderTest { BiPredicate filter = (n, v) -> !n.equalsIgnoreCase("Foo-Bar"); var r = HttpRequest.newBuilder(request, filter).build(); assertFalse(r.headers().map().containsKey("Foo-Bar")); - assertEquals(r.headers().map(), HttpHeaders.of(request.headers().map(), filter).map()); + assertEquals(HttpHeaders.of(request.headers().map(), filter).map(), r.headers().map()); } @Test diff --git a/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java b/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java index 6468175ab59..3b955b8feb7 100644 --- a/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java +++ b/test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +35,6 @@ import jdk.test.lib.net.URIBuilder; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; import java.io.IOException; import java.io.InputStream; @@ -53,18 +52,17 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class HttpResponseInputStreamInterruptTest { - HttpServer server; - int port; - private final CountDownLatch interruptReadyLatch = new CountDownLatch(2); - private final CountDownLatch interruptDoneLatch = new CountDownLatch(1); + private static HttpServer server; + private static int port; + private static final CountDownLatch interruptReadyLatch = new CountDownLatch(2); + private static final CountDownLatch interruptDoneLatch = new CountDownLatch(1); static final String FIRST_MESSAGE = "Should be received"; static final String SECOND_MESSAGE = "Shouldn't be received"; @BeforeAll - void before() throws Exception { + static void before() throws Exception { InetAddress loopback = InetAddress.getLoopbackAddress(); InetSocketAddress addr = new InetSocketAddress(loopback, 0); server = HttpServer.create(addr, 0); @@ -75,7 +73,7 @@ public class HttpResponseInputStreamInterruptTest { } @AfterAll - void after() throws Exception { + static void after() throws Exception { server.stop(0); } diff --git a/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java b/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java index 2249839e8bb..633c6877716 100644 --- a/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java +++ b/test/jdk/java/net/httpclient/HttpResponseInputStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,15 +38,14 @@ import java.util.concurrent.Flow; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; -import org.testng.annotations.Test; - -import static org.testng.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; /* * @test * @bug 8197564 8228970 * @summary Simple smoke test for BodySubscriber.asInputStream(); - * @run testng/othervm HttpResponseInputStreamTest + * @run junit/othervm HttpResponseInputStreamTest * @author daniel fuchs */ public class HttpResponseInputStreamTest { @@ -56,7 +55,7 @@ public class HttpResponseInputStreamTest { static class TestException extends IOException {} public static void main(String[] args) throws InterruptedException, ExecutionException { - testOnError(); + new HttpResponseInputStreamTest().testOnError(); } /** @@ -66,7 +65,7 @@ public class HttpResponseInputStreamTest { * @throws ExecutionException */ @Test - public static void testOnError() throws InterruptedException, ExecutionException { + public void testOnError() throws InterruptedException, ExecutionException { CountDownLatch latch = new CountDownLatch(1); BodySubscriber isb = BodySubscribers.ofInputStream(); ErrorTestSubscription s = new ErrorTestSubscription(isb); @@ -160,7 +159,7 @@ public class HttpResponseInputStreamTest { } @Test - public static void testCloseAndSubscribe() + public void testCloseAndSubscribe() throws InterruptedException, ExecutionException { BodySubscriber isb = BodySubscribers.ofInputStream(); @@ -189,34 +188,34 @@ public class HttpResponseInputStreamTest { } @Test - public static void testReadParameters() throws InterruptedException, ExecutionException, IOException { + public void testReadParameters() throws InterruptedException, ExecutionException, IOException { BodySubscriber isb = BodySubscribers.ofInputStream(); InputStream is = isb.getBody().toCompletableFuture().get(); Throwable ex; // len == 0 - assertEquals(is.read(new byte[16], 0, 0), 0); - assertEquals(is.read(new byte[16], 16, 0), 0); + assertEquals(0, is.read(new byte[16], 0, 0)); + assertEquals(0, is.read(new byte[16], 16, 0)); // index == -1 - ex = expectThrows(OOB, () -> is.read(new byte[16], -1, 10)); + ex = assertThrows(OOB, () -> is.read(new byte[16], -1, 10)); System.out.println("OutOfBoundsException thrown as expected: " + ex); // large offset - ex = expectThrows(OOB, () -> is.read(new byte[16], 17, 10)); + ex = assertThrows(OOB, () -> is.read(new byte[16], 17, 10)); System.out.println("OutOfBoundsException thrown as expected: " + ex); - ex = expectThrows(OOB, () -> is.read(new byte[16], 10, 10)); + ex = assertThrows(OOB, () -> is.read(new byte[16], 10, 10)); System.out.println("OutOfBoundsException thrown as expected: " + ex); // null value - ex = expectThrows(NPE, () -> is.read(null, 0, 10)); + ex = assertThrows(NPE, () -> is.read(null, 0, 10)); System.out.println("NullPointerException thrown as expected: " + ex); } @Test - public static void testSubscribeAndClose() + public void testSubscribeAndClose() throws InterruptedException, ExecutionException { BodySubscriber isb = BodySubscribers.ofInputStream(); diff --git a/test/jdk/java/net/httpclient/HttpVersionsTest.java b/test/jdk/java/net/httpclient/HttpVersionsTest.java index a55c2727a00..f047e2902e8 100644 --- a/test/jdk/java/net/httpclient/HttpVersionsTest.java +++ b/test/jdk/java/net/httpclient/HttpVersionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +28,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.Platform - * @run testng/othervm HttpVersionsTest + * @run junit/othervm HttpVersionsTest */ import java.io.IOException; @@ -42,30 +42,30 @@ import java.net.http.HttpResponse; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.net.ssl.SSLContext; -import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.String.format; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpResponse.BodyHandlers.ofString; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class HttpVersionsTest { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - Http2TestServer http2TestServer; - Http2TestServer https2TestServer; - String http2URI; - String https2URI; + static Http2TestServer http2TestServer; + static Http2TestServer https2TestServer; + static String http2URI; + static String https2URI; static final int ITERATIONS = 3; static final String[] BODY = new String[] { @@ -74,10 +74,9 @@ public class HttpVersionsTest { "I think I'll drink until I stink", "I'll drink until I cannot blink" }; - int nextBodyId; + static int nextBodyId; - @DataProvider(name = "scenarios") - public Object[][] scenarios() { + public static Object[][] scenarios() { return new Object[][] { { http2URI, true }, { https2URI, true }, @@ -87,9 +86,10 @@ public class HttpVersionsTest { } /** Checks that an HTTP/2 request receives an HTTP/2 response. */ - @Test(dataProvider = "scenarios") + @ParameterizedTest + @MethodSource("scenarios") void testHttp2Get(String uri, boolean sameClient) throws Exception { - out.println(format("\n--- testHttp2Get uri:%s, sameClient:%s", uri, sameClient)); + out.printf("\n--- testHttp2Get uri:%s, sameClient:%s%n", uri, sameClient); HttpClient client = null; for (int i=0; i out.println("X-Received-Body:" + s)); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_1_1); - assertEquals(response.body(), ""); - assertEquals(response.headers().firstValue("X-Magic").get(), - "HTTP/1.1 request received by HTTP/2 server"); - assertEquals(response.headers().firstValue("X-Received-Body").get(), ""); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_1_1, response.version()); + assertEquals("", response.body()); + assertEquals("HTTP/1.1 request received by HTTP/2 server", response.headers().firstValue("X-Magic").get()); + assertEquals("", response.headers().firstValue("X-Received-Body").get()); if (uri.startsWith("https")) assertTrue(response.sslSession().isPresent()); } } - @Test(dataProvider = "scenarios") + @ParameterizedTest + @MethodSource("scenarios") void testHttp1dot1Post(String uri, boolean sameClient) throws Exception { - out.println(format("\n--- testHttp1dot1Post uri:%s, sameClient:%s", uri, sameClient)); + out.printf("\n--- testHttp1dot1Post uri:%s, sameClient:%s%n", uri, sameClient); HttpClient client = null; for (int i=0; i out.println("X-Received-Body:" + s)); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_1_1); - assertEquals(response.body(), ""); - assertEquals(response.headers().firstValue("X-Magic").get(), - "HTTP/1.1 request received by HTTP/2 server"); - assertEquals(response.headers().firstValue("X-Received-Body").get(), msg); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_1_1, response.version()); + assertEquals("", response.body()); + assertEquals("HTTP/1.1 request received by HTTP/2 server", response.headers().firstValue("X-Magic").get()); + assertEquals(msg, response.headers().firstValue("X-Received-Body").get()); if (uri.startsWith("https")) assertTrue(response.sslSession().isPresent()); } @@ -203,8 +204,8 @@ public class HttpVersionsTest { static final ExecutorService executor = Executors.newCachedThreadPool(); - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { http2TestServer = new Http2TestServer("localhost", false, 0, executor, 50, null, null, true); http2TestServer.addHandler(new Http2VerEchoHandler(), "/http2/vts"); http2URI = "http://" + http2TestServer.serverAuthority() + "/http2/vts"; @@ -217,8 +218,8 @@ public class HttpVersionsTest { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { http2TestServer.stop(); https2TestServer.stop(); executor.shutdown(); diff --git a/test/jdk/java/net/httpclient/ISO_8859_1_Test.java b/test/jdk/java/net/httpclient/ISO_8859_1_Test.java index d629a6f3105..103284c9d54 100644 --- a/test/jdk/java/net/httpclient/ISO_8859_1_Test.java +++ b/test/jdk/java/net/httpclient/ISO_8859_1_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * ISO_8859_1_Test * @summary Tests that a client is able to receive ISO-8859-1 encoded header values. @@ -48,7 +48,6 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; @@ -60,21 +59,11 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; @@ -82,30 +71,38 @@ import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ISO_8859_1_Test implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - DummyServer http1DummyServer; - HttpTestServer http1TestServer; // HTTP/1.1 ( http ) - HttpTestServer https1TestServer; // HTTPS/1.1 ( https ) - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String http1Dummy; - String http1URI; - String https1URI; - String http2URI; - String https2URI; - String http3URI; + private static DummyServer http1DummyServer; + private static HttpTestServer http1TestServer; // HTTP/1.1 ( http ) + private static HttpTestServer https1TestServer; // HTTPS/1.1 ( https ) + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String http1Dummy; + private static String http1URI; + private static String https1URI; + private static String http2URI; + private static String https2URI; + private static String http3URI; - static final int RESPONSE_CODE = 200; static final int ITERATION_COUNT = 4; - static final Class IAE = IllegalArgumentException.class; - static final Class CE = CompletionException.class; // a shared executor helps reduce the amount of threads created by the test static final Executor executor = new TestExecutor(Executors.newCachedThreadPool()); static final ConcurrentMap FAILURES = new ConcurrentHashMap<>(); @@ -121,8 +118,8 @@ public class ISO_8859_1_Test implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -148,40 +145,40 @@ public class ISO_8859_1_Test implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { - var failed = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - FAILURES.putAll(failed); - out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); if (FAILURES.isEmpty()) return; @@ -199,7 +196,7 @@ public class ISO_8859_1_Test implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { http3URI, http1Dummy, @@ -210,13 +207,7 @@ public class ISO_8859_1_Test implements HttpServerAdapters { }; } - static AtomicLong URICOUNT = new AtomicLong(); - - @DataProvider(name = "variants") - public Object[][] variants(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -265,7 +256,7 @@ public class ISO_8859_1_Test implements HttpServerAdapters { } } - private static final Exception completionCause(CompletionException x) { + private static Exception completionCause(CompletionException x) { Throwable c = x; while (c instanceof CompletionException || c instanceof ExecutionException) { @@ -285,10 +276,11 @@ public class ISO_8859_1_Test implements HttpServerAdapters { return builder; } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void test(String uri, boolean sameClient) throws Exception { - checkSkip(); - System.out.println("Request to " + uri); + + System.out.printf("%n%s-- test sameClient=%s uri=%s%n%n", now(), sameClient, uri); HttpClient client = newHttpClient(uri, sameClient); @@ -307,7 +299,7 @@ public class ISO_8859_1_Test implements HttpServerAdapters { var response = cf.get(); System.out.println("Got: " + response); var value = response.headers().firstValue("Header8859").orElse(null); - assertEquals(value, "U\u00ffU"); + assertEquals("U\u00ffU", value); } System.out.println("HttpClient: PASSED"); if (uri.contains("http1")) { @@ -317,10 +309,10 @@ public class ISO_8859_1_Test implements HttpServerAdapters { conn.connect(); conn.getInputStream().readAllBytes(); var value = conn.getHeaderField("Header8859"); - assertEquals(value, "U\u00ffU", "legacy stack failed"); + assertEquals("U\u00ffU", value, "legacy stack failed"); System.out.println("URLConnection: PASSED"); } - System.out.println("test: DONE"); + System.out.println(now() + "test: DONE"); } static final class DummyServer extends Thread implements AutoCloseable { @@ -335,8 +327,8 @@ public class ISO_8859_1_Test implements HttpServerAdapters { static final InetSocketAddress LOOPBACK = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); final ServerSocket socket; - final CopyOnWriteArrayList accepted = new CopyOnWriteArrayList(); - final CompletableFuture done = new CompletableFuture(); + final CopyOnWriteArrayList accepted = new CopyOnWriteArrayList<>(); + final CompletableFuture done = new CompletableFuture<>(); volatile boolean closed; DummyServer() throws IOException { socket = new ServerSocket(); @@ -387,11 +379,11 @@ public class ISO_8859_1_Test implements HttpServerAdapters { } } - final void close(AutoCloseable toclose) { + void close(AutoCloseable toclose) { try { toclose.close(); } catch (Exception x) {}; } - final public void close() { + public void close() { closed = true; close(socket); accepted.forEach(this::close); @@ -410,8 +402,8 @@ public class ISO_8859_1_Test implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { HttpServerAdapters.HttpTestHandler handler = new ISO88591Handler(); InetSocketAddress loopback = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); @@ -448,8 +440,8 @@ public class ISO_8859_1_Test implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { String sharedClientName = sharedClient == null ? null : sharedClient.toString(); sharedClient = null; diff --git a/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java b/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java index 78984964895..be7e1db0033 100644 --- a/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java +++ b/test/jdk/java/net/httpclient/IdleConnectionTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,6 @@ import jdk.httpclient.test.lib.quic.QuicServerConnection; import jdk.internal.net.http.common.HttpHeadersBuilder; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; import java.io.IOException; import java.io.InputStream; @@ -56,7 +54,10 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; import static java.net.http.HttpClient.Version.HTTP_2; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /* * @test @@ -68,45 +69,45 @@ import static org.testng.Assert.assertEquals; * jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.http3.Http3TestServer * - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout=1 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout=1 * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout=20 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout=20 * IdleConnectionTimeoutTest * - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=1 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=1 * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=20 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=20 * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=abc + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=abc * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=-1 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h2=-1 * IdleConnectionTimeoutTest * - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=1 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=1 * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=20 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=20 * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=abc + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=abc * IdleConnectionTimeoutTest - * @run testng/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=-1 + * @run junit/othervm -Djdk.httpclient.HttpClient.log=all -Djdk.httpclient.keepalive.timeout.h3=-1 * IdleConnectionTimeoutTest */ public class IdleConnectionTimeoutTest { - URI timeoutUriH2, noTimeoutUriH2, timeoutUriH3, noTimeoutUriH3, getH3; + private static URI timeoutUriH2, noTimeoutUriH2, timeoutUriH3, noTimeoutUriH3, getH3; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); static volatile QuicServerConnection latestServerConn; final String KEEP_ALIVE_PROPERTY = "jdk.httpclient.keepalive.timeout"; final String IDLE_CONN_PROPERTY_H2 = "jdk.httpclient.keepalive.timeout.h2"; final String IDLE_CONN_PROPERTY_H3 = "jdk.httpclient.keepalive.timeout.h3"; - final String TIMEOUT_PATH = "/serverTimeoutHandler"; - final String NO_TIMEOUT_PATH = "/noServerTimeoutHandler"; + static final String TIMEOUT_PATH = "/serverTimeoutHandler"; + static final String NO_TIMEOUT_PATH = "/noServerTimeoutHandler"; static Http2TestServer http2TestServer; static Http3TestServer http3TestServer; static final PrintStream testLog = System.err; - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { http2TestServer = new Http2TestServer(false, 0); http2TestServer.addHandler(new ServerTimeoutHandlerH2(), TIMEOUT_PATH); http2TestServer.addHandler(new ServerNoTimeoutHandlerH2(), NO_TIMEOUT_PATH); @@ -212,7 +213,7 @@ public class IdleConnectionTimeoutTest { HttpRequest hreq = HttpRequest.newBuilder(uri).version(version).GET() .setOption(H3_DISCOVERY, config).build(); HttpResponse hresp = runRequest(hc, hreq, 2750); - assertEquals(hresp.statusCode(), 200, "idleConnectionTimeoutEvent was not expected but occurred"); + assertEquals(200, hresp.statusCode(), "idleConnectionTimeoutEvent was not expected but occurred"); } private void testNoTimeout(HttpClient hc, URI uri, Version version) { @@ -221,13 +222,13 @@ public class IdleConnectionTimeoutTest { HttpRequest hreq = HttpRequest.newBuilder(uri).version(version).GET() .setOption(H3_DISCOVERY, config).build(); HttpResponse hresp = runRequest(hc, hreq, 0); - assertEquals(hresp.statusCode(), 200, "idleConnectionTimeoutEvent was not expected but occurred"); + assertEquals(200, hresp.statusCode(), "idleConnectionTimeoutEvent was not expected but occurred"); } private HttpResponse runRequest(HttpClient hc, HttpRequest req, int sleepTime) { CompletableFuture> request = hc.sendAsync(req, HttpResponse.BodyHandlers.ofString(UTF_8)); HttpResponse hresp = request.join(); - assertEquals(hresp.statusCode(), 200); + assertEquals(200, hresp.statusCode()); try { Thread.sleep(sleepTime); } catch (InterruptedException e) { diff --git a/test/jdk/java/net/httpclient/ImmutableFlowItems.java b/test/jdk/java/net/httpclient/ImmutableFlowItems.java index 3ee4eb28768..e42e2e21a6e 100644 --- a/test/jdk/java/net/httpclient/ImmutableFlowItems.java +++ b/test/jdk/java/net/httpclient/ImmutableFlowItems.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm ImmutableFlowItems + * @run junit/othervm ImmutableFlowItems */ import java.io.IOException; @@ -58,32 +58,33 @@ import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.*; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ImmutableFlowItems { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpsServer httpsTestServer; // HTTPS/1.1 - Http2TestServer http2TestServer; // HTTP/2 ( h2c ) - Http2TestServer https2TestServer; // HTTP/2 ( h2 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; + private static HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpsServer httpsTestServer; // HTTPS/1.1 + private static Http2TestServer http2TestServer; // HTTP/2 ( h2c ) + private static Http2TestServer https2TestServer; // HTTP/2 ( h2 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpURI_fixed }, { httpURI_chunk }, @@ -104,7 +105,8 @@ public class ImmutableFlowItems { .build(); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsString(String uri) throws Exception { HttpClient client = newHttpClient(); @@ -114,14 +116,14 @@ public class ImmutableFlowItems { BodyHandler handler = new CRSBodyHandler(); client.sendAsync(req, handler) .thenApply(HttpResponse::body) - .thenAccept(body -> assertEquals(body, BODY)) + .thenAccept(body -> assertEquals(BODY, body)) .join(); } static class CRSBodyHandler implements BodyHandler { @Override public BodySubscriber apply(HttpResponse.ResponseInfo rinfo) { - assertEquals(rinfo.statusCode(), 200); + assertEquals(200, rinfo.statusCode()); return new CRSBodySubscriber(); } } @@ -138,7 +140,7 @@ public class ImmutableFlowItems { public void onNext(List item) { assertUnmodifiableList(item); long c = item.stream().filter(ByteBuffer::isReadOnly).count(); - assertEquals(c, item.size(), "Unexpected writable buffer in: " +item); + assertEquals(item.size(), c, "Unexpected writable buffer in: " +item); ofString.onNext(item); } @@ -173,8 +175,8 @@ public class ImmutableFlowItems { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpHandler h1_fixedLengthHandler = new HTTP1_FixedLengthHandler(); HttpHandler h1_chunkHandler = new HTTP1_ChunkedHandler(); @@ -214,8 +216,8 @@ public class ImmutableFlowItems { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(0); httpsTestServer.stop(0); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java index 10df564bd41..c83d9d67528 100644 --- a/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java +++ b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Dtest.http.version=http3 + * @run junit/othervm -Dtest.http.version=http3 * -Djdk.internal.httpclient.debug=true * InvalidInputStreamSubscriptionRequest */ @@ -41,7 +41,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Dtest.http.version=http2 InvalidInputStreamSubscriptionRequest + * @run junit/othervm -Dtest.http.version=http2 InvalidInputStreamSubscriptionRequest */ /* * @test id=http1 @@ -51,16 +51,11 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Dtest.http.version=http1 InvalidInputStreamSubscriptionRequest + * @run junit/othervm -Dtest.http.version=http1 InvalidInputStreamSubscriptionRequest */ import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -96,26 +91,31 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; - String http3URI_fixed; - String http3URI_chunk; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; + private static String http3URI_fixed; + private static String http3URI_chunk; static final int ITERATION_COUNT = 3; // a shared executor helps reduce the amount of threads created by the test @@ -156,7 +156,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters } } - @AfterClass + @AfterAll static final void printFailedTests() { out.println("\n========================="); try { @@ -200,8 +200,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters static final Supplier> OF_INPUTSTREAM = BHS.of(BodyHandlers::ofInputStream, "BodyHandlers::ofInputStream"); - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { Object[][] http3 = new Object[][]{ {http3URI_fixed, false, OF_INPUTSTREAM}, {http3URI_chunk, false, OF_INPUTSTREAM}, @@ -244,7 +243,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; HttpClient newHttpClient(String uri) { HttpClient.Builder builder = uri.contains("/http3/") ? newClientBuilderForH3() @@ -265,7 +264,8 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters return builder; } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testNoBody(String uri, boolean sameClient, BHS handlers) throws Exception { @@ -285,7 +285,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters HttpResponse response = client.send(req, badHandler); try (InputStream is = response.body()) { String body = new String(is.readAllBytes(), UTF_8); - assertEquals(body, ""); + assertEquals("", body); if (uri.endsWith("/chunk") && response.version() == HTTP_1_1) { // with /fixed and 0 length @@ -324,7 +324,8 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testNoBodyAsync(String uri, boolean sameClient, BHS handlers) throws Exception { @@ -352,7 +353,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters }); try { // Get the final result and compare it with the expected body - assertEquals(result.get(), ""); + assertEquals("", result.get()); if (uri.endsWith("/chunk") && response.get().version() == HTTP_1_1) { // with /fixed and 0 length @@ -390,7 +391,8 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsString(String uri, boolean sameClient, BHS handlers) throws Exception { @@ -409,7 +411,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters HttpResponse response = client.send(req, badHandler); try (InputStream is = response.body()) { String body = new String(is.readAllBytes(), UTF_8); - assertEquals(body, WITH_BODY); + assertEquals(WITH_BODY, body); throw new RuntimeException("Expected IAE not thrown"); } } catch (Exception x) { @@ -443,7 +445,8 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsStringAsync(String uri, boolean sameClient, BHS handlers) throws Exception { @@ -470,7 +473,7 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters // Get the final result and compare it with the expected body try { String body = result.get(); - assertEquals(body, WITH_BODY); + assertEquals(WITH_BODY, body); throw new RuntimeException("Expected IAE not thrown"); } catch (Exception x) { Throwable cause = x; @@ -563,8 +566,8 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpTestHandler h1_fixedLengthHandler = new HTTP_FixedLengthHandler(); HttpTestHandler h1_chunkHandler = new HTTP_VariableLengthHandler(); @@ -613,8 +616,8 @@ public class InvalidInputStreamSubscriptionRequest implements HttpServerAdapters http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { AssertionError fail = TRACKER.check(1500); try { httpTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java index be4d3297dd7..0027a7956d5 100644 --- a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java +++ b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * when SSL context is not valid. * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest */ import java.io.IOException; @@ -40,7 +40,6 @@ import java.util.concurrent.CompletionException; import java.net.SocketException; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; -import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLSocket; import java.net.http.HttpClient; @@ -49,32 +48,32 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.Assert; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class InvalidSSLContextTest { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - volatile SSLServerSocket sslServerSocket; - volatile String uri; + static volatile SSLServerSocket sslServerSocket; + static volatile String uri; - @DataProvider(name = "versions") - public Object[][] versions() { + public static Object[][] versions() { return new Object[][]{ { HTTP_1_1 }, { HTTP_2 } }; } - @Test(dataProvider = "versions") + @ParameterizedTest + @MethodSource("versions") public void testSync(Version version) throws Exception { // client-side uses a different context to that of the server-side HttpClient client = HttpClient.newBuilder() @@ -88,14 +87,15 @@ public class InvalidSSLContextTest { try { HttpResponse response = client.send(request, BodyHandlers.discarding()); - Assert.fail("UNEXPECTED response" + response); + Assertions.fail("UNEXPECTED response" + response); } catch (IOException ex) { System.out.println("Caught expected: " + ex); assertExceptionOrCause(SSLException.class, ex); } } - @Test(dataProvider = "versions") + @ParameterizedTest + @MethodSource("versions") public void testAsync(Version version) throws Exception { // client-side uses a different context to that of the server-side HttpClient client = HttpClient.newBuilder() @@ -115,13 +115,13 @@ public class InvalidSSLContextTest { CompletableFuture stage) { stage.handle((result, error) -> { if (result != null) { - Assert.fail("UNEXPECTED result: " + result); + Assertions.fail("UNEXPECTED result: " + result); return null; } if (error instanceof CompletionException) { Throwable cause = error.getCause(); if (cause == null) { - Assert.fail("Unexpected null cause: " + error); + Assertions.fail("Unexpected null cause: " + error); } assertExceptionOrCause(clazz, cause); } else { @@ -133,7 +133,7 @@ public class InvalidSSLContextTest { static void assertExceptionOrCause(Class clazz, Throwable t) { if (t == null) { - Assert.fail("Expected " + clazz + ", caught nothing"); + Assertions.fail("Expected " + clazz + ", caught nothing"); } final Throwable original = t; do { @@ -142,11 +142,11 @@ public class InvalidSSLContextTest { } } while ((t = t.getCause()) != null); original.printStackTrace(System.out); - Assert.fail("Expected " + clazz + "in " + original); + Assertions.fail("Expected " + clazz + "in " + original); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // server-side uses a different context to that of the client-side sslServerSocket = (SSLServerSocket)sslContext .getServerSocketFactory() @@ -169,7 +169,7 @@ public class InvalidSSLContextTest { Thread.sleep(500); s.startHandshake(); s.close(); - Assert.fail("SERVER: UNEXPECTED "); + Assertions.fail("SERVER: UNEXPECTED "); } catch (SSLException | SocketException se) { System.out.println("SERVER: caught expected " + se); } catch (IOException e) { @@ -187,8 +187,8 @@ public class InvalidSSLContextTest { t.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sslServerSocket.close(); } } diff --git a/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java index c16c9f1747c..692e4d0bea4 100644 --- a/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java +++ b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,21 +30,15 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm InvalidSubscriptionRequest + * @run junit/othervm InvalidSubscriptionRequest */ -import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.InetAddress; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -74,26 +68,31 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class InvalidSubscriptionRequest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; - String http3URI_fixed; - String http3URI_chunk; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; + private static String http3URI_fixed; + private static String http3URI_chunk; static final int ITERATION_COUNT = 3; // a shared executor helps reduce the amount of threads created by the test @@ -126,8 +125,7 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { static final Supplier>>> OF_PUBLISHER_API = BHS.of(BodyHandlers::ofPublisher, "BodyHandlers::ofPublisher"); - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { http3URI_fixed, false, OF_PUBLISHER_API }, { http3URI_chunk, false, OF_PUBLISHER_API }, @@ -154,7 +152,7 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { }; } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; HttpClient newHttpClient(String uri) { HttpClient.Builder builder = uri.contains("/http3/") ? newClientBuilderForH3() @@ -175,8 +173,9 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { return builder; } - @Test(dataProvider = "variants") - public void testNoBody(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testNoBody(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; Throwable failed = null; for (int i=0; i< ITERATION_COUNT; i++) { @@ -196,7 +195,7 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { // Get the final result and compare it with the expected body try { String body = ofString.getBody().toCompletableFuture().get(); - assertEquals(body, ""); + assertEquals("", body); if (uri.endsWith("/chunk") && response.version() == HTTP_1_1) { // with /fixed and 0 length @@ -231,8 +230,9 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testNoBodyAsync(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testNoBodyAsync(String uri, boolean sameClient, BHS handlers) { HttpClient client = null; Throwable failed = null; for (int i=0; i< ITERATION_COUNT; i++) { @@ -257,7 +257,7 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { }); try { // Get the final result and compare it with the expected body - assertEquals(result.get(), ""); + assertEquals("", result.get()); if (uri.endsWith("/chunk") && response.get().version() == HTTP_1_1) { // with /fixed and 0 length @@ -292,8 +292,9 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testAsString(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testAsString(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; Throwable failed = null; for (int i=0; i< ITERATION_COUNT; i++) { @@ -314,7 +315,7 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { // Get the final result and compare it with the expected body try { String body = ofString.getBody().toCompletableFuture().get(); - assertEquals(body, WITH_BODY); + assertEquals(WITH_BODY, body); throw new RuntimeException("Expected IAE not thrown"); } catch (Exception x) { Throwable cause = x; @@ -344,8 +345,9 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testAsStringAsync(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testAsStringAsync(String uri, boolean sameClient, BHS handlers) { HttpClient client = null; Throwable failed = null; for (int i=0; i< ITERATION_COUNT; i++) { @@ -369,7 +371,7 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { // Get the final result and compare it with the expected body try { String body = result.get(); - assertEquals(body, WITH_BODY); + assertEquals(WITH_BODY, body); throw new RuntimeException("Expected IAE not thrown"); } catch (Exception x) { Throwable cause = x; @@ -454,13 +456,8 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { } } - static String serverAuthority(HttpServer server) { - return InetAddress.getLoopbackAddress().getHostName() + ":" - + server.getAddress().getPort(); - } - - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpTestHandler h1_fixedLengthHandler = new HTTP_FixedLengthHandler(); HttpTestHandler h1_chunkHandler = new HTTP_VariableLengthHandler(); @@ -509,8 +506,8 @@ public class InvalidSubscriptionRequest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { AssertionError fail = TRACKER.check(500); try { httpTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/LightWeightHttpServer.java b/test/jdk/java/net/httpclient/LightWeightHttpServer.java index 496aa2c5778..9045d00829e 100644 --- a/test/jdk/java/net/httpclient/LightWeightHttpServer.java +++ b/test/jdk/java/net/httpclient/LightWeightHttpServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,9 +24,6 @@ /** * library /test/lib / * build jdk.test.lib.net.SimpleSSLContext ProxyServer - * compile ../../../com/sun/net/httpserver/LogFilter.java - * compile ../../../com/sun/net/httpserver/EchoHandler.java - * compile ../../../com/sun/net/httpserver/FileServerHandler.java */ import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpContext; @@ -39,6 +36,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.http.HttpClient.Version; import java.nio.file.Path; import java.util.HashSet; import java.util.concurrent.BrokenBarrierException; @@ -50,14 +48,21 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.net.ssl.SSLContext; +import jdk.httpclient.test.lib.common.HttpServerAdapters; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestContext; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestEchoHandler; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestExchange; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestFileServerHandler; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestHandler; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestServer; import jdk.httpclient.test.lib.common.TestServerConfigurator; import jdk.test.lib.net.SimpleSSLContext; public class LightWeightHttpServer { static final SSLContext ctx = SimpleSSLContext.findSSLContext(); - static HttpServer httpServer; - static HttpsServer httpsServer; + static HttpTestServer httpServer; + static HttpTestServer httpsServer; static ExecutorService executor; static int port; static int httpsport; @@ -82,36 +87,31 @@ public class LightWeightHttpServer { ch.setLevel(Level.ALL); logger.addHandler(ch); + executor = Executors.newCachedThreadPool(); + String root = System.getProperty("test.src", ".") + "/docs"; InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); - httpServer = HttpServer.create(addr, 0); - if (httpServer instanceof HttpsServer) { - throw new RuntimeException("should not be httpsserver"); - } - httpsServer = HttpsServer.create(addr, 0); - HttpHandler h = new FileServerHandler(root); + httpServer = HttpTestServer.create(Version.HTTP_1_1, null, executor); + httpsServer = HttpTestServer.create(Version.HTTP_1_1, ctx, executor); + HttpTestHandler h = new HttpTestFileServerHandler(root); - HttpContext c1 = httpServer.createContext("/files", h); - HttpContext c2 = httpsServer.createContext("/files", h); - HttpContext c3 = httpServer.createContext("/echo", new EchoHandler()); + HttpTestContext c1 = httpServer.createContext("/files", h); + HttpTestContext c2 = httpsServer.createContext("/files", h); + HttpTestContext c3 = httpServer.createContext("/echo", new EchoHandler()); redirectHandler = new RedirectHandler("/redirect"); redirectHandlerSecure = new RedirectHandler("/redirect"); - HttpContext c4 = httpServer.createContext("/redirect", redirectHandler); - HttpContext c41 = httpsServer.createContext("/redirect", redirectHandlerSecure); - HttpContext c5 = httpsServer.createContext("/echo", new EchoHandler()); - HttpContext c6 = httpServer.createContext("/keepalive", new KeepAliveHandler()); + HttpTestContext c4 = httpServer.createContext("/redirect", redirectHandler); + HttpTestContext c41 = httpsServer.createContext("/redirect", redirectHandlerSecure); + HttpTestContext c5 = httpsServer.createContext("/echo", new EchoHandler()); + HttpTestContext c6 = httpServer.createContext("/keepalive", new KeepAliveHandler()); redirectErrorHandler = new RedirectErrorHandler("/redirecterror"); redirectErrorHandlerSecure = new RedirectErrorHandler("/redirecterror"); - HttpContext c7 = httpServer.createContext("/redirecterror", redirectErrorHandler); - HttpContext c71 = httpsServer.createContext("/redirecterror", redirectErrorHandlerSecure); + HttpTestContext c7 = httpServer.createContext("/redirecterror", redirectErrorHandler); + HttpTestContext c71 = httpsServer.createContext("/redirecterror", redirectErrorHandlerSecure); delayHandler = new DelayHandler(); - HttpContext c8 = httpServer.createContext("/delay", delayHandler); - HttpContext c81 = httpsServer.createContext("/delay", delayHandler); + HttpTestContext c8 = httpServer.createContext("/delay", delayHandler); + HttpTestContext c81 = httpsServer.createContext("/delay", delayHandler); - executor = Executors.newCachedThreadPool(); - httpServer.setExecutor(executor); - httpsServer.setExecutor(executor); - httpsServer.setHttpsConfigurator(new TestServerConfigurator(addr.getAddress(), ctx)); httpServer.start(); httpsServer.start(); @@ -136,10 +136,10 @@ public class LightWeightHttpServer { public static void stop() throws IOException { if (httpServer != null) { - httpServer.stop(0); + httpServer.stop(); } if (httpsServer != null) { - httpsServer.stop(0); + httpsServer.stop(); } if (proxy != null) { proxy.close(); @@ -149,7 +149,14 @@ public class LightWeightHttpServer { } } - static class RedirectErrorHandler implements HttpHandler { + static class EchoHandler extends HttpServerAdapters.HttpTestEchoHandler { + @Override + protected boolean useXFixed() { + return true; + } + } + + static class RedirectErrorHandler implements HttpTestHandler { String root; volatile int count = 1; @@ -167,23 +174,23 @@ public class LightWeightHttpServer { } @Override - public synchronized void handle(HttpExchange t) + public synchronized void handle(HttpTestExchange t) throws IOException { byte[] buf = new byte[2048]; try (InputStream is = t.getRequestBody()) { while (is.read(buf) != -1) ; } - Headers map = t.getResponseHeaders(); - String redirect = root + "/foo/" + Integer.toString(count); + var map = t.getResponseHeaders(); + String redirect = root + "/foo/" + count; increment(); - map.add("Location", redirect); - t.sendResponseHeaders(301, -1); + map.addHeader("Location", redirect); + t.sendResponseHeaders(301, HttpTestExchange.RSPBODY_EMPTY); t.close(); } } - static class RedirectHandler implements HttpHandler { + static class RedirectHandler implements HttpTestHandler { String root; volatile int count = 0; @@ -193,21 +200,21 @@ public class LightWeightHttpServer { } @Override - public synchronized void handle(HttpExchange t) + public synchronized void handle(HttpTestExchange t) throws IOException { byte[] buf = new byte[2048]; try (InputStream is = t.getRequestBody()) { while (is.read(buf) != -1) ; } - Headers map = t.getResponseHeaders(); + var map = t.getResponseHeaders(); if (count++ < 1) { - map.add("Location", root + "/foo/" + count); + map.addHeader("Location", root + "/foo/" + count); } else { - map.add("Location", SmokeTest.midSizedFilename); + map.addHeader("Location", SmokeTest.midSizedFilename); } - t.sendResponseHeaders(301, -1); + t.sendResponseHeaders(301, HttpTestExchange.RSPBODY_EMPTY); t.close(); } @@ -220,7 +227,7 @@ public class LightWeightHttpServer { } } - static class KeepAliveHandler implements HttpHandler { + static class KeepAliveHandler implements HttpTestHandler { volatile int counter = 0; HashSet portSet = new HashSet<>(); @@ -234,7 +241,7 @@ public class LightWeightHttpServer { } @Override - public synchronized void handle(HttpExchange t) + public synchronized void handle(HttpTestExchange t) throws IOException { int remotePort = t.getRemoteAddress().getPort(); String result = "OK"; @@ -286,14 +293,15 @@ public class LightWeightHttpServer { try (InputStream is = t.getRequestBody()) { while (is.read(buf) != -1) ; } - t.sendResponseHeaders(200, result.length()); + byte[] bytes = result.getBytes("US-ASCII"); + t.sendResponseHeaders(200, HttpTestExchange.fixedRsp(bytes.length)); OutputStream o = t.getResponseBody(); - o.write(result.getBytes("US-ASCII")); + o.write(bytes); t.close(); } } - static class DelayHandler implements HttpHandler { + static class DelayHandler implements HttpTestHandler { CyclicBarrier bar1 = new CyclicBarrier(2); CyclicBarrier bar2 = new CyclicBarrier(2); @@ -308,7 +316,7 @@ public class LightWeightHttpServer { } @Override - public synchronized void handle(HttpExchange he) throws IOException { + public synchronized void handle(HttpTestExchange he) throws IOException { try(InputStream is = he.getRequestBody()) { is.readAllBytes(); bar1.await(); @@ -316,7 +324,7 @@ public class LightWeightHttpServer { } catch (InterruptedException | BrokenBarrierException e) { throw new IOException(e); } - he.sendResponseHeaders(200, -1); // will probably fail + he.sendResponseHeaders(200, HttpTestExchange.RSPBODY_EMPTY); // will probably fail he.close(); } } diff --git a/test/jdk/java/net/httpclient/LineBodyHandlerTest.java b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java index 45df8d13f7e..ddca2e1f7d2 100644 --- a/test/jdk/java/net/httpclient/LineBodyHandlerTest.java +++ b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,10 +54,6 @@ import java.util.stream.Stream; import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -66,11 +62,16 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_16; import static java.nio.charset.StandardCharsets.UTF_8; -import static java.net.http.HttpRequest.BodyPublishers.ofString; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +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; /* * @test @@ -81,29 +82,28 @@ import static org.testng.Assert.assertTrue; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build ReferenceTracker jdk.httpclient.test.lib.http2.Http2TestServer * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -XX:+UnlockDiagnosticVMOptions -XX:DiagnoseSyncOnValueBasedClasses=1 LineBodyHandlerTest + * @run junit/othervm -XX:+UnlockDiagnosticVMOptions -XX:DiagnoseSyncOnValueBasedClasses=1 LineBodyHandlerTest */ public class LineBodyHandlerTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - final AtomicInteger clientCount = new AtomicInteger(); - HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final AtomicInteger clientCount = new AtomicInteger(); + private static HttpClient sharedClient; - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { http3URI }, { httpURI }, @@ -171,7 +171,7 @@ public class LineBodyHandlerTest implements HttpServerAdapters { StandardCharsets.US_ASCII, "")); } - private static final List lines(String text, String eol) { + private static List lines(String text, String eol) { if (eol == null) { return new BufferedReader(new StringReader(text)).lines().collect(Collectors.toList()); } else { @@ -210,7 +210,8 @@ public class LineBodyHandlerTest implements HttpServerAdapters { return builder; } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testStringWithFinisher(String url) { String body = "May the luck of the Irish be with you!"; HttpClient client = newClient(); @@ -226,12 +227,13 @@ public class LineBodyHandlerTest implements HttpServerAdapters { HttpResponse response = cf.join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, body); - assertEquals(subscriber.list, lines(body, "\n")); + assertEquals(200, response.statusCode()); + assertEquals(body, text); + assertEquals(lines(body, "\n"), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsStream(String url) { String body = "May the luck of the Irish be with you!"; HttpClient client = newClient(); @@ -247,13 +249,14 @@ public class LineBodyHandlerTest implements HttpServerAdapters { List list = stream.collect(Collectors.toList()); String text = list.stream().collect(Collectors.joining("|")); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, body); - assertEquals(list, List.of(body)); - assertEquals(list, lines(body, null)); + assertEquals(200, response.statusCode()); + assertEquals(body, text); + assertEquals(List.of(body), list); + assertEquals(lines(body, null), list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testStringWithFinisher2(String url) { String body = "May the luck\r\n\r\n of the Irish be with you!"; HttpClient client = newClient(); @@ -270,12 +273,13 @@ public class LineBodyHandlerTest implements HttpServerAdapters { HttpResponse response = cf.join(); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, body.replace("\r\n", "\n")); - assertEquals(subscriber.list, lines(body, null)); + assertEquals(200, response.statusCode()); + assertEquals(body.replace("\r\n", "\n"), text); + assertEquals(lines(body, null), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsStreamWithCRLF(String url) { String body = "May the luck\r\n\r\n of the Irish be with you!"; HttpClient client = newClient(); @@ -291,15 +295,16 @@ public class LineBodyHandlerTest implements HttpServerAdapters { List list = stream.collect(Collectors.toList()); String text = list.stream().collect(Collectors.joining("|")); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, "May the luck|| of the Irish be with you!"); - assertEquals(list, List.of("May the luck", + assertEquals(200, response.statusCode()); + assertEquals("May the luck|| of the Irish be with you!", text); + assertEquals(List.of("May the luck", "", - " of the Irish be with you!")); - assertEquals(list, lines(body, null)); + " of the Irish be with you!"), list); + assertEquals(lines(body, null), list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testStringWithFinisherBlocking(String url) throws Exception { String body = "May the luck of the Irish be with you!"; HttpClient client = newClient(); @@ -311,12 +316,13 @@ public class LineBodyHandlerTest implements HttpServerAdapters { BodyHandlers.fromLineSubscriber(subscriber, Supplier::get, "\n")); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, "May the luck of the Irish be with you!"); - assertEquals(subscriber.list, lines(body, "\n")); + assertEquals(200, response.statusCode()); + assertEquals("May the luck of the Irish be with you!", text); + assertEquals(lines(body, "\n"), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testStringWithoutFinisherBlocking(String url) throws Exception { String body = "May the luck of the Irish be with you!"; HttpClient client = newClient(); @@ -328,14 +334,15 @@ public class LineBodyHandlerTest implements HttpServerAdapters { BodyHandlers.fromLineSubscriber(subscriber)); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, "May the luck of the Irish be with you!"); - assertEquals(subscriber.list, lines(body, null)); + assertEquals(200, response.statusCode()); + assertEquals("May the luck of the Irish be with you!", text); + assertEquals(lines(body, null), subscriber.list); } // Subscriber - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsStreamWithMixedCRLF(String url) { String body = "May\r\n the wind\r\n always be\rat your back.\r\r"; HttpClient client = newClient(); @@ -351,18 +358,19 @@ public class LineBodyHandlerTest implements HttpServerAdapters { List list = stream.collect(Collectors.toList()); String text = list.stream().collect(Collectors.joining("|")); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May| the wind| always be|at your back.|"); - assertEquals(list, List.of("May", + assertEquals("May| the wind| always be|at your back.|", text); + assertEquals(List.of("May", " the wind", " always be", "at your back.", - "")); - assertEquals(list, lines(body, null)); + ""), list); + assertEquals(lines(body, null), list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsStreamWithMixedCRLF_UTF8(String url) { String body = "May\r\n the wind\r\n always be\rat your back.\r\r"; HttpClient client = newClient(); @@ -378,17 +386,18 @@ public class LineBodyHandlerTest implements HttpServerAdapters { List list = stream.collect(Collectors.toList()); String text = list.stream().collect(Collectors.joining("|")); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May| the wind| always be|at your back.|"); - assertEquals(list, List.of("May", + assertEquals("May| the wind| always be|at your back.|", text); + assertEquals(List.of("May", " the wind", " always be", - "at your back.", "")); - assertEquals(list, lines(body, null)); + "at your back.", ""), list); + assertEquals(lines(body, null), list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsStreamWithMixedCRLF_UTF16(String url) { String body = "May\r\n the wind\r\n always be\rat your back.\r\r"; HttpClient client = newClient(); @@ -404,18 +413,19 @@ public class LineBodyHandlerTest implements HttpServerAdapters { List list = stream.collect(Collectors.toList()); String text = list.stream().collect(Collectors.joining("|")); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May| the wind| always be|at your back.|"); - assertEquals(list, List.of("May", + assertEquals("May| the wind| always be|at your back.|", text); + assertEquals(List.of("May", " the wind", " always be", "at your back.", - "")); - assertEquals(list, lines(body, null)); + ""), list); + assertEquals(lines(body, null), list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithFinisher(String url) { String body = "May\r\n the wind\r\n always be\rat your back."; HttpClient client = newClient(); @@ -431,16 +441,17 @@ public class LineBodyHandlerTest implements HttpServerAdapters { HttpResponse response = cf.join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May\n the wind\n always be\rat your back."); - assertEquals(subscriber.list, List.of("May", + assertEquals("May\n the wind\n always be\rat your back.", text); + assertEquals(List.of("May", " the wind", - " always be\rat your back.")); - assertEquals(subscriber.list, lines(body, "\r\n")); + " always be\rat your back."), subscriber.list); + assertEquals(lines(body, "\r\n"), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithFinisher_UTF16(String url) { String body = "May\r\n the wind\r\n always be\rat your back.\r\r"; HttpClient client = newClient(); @@ -455,18 +466,19 @@ public class LineBodyHandlerTest implements HttpServerAdapters { HttpResponse response = cf.join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May\n the wind\n always be\nat your back.\n"); - assertEquals(subscriber.list, List.of("May", + assertEquals("May\n the wind\n always be\nat your back.\n", text); + assertEquals(List.of("May", " the wind", " always be", "at your back.", - "")); - assertEquals(subscriber.list, lines(body, null)); + ""), subscriber.list); + assertEquals(lines(body, null), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithoutFinisher(String url) { String body = "May\r\n the wind\r\n always be\rat your back."; HttpClient client = newClient(); @@ -482,17 +494,18 @@ public class LineBodyHandlerTest implements HttpServerAdapters { HttpResponse response = cf.join(); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May\n the wind\n always be\nat your back."); - assertEquals(subscriber.list, List.of("May", + assertEquals("May\n the wind\n always be\nat your back.", text); + assertEquals(List.of("May", " the wind", " always be", - "at your back.")); - assertEquals(subscriber.list, lines(body, null)); + "at your back."), subscriber.list); + assertEquals(lines(body, null), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithFinisherBlocking(String url) throws Exception { String body = "May\r\n the wind\r\n always be\nat your back."; HttpClient client = newClient(); @@ -507,16 +520,17 @@ public class LineBodyHandlerTest implements HttpServerAdapters { "\r\n")); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May\n the wind\n always be\nat your back."); - assertEquals(subscriber.list, List.of("May", + assertEquals("May\n the wind\n always be\nat your back.", text); + assertEquals(List.of("May", " the wind", - " always be\nat your back.")); - assertEquals(subscriber.list, lines(body, "\r\n")); + " always be\nat your back."), subscriber.list); + assertEquals(lines(body, "\r\n"), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testObjectWithoutFinisherBlocking(String url) throws Exception { String body = "May\r\n the wind\r\n always be\nat your back."; HttpClient client = newClient(); @@ -529,14 +543,14 @@ public class LineBodyHandlerTest implements HttpServerAdapters { BodyHandlers.fromLineSubscriber(subscriber)); String text = subscriber.get(); System.out.println(text); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(text.length() != 0); // what else can be asserted! - assertEquals(text, "May\n the wind\n always be\nat your back."); - assertEquals(subscriber.list, List.of("May", + assertEquals("May\n the wind\n always be\nat your back.", text); + assertEquals(List.of("May", " the wind", " always be", - "at your back.")); - assertEquals(subscriber.list, lines(body, null)); + "at your back."), subscriber.list); + assertEquals(lines(body, null), subscriber.list); } static private final String LINE = "Bient\u00f4t nous plongerons dans les" + @@ -551,7 +565,8 @@ public class LineBodyHandlerTest implements HttpServerAdapters { return res.toString(); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testBigTextFromLineSubscriber(String url) { HttpClient client = newClient(); String bigtext = bigtext(); @@ -567,12 +582,13 @@ public class LineBodyHandlerTest implements HttpServerAdapters { HttpResponse response = cf.join(); String text = response.body(); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, bigtext.replace("\r\n", "\n")); - assertEquals(subscriber.list, lines(bigtext, "\r\n")); + assertEquals(200, response.statusCode()); + assertEquals(bigtext.replace("\r\n", "\n"), text); + assertEquals(lines(bigtext, "\r\n"), subscriber.list); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testBigTextAsStream(String url) { HttpClient client = newClient(); String bigtext = bigtext(); @@ -588,10 +604,10 @@ public class LineBodyHandlerTest implements HttpServerAdapters { List list = stream.collect(Collectors.toList()); String text = list.stream().collect(Collectors.joining("|")); System.out.println(text); - assertEquals(response.statusCode(), 200); - assertEquals(text, bigtext.replace("\r\n", "|")); - assertEquals(list, List.of(bigtext.split("\r\n"))); - assertEquals(list, lines(bigtext, null)); + assertEquals(200, response.statusCode()); + assertEquals(bigtext.replace("\r\n", "|"), text); + assertEquals(List.of(bigtext.split("\r\n")), list); + assertEquals(lines(bigtext, null), list); } /** An abstract Subscriber that converts all received data into a String. */ @@ -675,8 +691,8 @@ public class LineBodyHandlerTest implements HttpServerAdapters { return Executors.newCachedThreadPool(factory); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1, null, executorFor("HTTP/1.1 Server Thread")); httpTestServer.addHandler(new HttpTestEchoHandler(), "/http1/echo"); @@ -706,8 +722,8 @@ public class LineBodyHandlerTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sharedClient = null; try { System.gc(); diff --git a/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java b/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java index e082398f3c7..01a7ee9fdbf 100644 --- a/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java +++ b/test/jdk/java/net/httpclient/LineStreamsAndSurrogatesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -37,10 +37,11 @@ import java.util.concurrent.SubmissionPublisher; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.testng.annotations.Test; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_16; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; /* * @test @@ -48,7 +49,7 @@ import static org.testng.Assert.assertEquals; * In particular tests that surrogate characters are handled * correctly. * @modules java.net.http java.logging - * @run testng/othervm LineStreamsAndSurrogatesTest + * @run junit/othervm LineStreamsAndSurrogatesTest */ public class LineStreamsAndSurrogatesTest { @@ -56,7 +57,7 @@ public class LineStreamsAndSurrogatesTest { static final Class NPE = NullPointerException.class; - private static final List lines(String text) { + private static List lines(String text) { return new BufferedReader(new StringReader(text)).lines().collect(Collectors.toList()); } @@ -100,14 +101,14 @@ public class LineStreamsAndSurrogatesTest { String resp2 = reader.lines().collect(Collectors.joining("")); System.out.println("***** Got2: " + resp2); - assertEquals(resp, resp2); - assertEquals(list, List.of("Bient\u00f4t", + assertEquals(resp2, resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans", " les", "", " fr\u00f4\ud801\udc00des", - " t\u00e9n\u00e8bres\ufffd")); + " t\u00e9n\u00e8bres\ufffd"), list); } catch (ExecutionException x) { Throwable cause = x.getCause(); if (cause instanceof MalformedInputException) { @@ -151,18 +152,18 @@ public class LineStreamsAndSurrogatesTest { List list = stream.collect(Collectors.toList()); String resp = list.stream().collect(Collectors.joining("|")); System.out.println("***** Got: " + resp); - assertEquals(resp, text.replace("\r\n", "|") + assertEquals(text.replace("\r\n", "|") .replace("\n","|") - .replace("\r","|")); - assertEquals(list, List.of("Bient\u00f4t", + .replace("\r","|"), resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans", "", " les", "", " fr\u00f4\ud801\udc00des", - " t\u00e9n\u00e8bres")); - assertEquals(list, lines(text)); + " t\u00e9n\u00e8bres"), list); + assertEquals(lines(text), list); if (errorRef.get() != null) { throw new RuntimeException("Unexpected exception", errorRef.get()); } @@ -201,15 +202,15 @@ public class LineStreamsAndSurrogatesTest { System.out.println("***** Got: " + resp); String expected = Stream.of(text.split("\r\n|\r|\n")) .collect(Collectors.joining("")); - assertEquals(resp, expected); - assertEquals(list, List.of("Bient\u00f4t", + assertEquals(expected, resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans", "", " les fr\u00f4\ud801\udc00des", " t\u00e9n\u00e8bres", - "")); - assertEquals(list, lines(text)); + ""), list); + assertEquals(lines(text), list); if (errorRef.get() != null) { throw new RuntimeException("Unexpected exception", errorRef.get()); } @@ -246,16 +247,16 @@ public class LineStreamsAndSurrogatesTest { List list = stream.collect(Collectors.toList()); String resp = list.stream().collect(Collectors.joining("")); System.out.println("***** Got: " + resp); - assertEquals(resp, text.replace("\n","").replace("\r","")); - assertEquals(list, List.of("Bient\u00f4t", + assertEquals(text.replace("\n","").replace("\r",""), resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans", "", " les", "", " fr\u00f4\ud801\udc00des", - " t\u00e9n\u00e8bres")); - assertEquals(list, lines(text)); + " t\u00e9n\u00e8bres"), list); + assertEquals(lines(text), list); if (errorRef.get() != null) { throw new RuntimeException("Unexpected exception", errorRef.get()); } @@ -294,15 +295,15 @@ public class LineStreamsAndSurrogatesTest { System.out.println("***** Got: " + resp); String expected = Stream.of(text.split("\r\n|\r|\n")) .collect(Collectors.joining("")); - assertEquals(resp, expected); - assertEquals(list, List.of("Bient\u00f4t", + assertEquals(expected, resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans", "", " les fr\u00f4\ud801\udc00des", " t\u00e9n\u00e8bres", - "")); - assertEquals(list, lines(text)); + ""), list); + assertEquals(lines(text), list); if (errorRef.get() != null) { throw new RuntimeException("Unexpected exception", errorRef.get()); } diff --git a/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java b/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java index 543ff6e94a1..7932744a4db 100644 --- a/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java +++ b/test/jdk/java/net/httpclient/LineSubscribersAndSurrogatesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,11 @@ import java.util.concurrent.SubmissionPublisher; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.testng.annotations.Test; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_16; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; /* * @test @@ -53,7 +54,7 @@ import static org.testng.Assert.assertEquals; * In particular tests that surrogate characters are handled * correctly. * @modules java.net.http java.logging - * @run testng/othervm LineSubscribersAndSurrogatesTest + * @run junit/othervm LineSubscribersAndSurrogatesTest */ public class LineSubscribersAndSurrogatesTest { @@ -61,7 +62,7 @@ public class LineSubscribersAndSurrogatesTest { static final Class NPE = NullPointerException.class; - private static final List lines(String text, String eol) { + private static List lines(String text, String eol) { if (eol == null) { return new BufferedReader(new StringReader(text)).lines().collect(Collectors.toList()); } else { @@ -104,14 +105,14 @@ public class LineSubscribersAndSurrogatesTest { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); BufferedReader reader = new BufferedReader(new InputStreamReader(bais, UTF_8)); String resp2 = reader.lines().collect(Collectors.joining("")); - assertEquals(resp, resp2); - assertEquals(subscriber.list, List.of("Bient\u00f4t", + assertEquals(resp2, resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans", " les", "", " fr\u00f4\ud801\udc00des", - " t\u00e9n\u00e8bres\ufffd")); + " t\u00e9n\u00e8bres\ufffd"), subscriber.list); } catch (ExecutionException x) { Throwable cause = x.getCause(); if (cause instanceof MalformedInputException) { @@ -147,10 +148,10 @@ public class LineSubscribersAndSurrogatesTest { "", " fr\u00f4\ud801\udc00des\r", " t\u00e9n\u00e8bres\r"); - assertEquals(subscriber.list, expected); - assertEquals(resp, Stream.of(text.split("\n")).collect(Collectors.joining(""))); - assertEquals(resp, expected.stream().collect(Collectors.joining(""))); - assertEquals(subscriber.list, lines(text, "\n")); + assertEquals(expected, subscriber.list); + assertEquals(Stream.of(text.split("\n")).collect(Collectors.joining("")), resp); + assertEquals(expected.stream().collect(Collectors.joining("")), resp); + assertEquals(lines(text, "\n"), subscriber.list); } @@ -172,14 +173,14 @@ public class LineSubscribersAndSurrogatesTest { publisher.close(); String resp = bodySubscriber.getBody().toCompletableFuture().get(); System.out.println("***** Got: " + resp); - assertEquals(resp, text.replace("\r", "")); - assertEquals(subscriber.list, List.of("Bient\u00f4t", + assertEquals(text.replace("\r", ""), resp); + assertEquals(List.of("Bient\u00f4t", "\n nous plongerons", "\n dans", " les fr\u00f4\ud801\udc00des", "\n t\u00e9n\u00e8bres", - "")); - assertEquals(subscriber.list, lines(text, "\r")); + ""), subscriber.list); + assertEquals(lines(text, "\r"), subscriber.list); } @Test @@ -200,12 +201,12 @@ public class LineSubscribersAndSurrogatesTest { publisher.close(); String resp = bodySubscriber.getBody().toCompletableFuture().get(); System.out.println("***** Got: " + resp); - assertEquals(resp, text.replace("\r\n","")); - assertEquals(subscriber.list, List.of("Bient\u00f4t", + assertEquals(text.replace("\r\n",""), resp); + assertEquals(List.of("Bient\u00f4t", " nous plongerons", " dans\r les fr\u00f4\ud801\udc00des", - " t\u00e9n\u00e8bres")); - assertEquals(subscriber.list, lines(text, "\r\n")); + " t\u00e9n\u00e8bres"), subscriber.list); + assertEquals(lines(text, "\r\n"), subscriber.list); } @@ -234,9 +235,9 @@ public class LineSubscribersAndSurrogatesTest { "", " fr\u00f4\ud801\udc00des", " t\u00e9n\u00e8bres"); - assertEquals(subscriber.list, expected); - assertEquals(resp, expected.stream().collect(Collectors.joining(""))); - assertEquals(subscriber.list, lines(text, null)); + assertEquals(expected, subscriber.list); + assertEquals(expected.stream().collect(Collectors.joining("")), resp); + assertEquals(lines(text, null), subscriber.list); } @Test @@ -265,9 +266,9 @@ public class LineSubscribersAndSurrogatesTest { " fr\u00f4\ud801\udc00des", " t\u00e9n\u00e8bres", ""); - assertEquals(resp, expected.stream().collect(Collectors.joining(""))); - assertEquals(subscriber.list, expected); - assertEquals(subscriber.list, lines(text, null)); + assertEquals(expected.stream().collect(Collectors.joining("")), resp); + assertEquals(expected, subscriber.list); + assertEquals(lines(text, null), subscriber.list); } void testStringWithoutFinisherBR() throws Exception { @@ -293,9 +294,9 @@ public class LineSubscribersAndSurrogatesTest { "", " fr\u00f4\ud801\udc00des", " t\u00e9n\u00e8bres"); - assertEquals(subscriber.text, expected.stream().collect(Collectors.joining(""))); - assertEquals(subscriber.list, expected); - assertEquals(subscriber.list, lines(text, null)); + assertEquals(expected.stream().collect(Collectors.joining("")), subscriber.text); + assertEquals(expected, subscriber.list); + assertEquals(lines(text, null), subscriber.list); } diff --git a/test/jdk/java/net/httpclient/ManyRequests.java b/test/jdk/java/net/httpclient/ManyRequests.java index ee79ac80b68..3609aa8337a 100644 --- a/test/jdk/java/net/httpclient/ManyRequests.java +++ b/test/jdk/java/net/httpclient/ManyRequests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,14 +25,8 @@ * @test * @bug 8087112 8180044 8256459 * @key intermittent - * @modules java.net.http/jdk.internal.net.http.common - * java.logging - * jdk.httpserver * @library /test/lib /test/jdk/java/net/httpclient/lib - * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator - * @compile ../../../com/sun/net/httpserver/LogFilter.java - * @compile ../../../com/sun/net/httpserver/EchoHandler.java - * @compile ../../../com/sun/net/httpserver/FileServerHandler.java + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=ssl,channel ManyRequests * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true ManyRequests * @run main/othervm/timeout=160 -Djdk.httpclient.HttpClient.log=channel -Dtest.chunkSize=64 ManyRequests @@ -41,19 +35,14 @@ */ // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl,channel ManyRequests -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsParameters; -import com.sun.net.httpserver.HttpsServer; -import com.sun.net.httpserver.HttpExchange; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ConnectException; -import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpClient.Builder; +import java.net.http.HttpClient.Version; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; @@ -61,7 +50,6 @@ import java.net.http.HttpResponse.BodyHandlers; import java.time.Duration; import java.util.Arrays; import java.util.Formatter; -import java.util.HashMap; import java.util.LinkedList; import java.util.Map; import java.util.Random; @@ -77,15 +65,14 @@ import java.util.logging.Level; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLParameters; -import jdk.httpclient.test.lib.common.TestServerConfigurator; +import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.Platform; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; -public class ManyRequests { +public class ManyRequests implements HttpServerAdapters { static final int MAX_COUNT = 50; static final int MAX_LIMIT = 40; @@ -106,11 +93,8 @@ public class ManyRequests { + ", XFixed=" + XFIXED); SSLContext ctx = SimpleSSLContext.findSSLContext(); - InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); - HttpsServer server = HttpsServer.create(addr, 0); ExecutorService executor = executorFor("HTTPS/1.1 Server Thread"); - server.setHttpsConfigurator(new Configurator(addr.getAddress(), ctx)); - server.setExecutor(executor); + HttpTestServer server = HttpTestServer.create(Version.HTTP_1_1, ctx, executor); ExecutorService virtualExecutor = Executors.newThreadPerTaskExecutor(Thread.ofVirtual() .name("HttpClient-Worker", 0).factory()); @@ -125,7 +109,7 @@ public class ManyRequests { System.out.println("OK"); } finally { client.close(); - server.stop(0); + server.stop(); virtualExecutor.close(); executor.shutdownNow(); } @@ -138,15 +122,15 @@ public class ManyRequests { Integer.parseInt(System.getProperty("test.chunkSize", "0"))); static final boolean XFIXED = Boolean.getBoolean("test.XFixed"); - static class TestEchoHandler extends EchoHandler { + static class TestEchoHandler extends HttpTestEchoHandler { final Random rand = RANDOM; @Override - public void handle(HttpExchange e) throws IOException { + public void handle(HttpTestExchange e) throws IOException { System.out.println("Server: received " + e.getRequestURI()); super.handle(e); } @Override - protected void close(HttpExchange t, OutputStream os) throws IOException { + protected void close(HttpTestExchange t, OutputStream os) throws IOException { if (INSERT_DELAY) { try { Thread.sleep(rand.nextInt(200)); } catch (InterruptedException e) {} @@ -155,7 +139,7 @@ public class ManyRequests { super.close(t, os); } @Override - protected void close(HttpExchange t, InputStream is) throws IOException { + protected void close(HttpTestExchange t, InputStream is) throws IOException { if (INSERT_DELAY) { try { Thread.sleep(rand.nextInt(200)); } catch (InterruptedException e) {} @@ -181,7 +165,7 @@ public class ManyRequests { return s; } - static void test(HttpsServer server, HttpClient client) throws Exception { + static void test(HttpTestServer server, HttpClient client) throws Exception { int port = server.getAddress().getPort(); URI baseURI = URIBuilder.newBuilder() @@ -213,8 +197,11 @@ public class ManyRequests { byte[] buf = new byte[(i + 1) * CHUNK_SIZE + i + 1]; // different size bodies rand.nextBytes(buf); URI uri = new URI(baseURI.toString() + String.valueOf(i + 1)); - HttpRequest r = HttpRequest.newBuilder(uri) - .header("XFixed", "true") + HttpRequest.Builder reqBuilder = HttpRequest.newBuilder(uri); + if (XFIXED) { + reqBuilder.header("XFixed", "yes"); + } + HttpRequest r = reqBuilder .POST(BodyPublishers.ofByteArray(buf)) .build(); bodies.put(r, buf); @@ -367,21 +354,6 @@ public class ManyRequests { throw new RuntimeException(sb.toString()); } - static class Configurator extends HttpsConfigurator { - private final InetAddress serverAddr; - public Configurator(InetAddress serverAddr, SSLContext ctx) { - super(ctx); - this.serverAddr = serverAddr; - } - - @Override - public void configure(HttpsParameters params) { - final SSLParameters parameters = getSSLContext().getSupportedSSLParameters(); - TestServerConfigurator.addSNIMatcher(this.serverAddr, parameters); - params.setSSLParameters(parameters); - } - } - private static ExecutorService executorFor(String serverThreadName) { ThreadFactory factory = new ThreadFactory() { final AtomicInteger counter = new AtomicInteger(); diff --git a/test/jdk/java/net/httpclient/ManyRequests2.java b/test/jdk/java/net/httpclient/ManyRequests2.java index a1e2307b820..09fdc18f687 100644 --- a/test/jdk/java/net/httpclient/ManyRequests2.java +++ b/test/jdk/java/net/httpclient/ManyRequests2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,14 +24,8 @@ /* * @test * @bug 8087112 8180044 8256459 - * @modules java.net.http/jdk.internal.net.http.common - * java.logging - * jdk.httpserver * @library /test/lib /test/jdk/java/net/httpclient/lib - * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator - * @compile ../../../com/sun/net/httpserver/LogFilter.java - * @compile ../../../com/sun/net/httpserver/EchoHandler.java - * @compile ../../../com/sun/net/httpserver/FileServerHandler.java + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * @build ManyRequests ManyRequests2 * @run main/othervm/timeout=400 -Dsun.net.httpserver.idleInterval=400 -Dtest.XFixed=true * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 diff --git a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java index 2e58ee50bff..f1c4f881058 100644 --- a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java +++ b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,14 +23,8 @@ /* * @test - * @modules java.net.http/jdk.internal.net.http.common - * java.logging - * jdk.httpserver * @library /test/lib /test/jdk/java/net/httpclient/lib - * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator - * @compile ../../../com/sun/net/httpserver/LogFilter.java - * @compile ../../../com/sun/net/httpserver/EchoHandler.java - * @compile ../../../com/sun/net/httpserver/FileServerHandler.java + * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * @run main/othervm/timeout=80 -Dsun.net.httpserver.idleInterval=50000 ManyRequestsLegacy * @run main/othervm/timeout=80 -Dtest.insertDelay=true -Dsun.net.httpserver.idleInterval=50000 ManyRequestsLegacy * @run main/othervm/timeout=80 -Dtest.chunkSize=64 -Dsun.net.httpserver.idleInterval=50000 ManyRequestsLegacy @@ -44,16 +38,11 @@ import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HostnameVerifier; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsParameters; -import com.sun.net.httpserver.HttpsServer; -import com.sun.net.httpserver.HttpExchange; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ConnectException; import java.net.HttpURLConnection; -import java.net.InetAddress; import java.net.URI; import java.net.URLConnection; import java.util.Map; @@ -62,10 +51,12 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.CompletionStage; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSession; import java.net.http.HttpClient; import java.net.http.HttpClient.Version; @@ -73,22 +64,22 @@ import java.net.http.HttpHeaders; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; -import java.net.InetSocketAddress; import java.util.Arrays; import java.util.Formatter; -import java.util.HashMap; import java.util.LinkedList; import java.util.Random; import java.util.logging.Logger; import java.util.logging.Level; -import jdk.httpclient.test.lib.common.TestServerConfigurator; +import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.Platform; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; + import static java.net.Proxy.NO_PROXY; -public class ManyRequestsLegacy { +public class ManyRequestsLegacy implements HttpServerAdapters { static final int MAX_COUNT = 20; static final int MAX_LIMIT = 40; @@ -112,9 +103,8 @@ public class ManyRequestsLegacy { return true; } }); - InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); - HttpsServer server = HttpsServer.create(addr, 0); - server.setHttpsConfigurator(new Configurator(addr.getAddress(), ctx)); + ExecutorService executor = executorFor("HTTPS/1.1 Server Thread"); + HttpTestServer server = HttpTestServer.create(Version.HTTP_1_1, ctx, executor); LegacyHttpClient client = new LegacyHttpClient(); @@ -122,7 +112,7 @@ public class ManyRequestsLegacy { test(server, client); System.out.println("OK"); } finally { - server.stop(0); + server.stop(); } } @@ -210,15 +200,15 @@ public class ManyRequestsLegacy { } } - static class TestEchoHandler extends EchoHandler { + static class TestEchoHandler extends HttpTestEchoHandler { final Random rand = RANDOM; @Override - public void handle(HttpExchange e) throws IOException { + public void handle(HttpTestExchange e) throws IOException { System.out.println("Server: received " + e.getRequestURI()); super.handle(e); } @Override - protected void close(HttpExchange t, OutputStream os) throws IOException { + protected void close(HttpTestExchange t, OutputStream os) throws IOException { if (INSERT_DELAY) { try { Thread.sleep(rand.nextInt(200)); } catch (InterruptedException e) {} @@ -227,7 +217,7 @@ public class ManyRequestsLegacy { os.close(); } @Override - protected void close(HttpExchange t, InputStream is) throws IOException { + protected void close(HttpTestExchange t, InputStream is) throws IOException { if (INSERT_DELAY) { try { Thread.sleep(rand.nextInt(200)); } catch (InterruptedException e) {} @@ -253,9 +243,13 @@ public class ManyRequestsLegacy { return s; } - static void test(HttpsServer server, LegacyHttpClient client) throws Exception { + static void test(HttpTestServer server, LegacyHttpClient client) throws Exception { int port = server.getAddress().getPort(); - URI baseURI = new URI("https://localhost:" + port + "/foo/x"); + URI baseURI = URIBuilder.newBuilder() + .scheme("https") + .loopback() + .port(port) + .path("/foo/x").build(); server.createContext("/foo", new TestEchoHandler()); server.start(); @@ -279,8 +273,11 @@ public class ManyRequestsLegacy { byte[] buf = new byte[(i + 1) * CHUNK_SIZE + i + 1]; // different size bodies rand.nextBytes(buf); URI uri = new URI(baseURI.toString() + String.valueOf(i + 1)); - HttpRequest r = HttpRequest.newBuilder(uri) - .header("XFixed", "true") + HttpRequest.Builder reqBuilder = HttpRequest.newBuilder(uri); + if (XFIXED) { + reqBuilder.header("XFixed", "yes"); + } + HttpRequest r = reqBuilder .POST(BodyPublishers.ofByteArray(buf)) .build(); bodies.put(r, buf); @@ -432,19 +429,16 @@ public class ManyRequestsLegacy { throw new RuntimeException(sb.toString()); } - static class Configurator extends HttpsConfigurator { - private final InetAddress serverAddr; - - public Configurator(InetAddress serverAddr, SSLContext ctx) { - super(ctx); - this.serverAddr = serverAddr; - } - - @Override - public void configure(HttpsParameters params) { - final SSLParameters parameters = getSSLContext().getSupportedSSLParameters(); - TestServerConfigurator.addSNIMatcher(this.serverAddr, parameters); - params.setSSLParameters(parameters); - } + private static ExecutorService executorFor(String serverThreadName) { + ThreadFactory factory = new ThreadFactory() { + final AtomicInteger counter = new AtomicInteger(); + @Override + public Thread newThread(Runnable r) { + Thread thread = new Thread(r); + thread.setName(serverThreadName + "#" + counter.incrementAndGet()); + return thread; + } + }; + return Executors.newCachedThreadPool(factory); } } diff --git a/test/jdk/java/net/httpclient/MappingResponseSubscriber.java b/test/jdk/java/net/httpclient/MappingResponseSubscriber.java index 445b4a59e24..75454923e49 100644 --- a/test/jdk/java/net/httpclient/MappingResponseSubscriber.java +++ b/test/jdk/java/net/httpclient/MappingResponseSubscriber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer * jdk.httpclient.test.lib.common.TestServerConfigurator - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * MappingResponseSubscriber */ @@ -64,30 +64,32 @@ import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.test.lib.Utils; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class MappingResponseSubscriber { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpsServer httpsTestServer; // HTTPS/1.1 - Http2TestServer http2TestServer; // HTTP/2 ( h2c ) - Http2TestServer https2TestServer; // HTTP/2 ( h2 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; + private static HttpServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpsServer httpsTestServer; // HTTPS/1.1 + private static Http2TestServer http2TestServer; // HTTP/2 ( h2c ) + private static Http2TestServer https2TestServer; // HTTP/2 ( h2 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; static final int ITERATION_COUNT = 3; // a shared executor helps reduce the amount of threads created by the test @@ -95,8 +97,7 @@ public class MappingResponseSubscriber { static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { httpURI_fixed, false }, { httpURI_chunk, false }, @@ -125,7 +126,8 @@ public class MappingResponseSubscriber { .build(); } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsBytes(String uri, boolean sameClient) throws Exception { HttpClient client = null; for (int i = 0; i < ITERATION_COUNT; i++) { @@ -137,7 +139,7 @@ public class MappingResponseSubscriber { BodyHandler handler = new CRSBodyHandler(); HttpResponse response = client.send(req, handler); byte[] body = response.body(); - assertEquals(body, bytes); + Assertions.assertArrayEquals(bytes, body); // if sameClient we will reuse the client for the next // operation, so there's nothing more to do. @@ -163,7 +165,7 @@ public class MappingResponseSubscriber { static class CRSBodyHandler implements BodyHandler { @Override public BodySubscriber apply(HttpResponse.ResponseInfo rinfo) { - assertEquals(rinfo.statusCode(), 200); + assertEquals(200, rinfo.statusCode()); return BodySubscribers.mapping( new CRSBodySubscriber(), (s) -> s.getBytes(UTF_8) ); @@ -213,8 +215,8 @@ public class MappingResponseSubscriber { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpHandler h1_fixedLengthHandler = new HTTP1_FixedLengthHandler(); HttpHandler h1_chunkHandler = new HTTP1_ChunkedHandler(); @@ -254,8 +256,8 @@ public class MappingResponseSubscriber { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(0); httpsTestServer.stop(0); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/MaxStreams.java b/test/jdk/java/net/httpclient/MaxStreams.java index b25f931be9d..00875aceb6f 100644 --- a/test/jdk/java/net/httpclient/MaxStreams.java +++ b/test/jdk/java/net/httpclient/MaxStreams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * @summary Should HttpClient support SETTINGS_MAX_CONCURRENT_STREAMS from the server * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm MaxStreams + * @run junit/othervm MaxStreams */ import java.io.IOException; @@ -53,24 +53,24 @@ import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.fail; +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class MaxStreams { - Http2TestServer http2TestServer; // HTTP/2 ( h2c ) - Http2TestServer https2TestServer; // HTTP/2 ( h2 ) - final Http2FixedHandler handler = new Http2FixedHandler(); + private static Http2TestServer http2TestServer; // HTTP/2 ( h2c ) + private static Http2TestServer https2TestServer; // HTTP/2 ( h2 ) + private static final Http2FixedHandler handler = new Http2FixedHandler(); private static final SSLContext ctx = SimpleSSLContext.findSSLContext(); - String http2FixedURI; - String https2FixedURI; - ExecutorService exec; + private static String http2FixedURI; + private static String https2FixedURI; + private static ExecutorService exec; // we send an initial warm up request, then MAX_STREAMS+1 requests // in parallel. The last of them should hit the limit. @@ -81,8 +81,7 @@ public class MaxStreams { static final int MAX_STREAMS = 10; static final String RESPONSE = "Hello world"; - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ {http2FixedURI}, {https2FixedURI}, @@ -92,7 +91,8 @@ public class MaxStreams { } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsString(String uri) throws Exception { CountDownLatch latch = new CountDownLatch(1); handler.setLatch(latch); @@ -161,8 +161,8 @@ public class MaxStreams { System.err.println("Test OK"); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { exec = Executors.newCachedThreadPool(); InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); @@ -180,13 +180,13 @@ public class MaxStreams { https2TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { System.err.println("Stopping test server now"); http2TestServer.stop(); } - class Http2FixedHandler implements Http2Handler { + static class Http2FixedHandler implements Http2Handler { final AtomicInteger counter = new AtomicInteger(0); volatile CountDownLatch latch; diff --git a/test/jdk/java/net/httpclient/NoBodyPartOne.java b/test/jdk/java/net/httpclient/NoBodyPartOne.java index 7c7a51c92e7..980f4d8d100 100644 --- a/test/jdk/java/net/httpclient/NoBodyPartOne.java +++ b/test/jdk/java/net/httpclient/NoBodyPartOne.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 +27,7 @@ * @summary Test response body handlers/subscribers when there is no body * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all * NoBodyPartOne @@ -42,16 +42,21 @@ import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandler; import java.net.http.HttpResponse.BodyHandlers; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_3; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +// @TestInstance(TestInstance.Lifecycle.PER_CLASS) +// is inherited from the super class public class NoBodyPartOne extends AbstractNoBody { - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsString(String uri, boolean sameClient) throws Exception { printStamp(START, "testAsString(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -70,12 +75,13 @@ public class NoBodyPartOne extends AbstractNoBody { : BodyHandlers.ofString(UTF_8); HttpResponse response = client.send(req, handler); String body = response.body(); - assertEquals(body, ""); + assertEquals("", body); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsFile(String uri, boolean sameClient) throws Exception { printStamp(START, "testAsFile(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -94,14 +100,15 @@ public class NoBodyPartOne extends AbstractNoBody { Path p = Paths.get("NoBody_testAsFile.txt"); HttpResponse response = client.send(req, BodyHandlers.ofFile(p)); Path bodyPath = response.body(); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); assertTrue(Files.exists(bodyPath)); - assertEquals(Files.size(bodyPath), 0, Files.readString(bodyPath)); + assertEquals(0, Files.size(bodyPath), Files.readString(bodyPath)); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsByteArray(String uri, boolean sameClient) throws Exception { printStamp(START, "testAsByteArray(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -119,7 +126,7 @@ public class NoBodyPartOne extends AbstractNoBody { .build(); HttpResponse response = client.send(req, BodyHandlers.ofByteArray()); byte[] body = response.body(); - assertEquals(body.length, 0); + assertEquals(0, body.length); } } } diff --git a/test/jdk/java/net/httpclient/NoBodyPartThree.java b/test/jdk/java/net/httpclient/NoBodyPartThree.java index d5e310d1914..7020f7e2c25 100644 --- a/test/jdk/java/net/httpclient/NoBodyPartThree.java +++ b/test/jdk/java/net/httpclient/NoBodyPartThree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,7 +27,7 @@ * @summary Test request and response body handlers/subscribers when there is no body * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=quic,errors * -Djdk.httpclient.HttpClient.log=all * NoBodyPartThree @@ -46,19 +46,24 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import jdk.internal.net.http.common.Utils; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_3; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +// @TestInstance(TestInstance.Lifecycle.PER_CLASS) +// is inherited from the super class public class NoBodyPartThree extends AbstractNoBody { static final AtomicInteger REQID = new AtomicInteger(); volatile boolean consumerHasBeenCalled; - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsByteArrayPublisher(String uri, boolean sameClient) throws Exception { printStamp(START, "testAsByteArrayPublisher(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -83,7 +88,7 @@ public class NoBodyPartThree extends AbstractNoBody { consumerHasBeenCalled = false; var response = client.send(req, BodyHandlers.ofByteArrayConsumer(consumer)); assertTrue(consumerHasBeenCalled); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); u = uri + "/testAsByteArrayPublisher/second/" + REQID.getAndIncrement(); req = newRequestBuilder(u + "?echo") @@ -93,12 +98,13 @@ public class NoBodyPartThree extends AbstractNoBody { consumerHasBeenCalled = false; response = client.send(req, BodyHandlers.ofByteArrayConsumer(consumer)); assertTrue(consumerHasBeenCalled); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testStringPublisher(String uri, boolean sameClient) throws Exception { printStamp(START, "testStringPublisher(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -116,14 +122,15 @@ public class NoBodyPartThree extends AbstractNoBody { .build(); System.out.println("sending " + req); HttpResponse response = client.send(req, BodyHandlers.ofInputStream()); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); byte[] body = response.body().readAllBytes(); - assertEquals(body.length, 0); + assertEquals(0, body.length); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testInputStreamPublisherBuffering(String uri, boolean sameClient) throws Exception { printStamp(START, "testInputStreamPublisherBuffering(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -142,14 +149,15 @@ public class NoBodyPartThree extends AbstractNoBody { System.out.println("sending " + req); HttpResponse response = client.send(req, BodyHandlers.buffering(BodyHandlers.ofByteArray(), 1024)); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); byte[] body = response.body(); - assertEquals(body.length, 0); + assertEquals(0, body.length); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testEmptyArrayPublisher(String uri, boolean sameClient) throws Exception { printStamp(START, "testEmptyArrayPublisher(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -167,8 +175,8 @@ public class NoBodyPartThree extends AbstractNoBody { .build(); System.out.println("sending " + req); var response = client.send(req, BodyHandlers.ofLines()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body().toList(), List.of()); + assertEquals(200, response.statusCode()); + assertEquals(List.of(), response.body().toList()); } } } diff --git a/test/jdk/java/net/httpclient/NoBodyPartTwo.java b/test/jdk/java/net/httpclient/NoBodyPartTwo.java index f7d331cb526..9e7ceb11c55 100644 --- a/test/jdk/java/net/httpclient/NoBodyPartTwo.java +++ b/test/jdk/java/net/httpclient/NoBodyPartTwo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 +27,7 @@ * @summary Test response body handlers/subscribers when there is no body * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=all * NoBodyPartTwo @@ -44,17 +44,22 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import jdk.internal.net.http.common.Utils; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_3; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +// @TestInstance(TestInstance.Lifecycle.PER_CLASS) +// is inherited from the super class public class NoBodyPartTwo extends AbstractNoBody { volatile boolean consumerHasBeenCalled; - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsByteArrayConsumer(String uri, boolean sameClient) throws Exception { printStamp(START, "testAsByteArrayConsumer(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -81,7 +86,8 @@ public class NoBodyPartTwo extends AbstractNoBody { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsInputStream(String uri, boolean sameClient) throws Exception { printStamp(START, "testAsInputStream(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -98,12 +104,13 @@ public class NoBodyPartTwo extends AbstractNoBody { .build(); HttpResponse response = client.send(req, BodyHandlers.ofInputStream()); byte[] body = response.body().readAllBytes(); - assertEquals(body.length, 0); + assertEquals(0, body.length); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testBuffering(String uri, boolean sameClient) throws Exception { printStamp(START, "testBuffering(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -121,12 +128,13 @@ public class NoBodyPartTwo extends AbstractNoBody { HttpResponse response = client.send(req, BodyHandlers.buffering(BodyHandlers.ofByteArray(), 1024)); byte[] body = response.body(); - assertEquals(body.length, 0); + assertEquals(0, body.length); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testDiscard(String uri, boolean sameClient) throws Exception { printStamp(START, "testDiscard(\"%s\", %s)", uri, sameClient); HttpClient client = null; @@ -143,7 +151,7 @@ public class NoBodyPartTwo extends AbstractNoBody { .build(); Object obj = new Object(); HttpResponse response = client.send(req, BodyHandlers.replacing(obj)); - assertEquals(response.body(), obj); + assertEquals(obj, response.body()); } } } diff --git a/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java index 0a0da6366ad..2e53479a6ee 100644 --- a/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java +++ b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * @compile -encoding utf-8 NonAsciiCharsInURI.java - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=requests,headers,errors,quic * NonAsciiCharsInURI */ @@ -51,10 +51,6 @@ import java.util.List; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.err; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; @@ -63,24 +59,29 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.net.http.HttpClient.Builder.NO_PROXY; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class NonAsciiCharsInURI implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; - String http3URI_head; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; + private static String http3URI_head; - private volatile HttpClient sharedClient; + private static volatile HttpClient sharedClient; // € = '\u20AC' => 0xE20x820xAC static final String[][] pathsAndQueryStrings = new String[][] { @@ -93,8 +94,7 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { { "/006/x?url=https://ja.wikipedia.org/wiki/エリザベス1世_(イングランド女王)" }, }; - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { List list = new ArrayList<>(); for (boolean sameClient : new boolean[] { false, true }) { @@ -136,7 +136,7 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { return null; } - HttpRequest.Builder newRequestBuilder(String uri) { + static HttpRequest.Builder newRequestBuilder(String uri) { var builder = HttpRequest.newBuilder(URI.create(uri)); if (version(uri) == HTTP_3) { builder.version(HTTP_3); @@ -145,7 +145,7 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { return builder; } - HttpResponse headRequest(HttpClient client) + static HttpResponse headRequest(HttpClient client) throws IOException, InterruptedException { out.println("\n" + now() + "--- Sending HEAD request ----\n"); @@ -154,25 +154,26 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { var request = newRequestBuilder(http3URI_head) .HEAD().version(HTTP_2).build(); var response = client.send(request, BodyHandlers.ofString()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), HTTP_2); + assertEquals(200, response.statusCode()); + assertEquals(HTTP_2, response.version()); out.println("\n" + now() + "--- HEAD request succeeded ----\n"); err.println("\n" + now() + "--- HEAD request succeeded ----\n"); return response; } - private HttpClient makeNewClient() { - return newClientBuilderForH3() + private static HttpClient makeNewClient() { + return HttpServerAdapters.createClientBuilderForH3() .proxy(NO_PROXY) .sslContext(sslContext) .build(); } - HttpClient newHttpClient(boolean share) { + private static final Object zis = new Object(); + static HttpClient newHttpClient(boolean share) { if (!share) return makeNewClient(); HttpClient shared = sharedClient; if (shared != null) return shared; - synchronized (this) { + synchronized (zis) { shared = sharedClient; if (shared == null) { shared = sharedClient = makeNewClient(); @@ -191,7 +192,8 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { static final int ITERATION_COUNT = 3; // checks upgrade and re-use - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void test(String uriString, boolean sameClient) throws Exception { out.println("\n--- Starting "); // The single-argument factory requires any illegal characters in its @@ -215,7 +217,7 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { out.println("Got response: " + resp); out.println("Got body: " + resp.body()); - assertEquals(resp.statusCode(), 200, + assertEquals(200, resp.statusCode(), "Expected 200, got:" + resp.statusCode()); // the response body should contain the toASCIIString @@ -228,12 +230,13 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { } else { out.println("Found expected " + resp.body() + " in " + expectedURIString); } - assertEquals(resp.version(), version(uriString)); + assertEquals(version(uriString), resp.version()); } } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void testAsync(String uriString, boolean sameClient) throws Exception { out.println("\n--- Starting "); URI uri = URI.create(uriString); @@ -254,8 +257,8 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { .thenApply(response -> { out.println("Got response: " + response); out.println("Got body: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.version(), version(uriString)); + assertEquals(200, response.statusCode()); + assertEquals(version(uriString), response.version()); return response.body(); }) .thenAccept(body -> { @@ -276,8 +279,8 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println(now() + "begin setup"); HttpTestHandler handler = new HttpUriStringHandler(); @@ -324,8 +327,8 @@ public class NonAsciiCharsInURI implements HttpServerAdapters { err.println(now() + "setup done"); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sharedClient.close(); httpTestServer.stop(); httpsTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/NullReturningBodyHandlerTest.java b/test/jdk/java/net/httpclient/NullReturningBodyHandlerTest.java new file mode 100644 index 00000000000..2b2e6b2135d --- /dev/null +++ b/test/jdk/java/net/httpclient/NullReturningBodyHandlerTest.java @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2026, 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.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpClient.Version; +import java.net.http.HttpOption; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandler; +import java.net.http.HttpResponse.BodySubscriber; +import java.net.http.HttpResponse.ResponseInfo; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import javax.net.ssl.SSLContext; + +import jdk.httpclient.test.lib.common.HttpServerAdapters; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestEchoHandler; +import jdk.httpclient.test.lib.common.HttpServerAdapters.HttpTestServer; +import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import static java.net.http.HttpClient.Builder.NO_PROXY; +import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/* + * @test + * @bug 8377796 + * @summary Verify that HttpClient.send()/sendAsync() complete exceptionally + * when BodyHandler.apply() returns null + * @library /test/lib /test/jdk/java/net/httpclient/lib + * @build jdk.httpclient.test.lib.common.HttpServerAdapters + * jdk.test.lib.net.SimpleSSLContext + * jdk.test.lib.net.URIBuilder + * @run junit ${test.main.class} + */ +class NullReturningBodyHandlerTest { + private static final String CTX_PATH = "/" + NullReturningBodyHandlerTest.class.getName(); + + private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); + private static HttpClient client; + + private static HttpTestServer h1HttpServer; + private static HttpTestServer h1HttpsServer; + + private static HttpTestServer h2HttpServer; + private static HttpTestServer h2HttpsServer; + + private static HttpTestServer h3Server; + + @BeforeAll + static void beforeAll() throws Exception { + h1HttpServer = HttpTestServer.create(Version.HTTP_1_1); + h1HttpServer.addHandler(new HttpTestEchoHandler(false), CTX_PATH); + h1HttpServer.start(); + System.err.println("HTTP/1.1 http server started at " + h1HttpServer.getAddress()); + + h1HttpsServer = HttpTestServer.create(Version.HTTP_1_1, sslContext); + h1HttpsServer.addHandler(new HttpTestEchoHandler(false), CTX_PATH); + h1HttpsServer.start(); + System.err.println("HTTP/1.1 https server started at " + h1HttpsServer.getAddress()); + + h2HttpServer = HttpTestServer.create(Version.HTTP_2); + h2HttpServer.addHandler(new HttpTestEchoHandler(false), CTX_PATH); + h2HttpServer.start(); + System.err.println("HTTP/2 http server started at " + h2HttpServer.getAddress()); + + h2HttpsServer = HttpTestServer.create(Version.HTTP_2, sslContext); + h2HttpsServer.addHandler(new HttpTestEchoHandler(false), CTX_PATH); + h2HttpsServer.start(); + System.err.println("HTTP/2 https server started at " + h2HttpsServer.getAddress()); + + h3Server = HttpTestServer.create(HTTP_3_URI_ONLY, sslContext); + h3Server.addHandler(new HttpTestEchoHandler(false), CTX_PATH); + h3Server.start(); + System.err.println("HTTP/3 server started at " + h3Server.getAddress()); + + client = HttpServerAdapters.createClientBuilderForH3() + .sslContext(sslContext) + .proxy(NO_PROXY) + .build(); + } + + @AfterAll + static void afterAll() throws Exception { + close(h1HttpServer); + close(h1HttpsServer); + + close(h2HttpServer); + close(h2HttpsServer); + + close(h3Server); + + close(client); + } + + private static void close(final AutoCloseable resource) throws Exception { + if (resource == null) { + return; + } + System.err.println("closing " + resource); + resource.close(); + } + + static List params() throws Exception { + final List args = new ArrayList<>(); + + final URI h1HttpsReq = URIBuilder.newBuilder() + .scheme("https") + .host(h1HttpsServer.getAddress().getAddress()) + .port(h1HttpsServer.getAddress().getPort()) + .path(CTX_PATH) + .query("reqVersion=h1") + .build(); + args.add(Arguments.of(h1HttpsReq, Version.HTTP_1_1, false)); + + final URI h1HttpReq = URIBuilder.newBuilder() + .scheme("http") + .host(h1HttpServer.getAddress().getAddress()) + .port(h1HttpServer.getAddress().getPort()) + .path(CTX_PATH) + .query("reqVersion=h1&scheme=http") + .build(); + args.add(Arguments.of(h1HttpReq, Version.HTTP_1_1, false)); + + final URI h2Req = URIBuilder.newBuilder() + .scheme("https") + .host(h2HttpsServer.getAddress().getAddress()) + .port(h2HttpsServer.getAddress().getPort()) + .path(CTX_PATH) + .query("reqVersion=h2") + .build(); + args.add(Arguments.of(h2Req, Version.HTTP_2, false)); + + final URI h2HttpReq = URIBuilder.newBuilder() + .scheme("http") + .host(h2HttpServer.getAddress().getAddress()) + .port(h2HttpServer.getAddress().getPort()) + .path(CTX_PATH) + .query("reqVersion=h2&scheme=http") + .build(); + // test for HTTP/2 upgrade when there are no already established connections + args.add(Arguments.of(h2HttpReq, Version.HTTP_2, false)); + // test for HTTP/2 upgrade when there is an established connection + args.add(Arguments.of(h2HttpReq, Version.HTTP_2, true)); + + final URI h3Req = URIBuilder.newBuilder() + .scheme("https") + .host(h3Server.getAddress().getAddress()) + .port(h3Server.getAddress().getPort()) + .path(CTX_PATH) + .query("reqVersion=h3") + .build(); + args.add(Arguments.of(h3Req, Version.HTTP_3, false)); + return args; + } + + /* + * Issues a HTTP request with a BodyHandler implementation that returns a null + * BodySubscriber. The test then verifies that the request fails and the exception + * that's raised contains the expected NullPointerException (raised due to + * BodyHandler.apply(...) returning null). + */ + @ParameterizedTest + @MethodSource("params") + void test(final URI reqURI, final Version version, + final boolean requiresWarmupHEADRequest) throws Exception { + if (requiresWarmupHEADRequest) { + // the test only issues a warmup request for HTTP/2 requests + assertEquals(Version.HTTP_2, version, "unexpected HTTP version"); + final HttpRequest head = HttpRequest.newBuilder().HEAD() + .version(version) + .uri(reqURI) + .build(); + System.err.println("issuing warmup head request " + head); + HttpResponse headResp = client.send(head, HttpResponse.BodyHandlers.discarding()); + assertEquals(200, headResp.statusCode(), "unexpected status code for HEAD request"); + } + // now run the actual test + final HttpRequest.Builder builder = HttpRequest.newBuilder() + .version(version) + .uri(reqURI); + if (version == Version.HTTP_3) { + builder.setOption(HttpOption.H3_DISCOVERY, HTTP_3_URI_ONLY); + } + final HttpRequest req = builder.build(); + // test synchronous send() + System.err.println("issuing request " + reqURI); + final IOException ioe = assertThrows(IOException.class, + () -> client.send(req, new AlwaysReturnsNull())); + if (!(ioe.getCause() instanceof NullPointerException)) { + throw ioe; // propagate the original exception + } + // now test with sendAsync() + System.err.println("issuing async request " + reqURI); + final Future> f = client.sendAsync(req, new AlwaysReturnsNull()); + final ExecutionException ee = assertThrows(ExecutionException.class, f::get); + if (!(ee.getCause() instanceof IOException cause) + || !(cause.getCause() instanceof NullPointerException)) { + throw ee; // propagate the original exception + } + } + + private static final class AlwaysReturnsNull implements BodyHandler { + @Override + public BodySubscriber apply(final ResponseInfo responseInfo) { + return null; + } + } +} diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index c2fab85f8ff..cd7049285f1 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ -208,9 +208,9 @@ public class PlainProxyConnectionTest { System.out.println("Server is: " + server.getAddress().toString()); URI uri = new URI("http", null, server.getAddress().getAddress().getHostAddress(), - server.getAddress().getPort(), PATH + "x", + server.getAddress().getPort(), PATH + "/x", null, null); - URI proxiedURI = new URI("http://some.host.that.does.not.exist:4242" + PATH + "x"); + URI proxiedURI = new URI("http://some.host.that.does.not.exist:4242" + PATH + "/x"); performSanityTest(server, uri, proxiedURI); diff --git a/test/jdk/java/net/httpclient/ProxySelectorTest.java b/test/jdk/java/net/httpclient/ProxySelectorTest.java index bf63e5a77b5..bb339e91bdc 100644 --- a/test/jdk/java/net/httpclient/ProxySelectorTest.java +++ b/test/jdk/java/net/httpclient/ProxySelectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,34 +27,20 @@ * @summary checks that a different proxy returned for * the same host:port is taken into account * @library /test/lib /test/jdk/java/net/httpclient/lib - * @build DigestEchoServer ProxySelectorTest jdk.httpclient.test.lib.http2.Http2TestServer + * @build DigestEchoServer ProxySelectorTest * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.http.auth.tunneling.disabledSchemes * -Djdk.httpclient.HttpClient.log=headers,requests * -Djdk.internal.httpclient.debug=true * ProxySelectorTest */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; import java.io.InputStream; -import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.Proxy; import java.net.ProxySelector; import java.net.SocketAddress; @@ -63,7 +49,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; @@ -73,37 +58,44 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; import static java.lang.System.err; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import static org.junit.jupiter.api.Assertions.*; public class ProxySelectorTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 - HttpTestServer proxyHttpTestServer; // HTTP/1.1 - HttpTestServer authProxyHttpTestServer; // HTTP/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - DigestEchoServer.TunnelingProxy proxy; - DigestEchoServer.TunnelingProxy authproxy; - String httpURI; - String httpsURI; - String proxyHttpURI; - String authProxyHttpURI; - String http2URI; - String https2URI; - HttpClient client; + private static HttpTestServer httpTestServer; // HTTP/1.1 + private static HttpTestServer proxyHttpTestServer; // HTTP/1.1 + private static HttpTestServer authProxyHttpTestServer; // HTTP/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static DigestEchoServer.TunnelingProxy proxy; + private static DigestEchoServer.TunnelingProxy authproxy; + private static String httpURI; + private static String httpsURI; + private static String proxyHttpURI; + private static String http2URI; + private static String https2URI; + private static HttpClient client; - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static final long SLEEP_AFTER_TEST = 0; // milliseconds static final int ITERATIONS = 3; static final Executor executor = new TestExecutor(Executors.newCachedThreadPool()); @@ -144,34 +136,38 @@ public class ProxySelectorTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests() { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { // Exceptions should already have been added to FAILURES @@ -204,12 +200,10 @@ public class ProxySelectorTest implements HttpServerAdapters { static final int UNAUTHORIZED = 401; static final int PROXY_UNAUTHORIZED = 407; static final int HTTP_OK = 200; - static final String MESSAGE = "Unauthorized"; enum Schemes { HTTP, HTTPS } - @DataProvider(name = "all") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { Schemes.HTTP, HTTP_1_1, httpURI, true}, { Schemes.HTTP, HttpClient.Version.HTTP_2, http2URI, true}, @@ -222,15 +216,13 @@ public class ProxySelectorTest implements HttpServerAdapters { }; } - static final AtomicLong requestCounter = new AtomicLong(); - static final AtomicLong sleepCount = new AtomicLong(); - @Test(dataProvider = "all") + @ParameterizedTest + @MethodSource("positive") void test(Schemes scheme, HttpClient.Version version, String uri, boolean async) throws Throwable { - checkSkip(); var name = String.format("test(%s, %s, %s)", scheme, version, async); out.printf("%n---- starting %s ----%n", name); @@ -260,7 +252,7 @@ public class ProxySelectorTest implements HttpServerAdapters { HttpRequest request = requestBuilder.build(); out.println("Sending request: " + request.uri()); - HttpResponse response = null; + HttpResponse response; if (async) { response = client.send(request, handler); } else { @@ -288,9 +280,11 @@ public class ProxySelectorTest implements HttpServerAdapters { // A plain server or https server should serve it, and we should get 200 OK response = send(client, uri1, BodyHandlers.ofString(), async); out.println("Got response from plain server: " + response); - assertEquals(response.statusCode(), HTTP_OK); - assertEquals(response.headers().firstValue("X-value"), - scheme == Schemes.HTTPS ? Optional.of("https-server") : Optional.of("plain-server")); + assertEquals(HTTP_OK, response.statusCode()); + assertEquals(scheme == Schemes.HTTPS + ? Optional.of("https-server") + : Optional.of("plain-server"), + response.headers().firstValue("X-value")); // Second request should go through a non authenticating proxy. // For a clear connection - a proxy-server should serve it, and we should get 200 OK @@ -298,9 +292,11 @@ public class ProxySelectorTest implements HttpServerAdapters { // authenticating proxy - and we should receive 200 OK from an https-server response = send(client, uri2, BodyHandlers.ofString(), async); out.println("Got response through noauth proxy: " + response); - assertEquals(response.statusCode(), HTTP_OK); - assertEquals(response.headers().firstValue("X-value"), - scheme == Schemes.HTTPS ? Optional.of("https-server") : Optional.of("proxy-server")); + assertEquals(HTTP_OK, response.statusCode()); + assertEquals(scheme == Schemes.HTTPS + ? Optional.of("https-server") + : Optional.of("proxy-server"), + response.headers().firstValue("X-value")); // Third request should go through an authenticating proxy. // For a clear connection - an auth-proxy-server should serve it, and we @@ -310,16 +306,18 @@ public class ProxySelectorTest implements HttpServerAdapters { // proxy - so the X-value header will be absent response = send(client, uri3, BodyHandlers.ofString(), async); out.println("Got response through auth proxy: " + response); - assertEquals(response.statusCode(), PROXY_UNAUTHORIZED); - assertEquals(response.headers().firstValue("X-value"), - scheme == Schemes.HTTPS ? Optional.empty() : Optional.of("auth-proxy-server")); + assertEquals(PROXY_UNAUTHORIZED, response.statusCode()); + assertEquals(scheme == Schemes.HTTPS + ? Optional.empty() + : Optional.of("auth-proxy-server"), + response.headers().firstValue("X-value")); } // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new PlainServerHandler("plain-server"), "/http1/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1"; @@ -368,8 +366,8 @@ public class ProxySelectorTest implements HttpServerAdapters { serverCount.incrementAndGet(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { client = null; Thread.sleep(100); AssertionError fail = TRACKER.check(1500); @@ -387,7 +385,7 @@ public class ProxySelectorTest implements HttpServerAdapters { } } - class TestProxySelector extends ProxySelector { + static final class TestProxySelector extends ProxySelector { @Override public List select(URI uri) { String path = uri.getPath(); @@ -426,11 +424,8 @@ public class ProxySelectorTest implements HttpServerAdapters { String path = t.getRequestURI().getPath(); HttpTestRequestHeaders reqh = t.getRequestHeaders(); HttpTestResponseHeaders rsph = t.getResponseHeaders(); - - String xValue = serverType; rsph.addHeader("X-value", serverType); - t.getResponseHeaders().addHeader("X-value", xValue); byte[] body = "RESPONSE".getBytes(UTF_8); t.sendResponseHeaders(HTTP_OK, body.length); try (var out = t.getResponseBody()) { @@ -449,20 +444,16 @@ public class ProxySelectorTest implements HttpServerAdapters { @Override public void handle(HttpTestExchange t) throws IOException { readAllRequestData(t); // shouldn't be any - String method = t.getRequestMethod(); String path = t.getRequestURI().getPath(); - HttpTestRequestHeaders reqh = t.getRequestHeaders(); HttpTestResponseHeaders rsph = t.getResponseHeaders(); - String xValue = serverType; - String srv = path.contains("/proxy/") ? "proxy" : "server"; String prefix = path.contains("/proxy/") ? "Proxy-" : "WWW-"; int code = path.contains("/proxy/") ? PROXY_UNAUTHORIZED : UNAUTHORIZED; String resp = prefix + "Unauthorized"; rsph.addHeader(prefix + "Authenticate", "Basic realm=\"earth\", charset=\"UTF-8\""); byte[] body = resp.getBytes(UTF_8); - t.getResponseHeaders().addHeader("X-value", xValue); + rsph.addHeader("X-value", serverType); t.sendResponseHeaders(code, body.length); try (var out = t.getResponseBody()) { out.write(body); diff --git a/test/jdk/java/net/httpclient/RedirectMethodChange.java b/test/jdk/java/net/httpclient/RedirectMethodChange.java index b0b130921f5..73e27f6efff 100644 --- a/test/jdk/java/net/httpclient/RedirectMethodChange.java +++ b/test/jdk/java/net/httpclient/RedirectMethodChange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +26,7 @@ * @summary Method change during redirection * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm RedirectMethodChange + * @run junit/othervm RedirectMethodChange */ import javax.net.ssl.SSLContext; @@ -41,33 +41,34 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.US_ASCII; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class RedirectMethodChange implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpClient client; + private static HttpClient client; - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; static final String RESPONSE = "Hello world"; static final String POST_BODY = "This is the POST body 123909090909090"; @@ -86,8 +87,7 @@ public class RedirectMethodChange implements HttpServerAdapters { } } - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][] { { http3URI, "GET", 301, "GET" }, { http3URI, "GET", 302, "GET" }, @@ -180,7 +180,8 @@ public class RedirectMethodChange implements HttpServerAdapters { return builder; } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void test(String uriString, String method, int redirectCode, @@ -195,15 +196,15 @@ public class RedirectMethodChange implements HttpServerAdapters { HttpResponse resp = client.send(req, BodyHandlers.ofString()); System.out.println("Response: " + resp + ", body: " + resp.body()); - assertEquals(resp.statusCode(), 200); - assertEquals(resp.body(), RESPONSE); + assertEquals(200, resp.statusCode()); + assertEquals(RESPONSE, resp.body()); } // -- Infrastructure - @BeforeTest - public void setup() throws Exception { - client = newClientBuilderForH3() + @BeforeAll + public static void setup() throws Exception { + client = HttpServerAdapters.createClientBuilderForH3() .followRedirects(HttpClient.Redirect.NORMAL) .sslContext(sslContext) .build(); @@ -245,8 +246,8 @@ public class RedirectMethodChange implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { client.close(); httpTestServer.stop(); httpsTestServer.stop(); diff --git a/test/jdk/java/net/httpclient/RedirectTimeoutTest.java b/test/jdk/java/net/httpclient/RedirectTimeoutTest.java index e51f394f845..8c2fa8707ae 100644 --- a/test/jdk/java/net/httpclient/RedirectTimeoutTest.java +++ b/test/jdk/java/net/httpclient/RedirectTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,16 +29,11 @@ * an HttpTimeoutException during the redirected request. * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.httpclient.HttpClient.log=errors,trace -Djdk.internal.httpclient.debug=false RedirectTimeoutTest + * @run junit/othervm -Djdk.httpclient.HttpClient.log=errors,trace -Djdk.internal.httpclient.debug=false RedirectTimeoutTest */ import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.TestException; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.io.IOException; import java.io.OutputStream; @@ -64,6 +59,12 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static jdk.test.lib.Utils.adjustTimeout; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import static org.junit.jupiter.api.Assertions.fail; + public class RedirectTimeoutTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); @@ -75,8 +76,8 @@ public class RedirectTimeoutTest implements HttpServerAdapters { public static final int ITERATIONS = 4; private static final PrintStream out = System.out; - @BeforeTest - public void setup() throws IOException { + @BeforeAll + public static void setup() throws IOException { h1TestServer = HttpTestServer.create(HTTP_1_1); h2TestServer = HttpTestServer.create(HTTP_2); h3TestServer = HttpTestServer.create(HTTP_3_URI_ONLY, sslContext); @@ -101,15 +102,14 @@ public class RedirectTimeoutTest implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() { + @AfterAll + public static void teardown() { h1TestServer.stop(); h2TestServer.stop(); h3TestServer.stop(); } - @DataProvider(name = "testData") - public Object[][] testData() { + public static Object[][] testData() { return new Object[][] { { HTTP_3, h3Uri, h3RedirectUri }, { HTTP_1_1, h1Uri, h1RedirectUri }, @@ -117,7 +117,8 @@ public class RedirectTimeoutTest implements HttpServerAdapters { }; } - @Test(dataProvider = "testData") + @ParameterizedTest + @MethodSource("testData") public void test(Version version, URI uri, URI redirectURI) throws InterruptedException { out.println("Testing for " + version); testRedirectURI = redirectURI; @@ -159,7 +160,7 @@ public class RedirectTimeoutTest implements HttpServerAdapters { } catch (IOException e) { if (e.getClass() == HttpTimeoutException.class) { e.printStackTrace(System.out); - throw new TestException("Timeout from original HttpRequest expired on redirect when it should have been cancelled."); + fail("Timeout from original HttpRequest expired on redirect when it should have been cancelled."); } else { throw new RuntimeException(e); } diff --git a/test/jdk/java/net/httpclient/RedirectWithCookie.java b/test/jdk/java/net/httpclient/RedirectWithCookie.java index b4a4df38721..ad94b124132 100644 --- a/test/jdk/java/net/httpclient/RedirectWithCookie.java +++ b/test/jdk/java/net/httpclient/RedirectWithCookie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +26,7 @@ * @summary Test for cookie handling when redirecting * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=trace,headers,requests * RedirectWithCookie */ @@ -45,10 +45,6 @@ import java.util.List; import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -56,28 +52,32 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class RedirectWithCookie implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; static final String MESSAGE = "BasicRedirectTest message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { http3URI, }, { httpURI, }, @@ -96,7 +96,8 @@ public class RedirectWithCookie implements HttpServerAdapters { return builder; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); var builder = uriString.contains("/http3/") @@ -120,8 +121,8 @@ public class RedirectWithCookie implements HttpServerAdapters { out.println(" Got response: " + response); out.println(" Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); // asserts redirected URI in response.request().uri() assertTrue(response.uri().getPath().endsWith("message")); assertPreviousRedirectResponses(request, response); @@ -142,7 +143,7 @@ public class RedirectWithCookie implements HttpServerAdapters { response = response.previousResponse().get(); assertTrue(300 <= response.statusCode() && response.statusCode() <= 309, "Expected 300 <= code <= 309, got:" + response.statusCode()); - assertEquals(response.body(), null, "Unexpected body: " + response.body()); + assertEquals(null, response.body(), "Unexpected body: " + response.body()); String locationHeader = response.headers().firstValue("Location") .orElseThrow(() -> new RuntimeException("no previous Location")); assertTrue(uri.toString().endsWith(locationHeader), @@ -151,15 +152,15 @@ public class RedirectWithCookie implements HttpServerAdapters { } while (response.previousResponse().isPresent()); // initial - assertEquals(initialRequest, response.request(), + assertEquals(response.request(), initialRequest, String.format("Expected initial request [%s] to equal last prev req [%s]", initialRequest, response.request())); } // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new CookieRedirectHandler(), "/http1/cookie/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/cookie/redirect"; @@ -185,8 +186,8 @@ public class RedirectWithCookie implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); diff --git a/test/jdk/java/net/httpclient/RequestBodyTest.java b/test/jdk/java/net/httpclient/RequestBodyTest.java index 668e834e1f0..e87cbc694c7 100644 --- a/test/jdk/java/net/httpclient/RequestBodyTest.java +++ b/test/jdk/java/net/httpclient/RequestBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,38 +47,33 @@ import static java.lang.System.out; import static java.nio.charset.StandardCharsets.*; import static java.nio.file.StandardOpenOption.*; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.*; +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @bug 8087112 - * @modules java.net.http/jdk.internal.net.http.common - * java.logging - * jdk.httpserver * @library /test/lib /test/jdk/java/net/httpclient/lib - * @compile ../../../com/sun/net/httpserver/LogFilter.java - * @compile ../../../com/sun/net/httpserver/EchoHandler.java - * @compile ../../../com/sun/net/httpserver/FileServerHandler.java - * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator + * @build jdk.test.lib.net.SimpleSSLContext + * jdk.httpclient.test.lib.common.HttpServerAdapters * @build LightWeightHttpServer * @build jdk.test.lib.Platform * @build jdk.test.lib.util.FileUtils - * @run testng/othervm RequestBodyTest + * @run junit/othervm RequestBodyTest */ public class RequestBodyTest { static final String fileroot = System.getProperty("test.src", ".") + "/docs"; static final String midSizedFilename = "/files/notsobigfile.txt"; static final String smallFilename = "/files/smallfile.txt"; - final ConcurrentHashMap failures = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap failures = new ConcurrentHashMap<>(); - HttpClient client; - String httpURI; - String httpsURI; + private static HttpClient client; + private static String httpURI; + private static String httpsURI; enum RequestBody { BYTE_ARRAY, @@ -100,8 +95,8 @@ public class RequestBodyTest { STRING_WITH_CHARSET, } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { LightWeightHttpServer.initServer(); httpURI = LightWeightHttpServer.httproot + "echo/foo"; httpsURI = LightWeightHttpServer.httpsroot + "echo/foo"; @@ -114,8 +109,8 @@ public class RequestBodyTest { .build(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { try { LightWeightHttpServer.stop(); } finally { @@ -132,8 +127,7 @@ public class RequestBodyTest { } } - @DataProvider - public Object[][] exchanges() throws Exception { + public static Object[][] exchanges() throws Exception { List values = new ArrayList<>(); for (boolean async : new boolean[] { false, true }) @@ -148,7 +142,8 @@ public class RequestBodyTest { return values.stream().toArray(Object[][]::new); } - @Test(dataProvider = "exchanges") + @ParameterizedTest + @MethodSource("exchanges") void exchange(String target, RequestBody requestBodyType, ResponseBody responseBodyType, @@ -244,8 +239,8 @@ public class RequestBodyTest { BodyHandler bh = BodyHandlers.ofByteArray(); if (bufferResponseBody) bh = BodyHandlers.buffering(bh, 50); HttpResponse bar = getResponse(client, request, bh, async); - assertEquals(bar.statusCode(), 200); - assertEquals(bar.body(), fileAsBytes); + assertEquals(200, bar.statusCode()); + assertArrayEquals(fileAsBytes, bar.body()); break; case BYTE_ARRAY_CONSUMER: ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -254,46 +249,46 @@ public class RequestBodyTest { if (bufferResponseBody) bh1 = BodyHandlers.buffering(bh1, 49); HttpResponse v = getResponse(client, request, bh1, async); byte[] ba = baos.toByteArray(); - assertEquals(v.statusCode(), 200); - assertEquals(ba, fileAsBytes); + assertEquals(200, v.statusCode()); + assertArrayEquals(fileAsBytes, ba); break; case DISCARD: Object o = new Object(); BodyHandler bh2 = BodyHandlers.replacing(o); if (bufferResponseBody) bh2 = BodyHandlers.buffering(bh2, 51); HttpResponse or = getResponse(client, request, bh2, async); - assertEquals(or.statusCode(), 200); + assertEquals(200, or.statusCode()); assertSame(or.body(), o); break; case FILE: BodyHandler bh3 = BodyHandlers.ofFile(tempFile); if (bufferResponseBody) bh3 = BodyHandlers.buffering(bh3, 48); HttpResponse fr = getResponse(client, request, bh3, async); - assertEquals(fr.statusCode(), 200); - assertEquals(Files.size(tempFile), fileAsString.length()); - assertEquals(Files.readAllBytes(tempFile), fileAsBytes); + assertEquals(200, fr.statusCode()); + assertEquals(fileAsString.length(), Files.size(tempFile)); + assertArrayEquals(fileAsBytes, Files.readAllBytes(tempFile)); break; case FILE_WITH_OPTION: BodyHandler bh4 = BodyHandlers.ofFile(tempFile, CREATE_NEW, WRITE); if (bufferResponseBody) bh4 = BodyHandlers.buffering(bh4, 52); fr = getResponse(client, request, bh4, async); - assertEquals(fr.statusCode(), 200); - assertEquals(Files.size(tempFile), fileAsString.length()); - assertEquals(Files.readAllBytes(tempFile), fileAsBytes); + assertEquals(200, fr.statusCode()); + assertEquals(fileAsString.length(), Files.size(tempFile)); + assertArrayEquals(fileAsBytes, Files.readAllBytes(tempFile)); break; case STRING: BodyHandler bh5 = BodyHandlers.ofString(); if(bufferResponseBody) bh5 = BodyHandlers.buffering(bh5, 47); HttpResponse sr = getResponse(client, request, bh5, async); - assertEquals(sr.statusCode(), 200); - assertEquals(sr.body(), fileAsString); + assertEquals(200, sr.statusCode()); + assertEquals(fileAsString, sr.body()); break; case STRING_WITH_CHARSET: BodyHandler bh6 = BodyHandlers.ofString(StandardCharsets.UTF_8); if (bufferResponseBody) bh6 = BodyHandlers.buffering(bh6, 53); HttpResponse r = getResponse(client, request, bh6, async); - assertEquals(r.statusCode(), 200); - assertEquals(r.body(), fileAsString); + assertEquals(200, r.statusCode()); + assertEquals(fileAsString, r.body()); break; default: throw new AssertionError("Unknown response body:" + responseBodyType); diff --git a/test/jdk/java/net/httpclient/RequestBuilderTest.java b/test/jdk/java/net/httpclient/RequestBuilderTest.java index a83c12f592e..12af908457b 100644 --- a/test/jdk/java/net/httpclient/RequestBuilderTest.java +++ b/test/jdk/java/net/httpclient/RequestBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ * @test * @bug 8276559 * @summary HttpRequest[.Builder] API and behaviour checks - * @run testng RequestBuilderTest + * @run junit RequestBuilderTest */ import java.net.URI; @@ -49,9 +49,9 @@ import static java.time.Duration.ofNanos; import static java.time.Duration.ofMinutes; import static java.time.Duration.ofSeconds; import static java.time.Duration.ZERO; -import static org.testng.Assert.*; -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; public class RequestBuilderTest { @@ -70,12 +70,12 @@ public class RequestBuilderTest { newBuilder(uri).copy()); for (HttpRequest.Builder builder : builders) { assertFalse(builder.build().expectContinue()); - assertEquals(builder.build().method(), "GET"); + assertEquals("GET", builder.build().method()); assertFalse(builder.build().bodyPublisher().isPresent()); assertFalse(builder.build().version().isPresent()); assertFalse(builder.build().timeout().isPresent()); assertTrue(builder.build().headers() != null); - assertEquals(builder.build().headers().map().size(), 0); + assertEquals(0, builder.build().headers().map().size()); } } @@ -128,61 +128,61 @@ public class RequestBuilderTest { assertThrows(IAE, () -> newBuilder().uri(u)); } - assertEquals(newBuilder(uri).build().uri(), uri); - assertEquals(newBuilder().uri(uri).build().uri(), uri); + assertEquals(uri, newBuilder(uri).build().uri()); + assertEquals(uri, newBuilder().uri(uri).build().uri()); URI https = URI.create("https://foo.com"); - assertEquals(newBuilder(https).build().uri(), https); - assertEquals(newBuilder().uri(https).build().uri(), https); + assertEquals(https, newBuilder(https).build().uri()); + assertEquals(https, newBuilder().uri(https).build().uri()); } @Test public void testMethod() { HttpRequest request = newBuilder(uri).build(); - assertEquals(request.method(), "GET"); + assertEquals("GET", request.method()); assertTrue(!request.bodyPublisher().isPresent()); request = newBuilder(uri).GET().build(); - assertEquals(request.method(), "GET"); + assertEquals("GET", request.method()); assertTrue(!request.bodyPublisher().isPresent()); request = newBuilder(uri).POST(BodyPublishers.ofString("")).GET().build(); - assertEquals(request.method(), "GET"); + assertEquals("GET", request.method()); assertTrue(!request.bodyPublisher().isPresent()); request = newBuilder(uri).PUT(BodyPublishers.ofString("")).GET().build(); - assertEquals(request.method(), "GET"); + assertEquals("GET", request.method()); assertTrue(!request.bodyPublisher().isPresent()); request = newBuilder(uri).DELETE().GET().build(); - assertEquals(request.method(), "GET"); + assertEquals("GET", request.method()); assertTrue(!request.bodyPublisher().isPresent()); request = newBuilder(uri).POST(BodyPublishers.ofString("")).build(); - assertEquals(request.method(), "POST"); + assertEquals("POST", request.method()); assertTrue(request.bodyPublisher().isPresent()); request = newBuilder(uri).PUT(BodyPublishers.ofString("")).build(); - assertEquals(request.method(), "PUT"); + assertEquals("PUT", request.method()); assertTrue(request.bodyPublisher().isPresent()); request = newBuilder(uri).DELETE().build(); - assertEquals(request.method(), "DELETE"); + assertEquals("DELETE", request.method()); assertTrue(!request.bodyPublisher().isPresent()); request = newBuilder(uri).HEAD().build(); - assertEquals(request.method(), "HEAD"); + assertEquals("HEAD", request.method()); assertFalse(request.bodyPublisher().isPresent()); request = newBuilder(uri).GET().POST(BodyPublishers.ofString("")).build(); - assertEquals(request.method(), "POST"); + assertEquals("POST", request.method()); assertTrue(request.bodyPublisher().isPresent()); request = newBuilder(uri).GET().PUT(BodyPublishers.ofString("")).build(); - assertEquals(request.method(), "PUT"); + assertEquals("PUT", request.method()); assertTrue(request.bodyPublisher().isPresent()); request = newBuilder(uri).GET().DELETE().build(); - assertEquals(request.method(), "DELETE"); + assertEquals("DELETE", request.method()); assertTrue(!request.bodyPublisher().isPresent()); // CONNECT is disallowed in the implementation, since it is used for @@ -190,11 +190,11 @@ public class RequestBuilderTest { assertThrows(IAE, () -> newBuilder(uri).method("CONNECT", BodyPublishers.noBody()).build()); request = newBuilder(uri).method("GET", BodyPublishers.noBody()).build(); - assertEquals(request.method(), "GET"); + assertEquals("GET", request.method()); assertTrue(request.bodyPublisher().isPresent()); request = newBuilder(uri).method("POST", BodyPublishers.ofString("")).build(); - assertEquals(request.method(), "POST"); + assertEquals("POST", request.method()); assertTrue(request.bodyPublisher().isPresent()); } @@ -207,7 +207,7 @@ public class RequestBuilderTest { assertThrows(IAE, () -> builder.headers("1").build()); assertThrows(IAE, () -> builder.headers("1", "2", "3").build()); assertThrows(IAE, () -> builder.headers("1", "2", "3", "4", "5").build()); - assertEquals(builder.build().headers().map().size(),0); + assertEquals(0, builder.build().headers().map().size()); List requests = List.of( // same header built from different combinations of the API @@ -219,13 +219,13 @@ public class RequestBuilderTest { ); for (HttpRequest r : requests) { - assertEquals(r.headers().map().size(), 1); + assertEquals(1, r.headers().map().size()); assertTrue(r.headers().firstValue("A").isPresent()); assertTrue(r.headers().firstValue("a").isPresent()); - assertEquals(r.headers().firstValue("A").get(), "B"); - assertEquals(r.headers().allValues("A"), List.of("B")); - assertEquals(r.headers().allValues("C").size(), 0); - assertEquals(r.headers().map().get("A"), List.of("B")); + assertEquals("B", r.headers().firstValue("A").get()); + assertEquals(List.of("B"), r.headers().allValues("A")); + assertEquals(0, r.headers().allValues("C").size()); + assertEquals(List.of("B"), r.headers().map().get("A")); assertThrows(NFE, () -> r.headers().firstValueAsLong("A")); assertFalse(r.headers().firstValue("C").isPresent()); // a non-exhaustive list of mutators @@ -265,14 +265,14 @@ public class RequestBuilderTest { ); for (HttpRequest r : requests) { - assertEquals(r.headers().map().size(), 2); + assertEquals(2, r.headers().map().size()); assertTrue(r.headers().firstValue("A").isPresent()); - assertEquals(r.headers().firstValue("A").get(), "B"); - assertEquals(r.headers().allValues("A"), List.of("B")); + assertEquals("B", r.headers().firstValue("A").get()); + assertEquals(List.of("B"), r.headers().allValues("A")); assertTrue(r.headers().firstValue("C").isPresent()); - assertEquals(r.headers().firstValue("C").get(), "D"); - assertEquals(r.headers().allValues("C"), List.of("D")); - assertEquals(r.headers().map().get("C"), List.of("D")); + assertEquals("D", r.headers().firstValue("C").get()); + assertEquals(List.of("D"), r.headers().allValues("C")); + assertEquals(List.of("D"), r.headers().map().get("C")); assertThrows(NFE, () -> r.headers().firstValueAsLong("C")); assertFalse(r.headers().firstValue("E").isPresent()); // a smaller non-exhaustive list of mutators @@ -304,11 +304,11 @@ public class RequestBuilderTest { ); for (HttpRequest r : requests) { - assertEquals(r.headers().map().size(), 1); + assertEquals(1, r.headers().map().size()); assertTrue(r.headers().firstValue("A").isPresent()); assertTrue(r.headers().allValues("A").containsAll(List.of("B", "C"))); - assertEquals(r.headers().allValues("C").size(), 0); - assertEquals(r.headers().map().get("A"), List.of("B", "C")); + assertEquals(0, r.headers().allValues("C").size()); + assertEquals(List.of("B", "C"), r.headers().map().get("A")); assertThrows(NFE, () -> r.headers().firstValueAsLong("A")); assertFalse(r.headers().firstValue("C").isPresent()); // a non-exhaustive list of mutators @@ -340,11 +340,11 @@ public class RequestBuilderTest { "aCCept-EnCODing", "accepT-encodinG")) { assertTrue(r.headers().firstValue(name).isPresent()); assertTrue(r.headers().allValues(name).contains("gzip, deflate")); - assertEquals(r.headers().firstValue(name).get(), "gzip, deflate"); - assertEquals(r.headers().allValues(name).size(), 1); - assertEquals(r.headers().map().size(), 1); - assertEquals(r.headers().map().get(name).size(), 1); - assertEquals(r.headers().map().get(name).get(0), "gzip, deflate"); + assertEquals("gzip, deflate", r.headers().firstValue(name).get()); + assertEquals(1, r.headers().allValues(name).size()); + assertEquals(1, r.headers().map().size()); + assertEquals(1, r.headers().map().get(name).size()); + assertEquals("gzip, deflate", r.headers().map().get(name).get(0)); } } } @@ -391,7 +391,7 @@ public class RequestBuilderTest { .GET(), "x-" + name, value).build(); String v = req.headers().firstValue("x-" + name).orElseThrow( () -> new RuntimeException("header x-" + name + " not set")); - assertEquals(v, value); + assertEquals(value, v); try { f.withHeader(HttpRequest.newBuilder(uri) .GET(), name, value).build(); @@ -419,27 +419,27 @@ public class RequestBuilderTest { builder.GET().timeout(ofSeconds(5)).version(HTTP_2).setHeader("A", "C"); HttpRequest copyRequest = copy.build(); - assertEquals(copyRequest.uri(), uri); - assertEquals(copyRequest.expectContinue(), true); - assertEquals(copyRequest.headers().map().get("A"), List.of("B")); - assertEquals(copyRequest.method(), "POST"); - assertEquals(copyRequest.bodyPublisher().isPresent(), true); - assertEquals(copyRequest.timeout().get(), ofSeconds(30)); + assertEquals(uri, copyRequest.uri()); + assertEquals(true, copyRequest.expectContinue()); + assertEquals(List.of("B"), copyRequest.headers().map().get("A")); + assertEquals("POST", copyRequest.method()); + assertEquals(true, copyRequest.bodyPublisher().isPresent()); + assertEquals(ofSeconds(30), copyRequest.timeout().get()); assertTrue(copyRequest.version().isPresent()); - assertEquals(copyRequest.version().get(), HTTP_1_1); + assertEquals(HTTP_1_1, copyRequest.version().get()); assertTrue(copyRequest.getOption(H3_DISCOVERY).isPresent()); - assertEquals(copyRequest.getOption(H3_DISCOVERY).get(), HTTP_3_URI_ONLY); + assertEquals(HTTP_3_URI_ONLY, copyRequest.getOption(H3_DISCOVERY).get()); // lazy set URI ( maybe builder as a template ) copyRequest = newBuilder().copy().uri(uri).build(); - assertEquals(copyRequest.uri(), uri); + assertEquals(uri, copyRequest.uri()); builder = newBuilder().header("C", "D"); copy = builder.copy(); copy.uri(uri); copyRequest = copy.build(); - assertEquals(copyRequest.uri(), uri); - assertEquals(copyRequest.headers().firstValue("C").get(), "D"); + assertEquals(uri, copyRequest.uri()); + assertEquals("D", copyRequest.headers().firstValue("C").get()); } @Test @@ -449,42 +449,41 @@ public class RequestBuilderTest { assertThrows(IAE, () -> builder.timeout(ofSeconds(0))); assertThrows(IAE, () -> builder.timeout(ofSeconds(-1))); assertThrows(IAE, () -> builder.timeout(ofNanos(-100))); - assertEquals(builder.timeout(ofNanos(15)).build().timeout().get(), ofNanos(15)); - assertEquals(builder.timeout(ofSeconds(50)).build().timeout().get(), ofSeconds(50)); - assertEquals(builder.timeout(ofMinutes(30)).build().timeout().get(), ofMinutes(30)); + assertEquals(ofNanos(15), builder.timeout(ofNanos(15)).build().timeout().get()); + assertEquals(ofSeconds(50), builder.timeout(ofSeconds(50)).build().timeout().get()); + assertEquals(ofMinutes(30), builder.timeout(ofMinutes(30)).build().timeout().get()); } @Test public void testExpect() { HttpRequest.Builder builder = newBuilder(uri); - assertEquals(builder.build().expectContinue(), false); - assertEquals(builder.expectContinue(true).build().expectContinue(), true); - assertEquals(builder.expectContinue(false).build().expectContinue(), false); - assertEquals(builder.expectContinue(true).build().expectContinue(), true); + assertEquals(false, builder.build().expectContinue()); + assertEquals(true, builder.expectContinue(true).build().expectContinue()); + assertEquals(false, builder.expectContinue(false).build().expectContinue()); + assertEquals(true, builder.expectContinue(true).build().expectContinue()); } @Test public void testEquals() { - assertNotEquals(newBuilder(URI.create("http://foo.com")), - newBuilder(URI.create("http://bar.com"))); + assertNotEquals( newBuilder(URI.create("http://bar.com")), newBuilder(URI.create("http://foo.com"))); HttpRequest.Builder builder = newBuilder(uri); assertEquals(builder.build(), builder.build()); - assertEquals(builder.build(), newBuilder(uri).build()); + assertEquals(newBuilder(uri).build(), builder.build()); builder.POST(BodyPublishers.noBody()); assertEquals(builder.build(), builder.build()); - assertEquals(builder.build(), newBuilder(uri).POST(BodyPublishers.noBody()).build()); - assertEquals(builder.build(), newBuilder(uri).POST(BodyPublishers.ofString("")).build()); - assertNotEquals(builder.build(), newBuilder(uri).build()); - assertNotEquals(builder.build(), newBuilder(uri).GET().build()); - assertNotEquals(builder.build(), newBuilder(uri).PUT(BodyPublishers.noBody()).build()); + assertEquals(newBuilder(uri).POST(BodyPublishers.noBody()).build(), builder.build()); + assertEquals(newBuilder(uri).POST(BodyPublishers.ofString("")).build(), builder.build()); + assertNotEquals(newBuilder(uri).build(), builder.build()); + assertNotEquals(newBuilder(uri).GET().build(), builder.build()); + assertNotEquals(newBuilder(uri).PUT(BodyPublishers.noBody()).build(), builder.build()); builder = newBuilder(uri).header("x", "y"); assertEquals(builder.build(), builder.build()); - assertEquals(builder.build(), newBuilder(uri).header("x", "y").build()); - assertNotEquals(builder.build(), newBuilder(uri).header("x", "Z").build()); - assertNotEquals(builder.build(), newBuilder(uri).header("z", "y").build()); + assertEquals(newBuilder(uri).header("x", "y").build(), builder.build()); + assertNotEquals(newBuilder(uri).header("x", "Z").build(), builder.build()); + assertNotEquals(newBuilder(uri).header("z", "y").build(), builder.build()); } @Test diff --git a/test/jdk/java/net/httpclient/Response1xxTest.java b/test/jdk/java/net/httpclient/Response1xxTest.java index 5cff7a69259..9b54f852510 100644 --- a/test/jdk/java/net/httpclient/Response1xxTest.java +++ b/test/jdk/java/net/httpclient/Response1xxTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,6 @@ import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; -import org.testng.Assert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; @@ -54,39 +50,44 @@ import static java.net.http.HttpClient.Version.valueOf; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; -/** +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/* * @test * @bug 8292044 * @summary Tests behaviour of HttpClient when server responds with 102 or 103 status codes * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http2.Http2TestServer - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=headers,requests,responses,errors Response1xxTest */ public class Response1xxTest implements HttpServerAdapters { private static final String EXPECTED_RSP_BODY = "Hello World"; - private ServerSocket serverSocket; - private Http11Server server; - private String http1RequestURIBase; + private static ServerSocket serverSocket; + private static Http11Server server; + private static String http1RequestURIBase; - private HttpTestServer http2Server; // h2c - private String http2RequestURIBase; + private static HttpTestServer http2Server; // h2c + private static String http2RequestURIBase; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - private HttpTestServer https2Server; // h2 - private String https2RequestURIBase; + private static HttpTestServer https2Server; // h2 + private static String https2RequestURIBase; - private HttpTestServer http3Server; // h3 - private String http3RequestURIBase; + private static HttpTestServer http3Server; // h3 + private static String http3RequestURIBase; - private final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - @BeforeClass - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { serverSocket = new ServerSocket(0, 0, InetAddress.getLoopbackAddress()); server = new Http11Server(serverSocket); new Thread(server).start(); @@ -130,8 +131,8 @@ public class Response1xxTest implements HttpServerAdapters { } - @AfterClass - public void teardown() throws Throwable { + @AfterAll + public static void teardown() throws Throwable { try { assertNoOutstandingClientOps(); } finally { @@ -269,7 +270,7 @@ public class Response1xxTest implements HttpServerAdapters { static String readRequestLine(final Socket sock) throws IOException { final InputStream is = sock.getInputStream(); - final StringBuilder sb = new StringBuilder(""); + final StringBuilder sb = new StringBuilder(); byte[] buf = new byte[1024]; while (!sb.toString().endsWith("\r\n\r\n")) { final int numRead = is.read(buf); @@ -424,10 +425,10 @@ public class Response1xxTest implements HttpServerAdapters { System.out.println("Issuing request to " + requestURI); final HttpResponse response = client.send(request, BodyHandlers.ofString(StandardCharsets.UTF_8)); - Assert.assertEquals(response.version(), version, + Assertions.assertEquals(version, response.version(), "Unexpected HTTP version in response"); - Assert.assertEquals(response.statusCode(), 200, "Unexpected response code"); - Assert.assertEquals(response.body(), EXPECTED_RSP_BODY, "Unexpected response body"); + Assertions.assertEquals(200, response.statusCode(), "Unexpected response code"); + Assertions.assertEquals(EXPECTED_RSP_BODY, response.body(), "Unexpected response body"); } } @@ -484,7 +485,7 @@ public class Response1xxTest implements HttpServerAdapters { .build(); System.out.println("Issuing request to " + requestURI); // we expect the request to timeout - Assert.assertThrows(HttpTimeoutException.class, () -> { + Assertions.assertThrows(HttpTimeoutException.class, () -> { client.send(request, BodyHandlers.ofString(StandardCharsets.UTF_8)); }); } @@ -561,7 +562,7 @@ public class Response1xxTest implements HttpServerAdapters { final HttpRequest request = requestBuilder.build(); System.out.println("Issuing request to " + requestURI); // we expect the request to fail because the server sent an unexpected 101 - Assert.assertThrows(ProtocolException.class, + Assertions.assertThrows(ProtocolException.class, () -> client.send(request, BodyHandlers.ofString(StandardCharsets.UTF_8))); } @@ -571,11 +572,11 @@ public class Response1xxTest implements HttpServerAdapters { final HttpRequest request = HttpRequest.newBuilder(requestURI).build(); System.out.println("Issuing (warmup) request to " + requestURI); final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.discarding()); - Assert.assertEquals(response.statusCode(), 200, "Unexpected response code"); + Assertions.assertEquals(200, response.statusCode(), "Unexpected response code"); } // verifies that the HttpClient being tracked has no outstanding operations - private void assertNoOutstandingClientOps() throws AssertionError { + private static void assertNoOutstandingClientOps() throws AssertionError { System.gc(); final AssertionError refCheckFailure = TRACKER.check(1000); if (refCheckFailure != null) { diff --git a/test/jdk/java/net/httpclient/Response204V2Test.java b/test/jdk/java/net/httpclient/Response204V2Test.java index c9dbd8eccf9..835f7aa65f7 100644 --- a/test/jdk/java/net/httpclient/Response204V2Test.java +++ b/test/jdk/java/net/httpclient/Response204V2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,7 +27,7 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * ReferenceTracker jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * Response204V2Test * @summary Tests that streams are closed after receiving a 204 response. @@ -44,7 +44,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.util.Arrays; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -52,19 +51,9 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; @@ -74,15 +63,25 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + public class Response204V2Test implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String http2URI; + private static String https2URI; + private static String http3URI; static final int RESPONSE_CODE = 204; static final int ITERATION_COUNT = 4; @@ -101,8 +100,8 @@ public class Response204V2Test implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -128,40 +127,40 @@ public class Response204V2Test implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static final void printFailedTests() { out.println("\n========================="); try { - var failed = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - FAILURES.putAll(failed); - out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); if (FAILURES.isEmpty()) return; @@ -179,7 +178,7 @@ public class Response204V2Test implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { http3URI, http2URI, @@ -187,13 +186,7 @@ public class Response204V2Test implements HttpServerAdapters { }; } - static AtomicLong URICOUNT = new AtomicLong(); - - @DataProvider(name = "variants") - public Object[][] variants(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; int i = 0; @@ -232,23 +225,6 @@ public class Response204V2Test implements HttpServerAdapters { } } - - static void checkStatus(int expected, int found) throws Exception { - if (expected != found) { - System.err.printf ("Test failed: wrong status code %d/%d\n", - expected, found); - throw new RuntimeException("Test failed"); - } - } - - static void checkStrings(String expected, String found) throws Exception { - if (!expected.equals(found)) { - System.err.printf ("Test failed: wrong string %s/%s\n", - expected, found); - throw new RuntimeException("Test failed"); - } - } - private HttpRequest.Builder newRequestBuilder(URI uri) { var builder = HttpRequest.newBuilder(uri); if (uri.getRawPath().contains("/http3/")) { @@ -258,10 +234,10 @@ public class Response204V2Test implements HttpServerAdapters { return builder; } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void test(String uri, boolean sameClient) throws Exception { - checkSkip(); - out.println("Request to " + uri); + out.printf("%n%s-- test sameClient=%s, uri=%s%n%n", now(), sameClient, uri); HttpClient client = newHttpClient(uri, sameClient); @@ -282,8 +258,8 @@ public class Response204V2Test implements HttpServerAdapters { out.println("test: DONE"); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/2 HttpTestHandler handler204 = new Handler204(); @@ -305,8 +281,8 @@ public class Response204V2Test implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { String sharedClientName = sharedClient == null ? null : sharedClient.toString(); sharedClient = null; diff --git a/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java index 123e47e2ac9..19393d99ee9 100644 --- a/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java +++ b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @modules java.net.http/jdk.internal.net.http.common * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm/timeout=480 ResponseBodyBeforeError + * @run junit/othervm/timeout=480 ResponseBodyBeforeError */ import java.io.Closeable; @@ -54,10 +54,6 @@ import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutionException; import java.util.concurrent.Flow; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLServerSocketFactory; @@ -67,28 +63,32 @@ import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpResponse.BodyHandlers.ofString; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ResponseBodyBeforeError { - ReplyingServer variableLengthServer; - ReplyingServer variableLengthHttpsServer; - ReplyingServer fixedLengthServer; - ReplyingServer fixedLengthHttpsServer; + private static ReplyingServer variableLengthServer; + private static ReplyingServer variableLengthHttpsServer; + private static ReplyingServer fixedLengthServer; + private static ReplyingServer fixedLengthHttpsServer; - String httpURIVarLen; - String httpsURIVarLen; - String httpURIFixLen; - String httpsURIFixLen; + private static String httpURIVarLen; + private static String httpsURIVarLen; + private static String httpURIFixLen; + private static String httpsURIFixLen; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); static final String EXPECTED_RESPONSE_BODY = "

    Heading

    Some Text

    "; - @DataProvider(name = "sanity") - public Object[][] sanity() { + public static Object[][] sanity() { return new Object[][]{ { httpURIVarLen + "?length=all" }, { httpsURIVarLen + "?length=all" }, @@ -97,7 +97,8 @@ public class ResponseBodyBeforeError { }; } - @Test(dataProvider = "sanity") + @ParameterizedTest + @MethodSource("sanity") void sanity(String url) throws Exception { HttpClient client = HttpClient.newBuilder() .proxy(NO_PROXY) @@ -106,15 +107,14 @@ public class ResponseBodyBeforeError { HttpRequest request = HttpRequest.newBuilder(URI.create(url)).build(); HttpResponse response = client.send(request, ofString()); String body = response.body(); - assertEquals(body, EXPECTED_RESPONSE_BODY); + assertEquals(EXPECTED_RESPONSE_BODY, body); client.sendAsync(request, ofString()) .thenApply(resp -> resp.body()) - .thenAccept(b -> assertEquals(b, EXPECTED_RESPONSE_BODY)) + .thenAccept(b -> assertEquals(EXPECTED_RESPONSE_BODY, b)) .join(); } - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { Object[][] cases = new Object[][] { // The length query string is the total number of response body // bytes in the reply, before the server closes the connection. The @@ -182,7 +182,8 @@ public class ResponseBodyBeforeError { static final int ITERATION_COUNT = 3; static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testSynchronousAllRequestBody(String url, String expectedPatrialBody, boolean sameClient) @@ -210,7 +211,7 @@ public class ResponseBodyBeforeError { } catch (IOException expected) { String pm = bs.receivedAsString(); out.println("partial body received: " + pm); - assertEquals(pm, expectedPatrialBody); + assertEquals(expectedPatrialBody, pm); } } } finally { @@ -221,7 +222,8 @@ public class ResponseBodyBeforeError { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsynchronousAllRequestBody(String url, String expectedPatrialBody, boolean sameClient) @@ -250,7 +252,7 @@ public class ResponseBodyBeforeError { if (ee.getCause() instanceof IOException) { String pm = bs.receivedAsString(); out.println("partial body received: " + pm); - assertEquals(pm, expectedPatrialBody); + assertEquals(expectedPatrialBody, pm); } else { throw ee; } @@ -536,8 +538,8 @@ public class ResponseBodyBeforeError { + server.getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { SSLContext.setDefault(sslContext); variableLengthServer = new PlainVariableLengthServer(); @@ -557,8 +559,8 @@ public class ResponseBodyBeforeError { + "/https1/fixed/foz"; } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { variableLengthServer.close(); variableLengthHttpsServer.close(); fixedLengthServer.close(); diff --git a/test/jdk/java/net/httpclient/ResponsePublisher.java b/test/jdk/java/net/httpclient/ResponsePublisher.java index ce86a0a3cf5..be135e84b31 100644 --- a/test/jdk/java/net/httpclient/ResponsePublisher.java +++ b/test/jdk/java/net/httpclient/ResponsePublisher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,22 +28,16 @@ * immediately with a Publisher> * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm/timeout=480 ResponsePublisher + * @run junit/othervm/timeout=480 ResponsePublisher */ -import com.sun.net.httpserver.HttpServer; import jdk.internal.net.http.common.OperationTrackers; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.InetAddress; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -73,28 +67,33 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ResponsePublisher implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI_fixed; - String httpURI_chunk; - String httpsURI_fixed; - String httpsURI_chunk; - String http2URI_fixed; - String http2URI_chunk; - String https2URI_fixed; - String https2URI_chunk; - String http3URI_fixed; - String http3URI_chunk; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI_fixed; + private static String httpURI_chunk; + private static String httpsURI_fixed; + private static String httpsURI_chunk; + private static String http2URI_fixed; + private static String http2URI_chunk; + private static String https2URI_fixed; + private static String https2URI_chunk; + private static String http3URI_fixed; + private static String http3URI_chunk; static final int ITERATION_COUNT = 3; // a shared executor helps reduce the amount of threads created by the test @@ -139,8 +138,7 @@ public class ResponsePublisher implements HttpServerAdapters { static final Supplier>>> OF_PUBLISHER_TEST = BHS.of(PublishingBodyHandler::new, "PublishingBodyHandler::new"); - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][]{ { http3URI_fixed, false, OF_PUBLISHER_API }, { http3URI_chunk, false, OF_PUBLISHER_API }, @@ -190,7 +188,7 @@ public class ResponsePublisher implements HttpServerAdapters { }; } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; HttpClient newHttpClient(String uri) { var builder = uri.contains("/http3/") ? newClientBuilderForH3() @@ -210,8 +208,9 @@ public class ResponsePublisher implements HttpServerAdapters { return builder; } - @Test(dataProvider = "variants") - public void testExceptions(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testExceptions(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { if (!sameClient || client == null) @@ -247,7 +246,7 @@ public class ResponsePublisher implements HttpServerAdapters { } // Get the final result and compare it with the expected body String body = ofString.getBody().toCompletableFuture().get(); - assertEquals(body, ""); + assertEquals("", body); // ensure client closes before next iteration if (!sameClient) { var tracker = TRACKER.getTracker(client); @@ -257,8 +256,9 @@ public class ResponsePublisher implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testNoBody(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testNoBody(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { if (!sameClient || client == null) @@ -276,7 +276,7 @@ public class ResponsePublisher implements HttpServerAdapters { response.body().subscribe(ofString); // Get the final result and compare it with the expected body String body = ofString.getBody().toCompletableFuture().get(); - assertEquals(body, ""); + assertEquals("", body); // ensure client closes before next iteration if (!sameClient) { var tracker = TRACKER.getTracker(client); @@ -286,8 +286,9 @@ public class ResponsePublisher implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testNoBodyAsync(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testNoBodyAsync(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { if (!sameClient || client == null) @@ -308,7 +309,7 @@ public class ResponsePublisher implements HttpServerAdapters { return ofString.getBody(); }); // Get the final result and compare it with the expected body - assertEquals(result.get(), ""); + assertEquals("", result.get()); // ensure client closes before next iteration if (!sameClient) { var tracker = TRACKER.getTracker(client); @@ -318,8 +319,9 @@ public class ResponsePublisher implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testAsString(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testAsString(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { if (!sameClient || client == null) @@ -337,7 +339,7 @@ public class ResponsePublisher implements HttpServerAdapters { response.body().subscribe(ofString); // Get the final result and compare it with the expected body String body = ofString.getBody().toCompletableFuture().get(); - assertEquals(body, WITH_BODY); + assertEquals(WITH_BODY, body); // ensure client closes before next iteration if (!sameClient) { var tracker = TRACKER.getTracker(client); @@ -347,8 +349,9 @@ public class ResponsePublisher implements HttpServerAdapters { } } - @Test(dataProvider = "variants") - public void testAsStringAsync(String uri, boolean sameClient, BHS handlers) throws Exception { + @ParameterizedTest + @MethodSource("variants") + void testAsStringAsync(String uri, boolean sameClient, BHS handlers) throws Exception { HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { if (!sameClient || client == null) @@ -369,7 +372,7 @@ public class ResponsePublisher implements HttpServerAdapters { }); // Get the final result and compare it with the expected body String body = result.get(); - assertEquals(body, WITH_BODY); + assertEquals(WITH_BODY, body); // ensure client closes before next iteration if (!sameClient) { var tracker = TRACKER.getTracker(client); @@ -383,7 +386,7 @@ public class ResponsePublisher implements HttpServerAdapters { static class PublishingBodyHandler implements BodyHandler>> { @Override public BodySubscriber>> apply(HttpResponse.ResponseInfo rinfo) { - assertEquals(rinfo.statusCode(), 200); + assertEquals(200, rinfo.statusCode()); return new PublishingBodySubscriber(); } } @@ -392,7 +395,7 @@ public class ResponsePublisher implements HttpServerAdapters { static class PublishingBodySubscriber implements BodySubscriber>> { private final CompletableFuture subscriptionCF = new CompletableFuture<>(); private final CompletableFuture>> subscribedCF = new CompletableFuture<>(); - private AtomicReference>> subscriberRef = new AtomicReference<>(); + private final AtomicReference>> subscriberRef = new AtomicReference<>(); private final CompletionStage>> body = subscriptionCF.thenCompose((s) -> CompletableFuture.completedStage(this::subscribe)); //CompletableFuture.completedStage(this::subscribe); @@ -449,13 +452,8 @@ public class ResponsePublisher implements HttpServerAdapters { } } - static String serverAuthority(HttpServer server) { - return InetAddress.getLoopbackAddress().getHostName() + ":" - + server.getAddress().getPort(); - } - - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // HTTP/1.1 HttpTestHandler h1_fixedLengthHandler = new HTTP_FixedLengthHandler(); HttpTestHandler h1_chunkHandler = new HTTP_VariableLengthHandler(); @@ -504,8 +502,8 @@ public class ResponsePublisher implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.check(500); try { diff --git a/test/jdk/java/net/httpclient/RetryPost.java b/test/jdk/java/net/httpclient/RetryPost.java index ccd5dbb2922..67969306acc 100644 --- a/test/jdk/java/net/httpclient/RetryPost.java +++ b/test/jdk/java/net/httpclient/RetryPost.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,8 +24,8 @@ /* * @test * @summary Ensure that the POST method is retied when the property is set. - * @run testng/othervm -Djdk.httpclient.enableAllMethodRetry RetryPost - * @run testng/othervm -Djdk.httpclient.enableAllMethodRetry=true RetryPost + * @run junit/othervm -Djdk.httpclient.enableAllMethodRetry RetryPost + * @run junit/othervm -Djdk.httpclient.enableAllMethodRetry=true RetryPost */ import java.io.IOException; @@ -41,26 +41,26 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; import java.net.http.HttpResponse; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpResponse.BodyHandlers.ofString; import static java.nio.charset.StandardCharsets.US_ASCII; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class RetryPost { - FixedLengthServer fixedLengthServer; - String httpURIFixLen; + private static FixedLengthServer fixedLengthServer; + private static String httpURIFixLen; static final String RESPONSE_BODY = "You use a glass mirror to see your face: you use works of art to see your soul."; - @DataProvider(name = "uris") - public Object[][] variants() { + public static Object[][] variants() { return new Object[][] { { httpURIFixLen, true }, { httpURIFixLen, false }, @@ -71,7 +71,8 @@ public class RetryPost { static final String REQUEST_BODY = "Body"; - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testSynchronousPOST(String url, boolean sameClient) throws Exception { out.print("---\n"); HttpClient client = null; @@ -84,12 +85,13 @@ public class RetryPost { HttpResponse response = client.send(request, ofString()); String body = response.body(); out.println(response + ": " + body); - assertEquals(response.statusCode(), 200); - assertEquals(body, RESPONSE_BODY); + assertEquals(200, response.statusCode()); + assertEquals(RESPONSE_BODY, body); } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsynchronousPOST(String url, boolean sameClient) { out.print("---\n"); HttpClient client = null; @@ -101,9 +103,9 @@ public class RetryPost { .build(); client.sendAsync(request, ofString()) .thenApply(r -> { out.println(r + ": " + r.body()); return r; }) - .thenApply(r -> { assertEquals(r.statusCode(), 200); return r; }) + .thenApply(r -> { assertEquals(200, r.statusCode()); return r; }) .thenApply(HttpResponse::body) - .thenAccept(b -> assertEquals(b, RESPONSE_BODY)) + .thenAccept(b -> assertEquals(RESPONSE_BODY, b)) .join(); } } @@ -223,15 +225,15 @@ public class RetryPost { + server.getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { fixedLengthServer = new FixedLengthServer(); httpURIFixLen = "http://" + serverAuthority(fixedLengthServer) + "/http1/fixed/baz"; } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { fixedLengthServer.close(); } } diff --git a/test/jdk/java/net/httpclient/RetryWithCookie.java b/test/jdk/java/net/httpclient/RetryWithCookie.java index 782d8a0b956..8638693b50d 100644 --- a/test/jdk/java/net/httpclient/RetryWithCookie.java +++ b/test/jdk/java/net/httpclient/RetryWithCookie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,16 +29,12 @@ * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=trace,headers,requests * RetryWithCookie */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -67,28 +63,32 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class RetryWithCookie implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 5 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; static final String MESSAGE = "BasicRedirectTest message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { http3URI, }, { httpURI, }, @@ -99,7 +99,7 @@ public class RetryWithCookie implements HttpServerAdapters { } static final AtomicLong requestCounter = new AtomicLong(); - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; private HttpRequest.Builder newRequestBuilder(URI uri) { var builder = HttpRequest.newBuilder(uri); @@ -110,7 +110,8 @@ public class RetryWithCookie implements HttpServerAdapters { return builder; } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); CookieManager cookieManager = new CookieManager(); @@ -145,9 +146,9 @@ public class RetryWithCookie implements HttpServerAdapters { out.println(" Got response: " + response); out.println(" Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); - assertEquals(response.headers().allValues("X-Request-Cookie"), cookies); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); + assertEquals(cookies, response.headers().allValues("X-Request-Cookie")); request = newRequestBuilder(uri) .header("X-uuid", "uuid-" + requestCounter.incrementAndGet()) .build(); @@ -156,8 +157,8 @@ public class RetryWithCookie implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new CookieRetryHandler(), "/http1/cookie/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/cookie/retry"; @@ -183,8 +184,8 @@ public class RetryWithCookie implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.check(500); try { diff --git a/test/jdk/java/net/httpclient/SSLExceptionTest.java b/test/jdk/java/net/httpclient/SSLExceptionTest.java index 4fa17c875c3..cf94d1b50f7 100644 --- a/test/jdk/java/net/httpclient/SSLExceptionTest.java +++ b/test/jdk/java/net/httpclient/SSLExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,9 +24,11 @@ import java.io.UncheckedIOException; import java.net.http.HttpClient; import java.security.NoSuchAlgorithmException; -import org.testng.annotations.Test; -import static org.testng.Assert.expectThrows; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; /* * @test @@ -34,7 +36,7 @@ import static org.testng.Assert.fail; * @summary This test verifies exception when resources for * SSLcontext used by HttpClient are not available * @build SSLExceptionTest - * @run testng/othervm -Djdk.tls.client.protocols="InvalidTLSv1.4" + * @run junit/othervm -Djdk.tls.client.protocols="InvalidTLSv1.4" * SSLExceptionTest */ @@ -47,12 +49,12 @@ public class SSLExceptionTest { @Test public void testHttpClientsslException() { for (int i = 0; i < ITERATIONS; i++) { - excp = expectThrows(UncheckedIOException.class, HttpClient.newBuilder()::build); + excp = Assertions.assertThrows(UncheckedIOException.class, HttpClient.newBuilder()::build); noSuchAlgo = excp.getCause().getCause(); if ( !(noSuchAlgo instanceof NoSuchAlgorithmException) ) { fail("Test failed due to wrong exception cause : " + noSuchAlgo); } - excp = expectThrows(UncheckedIOException.class, HttpClient::newHttpClient); + excp = Assertions.assertThrows(UncheckedIOException.class, HttpClient::newHttpClient); noSuchAlgo = excp.getCause().getCause(); if ( !(noSuchAlgo instanceof NoSuchAlgorithmException) ) { fail("Test failed due to wrong exception cause : " + noSuchAlgo); diff --git a/test/jdk/java/net/httpclient/SendResponseHeadersTest.java b/test/jdk/java/net/httpclient/SendResponseHeadersTest.java index df8bc3b0844..2998522616f 100644 --- a/test/jdk/java/net/httpclient/SendResponseHeadersTest.java +++ b/test/jdk/java/net/httpclient/SendResponseHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,16 +27,13 @@ * @library /test/lib * @summary Check that sendResponseHeaders throws an IOException when headers * have already been sent - * @run testng/othervm SendResponseHeadersTest + * @run junit/othervm SendResponseHeadersTest */ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; import jdk.test.lib.net.URIBuilder; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; import java.io.IOException; import java.io.InputStream; @@ -54,16 +51,21 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import static java.net.http.HttpClient.Builder.NO_PROXY; -import static org.testng.Assert.expectThrows; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class SendResponseHeadersTest { - URI uri; - HttpServer server; - ExecutorService executor; + private static URI uri; + private static HttpServer server; + private static ExecutorService executor; - @BeforeTest - public void setUp() throws IOException, URISyntaxException { + @BeforeAll + public static void setUp() throws IOException, URISyntaxException { var loopback = InetAddress.getLoopbackAddress(); var addr = new InetSocketAddress(loopback, 0); server = HttpServer.create(addr, 0); @@ -94,8 +96,8 @@ public class SendResponseHeadersTest { fail(response.body()); } - @AfterTest - public void tearDown() { + @AfterAll + public static void tearDown() { server.stop(0); executor.shutdown(); } @@ -108,7 +110,7 @@ public class SendResponseHeadersTest { is.readAllBytes(); exchange.sendResponseHeaders(200, 0); try { - IOException io = expectThrows(IOException.class, + IOException io = Assertions.assertThrows(IOException.class, () -> exchange.sendResponseHeaders(200, 0)); System.out.println("Got expected exception: " + io); } catch (Throwable t) { diff --git a/test/jdk/java/net/httpclient/ServerCloseTest.java b/test/jdk/java/net/httpclient/ServerCloseTest.java index 65eb6cfc589..d5e762b15a4 100644 --- a/test/jdk/java/net/httpclient/ServerCloseTest.java +++ b/test/jdk/java/net/httpclient/ServerCloseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,16 +28,11 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Djdk.tls.acknowledgeCloseNotify=true ServerCloseTest + * @run junit/othervm -Djdk.tls.acknowledgeCloseNotify=true ServerCloseTest */ //* -Djdk.internal.httpclient.debug=true import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ServerSocketFactory; import javax.net.ssl.SSLContext; @@ -70,18 +65,22 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; import static java.lang.System.out; import static java.nio.charset.StandardCharsets.UTF_8; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + public class ServerCloseTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - DummyServer httpDummyServer; // HTTP/1.1 [ 2 servers ] - DummyServer httpsDummyServer; // HTTPS/1.1 - String httpDummy; - String httpsDummy; + private static DummyServer httpDummyServer; // HTTP/1.1 [ 2 servers ] + private static DummyServer httpsDummyServer; // HTTPS/1.1 + private static String httpDummy; + private static String httpsDummy; static final int ITERATION_COUNT = 3; // a shared executor helps reduce the amount of threads created by the test @@ -99,7 +98,7 @@ public class ServerCloseTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - private volatile HttpClient sharedClient; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -125,8 +124,8 @@ public class ServerCloseTest implements HttpServerAdapters { } } - @AfterClass - static final void printFailedTests() { + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { out.printf("%n%sCreated %d servers and %d clients%n", @@ -145,15 +144,14 @@ public class ServerCloseTest implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { httpDummy, httpsDummy, }; } - @DataProvider(name = "servers") - public Object[][] noThrows() { + public static Object[][] noThrows() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2][]; //Object[][] result = new Object[uris.length][]; @@ -192,7 +190,8 @@ public class ServerCloseTest implements HttpServerAdapters { final String ENCODED = "/01%252F03/"; - @Test(dataProvider = "servers") + @ParameterizedTest + @MethodSource("noThrows") public void testServerClose(String uri, boolean sameClient) { HttpClient client = null; out.printf("%n%s testServerClose(%s, %b)%n", now(), uri, sameClient); @@ -224,8 +223,8 @@ public class ServerCloseTest implements HttpServerAdapters { } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); // DummyServer @@ -240,8 +239,8 @@ public class ServerCloseTest implements HttpServerAdapters { httpsDummyServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { sharedClient = null; httpDummyServer.stopServer(); httpsDummyServer.stopServer(); @@ -324,7 +323,7 @@ public class ServerCloseTest implements HttpServerAdapters { // Read all headers until we find the empty line that // signals the end of all headers. String line = requestLine; - while (!line.equals("")) { + while (!line.isEmpty()) { System.out.println(now() + getName() + ": Reading header: " + (line = readLine(ccis))); headers.append(line).append("\r\n"); @@ -338,7 +337,7 @@ public class ServerCloseTest implements HttpServerAdapters { byte[] b = uri.toString().getBytes(UTF_8); if (index >= 0) { index = index + "content-length: ".length(); - String cl = headers.toString().substring(index); + String cl = headers.substring(index); StringTokenizer tk = new StringTokenizer(cl); int len = Integer.parseInt(tk.nextToken()); assert len < b.length * 2; diff --git a/test/jdk/java/net/httpclient/ShortResponseBody.java b/test/jdk/java/net/httpclient/ShortResponseBody.java index b4fd83585ee..5f931cd1ed3 100644 --- a/test/jdk/java/net/httpclient/ShortResponseBody.java +++ b/test/jdk/java/net/httpclient/ShortResponseBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -36,24 +36,16 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.util.Arrays; import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; import java.util.stream.Stream; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLServerSocketFactory; @@ -64,28 +56,40 @@ import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpResponse.BodyHandlers.ofString; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.util.stream.Collectors.toList; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public abstract class ShortResponseBody { - Server closeImmediatelyServer; - Server closeImmediatelyHttpsServer; - Server variableLengthServer; - Server variableLengthHttpsServer; - Server fixedLengthServer; + private static Server closeImmediatelyServer; + private static Server closeImmediatelyHttpsServer; + private static Server variableLengthServer; + private static Server variableLengthHttpsServer; + private static Server fixedLengthServer; - String httpURIClsImed; - String httpsURIClsImed; - String httpURIVarLen; - String httpsURIVarLen; - String httpURIFixLen; + private static String httpURIClsImed; + private static String httpsURIClsImed; + private static String httpURIVarLen; + private static String httpsURIVarLen; + private static String httpURIFixLen; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - SSLParameters sslParameters; - HttpClient client; - int numberOfRequests; + private static SSLParameters sslParameters; + protected static HttpClient client; + private static int numberOfRequests; static final int REQUESTS_PER_CLIENT = 10; // create new client every 10 requests static final long PAUSE_FOR_GC = 5; // 5ms to let gc work @@ -99,7 +103,7 @@ public abstract class ShortResponseBody { static final AtomicLong reqnb = new AtomicLong(); static final AtomicLong ids = new AtomicLong(); - final ThreadFactory factory = new ThreadFactory() { + private static final ThreadFactory factory = new ThreadFactory() { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r, "HttpClient-Worker-" + ids.incrementAndGet()); @@ -107,21 +111,49 @@ public abstract class ShortResponseBody { return thread; } }; - final ExecutorService service = Executors.newCachedThreadPool(factory); - - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); + private static final ExecutorService service = Executors.newCachedThreadPool(factory); + static final ConcurrentMap FAILURES = new ConcurrentHashMap<>(); + static final long start = System.nanoTime(); + public static String now() { + long now = System.nanoTime() - start; + long secs = now / 1000_000_000; + long mill = (now % 1000_000_000) / 1000_000; + long nan = now % 1000_000; + return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - @BeforeMethod - void beforeMethod(ITestContext context) { + private static boolean stopAfterFirstFailure() { + return Boolean.getBoolean("jdk.internal.httpclient.debug"); + } + + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } + } + + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @BeforeEach + void beforeMethod() { if (client == null || numberOfRequests == REQUESTS_PER_CLIENT) { numberOfRequests = 0; out.println("--- new client"); @@ -134,22 +166,12 @@ public abstract class ShortResponseBody { } } numberOfRequests++; - if (context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); - } - } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @AfterAll + static void printFailedTests() { out.println("\n=========================\n"); try { - var FAILURES = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - if (FAILURES.isEmpty()) return; out.println("Failed tests: "); FAILURES.entrySet().forEach((e) -> { @@ -162,8 +184,7 @@ public abstract class ShortResponseBody { } } - @DataProvider(name = "sanity") - public Object[][] sanity() { + public static Object[][] sanity() { return new Object[][]{ { httpURIVarLen + "?length=all" }, { httpsURIVarLen + "?length=all" }, @@ -175,22 +196,22 @@ public abstract class ShortResponseBody { return url.replace("%reqnb%", String.valueOf(reqnb.incrementAndGet())); } - @Test(dataProvider = "sanity") + @ParameterizedTest + @MethodSource("sanity") void sanity(String url) throws Exception { url = uniqueURL(url); HttpRequest request = HttpRequest.newBuilder(URI.create(url)).build(); out.println("Request: " + request); HttpResponse response = client.send(request, ofString()); String body = response.body(); - assertEquals(body, EXPECTED_RESPONSE_BODY); + assertEquals(EXPECTED_RESPONSE_BODY, body); client.sendAsync(request, ofString()) .thenApply(resp -> resp.body()) - .thenAccept(b -> assertEquals(b, EXPECTED_RESPONSE_BODY)) + .thenAccept(b -> assertEquals(EXPECTED_RESPONSE_BODY, b)) .join(); } - @DataProvider(name = "sanityBadRequest") - public Object[][] sanityBadRequest() { + public static Object[][] sanityBadRequest() { return new Object[][]{ { httpURIVarLen }, // no query string { httpsURIVarLen }, @@ -198,18 +219,18 @@ public abstract class ShortResponseBody { }; } - @Test(dataProvider = "sanityBadRequest") + @ParameterizedTest + @MethodSource("sanityBadRequest") void sanityBadRequest(String url) throws Exception { url = uniqueURL(url); HttpRequest request = HttpRequest.newBuilder(URI.create(url)).build(); out.println("Request: " + request); HttpResponse response = client.send(request, ofString()); - assertEquals(response.statusCode(), 400); - assertEquals(response.body(), ""); + assertEquals(400, response.statusCode()); + assertEquals("", response.body()); } - @DataProvider(name = "uris") - public Object[][] variants(ITestContext context) { + public static Object[][] variants() { String[][] cases = new String[][] { // The length query string is the total number of bytes in the reply, // including headers, before the server closes the connection. The @@ -268,13 +289,6 @@ public abstract class ShortResponseBody { { httpsURIClsImed, "no bytes"}, }; - if (context.getFailedTests().size() > 0) { - // Shorten the log output by preventing useless - // skip traces to be printed for subsequent methods - // if one of the previous @Test method has failed. - return new Object[0][]; - } - return cases; } @@ -618,7 +632,7 @@ public abstract class ShortResponseBody { String response( ) { return RESPONSE; } } - /** A server that issues a, possibly-partial, chunked reply over SSL. */ + /** A server that issues a possibly-partial, chunked reply over SSL. */ static final class SSLVariableLengthServer extends PlainVariableLengthServer { SSLVariableLengthServer() throws IOException { super("SSLVariableLengthServer"); @@ -655,8 +669,8 @@ public abstract class ShortResponseBody { + server.getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { SSLContext.setDefault(sslContext); sslParameters = new SSLParameters(); @@ -682,8 +696,8 @@ public abstract class ShortResponseBody { + "/http1/fixed/req=%reqnb%/baz"; } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { closeImmediatelyServer.close(); closeImmediatelyHttpsServer.close(); variableLengthServer.close(); diff --git a/test/jdk/java/net/httpclient/ShortResponseBodyGet.java b/test/jdk/java/net/httpclient/ShortResponseBodyGet.java index 0a9041020a5..47be508c8c1 100644 --- a/test/jdk/java/net/httpclient/ShortResponseBodyGet.java +++ b/test/jdk/java/net/httpclient/ShortResponseBodyGet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +28,7 @@ * received before a socket exception or eof. * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext ShortResponseBody ShortResponseBodyGet - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers,errors,channel * ShortResponseBodyGet */ @@ -38,21 +38,24 @@ import java.net.URI; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.util.concurrent.ExecutionException; -import org.testng.annotations.Test; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import static java.lang.System.out; import static java.net.http.HttpResponse.BodyHandlers.ofString; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; public class ShortResponseBodyGet extends ShortResponseBody { - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testSynchronousGET(String urlp, String expectedMsg) throws Exception { - checkSkip(); String url = uniqueURL(urlp); HttpRequest request = HttpRequest.newBuilder(URI.create(url)).build(); - out.println("Request: " + request); + out.printf("%n%s-- testSynchronousGET Request: %s%n%n", now(), request); try { HttpResponse response = client.send(request, ofString()); String body = response.body(); @@ -67,14 +70,14 @@ public class ShortResponseBodyGet extends ShortResponseBody { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsynchronousGET(String urlp, String expectedMsg) throws Exception { - checkSkip(); String url = uniqueURL(urlp); HttpRequest request = HttpRequest.newBuilder(URI.create(url)).build(); - out.println("Request: " + request); + out.printf("%n%s-- testAsynchronousGET Request: %s%n%n", now(), request); try { HttpResponse response = client.sendAsync(request, ofString()).get(); String body = response.body(); diff --git a/test/jdk/java/net/httpclient/ShortResponseBodyPost.java b/test/jdk/java/net/httpclient/ShortResponseBodyPost.java index c72540c5990..60d2796b34f 100644 --- a/test/jdk/java/net/httpclient/ShortResponseBodyPost.java +++ b/test/jdk/java/net/httpclient/ShortResponseBodyPost.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +28,7 @@ * received before a socket exception or eof. * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext ShortResponseBody ShortResponseBodyPost - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers,errors,channel * -Djdk.internal.httpclient.debug=true * ShortResponseBodyPost @@ -42,10 +42,14 @@ import java.net.http.HttpResponse; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; -import org.testng.annotations.Test; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import static java.lang.System.out; import static java.net.http.HttpResponse.BodyHandlers.ofString; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; + public class ShortResponseBodyPost extends ShortResponseBody { // POST tests are racy in what may be received before writing may cause a @@ -56,16 +60,16 @@ public class ShortResponseBodyPost extends ShortResponseBody { List.of("no bytes", "status line", "header"); - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testSynchronousPOST(String urlp, String expectedMsg) throws Exception { - checkSkip(); String url = uniqueURL(urlp); HttpRequest request = HttpRequest.newBuilder(URI.create(url)) .POST(BodyPublishers.ofInputStream(() -> new InfiniteInputStream())) .build(); - out.println("Request: " + request); + out.printf("%n%s-- testSynchronousPOST Request: %s%n%n", now(), request); try { HttpResponse response = client.send(request, ofString()); String body = response.body(); @@ -86,16 +90,16 @@ public class ShortResponseBodyPost extends ShortResponseBody { } } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("variants") void testAsynchronousPOST(String urlp, String expectedMsg) throws Exception { - checkSkip(); String url = uniqueURL(urlp); HttpRequest request = HttpRequest.newBuilder(URI.create(url)) .POST(BodyPublishers.ofInputStream(() -> new InfiniteInputStream())) .build(); - out.println("Request: " + request); + out.printf("%n%s-- testAsynchronousPOST Request: %s%n%n", now(), request); try { HttpResponse response = client.sendAsync(request, ofString()).get(); String body = response.body(); diff --git a/test/jdk/java/net/httpclient/ShortResponseBodyPostWithRetry.java b/test/jdk/java/net/httpclient/ShortResponseBodyPostWithRetry.java index bd234690526..0ab404e556a 100644 --- a/test/jdk/java/net/httpclient/ShortResponseBodyPostWithRetry.java +++ b/test/jdk/java/net/httpclient/ShortResponseBodyPostWithRetry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * @library /test/lib * @build jdk.test.lib.net.SimpleSSLContext * @build ShortResponseBody ShortResponseBodyPost - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers,errors,channel * -Djdk.httpclient.enableAllMethodRetry * -Djdk.internal.httpclient.debug=true diff --git a/test/jdk/java/net/httpclient/ShutdownNow.java b/test/jdk/java/net/httpclient/ShutdownNow.java index 4f9eabbeb4d..e48667d2c69 100644 --- a/test/jdk/java/net/httpclient/ShutdownNow.java +++ b/test/jdk/java/net/httpclient/ShutdownNow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,7 +32,7 @@ * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext * jdk.test.lib.RandomFactory jdk.test.lib.Utils * ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * ShutdownNow @@ -66,10 +66,6 @@ import javax.net.ssl.SSLContext; import jdk.test.lib.RandomFactory; import jdk.test.lib.Utils; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; @@ -80,9 +76,14 @@ import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class ShutdownNow implements HttpServerAdapters { @@ -92,25 +93,24 @@ public class ShutdownNow implements HttpServerAdapters { static final Random RANDOM = RandomFactory.getRandom(); private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) - HttpTestServer h3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String h2h3URI; - String h2h3Head; - String h3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer h2h3TestServer; // HTTP/3 ( h2 + h3 ) + private static HttpTestServer h3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String h2h3URI; + private static String h2h3Head; + private static String h3URI; static final String MESSAGE = "ShutdownNow message body"; static final int ITERATIONS = 3; - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { h2h3URI, HTTP_3, h2h3TestServer.h3DiscoveryConfig()}, { h3URI, HTTP_3, h3TestServer.h3DiscoveryConfig()}, @@ -122,7 +122,7 @@ public class ShutdownNow implements HttpServerAdapters { } static final AtomicLong requestCounter = new AtomicLong(); - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; static Throwable getCause(Throwable t) { while (t instanceof CompletionException || t instanceof ExecutionException) { @@ -137,7 +137,7 @@ public class ShutdownNow implements HttpServerAdapters { .HEAD() .build(); var resp = client.send(request, BodyHandlers.discarding()); - assertEquals(resp.statusCode(), 200); + assertEquals(200, resp.statusCode()); } static boolean hasExpectedMessage(IOException io) { @@ -176,7 +176,8 @@ public class ShutdownNow implements HttpServerAdapters { throw new AssertionError(what + ": Unexpected exception: " + cause, cause); } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testConcurrent(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting concurrent (%s, %s, %s) ----%n%n", uriString, version, config); HttpClient client = newClientBuilderForH3() @@ -217,8 +218,8 @@ public class ShutdownNow implements HttpServerAdapters { var cf = responseCF.thenApply((response) -> { out.println(si + ": Got response: " + response); out.println(si + ": Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); return response; }).exceptionally((t) -> { Throwable cause = getCause(t); @@ -243,7 +244,8 @@ public class ShutdownNow implements HttpServerAdapters { } } - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void testSequential(String uriString, Version version, Http3DiscoveryMode config) throws Exception { out.printf("%n---- starting sequential (%s, %s, %s) ----%n%n", uriString, version, config); @@ -284,8 +286,8 @@ public class ShutdownNow implements HttpServerAdapters { responseCF.thenApply((response) -> { out.println(si + ": Got response: " + response); out.println(si + ": Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); return response; }).handle((r,t) -> { if (t != null) { @@ -318,8 +320,8 @@ public class ShutdownNow implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("\n**** Setup ****\n"); httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new ServerRequestHandler(), "/http1/exec/"); @@ -352,8 +354,8 @@ public class ShutdownNow implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { Thread.sleep(100); AssertionError fail = TRACKER.check(5000); try { diff --git a/test/jdk/java/net/httpclient/SmokeTest.java b/test/jdk/java/net/httpclient/SmokeTest.java index 42c082a5e0f..f87cc462fac 100644 --- a/test/jdk/java/net/httpclient/SmokeTest.java +++ b/test/jdk/java/net/httpclient/SmokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,39 +24,25 @@ /* * @test * @bug 8087112 8178699 8338569 - * @modules java.net.http/jdk.internal.net.http.common - * java.logging - * jdk.httpserver * @library /test/lib /test/jdk/java/net/httpclient/lib / * @build jdk.test.lib.net.SimpleSSLContext ProxyServer * jdk.httpclient.test.lib.common.TestServerConfigurator - * @compile ../../../com/sun/net/httpserver/LogFilter.java - * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @run main/othervm * -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=errors,ssl,trace * SmokeTest */ -import com.sun.net.httpserver.Headers; -import com.sun.net.httpserver.HttpContext; -import com.sun.net.httpserver.HttpExchange; -import com.sun.net.httpserver.HttpHandler; -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsParameters; -import com.sun.net.httpserver.HttpsServer; - import java.net.InetAddress; import java.net.Proxy; import java.net.SocketAddress; +import java.net.http.HttpClient.Version; import java.net.http.HttpHeaders; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; @@ -94,7 +80,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Random; -import jdk.httpclient.test.lib.common.TestServerConfigurator; +import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; import static java.nio.file.StandardOpenOption.WRITE; @@ -120,11 +106,11 @@ import java.util.logging.Logger; * Uses a FileServerHandler serving a couple of known files * in docs directory. */ -public class SmokeTest { +public class SmokeTest implements HttpServerAdapters { private static final SSLContext ctx = SimpleSSLContext.findSSLContext(); static SSLParameters sslparams; - static HttpServer s1 ; - static HttpsServer s2; + static HttpTestServer s1 ; + static HttpTestServer s2; static ExecutorService executor; static int port; static int httpsport; @@ -142,19 +128,10 @@ public class SmokeTest { static Path smallFile; static String fileroot; - static class HttpEchoHandler implements HttpHandler { - + static class HttpEchoHandler extends HttpTestEchoHandler { @Override - public void handle(HttpExchange exchange) throws IOException { - try (InputStream is = exchange.getRequestBody(); - OutputStream os = exchange.getResponseBody()) { - byte[] bytes = is.readAllBytes(); - long responseLength = bytes.length == 0 ? -1 : bytes.length; - boolean fixedLength = "yes".equals(exchange.getRequestHeaders() - .getFirst("XFixed")); - exchange.sendResponseHeaders(200, fixedLength ? responseLength : 0); - os.write(bytes); - } + protected boolean useXFixed() { + return true; } } @@ -242,8 +219,8 @@ public class SmokeTest { //test12(httproot + "delay/foo", delayHandler); } finally { - s1.stop(0); - s2.stop(0); + s1.stop(); + s2.stop(); proxy.close(); e.shutdownNow(); executor.shutdownNow(); @@ -779,38 +756,31 @@ public class SmokeTest { ch.setLevel(Level.SEVERE); logger.addHandler(ch); - String root = System.getProperty ("test.src", ".")+ "/docs"; - InetSocketAddress addr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); - s1 = HttpServer.create (addr, 0); - if (s1 instanceof HttpsServer) { - throw new RuntimeException ("should not be httpsserver"); - } - s2 = HttpsServer.create (addr, 0); - HttpHandler h = new FileServerHandler(root); + sslparams = ctx.getDefaultSSLParameters(); + executor = Executors.newCachedThreadPool(); - HttpContext c1 = s1.createContext("/files", h); - HttpContext c2 = s2.createContext("/files", h); - HttpContext c3 = s1.createContext("/echo", new HttpEchoHandler()); + String root = System.getProperty ("test.src", ".")+ "/docs"; + s1 = HttpTestServer.create(Version.HTTP_1_1, null, executor); + s2 = HttpTestServer.create(Version.HTTP_1_1, ctx, executor); + HttpTestHandler h = new HttpTestFileServerHandler(root); + + HttpTestContext c1 = s1.createContext("/files", h); + HttpTestContext c2 = s2.createContext("/files", h); + HttpTestContext c3 = s1.createContext("/echo", new HttpEchoHandler()); redirectHandler = new RedirectHandler("/redirect"); redirectHandlerSecure = new RedirectHandler("/redirect"); - HttpContext c4 = s1.createContext("/redirect", redirectHandler); - HttpContext c41 = s2.createContext("/redirect", redirectHandlerSecure); - HttpContext c5 = s2.createContext("/echo", new HttpEchoHandler()); - HttpContext c6 = s1.createContext("/keepalive", new KeepAliveHandler()); + HttpTestContext c4 = s1.createContext("/redirect", redirectHandler); + HttpTestContext c41 = s2.createContext("/redirect", redirectHandlerSecure); + HttpTestContext c5 = s2.createContext("/echo", new HttpEchoHandler()); + HttpTestContext c6 = s1.createContext("/keepalive", new KeepAliveHandler()); redirectErrorHandler = new RedirectErrorHandler("/redirecterror"); redirectErrorHandlerSecure = new RedirectErrorHandler("/redirecterror"); - HttpContext c7 = s1.createContext("/redirecterror", redirectErrorHandler); - HttpContext c71 = s2.createContext("/redirecterror", redirectErrorHandlerSecure); + HttpTestContext c7 = s1.createContext("/redirecterror", redirectErrorHandler); + HttpTestContext c71 = s2.createContext("/redirecterror", redirectErrorHandlerSecure); delayHandler = new DelayHandler(); - HttpContext c8 = s1.createContext("/delay", delayHandler); - HttpContext c81 = s2.createContext("/delay", delayHandler); + HttpTestContext c8 = s1.createContext("/delay", delayHandler); + HttpTestContext c81 = s2.createContext("/delay", delayHandler); - executor = Executors.newCachedThreadPool(); - s1.setExecutor(executor); - s2.setExecutor(executor); - sslparams = ctx.getDefaultSSLParameters(); - //sslparams.setProtocols(new String[]{"TLSv1.2"}); - s2.setHttpsConfigurator(new Configurator(addr.getAddress(), ctx)); s1.start(); s2.start(); @@ -839,7 +809,7 @@ public class SmokeTest { } } - static class RedirectHandler implements HttpHandler { + static class RedirectHandler implements HttpTestHandler { private final String root; private volatile int count = 0; @@ -848,17 +818,17 @@ public class SmokeTest { } @Override - public synchronized void handle(HttpExchange t) throws IOException { + public synchronized void handle(HttpTestExchange t) throws IOException { try (InputStream is = t.getRequestBody()) { is.readAllBytes(); } - Headers responseHeaders = t.getResponseHeaders(); + var responseHeaders = t.getResponseHeaders(); if (count++ < 1) { - responseHeaders.add("Location", root + "/foo/" + count); + responseHeaders.addHeader("Location", root + "/foo/" + count); } else { - responseHeaders.add("Location", SmokeTest.midSizedFilename); + responseHeaders.addHeader("Location", SmokeTest.midSizedFilename); } t.sendResponseHeaders(301, 64 * 1024); byte[] bb = new byte[1024]; @@ -879,7 +849,7 @@ public class SmokeTest { } } - static class RedirectErrorHandler implements HttpHandler { + static class RedirectErrorHandler implements HttpTestHandler { private final String root; private volatile int count = 1; @@ -896,21 +866,21 @@ public class SmokeTest { } @Override - public synchronized void handle(HttpExchange t) throws IOException { + public synchronized void handle(HttpTestExchange t) throws IOException { try (InputStream is = t.getRequestBody()) { is.readAllBytes(); } - Headers map = t.getResponseHeaders(); - String redirect = root + "/foo/" + Integer.toString(count); + var map = t.getResponseHeaders(); + String redirect = root + "/foo/" + count; increment(); - map.add("Location", redirect); - t.sendResponseHeaders(301, -1); + map.addHeader("Location", redirect); + t.sendResponseHeaders(301, HttpTestExchange.RSPBODY_EMPTY); t.close(); } } - static class DelayHandler implements HttpHandler { + static class DelayHandler implements HttpTestHandler { CyclicBarrier bar1 = new CyclicBarrier(2); CyclicBarrier bar2 = new CyclicBarrier(2); @@ -925,34 +895,17 @@ public class SmokeTest { } @Override - public synchronized void handle(HttpExchange he) throws IOException { + public synchronized void handle(HttpTestExchange he) throws IOException { he.getRequestBody().readAllBytes(); try { bar1.await(); bar2.await(); } catch (Exception e) { } - he.sendResponseHeaders(200, -1); // will probably fail + he.sendResponseHeaders(200, HttpTestExchange.RSPBODY_EMPTY); // will probably fail he.close(); } } - static class Configurator extends HttpsConfigurator { - private final InetAddress serverAddr; - - public Configurator(InetAddress serverAddr, SSLContext ctx) { - super(ctx); - this.serverAddr = serverAddr; - } - - @Override - public void configure(final HttpsParameters params) { - final SSLParameters p = getSSLContext().getDefaultSSLParameters(); - TestServerConfigurator.addSNIMatcher(this.serverAddr, p); - //p.setProtocols(new String[]{"TLSv1.2"}); - params.setSSLParameters(p); - } - } - static final Path CWD = Paths.get("."); static Path getTempFile(int size) throws IOException { @@ -971,120 +924,132 @@ public class SmokeTest { fos.close(); return f.toPath(); } -} -// check for simple hardcoded sequence and use remote address -// to check. -// First 4 requests executed in sequence (should use same connection/address) -// Next 4 requests parallel (should use different addresses) -// Then send 4 requests in parallel x 100 times (same four addresses used all time) -class KeepAliveHandler implements HttpHandler { - final AtomicInteger counter = new AtomicInteger(0); - final AtomicInteger nparallel = new AtomicInteger(0); + // check for simple hardcoded sequence and use remote address + // to check. + // First 4 requests executed in sequence (should use same connection/address) + // Next 4 requests parallel (should use different addresses) + // Then send 4 requests in parallel x 100 times (same four addresses used all time) - final Set portSet = Collections.synchronizedSet(new HashSet<>()); + static class KeepAliveHandler implements HttpTestHandler { + final AtomicInteger counter = new AtomicInteger(0); + final AtomicInteger nparallel = new AtomicInteger(0); - final int[] ports = new int[8]; + final Set portSet = Collections.synchronizedSet(new HashSet<>()); - void sleep(int n) { - try { - Thread.sleep(n); - } catch (InterruptedException e) {} - } + final int[] ports = new int[8]; - synchronized void setPort(int index, int value) { - ports[index] = value; - } - - synchronized int getPort(int index) { - return ports[index]; - } - - synchronized void getPorts(int[] dest, int from) { - dest[0] = ports[from+0]; - dest[1] = ports[from+1]; - dest[2] = ports[from+2]; - dest[3] = ports[from+3]; - } - - static final CountDownLatch latch = new CountDownLatch(4); - static final CountDownLatch latch7 = new CountDownLatch(4); - static final CountDownLatch latch8 = new CountDownLatch(1); - - @Override - public void handle (HttpExchange t) - throws IOException - { - int np = nparallel.incrementAndGet(); - int remotePort = t.getRemoteAddress().getPort(); - String result = "OK"; - int[] lports = new int[4]; - - int n = counter.getAndIncrement(); - - /// First test - if (n < 4) { - setPort(n, remotePort); - } - if (n == 3) { - getPorts(lports, 0); - // check all values in ports[] are the same - if (lports[0] != lports[1] || lports[2] != lports[3] - || lports[0] != lports[2]) { - result = "Error " + Integer.toString(n); - System.out.println(result); - } - } - // Second test - if (n >=4 && n < 8) { - // delay so that this connection doesn't get reused - // before all 4 requests sent - setPort(n, remotePort); - latch.countDown(); - try {latch.await();} catch (InterruptedException e) {} - latch7.countDown(); - } - if (n == 7) { - // wait until all n <= 7 have called setPort(...) - try {latch7.await();} catch (InterruptedException e) {} - getPorts(lports, 4); - // should be all different - if (lports[0] == lports[1] || lports[2] == lports[3] - || lports[0] == lports[2]) { - result = "Error " + Integer.toString(n); - System.out.println(result); - } - // setup for third test - for (int i=0; i<4; i++) { - portSet.add(lports[i]); - } - System.out.printf("Ports: %d, %d, %d, %d\n", lports[0], lports[1], lports[2], lports[3]); - latch8.countDown(); - } - // Third test - if (n > 7) { - // wait until all n == 7 has updated portSet - try {latch8.await();} catch (InterruptedException e) {} - if (np > 4) { - System.err.println("XXX np = " + np); - } - // just check that port is one of the ones in portSet - if (!portSet.contains(remotePort)) { - System.out.println ("UNEXPECTED REMOTE PORT " - + remotePort + " not in " + portSet); - result = "Error " + Integer.toString(n); - System.out.println(result); + void sleep(int n) { + try { + Thread.sleep(n); + } catch (InterruptedException e) { } } - try (InputStream is = t.getRequestBody()) { - is.readAllBytes(); + synchronized void setPort(int index, int value) { + ports[index] = value; + } + + synchronized int getPort(int index) { + return ports[index]; + } + + synchronized void getPorts(int[] dest, int from) { + dest[0] = ports[from + 0]; + dest[1] = ports[from + 1]; + dest[2] = ports[from + 2]; + dest[3] = ports[from + 3]; + } + + static final CountDownLatch latch = new CountDownLatch(4); + static final CountDownLatch latch7 = new CountDownLatch(4); + static final CountDownLatch latch8 = new CountDownLatch(1); + + @Override + public void handle(HttpTestExchange t) + throws IOException { + int np = nparallel.incrementAndGet(); + int remotePort = t.getRemoteAddress().getPort(); + String result = "OK"; + int[] lports = new int[4]; + + int n = counter.getAndIncrement(); + + /// First test + if (n < 4) { + setPort(n, remotePort); + } + if (n == 3) { + getPorts(lports, 0); + // check all values in ports[] are the same + if (lports[0] != lports[1] || lports[2] != lports[3] + || lports[0] != lports[2]) { + result = "Error " + Integer.toString(n); + System.out.println(result); + } + } + // Second test + if (n >= 4 && n < 8) { + // delay so that this connection doesn't get reused + // before all 4 requests sent + setPort(n, remotePort); + latch.countDown(); + try { + latch.await(); + } catch (InterruptedException e) { + } + latch7.countDown(); + } + if (n == 7) { + // wait until all n <= 7 have called setPort(...) + try { + latch7.await(); + } catch (InterruptedException e) { + } + getPorts(lports, 4); + // should be all different + if (lports[0] == lports[1] || lports[2] == lports[3] + || lports[0] == lports[2]) { + result = "Error " + Integer.toString(n); + System.out.println(result); + } + // setup for third test + for (int i = 0; i < 4; i++) { + portSet.add(lports[i]); + } + System.out.printf("Ports: %d, %d, %d, %d\n", lports[0], lports[1], lports[2], lports[3]); + latch8.countDown(); + } + // Third test + if (n > 7) { + // wait until all n == 7 has updated portSet + try { + latch8.await(); + } catch (InterruptedException e) { + } + if (np > 4) { + System.err.println("XXX np = " + np); + } + // just check that port is one of the ones in portSet + if (!portSet.contains(remotePort)) { + System.out.println("UNEXPECTED REMOTE PORT " + + remotePort + " not in " + portSet); + result = "Error " + Integer.toString(n); + System.out.println(result); + } + } + + try (InputStream is = t.getRequestBody()) { + is.readAllBytes(); + } + byte[] bytes = result.getBytes(StandardCharsets.UTF_8); + long responseLength = HttpTestExchange.fixedRsp(bytes.length); + t.sendResponseHeaders(200, responseLength); + OutputStream o = t.getResponseBody(); + o.write(bytes); + t.close(); + nparallel.getAndDecrement(); } - t.sendResponseHeaders(200, result.length()); - OutputStream o = t.getResponseBody(); - o.write(result.getBytes(StandardCharsets.UTF_8)); - t.close(); - nparallel.getAndDecrement(); } } diff --git a/test/jdk/java/net/httpclient/SpecialHeadersTest.java b/test/jdk/java/net/httpclient/SpecialHeadersTest.java index d33135dd4ce..d4d5f2a85e2 100644 --- a/test/jdk/java/net/httpclient/SpecialHeadersTest.java +++ b/test/jdk/java/net/httpclient/SpecialHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,35 +31,22 @@ * jdk.httpclient.test.lib.http2.Http2TestServer * jdk.test.lib.net.SimpleSSLContext * @requires (vm.compMode != "Xcomp") - * @run testng/othervm/timeout=480 + * @run junit/othervm/timeout=480 * -Djdk.httpclient.HttpClient.log=requests,headers,errors * SpecialHeadersTest - * @run testng/othervm/timeout=480 -Djdk.httpclient.allowRestrictedHeaders=Host + * @run junit/othervm/timeout=480 -Djdk.httpclient.allowRestrictedHeaders=Host * -Djdk.httpclient.HttpClient.log=requests,headers,errors * SpecialHeadersTest */ -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsServer; import jdk.internal.net.http.common.OperationTrackers.Tracker; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.ITestResult; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpHeaders; @@ -83,9 +70,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; -import java.util.stream.Collectors; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2TestServer; import static java.lang.System.err; import static java.lang.System.out; @@ -93,22 +78,37 @@ import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; +import static java.net.http.HttpOption.H3_DISCOVERY; +import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.nio.charset.StandardCharsets.US_ASCII; -import org.testng.Assert; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class SpecialHeadersTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String https3URI; static final String[][] headerNamesAndValues = new String[][]{ {"User-Agent: "}, @@ -132,8 +132,7 @@ public class SpecialHeadersTest implements HttpServerAdapters { {"hoSt: mixed"} }; - @DataProvider(name = "variants") - public Object[][] variants() { + public static Object[][] variants() { String prop = System.getProperty("jdk.httpclient.allowRestrictedHeaders"); boolean hostTest = prop != null && prop.equalsIgnoreCase("host"); final String[][] testInput = hostTest ? headerNamesAndValues1 : headerNamesAndValues; @@ -153,6 +152,9 @@ public class SpecialHeadersTest implements HttpServerAdapters { Arrays.asList(testInput).stream() .map(e -> new Object[] {https2URI, e[0], sameClient}) .forEach(list::add); + Arrays.asList(testInput).stream() + .map(e -> new Object[] {https3URI, e[0], sameClient}) + .forEach(list::add); } return list.stream().toArray(Object[][]::new); } @@ -173,8 +175,8 @@ public class SpecialHeadersTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - private volatile HttpClient sharedClient; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static volatile HttpClient sharedClient; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -209,38 +211,39 @@ public class SpecialHeadersTest implements HttpServerAdapters { } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - final AtomicReference skiptests = new AtomicReference<>(); - void checkSkip() { - var skip = skiptests.get(); - if (skip != null) throw skip; - } - static String name(ITestResult result) { - var params = result.getParameters(); - return result.getName() - + (params == null ? "()" : Arrays.toString(result.getParameters())); - } - - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - if (skiptests.get() == null) { - SkipException skip = new SkipException("some tests failed"); - skip.setStackTrace(new StackTraceElement[0]); - skiptests.compareAndSet(null, skip); + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); } } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); + } } - @AfterClass - static final void printFailedTests(ITestContext context) { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); - var failed = context.getFailedTests().getAllResults().stream() - .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); - FAILURES.putAll(failed); try { out.printf("%n%sCreated %d servers and %d clients%n", now(), serverCount.get(), clientCount.get()); @@ -260,7 +263,7 @@ public class SpecialHeadersTest implements HttpServerAdapters { private HttpClient makeNewClient() { clientCount.incrementAndGet(); - return HttpClient.newBuilder() + return newClientBuilderForH3() .proxy(NO_PROXY) .executor(executor) .sslContext(sslContext) @@ -307,7 +310,8 @@ public class SpecialHeadersTest implements HttpServerAdapters { if (throwable instanceof Error e) throw e; } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void test(String uriString, String headerNameAndValue, boolean sameClient) @@ -335,6 +339,10 @@ public class SpecialHeadersTest implements HttpServerAdapters { } HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri); + if (uriString.contains("/http3")) { + requestBuilder.version(HTTP_3); + requestBuilder.setOption(H3_DISCOVERY, HTTP_3_URI_ONLY); + } if (!useDefault) { requestBuilder.header(name, value); } @@ -343,7 +351,7 @@ public class SpecialHeadersTest implements HttpServerAdapters { out.println("Got response: " + resp); out.println("Got body: " + resp.body()); - assertEquals(resp.statusCode(), 200, + assertEquals(200, resp.statusCode(), "Expected 200, got:" + resp.statusCode()); boolean isInitialRequest = i == 0; @@ -366,10 +374,10 @@ public class SpecialHeadersTest implements HttpServerAdapters { : resp.headers().firstValue("X-" + key).get(); out.println("Got X-" + key + ": " + resp.headers().allValues("X-" + key)); if (value != null) { - assertEquals(receivedHeaderString, value); - assertEquals(resp.headers().allValues("X-" + key), List.of(value)); + assertEquals(value, receivedHeaderString); + assertEquals(List.of(value), resp.headers().allValues("X-" + key)); } else { - assertEquals(resp.headers().allValues("X-" + key).size(), 0); + assertEquals(0, resp.headers().allValues("X-" + key).size()); } } } catch (Throwable x) { @@ -389,7 +397,8 @@ public class SpecialHeadersTest implements HttpServerAdapters { } } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void testHomeMadeIllegalHeader(String uriString, String headerNameAndValue, boolean sameClient) @@ -443,7 +452,7 @@ public class SpecialHeadersTest implements HttpServerAdapters { try { HttpResponse response = client.send(req, BodyHandlers.ofString()); - Assert.fail("Unexpected reply: " + response); + Assertions.fail("Unexpected reply: " + response); } catch (IllegalArgumentException ee) { out.println("Got IAE as expected"); } @@ -465,7 +474,8 @@ public class SpecialHeadersTest implements HttpServerAdapters { - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") void testAsync(String uriString, String headerNameAndValue, boolean sameClient) throws Exception { @@ -490,6 +500,10 @@ public class SpecialHeadersTest implements HttpServerAdapters { } HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri); + if (uriString.contains("/http3")) { + requestBuilder.version(HTTP_3); + requestBuilder.setOption(H3_DISCOVERY, HTTP_3_URI_ONLY); + } if (!useDefault) { requestBuilder.header(name, value); } @@ -504,7 +518,7 @@ public class SpecialHeadersTest implements HttpServerAdapters { .thenApply(response -> { out.println("Got response: " + response); out.println("Got body: " + response.body()); - assertEquals(response.statusCode(), 200); + assertEquals(200, response.statusCode()); return response; }) .thenAccept(resp -> { @@ -522,10 +536,10 @@ public class SpecialHeadersTest implements HttpServerAdapters { : resp.headers().firstValue("X-" + key).orElse(null); out.println("Got X-" + key + ": " + resp.headers().allValues("X-" + key)); if (value != null) { - assertEquals(receivedHeaderString, value); - assertEquals(resp.headers().allValues("X-" + key), List.of(value)); + assertEquals(value, receivedHeaderString); + assertEquals(List.of(value), resp.headers().allValues("X-" + key)); } else { - assertEquals(resp.headers().allValues("X-" + key).size(), 1); + assertEquals(1, resp.headers().allValues("X-" + key).size()); } } }) @@ -552,8 +566,8 @@ public class SpecialHeadersTest implements HttpServerAdapters { + server.getAddress().getPort(); } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { out.println("--- Starting setup " + now()); HttpTestHandler handler = new HttpUriStringHandler(); @@ -573,14 +587,19 @@ public class SpecialHeadersTest implements HttpServerAdapters { https2TestServer.addHandler(handler, "/https2"); https2URI = "https://" + https2TestServer.serverAuthority() + "/https2"; + http3TestServer = HttpTestServer.create(HTTP_3_URI_ONLY, sslContext); + http3TestServer.addHandler(handler, "/http3"); + https3URI = "https://" + http3TestServer.serverAuthority() + "/http3"; + httpTestServer.start(); httpsTestServer.start(); http2TestServer.start(); https2TestServer.start(); + http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { out.println("\n--- Teardown " + now()); HttpClient shared = sharedClient; String sharedClientName = @@ -595,6 +614,7 @@ public class SpecialHeadersTest implements HttpServerAdapters { httpsTestServer.stop(); http2TestServer.stop(); https2TestServer.stop(); + http3TestServer.start(); executor.shutdown(); } finally { if (fail != null) { diff --git a/test/jdk/java/net/httpclient/StreamCloseTest.java b/test/jdk/java/net/httpclient/StreamCloseTest.java index fcb00188581..7b228e69de2 100644 --- a/test/jdk/java/net/httpclient/StreamCloseTest.java +++ b/test/jdk/java/net/httpclient/StreamCloseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, NTT DATA. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +30,7 @@ * @library /test/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.http2.Http2TestServer - * @run testng/othervm StreamCloseTest + * @run junit/othervm StreamCloseTest */ import java.io.InputStream; @@ -44,10 +44,10 @@ import java.net.http.HttpResponse.BodyHandlers; import java.net.URI; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; -import org.testng.Assert; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class StreamCloseTest { @@ -82,8 +82,8 @@ public class StreamCloseTest { private static HttpServerAdapters.HttpTestServer httpTestServer; - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpServerAdapters.HttpTestServer.create(Version.HTTP_1_1); httpTestServer.addHandler(new HttpServerAdapters.HttpTestEchoHandler(), "/"); URI uri = URI.create("http://" + httpTestServer.serverAuthority() + "/"); @@ -96,8 +96,8 @@ public class StreamCloseTest { requestBuilder = HttpRequest.newBuilder(uri); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); } @@ -108,7 +108,7 @@ public class StreamCloseTest { .POST(BodyPublishers.ofInputStream(() -> in)) .build(); client.send(request, BodyHandlers.discarding()); - Assert.assertTrue(in.closeCalled, "InputStream was not closed!"); + Assertions.assertTrue(in.closeCalled, "InputStream was not closed!"); } @Test @@ -120,9 +120,9 @@ public class StreamCloseTest { try { client.send(request, BodyHandlers.discarding()); } catch (IOException e) { // expected - Assert.assertTrue(in.closeCalled, "InputStream was not closed!"); + Assertions.assertTrue(in.closeCalled, "InputStream was not closed!"); return; } - Assert.fail("IOException should be occurred!"); + Assertions.fail("IOException should be occurred!"); } } diff --git a/test/jdk/java/net/httpclient/StreamingBody.java b/test/jdk/java/net/httpclient/StreamingBody.java index 3fb4f29208e..d0577596038 100644 --- a/test/jdk/java/net/httpclient/StreamingBody.java +++ b/test/jdk/java/net/httpclient/StreamingBody.java @@ -72,20 +72,19 @@ import org.junit.jupiter.api.extension.TestWatcher; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class StreamingBody implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; static final AtomicLong clientCount = new AtomicLong(); static final AtomicLong serverCount = new AtomicLong(); @@ -186,7 +185,7 @@ public class StreamingBody implements HttpServerAdapters { static final String MESSAGE = "StreamingBody message body"; static final int ITERATIONS = 100; - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { http3URI, }, { httpURI, }, @@ -253,7 +252,7 @@ public class StreamingBody implements HttpServerAdapters { // -- Infrastructure @BeforeAll - public void setup() throws Exception { + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new MessageHandler(), "/http1/streamingbody/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/streamingbody/w"; @@ -290,7 +289,7 @@ public class StreamingBody implements HttpServerAdapters { } @AfterAll - public void teardown() throws Exception { + public static void teardown() throws Exception { try { httpTestServer.stop(); httpsTestServer.stop(); @@ -303,7 +302,7 @@ public class StreamingBody implements HttpServerAdapters { } } - static final void printFailedTests() { + static void printFailedTests() { out.println("\n========================="); try { out.printf("%n%sCreated %s servers and %s clients%n", diff --git a/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java b/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java index bf0f7c0bda7..93f55d066e9 100644 --- a/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java +++ b/test/jdk/java/net/httpclient/SubscriberAPIExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -36,26 +36,26 @@ import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.BodySubscribers; import java.util.function.Function; -import org.testng.annotations.Test; import static java.nio.file.StandardOpenOption.CREATE; import static java.nio.file.StandardOpenOption.DELETE_ON_CLOSE; import static java.nio.file.StandardOpenOption.WRITE; import static java.nio.file.StandardOpenOption.READ; -import static org.testng.Assert.assertThrows; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Test; /* * @test * @summary Basic tests for API specified exceptions from Handler, * and Subscriber convenience static factory methods. - * @run testng SubscriberAPIExceptions + * @run junit SubscriberAPIExceptions */ public class SubscriberAPIExceptions { static final Class NPE = NullPointerException.class; static final Class IAE = IllegalArgumentException.class; - static final Class IOB = IndexOutOfBoundsException.class; @Test public void handlerAPIExceptions() throws Exception { diff --git a/test/jdk/java/net/httpclient/TestKitTest.java b/test/jdk/java/net/httpclient/TestKitTest.java index 25f39d90305..2aba794426f 100644 --- a/test/jdk/java/net/httpclient/TestKitTest.java +++ b/test/jdk/java/net/httpclient/TestKitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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,7 +21,6 @@ * questions. */ -import org.testng.annotations.Test; import java.io.IOException; import java.util.ArrayList; @@ -33,15 +32,16 @@ import java.util.LinkedList; import java.util.Map; import java.util.Set; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; /* * @test * @compile TestKit.java - * @run testng TestKitTest + * @run junit TestKitTest */ public final class TestKitTest { @@ -50,15 +50,14 @@ public final class TestKitTest { Integer integer = TestKit.assertNotThrows( () -> TestKit.assertNotThrows(() -> 1) ); - assertEquals(integer, Integer.valueOf(1)); + assertEquals(Integer.valueOf(1), integer); RuntimeException re = TestKit.assertThrows( RuntimeException.class, () -> TestKit.assertNotThrows(() -> { throw new IOException(); }) ); - assertEquals(re.getMessage(), - "Expected to run normally, but threw " - + "java.io.IOException"); + assertEquals("Expected to run normally, but threw " + + "java.io.IOException", re.getMessage()); TestKit.assertNotThrows( () -> TestKit.assertNotThrows(() -> { }) @@ -68,9 +67,8 @@ public final class TestKitTest { RuntimeException.class, () -> TestKit.assertNotThrows((TestKit.ThrowingProcedure) () -> { throw new IOException(); }) ); - assertEquals(re.getMessage(), - "Expected to run normally, but threw " - + "java.io.IOException"); + assertEquals("Expected to run normally, but threw " + + "java.io.IOException", re.getMessage()); } @Test @@ -87,13 +85,13 @@ public final class TestKitTest { () -> TestKit.assertThrows(IOException.class, null) ); assertNotNull(npe); - assertEquals(npe.getMessage(), "code"); + assertEquals("code", npe.getMessage()); npe = TestKit.assertThrows( NullPointerException.class, () -> TestKit.assertThrows(null, () -> { }) ); - assertEquals(npe.getMessage(), "clazz"); + assertEquals("clazz", npe.getMessage()); npe = TestKit.assertThrows( NullPointerException.class, @@ -101,16 +99,15 @@ public final class TestKitTest { ); assertNotNull(npe); assertNull(npe.getMessage()); - assertEquals(npe.getClass(), NullPointerException.class); + assertEquals(NullPointerException.class, npe.getClass()); RuntimeException re = TestKit.assertThrows( RuntimeException.class, () -> TestKit.assertThrows(NullPointerException.class, () -> { }) ); - assertEquals(re.getClass(), RuntimeException.class); - assertEquals(re.getMessage(), - "Expected to catch an exception of type " - + "java.lang.NullPointerException, but caught nothing"); + assertEquals(RuntimeException.class, re.getClass()); + assertEquals("Expected to catch an exception of type " + + "java.lang.NullPointerException, but caught nothing", re.getMessage()); re = TestKit.assertThrows( RuntimeException.class, @@ -118,7 +115,7 @@ public final class TestKitTest { ); assertNotNull(re); assertNull(re.getMessage()); - assertEquals(re.getClass(), NullPointerException.class); + assertEquals(NullPointerException.class, re.getClass()); re = TestKit.assertThrows( RuntimeException.class, @@ -127,10 +124,9 @@ public final class TestKitTest { () -> { throw new IndexOutOfBoundsException(); } )); assertNotNull(re); - assertEquals(re.getClass(), RuntimeException.class); - assertEquals(re.getMessage(), - "Expected to catch an exception of type java.util.IllegalFormatException" - + ", but caught java.lang.IndexOutOfBoundsException"); + assertEquals(RuntimeException.class, re.getClass()); + assertEquals("Expected to catch an exception of type java.util.IllegalFormatException" + + ", but caught java.lang.IndexOutOfBoundsException", re.getMessage()); } @Test diff --git a/test/jdk/java/net/httpclient/TlsContextTest.java b/test/jdk/java/net/httpclient/TlsContextTest.java index 8a5cc99aad3..95cb501d24c 100644 --- a/test/jdk/java/net/httpclient/TlsContextTest.java +++ b/test/jdk/java/net/httpclient/TlsContextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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 @@ -36,19 +36,22 @@ import javax.net.ssl.SSLParameters; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version; import static java.net.http.HttpClient.Version.HTTP_1_1; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpResponse.BodyHandlers.ofString; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; + import jdk.test.lib.security.SecurityUtils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + /* * @test * @bug 8239594 8371887 @@ -56,7 +59,7 @@ import jdk.test.lib.security.SecurityUtils; * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.test.lib.net.SimpleSSLContext TlsContextTest * jdk.httpclient.test.lib.common.HttpServerAdapters - * @run testng/othervm -Dtest.requiresHost=true + * @run junit/othervm -Dtest.requiresHost=true * -Djdk.httpclient.HttpClient.log=headers * -Djdk.internal.httpclient.disableHostnameVerification * -Djdk.internal.httpclient.debug=false @@ -67,11 +70,11 @@ public class TlsContextTest implements HttpServerAdapters { static HttpTestServer https2Server; static String https2URI; - SSLContext server; + static SSLContext server; final static Integer ITERATIONS = 3; - @BeforeTest - public void setUp() throws Exception { + @BeforeAll + public static void setUp() throws Exception { // Re-enable TLSv1 and TLSv1.1 since test depends on them SecurityUtils.removeFromDisabledTlsAlgs("TLSv1", "TLSv1.1"); @@ -86,8 +89,7 @@ public class TlsContextTest implements HttpServerAdapters { https2URI = "https://" + https2Server.serverAuthority() + "/server/"; } - @DataProvider(name = "scenarios") - public Object[][] scenarios() throws Exception { + public static Object[][] scenarios() throws Exception { return new Object[][]{ { SimpleSSLContext.findSSLContext("TLS"), HTTP_2, "TLSv1.3" }, { SimpleSSLContext.findSSLContext("TLSv1.2"), HTTP_2, "TLSv1.2" }, @@ -102,7 +104,8 @@ public class TlsContextTest implements HttpServerAdapters { /** * Tests various scenarios between client and server tls handshake with valid http */ - @Test(dataProvider = "scenarios") + @ParameterizedTest + @MethodSource("scenarios") public void testVersionProtocolsNoParams(SSLContext context, Version version, String expectedProtocol) throws Exception { @@ -113,7 +116,8 @@ public class TlsContextTest implements HttpServerAdapters { * Tests various scenarios between client and server tls handshake with valid http, * but with empty SSLParameters */ - @Test(dataProvider = "scenarios") + @ParameterizedTest + @MethodSource("scenarios") public void testVersionProtocolsEmptyParams(SSLContext context, Version version, String expectedProtocol) throws Exception { @@ -150,24 +154,24 @@ public class TlsContextTest implements HttpServerAdapters { private void testAllProtocols(HttpResponse response, String expectedProtocol, - Version clientVersion) throws Exception { + Version clientVersion) { String protocol = response.sslSession().get().getProtocol(); int statusCode = response.statusCode(); Version version = response.version(); out.println("Got Body " + response.body()); out.println("The protocol negotiated is :" + protocol); - assertEquals(statusCode, 200); - assertEquals(protocol, expectedProtocol); + assertEquals(200, statusCode); + assertEquals(expectedProtocol, protocol); if (clientVersion == HTTP_3) { - assertEquals(version, expectedProtocol.equals("TLSv1.1") ? HTTP_1_1 : - expectedProtocol.equals("TLSv1.2") ? HTTP_2 : HTTP_3); + assertEquals(expectedProtocol.equals("TLSv1.1") ? HTTP_1_1 : + expectedProtocol.equals("TLSv1.2") ? HTTP_2 : HTTP_3, version); } else { - assertEquals(version, expectedProtocol.equals("TLSv1.1") ? HTTP_1_1 : HTTP_2); + assertEquals(expectedProtocol.equals("TLSv1.1") ? HTTP_1_1 : HTTP_2, version); } } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { https2Server.stop(); } diff --git a/test/jdk/java/net/httpclient/UnauthorizedTest.java b/test/jdk/java/net/httpclient/UnauthorizedTest.java index 628130f9ffc..1c72bac6cc9 100644 --- a/test/jdk/java/net/httpclient/UnauthorizedTest.java +++ b/test/jdk/java/net/httpclient/UnauthorizedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,16 +32,12 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.net.SimpleSSLContext ReferenceTracker - * @run testng/othervm + * @run junit/othervm * -Djdk.httpclient.HttpClient.log=headers * UnauthorizedTest */ import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -65,24 +61,29 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class UnauthorizedTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; - HttpClient authClient; - HttpClient noAuthClient; + private static HttpTestServer httpTestServer; // HTTP/1.1 + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; + private static HttpClient authClient; + private static HttpClient noAuthClient; static final int ITERATIONS = 3; @@ -100,8 +101,7 @@ public class UnauthorizedTest implements HttpServerAdapters { return new WeakReference<>(client); } - @DataProvider(name = "all") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { http3URI + "/server", UNAUTHORIZED, true, ref(authClient)}, { http3URI + "/server", UNAUTHORIZED, false, ref(authClient)}, @@ -144,8 +144,6 @@ public class UnauthorizedTest implements HttpServerAdapters { }; } - static final AtomicLong requestCounter = new AtomicLong(); - static final Authenticator authenticator = new Authenticator() { }; @@ -158,7 +156,8 @@ public class UnauthorizedTest implements HttpServerAdapters { return builder; } - @Test(dataProvider = "all") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, int code, boolean async, WeakReference clientRef) throws Throwable { HttpClient client = clientRef.get(); out.printf("%n---- starting (%s, %d, %s, %s) ----%n", @@ -195,9 +194,8 @@ public class UnauthorizedTest implements HttpServerAdapters { } out.println(" Got response: " + response); - assertEquals(response.statusCode(), code); - assertEquals(response.body(), - (code == UNAUTHORIZED ? "WWW-" : "Proxy-") + MESSAGE); + assertEquals(code, response.statusCode()); + assertEquals( (code == UNAUTHORIZED ? "WWW-" : "Proxy-") + MESSAGE, response.body()); if (shouldThrow) { throw new RuntimeException("Expected IOException not thrown."); } @@ -205,8 +203,8 @@ public class UnauthorizedTest implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new UnauthorizedHandler(), "/http1/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1"; @@ -225,13 +223,13 @@ public class UnauthorizedTest implements HttpServerAdapters { http3TestServer.addHandler(new UnauthorizedHandler(), "/http3/"); http3URI = "https://" + http3TestServer.serverAuthority() + "/http3"; - authClient = newClientBuilderForH3() + authClient = HttpServerAdapters.createClientBuilderForH3() .proxy(HttpClient.Builder.NO_PROXY) .sslContext(sslContext) .authenticator(authenticator) .build(); - noAuthClient = newClientBuilderForH3() + noAuthClient = HttpServerAdapters.createClientBuilderForH3() .proxy(HttpClient.Builder.NO_PROXY) .sslContext(sslContext) .build(); @@ -243,8 +241,8 @@ public class UnauthorizedTest implements HttpServerAdapters { http3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { // authClient.close(); // noAuthClient.close(); var TRACKER = ReferenceTracker.INSTANCE; diff --git a/test/jdk/java/net/httpclient/UserCookieTest.java b/test/jdk/java/net/httpclient/UserCookieTest.java index 3d202914050..f49f44c157c 100644 --- a/test/jdk/java/net/httpclient/UserCookieTest.java +++ b/test/jdk/java/net/httpclient/UserCookieTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,7 +28,7 @@ * server-cookies for HTTP/2 vs HTTP/1.1 * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.common.HttpServerAdapters jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm + * @run junit/othervm * -Djdk.tls.acknowledgeCloseNotify=true * -Djdk.httpclient.HttpClient.log=trace,headers,requests * UserCookieTest @@ -68,10 +68,6 @@ import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_1_1; @@ -80,25 +76,30 @@ import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; public class UserCookieTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer httpTestServer; // HTTP/1.1 [ 7 servers ] - HttpTestServer httpsTestServer; // HTTPS/1.1 - HttpTestServer http2TestServer; // HTTP/2 ( h2c ) - HttpTestServer https2TestServer; // HTTP/2 ( h2 ) - HttpTestServer http3TestServer; // HTTP/3 ( h3 ) - DummyServer httpDummyServer; - DummyServer httpsDummyServer; - String httpURI; - String httpsURI; - String http2URI; - String https2URI; - String http3URI; - String httpDummy; - String httpsDummy; + private static HttpTestServer httpTestServer; // HTTP/1.1 [ 7 servers ] + private static HttpTestServer httpsTestServer; // HTTPS/1.1 + private static HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + private static HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + private static HttpTestServer http3TestServer; // HTTP/3 ( h3 ) + private static DummyServer httpDummyServer; + private static DummyServer httpsDummyServer; + private static String httpURI; + private static String httpsURI; + private static String http2URI; + private static String https2URI; + private static String http3URI; + private static String httpDummy; + private static String httpsDummy; static final String MESSAGE = "Basic CookieHeaderTest message body"; static final int ITERATIONS = 3; @@ -111,8 +112,7 @@ public class UserCookieTest implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - @DataProvider(name = "positive") - public Object[][] positive() { + public static Object[][] positive() { return new Object[][] { { http3URI, HTTP_3 }, { httpURI, HTTP_1_1 }, @@ -130,7 +130,8 @@ public class UserCookieTest implements HttpServerAdapters { static final AtomicLong requestCounter = new AtomicLong(); - @Test(dataProvider = "positive") + @ParameterizedTest + @MethodSource("positive") void test(String uriString, HttpClient.Version version) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); ConcurrentHashMap> cookieHeaders @@ -178,12 +179,13 @@ public class UserCookieTest implements HttpServerAdapters { out.println(" Got response: " + response); out.println(" Got body Path: " + response.body()); - assertEquals(response.statusCode(), 200); - assertEquals(response.body(), MESSAGE); - assertEquals(response.headers().allValues("X-Request-Cookie"), - expectedCookies.stream() - .filter(s -> !s.startsWith("LOC")) - .toList()); + assertEquals(200, response.statusCode()); + assertEquals(MESSAGE, response.body()); + List expectedCookieList = expectedCookies.stream() + .filter(s -> !s.startsWith("LOC")).toList(); + List actualCookieList = response.headers() + .allValues("X-Request-Cookie"); + assertEquals(expectedCookieList, actualCookieList); requestBuilder = HttpRequest.newBuilder(uri) .header("X-uuid", "uuid-" + requestCounter.incrementAndGet()) .header("Cookie", userCookie); @@ -200,8 +202,8 @@ public class UserCookieTest implements HttpServerAdapters { // -- Infrastructure - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { httpTestServer = HttpTestServer.create(HTTP_1_1); httpTestServer.addHandler(new CookieValidationHandler(), "/http1/cookie/"); httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/cookie/retry"; @@ -236,8 +238,8 @@ public class UserCookieTest implements HttpServerAdapters { httpsDummyServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { httpTestServer.stop(); httpsTestServer.stop(); http2TestServer.stop(); @@ -575,6 +577,5 @@ public class UserCookieTest implements HttpServerAdapters { return new DummyServer(ss, true); } - } } diff --git a/test/jdk/java/net/httpclient/http2/BasicTest.java b/test/jdk/java/net/httpclient/http2/BasicTest.java index 58ab191fc6f..ddcf707e875 100644 --- a/test/jdk/java/net/httpclient/http2/BasicTest.java +++ b/test/jdk/java/net/httpclient/http2/BasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,8 +27,6 @@ * @library /test/jdk/java/net/httpclient/lib * /test/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer - * jdk.httpclient.test.lib.http2.Http2TestExchange - * jdk.httpclient.test.lib.http2.Http2EchoHandler * jdk.test.lib.Asserts * jdk.test.lib.Utils * jdk.test.lib.net.SimpleSSLContext @@ -49,9 +47,9 @@ import java.util.concurrent.*; import java.util.Collections; import java.util.LinkedList; import java.util.List; + +import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; -import jdk.httpclient.test.lib.http2.Http2TestExchange; -import jdk.httpclient.test.lib.http2.Http2EchoHandler; import jdk.test.lib.net.SimpleSSLContext; import org.junit.jupiter.api.Test; @@ -60,13 +58,13 @@ import static jdk.test.lib.Asserts.assertFileContentsEqual; import static jdk.test.lib.Utils.createTempFile; import static jdk.test.lib.Utils.createTempFileOfSize; -public class BasicTest { +public class BasicTest implements HttpServerAdapters { private static final String TEMP_FILE_PREFIX = HttpClient.class.getPackageName() + '-' + BasicTest.class.getSimpleName() + '-'; static int httpPort, httpsPort; - static Http2TestServer httpServer, httpsServer; + static HttpTestServer httpServer, httpsServer; static HttpClient client = null; static ExecutorService clientExec; static ExecutorService serverExec; @@ -77,18 +75,20 @@ public class BasicTest { static void initialize() throws Exception { try { client = getClient(); - httpServer = new Http2TestServer(false, 0, serverExec, sslContext); - httpServer.addHandler(new Http2EchoHandler(), "/"); + httpServer = HttpTestServer.of( + new Http2TestServer(false, 0, serverExec, sslContext)); + httpServer.addHandler(new HttpTestFileEchoHandler(), "/"); httpServer.addHandler(new EchoWithPingHandler(), "/ping"); httpPort = httpServer.getAddress().getPort(); - httpsServer = new Http2TestServer(true, 0, serverExec, sslContext); - httpsServer.addHandler(new Http2EchoHandler(), "/"); + httpsServer = HttpTestServer.of( + new Http2TestServer(true, 0, serverExec, sslContext)); + httpsServer.addHandler(new HttpTestFileEchoHandler(), "/"); httpsPort = httpsServer.getAddress().getPort(); - httpURIString = "http://localhost:" + httpPort + "/foo/"; - pingURIString = "http://localhost:" + httpPort + "/ping/"; - httpsURIString = "https://localhost:" + httpsPort + "/bar/"; + httpURIString = "http://" + httpServer.serverAuthority() + "/foo/"; + pingURIString = "http://" + httpServer.serverAuthority() + "/ping/"; + httpsURIString = "https://" + httpsServer.serverAuthority() + "/bar/"; httpServer.start(); httpsServer.start(); @@ -104,11 +104,11 @@ public class BasicTest { static CompletableFuture currentCF; - static class EchoWithPingHandler extends Http2EchoHandler { + static class EchoWithPingHandler extends HttpTestFileEchoHandler { private final Object lock = new Object(); @Override - public void handle(Http2TestExchange exchange) throws IOException { + public void handle(HttpTestExchange exchange) throws IOException { // for now only one ping active at a time. don't want to saturate synchronized(lock) { CompletableFuture cf = currentCF; @@ -221,17 +221,17 @@ public class BasicTest { } static void paramsTest() throws Exception { - httpsServer.addHandler((t -> { + httpsServer.addHandler(((HttpTestExchange t) -> { SSLSession s = t.getSSLSession(); String prot = s.getProtocol(); if (prot.equals("TLSv1.2") || prot.equals("TLSv1.3")) { - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, HttpTestExchange.RSPBODY_EMPTY); } else { System.err.printf("Protocols =%s\n", prot); - t.sendResponseHeaders(500, -1); + t.sendResponseHeaders(500, HttpTestExchange.RSPBODY_EMPTY); } }), "/"); - URI u = new URI("https://localhost:"+httpsPort+"/foo"); + URI u = new URI("https://" + httpsServer.serverAuthority() + "/foo"); HttpClient client = getClient(); HttpRequest req = HttpRequest.newBuilder(u).build(); HttpResponse resp = client.send(req, BodyHandlers.ofString()); diff --git a/test/jdk/java/net/httpclient/http2/ErrorTest.java b/test/jdk/java/net/httpclient/http2/ErrorTest.java index 6ecc27441e1..6b36529b38f 100644 --- a/test/jdk/java/net/httpclient/http2/ErrorTest.java +++ b/test/jdk/java/net/httpclient/http2/ErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -60,8 +60,9 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; import java.util.concurrent.Executors; import java.util.concurrent.ExecutorService; + +import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; -import jdk.httpclient.test.lib.http2.Http2EchoHandler; import jdk.test.lib.net.SimpleSSLContext; import static java.net.http.HttpClient.Version.HTTP_2; @@ -73,7 +74,7 @@ import org.testng.annotations.Test; * But, the exception that was thrown was not being returned up to application * causing hang problems */ -public class ErrorTest { +public class ErrorTest implements HttpServerAdapters { static final String[] CIPHER_SUITES = new String[]{ "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" }; @@ -91,16 +92,17 @@ public class ErrorTest { .version(HTTP_2) .build(); - Http2TestServer httpsServer = null; + HttpTestServer httpsServer = null; try { SSLContext serverContext = SimpleSSLContext.findSSLContext(); SSLParameters p = serverContext.getSupportedSSLParameters(); p.setApplicationProtocols(new String[]{"h2"}); - httpsServer = new Http2TestServer(true, + Http2TestServer httpsServerImpl = new Http2TestServer(true, 0, exec, serverContext); - httpsServer.addHandler(new Http2EchoHandler(), "/"); + httpsServer = HttpTestServer.of(httpsServerImpl); + httpsServer.addHandler(new HttpTestFileEchoHandler(), "/"); int httpsPort = httpsServer.getAddress().getPort(); String httpsURIString = "https://localhost:" + httpsPort + "/bar/"; diff --git a/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java index 0f807c33dff..2378b0b6982 100644 --- a/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java +++ b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 +27,6 @@ * @library /test/jdk/java/net/httpclient/lib * /test/lib * @build jdk.httpclient.test.lib.http2.Http2TestServer - * jdk.httpclient.test.lib.http2.Http2EchoHandler * jdk.test.lib.Asserts * jdk.test.lib.Utils * jdk.test.lib.net.SimpleSSLContext @@ -41,8 +40,10 @@ import java.net.http.HttpResponse.BodyHandlers; import javax.net.ssl.*; import java.nio.file.*; import java.util.concurrent.*; + +import jdk.httpclient.test.lib.common.HttpServerAdapters; +import jdk.httpclient.test.lib.http2.Http2TestExchange; import jdk.httpclient.test.lib.http2.Http2TestServer; -import jdk.httpclient.test.lib.http2.Http2EchoHandler; import jdk.test.lib.net.SimpleSSLContext; import static java.net.http.HttpClient.Version.HTTP_2; @@ -52,14 +53,13 @@ import static jdk.test.lib.Utils.createTempFileOfSize; import org.testng.annotations.Test; -@Test -public class FixedThreadPoolTest { +public class FixedThreadPoolTest implements HttpServerAdapters { private static final String TEMP_FILE_PREFIX = HttpClient.class.getPackageName() + '-' + FixedThreadPoolTest.class.getSimpleName() + '-'; static int httpPort, httpsPort; - static Http2TestServer httpServer, httpsServer; + static HttpTestServer httpServer, httpsServer; static HttpClient client = null; static ExecutorService exec; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); @@ -69,16 +69,18 @@ public class FixedThreadPoolTest { static void initialize() throws Exception { try { client = getClient(); - httpServer = new Http2TestServer(false, 0, exec, sslContext); - httpServer.addHandler(new Http2EchoHandler(), "/"); + httpServer = HttpTestServer.of( + new Http2TestServer(false, 0, exec, sslContext)); + httpServer.addHandler(new HttpTestFileEchoHandler(), "/"); httpPort = httpServer.getAddress().getPort(); - httpsServer = new Http2TestServer(true, 0, exec, sslContext); - httpsServer.addHandler(new Http2EchoHandler(), "/"); + httpsServer = HttpTestServer.of( + new Http2TestServer(true, 0, exec, sslContext)); + httpsServer.addHandler(new HttpTestFileEchoHandler(), "/"); httpsPort = httpsServer.getAddress().getPort(); - httpURIString = "http://localhost:" + httpPort + "/foo/"; - httpsURIString = "https://localhost:" + httpsPort + "/bar/"; + httpURIString = "http://" + httpServer.serverAuthority() + "/foo/"; + httpsURIString = "https://" + httpsServer.serverAuthority() + "/bar/"; httpServer.start(); httpsServer.start(); @@ -193,7 +195,7 @@ public class FixedThreadPoolTest { static void paramsTest() throws Exception { System.err.println("paramsTest"); Http2TestServer server = new Http2TestServer(true, 0, exec, sslContext); - server.addHandler((t -> { + server.addHandler(((Http2TestExchange t) -> { SSLSession s = t.getSSLSession(); String prot = s.getProtocol(); if (prot.equals(expectedTLSVersion(sslContext))) { diff --git a/test/jdk/java/net/httpclient/http2/RedirectTest.java b/test/jdk/java/net/httpclient/http2/RedirectTest.java index 1d7b894bc40..e2acd807bd5 100644 --- a/test/jdk/java/net/httpclient/http2/RedirectTest.java +++ b/test/jdk/java/net/httpclient/http2/RedirectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,7 +27,6 @@ * @library /test/lib /test/jdk/java/net/httpclient/lib * @build jdk.httpclient.test.lib.http2.Http2TestExchange * jdk.httpclient.test.lib.http2.Http2TestServer - * jdk.httpclient.test.lib.http2.Http2EchoHandler * jdk.httpclient.test.lib.http2.Http2RedirectHandler * jdk.test.lib.Asserts * jdk.test.lib.net.SimpleSSLContext @@ -48,16 +47,17 @@ import java.util.concurrent.*; import java.util.function.*; import java.util.Arrays; import java.util.Iterator; + +import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; import jdk.httpclient.test.lib.http2.Http2TestExchange; -import jdk.httpclient.test.lib.http2.Http2EchoHandler; import jdk.httpclient.test.lib.http2.Http2RedirectHandler; import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_2; -public class RedirectTest { +public class RedirectTest implements HttpServerAdapters { static int httpPort; - static Http2TestServer httpServer; + static HttpTestServer httpServer; static HttpClient client; static String httpURIString, altURIString1, altURIString2; @@ -105,23 +105,26 @@ public class RedirectTest { static void initialize() throws Exception { try { client = getClient(); - httpServer = new Http2TestServer(false, 0, null, null); + Http2TestServer http2ServerImpl = + new Http2TestServer(false, 0, null, null); + httpServer = HttpTestServer.of(http2ServerImpl); httpPort = httpServer.getAddress().getPort(); // urls are accessed in sequence below. The first two are on // different servers. Third on same server as second. So, the // client should use the same http connection. - httpURIString = "http://localhost:" + httpPort + "/foo/"; + httpURIString = "http://" + httpServer.serverAuthority() + "/foo/"; httpURI = URI.create(httpURIString); - altURIString1 = "http://localhost:" + httpPort + "/redir"; + altURIString1 = "http://" + httpServer.serverAuthority() + "/redir"; altURI1 = URI.create(altURIString1); - altURIString2 = "http://localhost:" + httpPort + "/redir_again"; + altURIString2 = "http://" + httpServer.serverAuthority() + "/redir_again"; altURI2 = URI.create(altURIString2); + // TODO: remove dependency on Http2RedirectHandler Redirector r = new Redirector(sup(altURIString1, altURIString2)); - httpServer.addHandler(r, "/foo"); - httpServer.addHandler(r, "/redir"); - httpServer.addHandler(new Http2EchoHandler(), "/redir_again"); + http2ServerImpl.addHandler(r, "/foo"); + http2ServerImpl.addHandler(r, "/redir"); + httpServer.addHandler(new HttpTestFileEchoHandler(), "/redir_again"); httpServer.start(); } catch (Throwable e) { diff --git a/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java b/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java index 17fc33f3aa5..800a02eb2c4 100644 --- a/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java +++ b/test/jdk/java/net/httpclient/http3/GetHTTP3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,30 +44,31 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLContext; import jdk.test.lib.Utils; import jdk.test.lib.net.SimpleSSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; -import org.testng.ITestContext; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.ANY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.*; - +import static org.junit.jupiter.api.Assertions.*; import static java.lang.System.out; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -76,7 +77,7 @@ import static java.lang.System.out; * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.Utils * @compile ../ReferenceTracker.java - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * GetHTTP3Test * @summary Basic HTTP/3 GET test @@ -92,8 +93,8 @@ public class GetHTTP3Test implements HttpServerAdapters { """; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer h3TestServer; // HTTP/2 ( h2 + h3) - String h3URI; + private static HttpTestServer h3TestServer; // HTTP/2 ( h2 + h3) + private static String h3URI; static final int ITERATION_COUNT = 4; // a shared executor helps reduce the amount of threads created by the test @@ -111,10 +112,10 @@ public class GetHTTP3Test implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - final Set sharedClientHasH3 = ConcurrentHashMap.newKeySet(); - private volatile HttpClient sharedClient; - private boolean directQuicConnectionSupported; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final Set sharedClientHasH3 = ConcurrentHashMap.newKeySet(); + private static volatile HttpClient sharedClient; + private static boolean directQuicConnectionSupported; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -140,21 +141,38 @@ public class GetHTTP3Test implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - var x = new SkipException("Skipping: some test failed"); - x.setStackTrace(new StackTraceElement[0]); - throw x; + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); } } - @AfterClass - final void printFailedTests() { + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll + static void printFailedTests() { out.println("\n========================="); try { out.printf("%n%sCreated %d servers and %d clients%n", @@ -174,24 +192,20 @@ public class GetHTTP3Test implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { h3URI, }; } - @DataProvider(name = "variants") - public Object[][] variants(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2 * 2 * 2][]; int i = 0; for (var version : List.of(Optional.empty(), Optional.of(HTTP_3))) { for (Version firstRequestVersion : List.of(HTTP_2, HTTP_3)) { for (boolean sameClient : List.of(false, true)) { - for (String uri : uris()) { + for (String uri : uris) { result[i++] = new Object[]{uri, firstRequestVersion, sameClient, version}; } } @@ -201,15 +215,6 @@ public class GetHTTP3Test implements HttpServerAdapters { return result; } - @DataProvider(name = "uris") - public Object[][] uris(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } - Object[][] result = {{h3URI}}; - return result; - } - private HttpClient makeNewClient() { clientCount.incrementAndGet(); HttpClient client = newClientBuilderForH3() @@ -235,7 +240,8 @@ public class GetHTTP3Test implements HttpServerAdapters { } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsync(String uri, Version firstRequestVersion, boolean sameClient, Optional version) throws Exception { System.out.println("Request to " + uri +"/Async/*" + ", firstRequestVersion=" + firstRequestVersion + @@ -263,17 +269,17 @@ public class GetHTTP3Test implements HttpServerAdapters { } HttpResponse response1 = client.send(headBuilder.build(), BodyHandlers.ofString()); - assertEquals(response1.statusCode(), 200, "Unexpected first response code"); - assertEquals(response1.body(), "", "Unexpected first response body"); + assertEquals(200, response1.statusCode(), "Unexpected first response code"); + assertEquals("", response1.body(), "Unexpected first response body"); boolean expectH3 = sameClient && sharedClientHasH3.contains(headURI.getRawAuthority()); if (firstRequestVersion == HTTP_3) { if (expectH3) { out.println("Expecting HEAD response over HTTP_3"); - assertEquals(response1.version(), HTTP_3, "Unexpected first response version"); + assertEquals(HTTP_3, response1.version(), "Unexpected first response version"); } } else { out.println("Expecting HEAD response over HTTP_2"); - assertEquals(response1.version(), HTTP_2, "Unexpected first response version"); + assertEquals(HTTP_2, response1.version(), "Unexpected first response version"); } out.println("HEAD response version: " + response1.version()); if (response1.version() == HTTP_2) { @@ -329,10 +335,10 @@ public class GetHTTP3Test implements HttpServerAdapters { out.println("Checking response: " + u); var response = e.getValue().get(); out.println("Response is: " + response + ", [version: " + response.version() + "]"); - assertEquals(response.statusCode(), 200,"status for " + u); - assertEquals(response.body(), BODY,"body for " + u); + assertEquals(200, response.statusCode(), "status for " + u); + assertEquals(BODY, response.body(), "body for " + u); if (expectH3) { - assertEquals(response.version(), HTTP_3, "version for " + u); + assertEquals(HTTP_3, response.version(), "version for " + u); } if (response.version() == HTTP_3) { h3Count++; @@ -354,7 +360,8 @@ public class GetHTTP3Test implements HttpServerAdapters { System.out.println("test: DONE"); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("uris") public void testSync(String h3URI) throws Exception { HttpClient client = makeNewClient(); Builder builder = HttpRequest.newBuilder(URI.create(h3URI + "/Sync/GET/1")) @@ -374,22 +381,22 @@ public class GetHTTP3Test implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #1: " + response); out.println("Version #1: " + response.version()); - assertEquals(response.statusCode(), 200, "first response status"); + assertEquals(200, response.statusCode(), "first response status"); if (directQuicConnectionSupported) { // TODO unreliable assertion //assertEquals(response.version(), HTTP_3, "Unexpected first response version"); } else { - assertEquals(response.version(), HTTP_2, "Unexpected first response version"); + assertEquals(HTTP_2, response.version(), "Unexpected first response version"); } - assertEquals(response.body(), BODY, "first response body"); + assertEquals(BODY, response.body(), "first response body"); request = builder.uri(URI.create(h3URI + "/Sync/GET/2")).build(); response = client.send(request, BodyHandlers.ofString()); out.println("Response #2: " + response); out.println("Version #2: " + response.version()); - assertEquals(response.statusCode(), 200, "second response status"); - assertEquals(response.version(), HTTP_3, "second response version"); - assertEquals(response.body(), BODY, "second response body"); + assertEquals(200, response.statusCode(), "second response status"); + assertEquals(HTTP_3, response.version(), "second response version"); + assertEquals(BODY, response.body(), "second response body"); var tracker = TRACKER.getTracker(client); client = null; @@ -398,8 +405,8 @@ public class GetHTTP3Test implements HttpServerAdapters { if (error != null) throw error; } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { final Http2TestServer h2WithAltService = new Http2TestServer("localhost", true, sslContext).enableH3AltServiceOnSamePort(); h3TestServer = HttpTestServer.of(h2WithAltService); @@ -410,8 +417,8 @@ public class GetHTTP3Test implements HttpServerAdapters { directQuicConnectionSupported = h2WithAltService.supportsH3DirectConnection(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { System.err.println("======================================================="); System.err.println(" Tearing down test"); System.err.println("======================================================="); @@ -453,7 +460,7 @@ public class GetHTTP3Test implements HttpServerAdapters { } try (InputStream is = t.getRequestBody(); OutputStream os = t.getResponseBody()) { - assertEquals(is.readAllBytes().length, 0); + assertEquals(0, is.readAllBytes().length); if (!"HEAD".equals(t.getRequestMethod())) { String[] body = BODY.split("\n"); for (String line : body) { diff --git a/test/jdk/java/net/httpclient/http3/H3BasicTest.java b/test/jdk/java/net/httpclient/http3/H3BasicTest.java index 79002d98995..a03df11c1a3 100644 --- a/test/jdk/java/net/httpclient/http3/H3BasicTest.java +++ b/test/jdk/java/net/httpclient/http3/H3BasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,6 @@ import java.util.concurrent.atomic.AtomicInteger; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; -import jdk.httpclient.test.lib.http2.Http2TestExchange; -import jdk.httpclient.test.lib.http2.Http2EchoHandler; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; @@ -79,8 +77,8 @@ public class H3BasicTest implements HttpServerAdapters { private static final String CLASS_NAME = H3BasicTest.class.getSimpleName(); static int http3Port, https2Port; - static Http3TestServer http3OnlyServer; - static Http2TestServer https2AltSvcServer; + static HttpTestServer http3OnlyServer; + static HttpTestServer https2AltSvcServer; static HttpClient client = null; static ExecutorService clientExec; static ExecutorService serverExec; @@ -92,20 +90,21 @@ public class H3BasicTest implements HttpServerAdapters { client = getClient(); // server that only supports HTTP/3 - http3OnlyServer = new Http3TestServer(sslContext, serverExec); - http3OnlyServer.addHandler("/", new Http2EchoHandler()); - http3OnlyServer.addHandler("/ping", new EchoWithPingHandler()); + http3OnlyServer = HttpTestServer.of(new Http3TestServer(sslContext, serverExec)); + http3OnlyServer.createContext("/", new HttpTestFileEchoHandler()); + http3OnlyServer.createContext("/ping", new EchoWithPingHandler()); http3Port = http3OnlyServer.getAddress().getPort(); System.out.println("HTTP/3 server started at localhost:" + http3Port); // server that supports both HTTP/2 and HTTP/3, with HTTP/3 on an altSvc port. - https2AltSvcServer = new Http2TestServer(true, 0, serverExec, sslContext); + Http2TestServer http2ServerImpl = new Http2TestServer(true, 0, serverExec, sslContext); if (RANDOM.nextBoolean()) { - https2AltSvcServer.enableH3AltServiceOnEphemeralPort(); + http2ServerImpl.enableH3AltServiceOnEphemeralPort(); } else { - https2AltSvcServer.enableH3AltServiceOnSamePort(); + http2ServerImpl.enableH3AltServiceOnSamePort(); } - https2AltSvcServer.addHandler(new Http2EchoHandler(), "/"); + https2AltSvcServer = HttpTestServer.of(http2ServerImpl); + https2AltSvcServer.addHandler(new HttpTestFileEchoHandler(), "/"); https2Port = https2AltSvcServer.getAddress().getPort(); if (https2AltSvcServer.supportsH3DirectConnection()) { System.out.println("HTTP/2 server (same HTTP/3 origin) started at localhost:" + https2Port); @@ -113,9 +112,9 @@ public class H3BasicTest implements HttpServerAdapters { System.out.println("HTTP/2 server (different HTTP/3 origin) started at localhost:" + https2Port); } - http3URIString = "https://localhost:" + http3Port + "/foo/"; - pingURIString = "https://localhost:" + http3Port + "/ping/"; - https2URIString = "https://localhost:" + https2Port + "/bar/"; + http3URIString = "https://" + http3OnlyServer.serverAuthority() + "/foo/"; + pingURIString = "https://" + http3OnlyServer.serverAuthority() + "/ping/"; + https2URIString = "https://" + https2AltSvcServer.serverAuthority() + "/bar/"; http3OnlyServer.start(); https2AltSvcServer.start(); @@ -131,11 +130,11 @@ public class H3BasicTest implements HttpServerAdapters { static CompletableFuture currentCF; - static class EchoWithPingHandler extends Http2EchoHandler { + static class EchoWithPingHandler extends HttpTestFileEchoHandler { private final Object lock = new Object(); @Override - public void handle(Http2TestExchange exchange) throws IOException { + public void handle(HttpTestExchange exchange) throws IOException { // for now only one ping active at a time. don't want to saturate System.out.println("PING handler invoked for " + exchange.getRequestURI()); synchronized(lock) { @@ -292,16 +291,16 @@ public class H3BasicTest implements HttpServerAdapters { } static void paramsTest() throws Exception { - URI u = new URI("https://localhost:"+https2Port+"/foo"); + URI u = new URI("https://" + https2AltSvcServer.serverAuthority() + "/foo"); System.out.println("paramsTest: Request to " + u); - https2AltSvcServer.addHandler((t -> { + https2AltSvcServer.addHandler(((HttpTestExchange t) -> { SSLSession s = t.getSSLSession(); String prot = s.getProtocol(); if (prot.equals("TLSv1.3")) { - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, HttpTestExchange.RSPBODY_EMPTY); } else { System.err.printf("Protocols =%s\n", prot); - t.sendResponseHeaders(500, -1); + t.sendResponseHeaders(500, HttpTestExchange.RSPBODY_EMPTY); } }), "/"); HttpClient client = getClient(); diff --git a/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java b/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java index 0449db3e961..c90059ccbfd 100644 --- a/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java +++ b/test/jdk/java/net/httpclient/http3/H3ConnectionPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,7 +40,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -51,9 +50,7 @@ import java.util.function.Supplier; import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; -import jdk.httpclient.test.lib.http2.Http2Handler; import jdk.httpclient.test.lib.http2.Http2TestServer; -import jdk.httpclient.test.lib.http2.Http2EchoHandler; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; import org.testng.annotations.Test; @@ -73,17 +70,17 @@ public class H3ConnectionPoolTest implements HttpServerAdapters { private static final String CLASS_NAME = H3ConnectionPoolTest.class.getSimpleName(); static int altsvcPort, https2Port, http3Port; - static Http3TestServer http3OnlyServer; - static Http2TestServer https2AltSvcServer; + static HttpTestServer http3OnlyServer; + static HttpTestServer https2AltSvcServer; static volatile HttpClient client = null; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); static volatile String http3OnlyURIString, https2URIString, http3AltSvcURIString, http3DirectURIString; static void initialize(boolean samePort) throws Exception { - initialize(samePort, Http2EchoHandler::new); + initialize(samePort, HttpTestFileEchoHandler::new); } - static void initialize(boolean samePort, Supplier handlers) throws Exception { + static void initialize(boolean samePort, Supplier handlers) throws Exception { System.out.println("\nConfiguring for advertised AltSvc on " + (samePort ? "same port" : "ephemeral port")); try { @@ -91,16 +88,17 @@ public class H3ConnectionPoolTest implements HttpServerAdapters { client = getClient(); // server that supports both HTTP/2 and HTTP/3, with HTTP/3 on an altSvc port. - https2AltSvcServer = new Http2TestServer(true, sslContext); + Http2TestServer serverImpl = new Http2TestServer(true, sslContext); if (samePort) { System.out.println("Attempting to enable advertised HTTP/3 service on same port"); - https2AltSvcServer.enableH3AltServiceOnSamePort(); + serverImpl.enableH3AltServiceOnSamePort(); System.out.println("Advertised AltSvc on same port " + - (https2AltSvcServer.supportsH3DirectConnection() ? "enabled" : " not enabled")); + (serverImpl.supportsH3DirectConnection() ? "enabled" : " not enabled")); } else { System.out.println("Attempting to enable advertised HTTP/3 service on different port"); - https2AltSvcServer.enableH3AltServiceOnEphemeralPort(); + serverImpl.enableH3AltServiceOnEphemeralPort(); } + https2AltSvcServer = HttpTestServer.of(serverImpl); https2AltSvcServer.addHandler(handlers.get(), "/" + CLASS_NAME + "/https2/"); https2AltSvcServer.addHandler(handlers.get(), "/" + CLASS_NAME + "/h2h3/"); https2Port = https2AltSvcServer.getAddress().getPort(); @@ -113,18 +111,20 @@ public class H3ConnectionPoolTest implements HttpServerAdapters { // one advertised (the alt service endpoint og the HTTP/2 server) // one non advertised (the direct endpoint, at the same authority as HTTP/2, but which // is in fact our http3OnlyServer) + Http3TestServer http3ServerImpl; try { - http3OnlyServer = new Http3TestServer(sslContext, samePort ? 0 : https2Port); + http3ServerImpl = new Http3TestServer(sslContext, samePort ? 0 : https2Port); System.out.println("Unadvertised service enabled on " + (samePort ? "ephemeral port" : "same port")); } catch (IOException ex) { System.out.println("Can't create HTTP/3 server on same port: " + ex); - http3OnlyServer = new Http3TestServer(sslContext, 0); + http3ServerImpl = new Http3TestServer(sslContext, 0); } - http3OnlyServer.addHandler("/" + CLASS_NAME + "/http3/", handlers.get()); - http3OnlyServer.addHandler("/" + CLASS_NAME + "/h2h3/", handlers.get()); + http3OnlyServer = HttpTestServer.of(http3ServerImpl); + http3OnlyServer.createContext("/" + CLASS_NAME + "/http3/", handlers.get()); + http3OnlyServer.createContext("/" + CLASS_NAME + "/h2h3/", handlers.get()); http3OnlyServer.start(); - http3Port = http3OnlyServer.getQuicServer().getAddress().getPort(); + http3Port = http3ServerImpl.getQuicServer().getAddress().getPort(); if (http3Port == https2Port) { System.out.println("HTTP/3 server enabled on same port than HTTP/2 server"); diff --git a/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java b/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java index 9f509b5440a..8a83b51a174 100644 --- a/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java +++ b/test/jdk/java/net/httpclient/http3/H3DataLimitsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,14 +24,6 @@ import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http3.Http3TestServer; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.ITestContext; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.net.ssl.SSLContext; import java.io.IOException; @@ -44,18 +36,29 @@ import java.net.http.HttpRequest; import java.net.http.HttpRequest.Builder; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.time.Duration; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* @@ -64,7 +67,7 @@ import static org.testng.Assert.assertEquals; * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.quic.QuicStandaloneServer - * @run testng/othervm/timeout=480 -Djdk.internal.httpclient.debug=true + * @run junit/othervm/timeout=480 -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * -Djavax.net.debug=all * H3DataLimitsTest @@ -73,8 +76,8 @@ import static org.testng.Assert.assertEquals; public class H3DataLimitsTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer h3TestServer; - String h3URI; + private static HttpTestServer h3TestServer; + private static String h3URI; static final Executor executor = new TestExecutor(Executors.newCachedThreadPool()); static final ConcurrentMap FAILURES = new ConcurrentHashMap<>(); @@ -114,20 +117,37 @@ public class H3DataLimitsTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - var x = new SkipException("Skipping: some test failed"); - x.setStackTrace(new StackTraceElement[0]); - throw x; + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); } } - @AfterClass + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll static void printFailedTests() { out.println("\n========================="); try { @@ -148,13 +168,8 @@ public class H3DataLimitsTest implements HttpServerAdapters { } } - @DataProvider(name = "h3URIs") - public Object[][] versions(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } - Object[][] result = {{h3URI}}; - return result; + public static Object[][] versions() { + return new Object[][] {{h3URI}}; } private HttpClient makeNewClient() { @@ -168,7 +183,8 @@ public class H3DataLimitsTest implements HttpServerAdapters { return client; } - @Test(dataProvider = "h3URIs") + @ParameterizedTest + @MethodSource("versions") public void testHugeResponse(final String h3URI) throws Exception { HttpClient client = makeNewClient(); URI uri = URI.create(h3URI + "?16000000"); @@ -180,17 +196,18 @@ public class H3DataLimitsTest implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #1: " + response); out.println("Version #1: " + response.version()); - assertEquals(response.statusCode(), 200, "first response status"); - assertEquals(response.version(), HTTP_3, "first response version"); + assertEquals(200, response.statusCode(), "first response status"); + assertEquals(HTTP_3, response.version(), "first response version"); response = client.send(request, BodyHandlers.ofString()); out.println("Response #2: " + response); out.println("Version #2: " + response.version()); - assertEquals(response.statusCode(), 200, "second response status"); - assertEquals(response.version(), HTTP_3, "second response version"); + assertEquals(200, response.statusCode(), "second response status"); + assertEquals(HTTP_3, response.version(), "second response version"); } - @Test(dataProvider = "h3URIs") + @ParameterizedTest + @MethodSource("versions") public void testManySmallResponses(final String h3URI) throws Exception { HttpClient client = makeNewClient(); URI uri = URI.create(h3URI + "?160000"); @@ -203,13 +220,13 @@ public class H3DataLimitsTest implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #" + i + ": " + response); out.println("Version #" + i + ": " + response.version()); - assertEquals(response.statusCode(), 200, "response status"); - assertEquals(response.version(), HTTP_3, "response version"); + assertEquals(200, response.statusCode(), "response status"); + assertEquals(HTTP_3, response.version(), "response version"); } } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { // An HTTP/3 server that only supports HTTP/3 h3TestServer = HttpTestServer.of(new Http3TestServer(sslContext)); final HttpTestHandler h3Handler = new Handler(); @@ -220,8 +237,8 @@ public class H3DataLimitsTest implements HttpServerAdapters { h3TestServer.start(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { System.err.println("======================================================="); System.err.println(" Tearing down test"); System.err.println("======================================================="); diff --git a/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java b/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java index 27eec672bcd..a93c6a37594 100644 --- a/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java +++ b/test/jdk/java/net/httpclient/http3/H3MaxInitialTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,25 +39,29 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; -import org.testng.ITestContext; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.lang.System.out; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.assertEquals; + +import org.junit.jupiter.api.AfterAll; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* @@ -68,15 +72,15 @@ import static org.testng.Assert.assertEquals; * @build jdk.test.lib.net.SimpleSSLContext * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.httpclient.test.lib.quic.QuicStandaloneServer - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,quic:controls * -Djdk.httpclient.quic.maxInitialTimeout=1 * H3MaxInitialTimeoutTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,quic:controls * -Djdk.httpclient.quic.maxInitialTimeout=2 * H3MaxInitialTimeoutTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors,quic:controls * -Djdk.httpclient.quic.maxInitialTimeout=2147483647 * H3MaxInitialTimeoutTest @@ -84,8 +88,8 @@ import static org.testng.Assert.assertEquals; public class H3MaxInitialTimeoutTest implements HttpServerAdapters { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - DatagramChannel receiver; - String h3URI; + static DatagramChannel receiver; + static String h3URI; static final Executor executor = new TestExecutor(Executors.newVirtualThreadPerTaskExecutor()); static final ConcurrentMap FAILURES = new ConcurrentHashMap<>(); @@ -125,20 +129,37 @@ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - var x = new SkipException("Skipping: some test failed"); - x.setStackTrace(new StackTraceElement[0]); - throw x; + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); } } - @AfterClass + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll static void printFailedTests() { out.println("\n========================="); try { @@ -159,13 +180,8 @@ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { } } - @DataProvider(name = "h3URIs") - public Object[][] versions(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } - Object[][] result = {{h3URI}}; - return result; + public static Object[][] versions() { + return new Object[][] {{h3URI}}; } private HttpClient makeNewClient(long connectionTimeout) { @@ -180,7 +196,8 @@ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { return client; } - @Test(dataProvider = "h3URIs") + @ParameterizedTest + @MethodSource("versions") public void testTimeout(final String h3URI) throws Exception { long timeout = Long.getLong("jdk.httpclient.quic.maxInitialTimeout", 30); long connectionTimeout = timeout == Integer.MAX_VALUE ? 2 : 10 * timeout; @@ -196,8 +213,8 @@ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { HttpResponse response = client.send(request, BodyHandlers.ofString()); out.println("Response #1: " + response); out.println("Version #1: " + response.version()); - assertEquals(response.statusCode(), 200, "first response status"); - assertEquals(response.version(), HTTP_3, "first response version"); + assertEquals(200, response.statusCode(), "first response status"); + assertEquals(HTTP_3, response.version(), "first response version"); throw new AssertionError("Expected ConnectException not thrown"); } catch (ConnectException c) { String msg = c.getMessage(); @@ -222,8 +239,8 @@ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { receiver = DatagramChannel.open(); receiver.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); h3URI = URIBuilder.newBuilder() @@ -235,8 +252,8 @@ public class H3MaxInitialTimeoutTest implements HttpServerAdapters { .toString(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { System.err.println("======================================================="); System.err.println(" Tearing down test"); System.err.println("======================================================="); diff --git a/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java b/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java index 90f2c41f4e5..1f109e27ebc 100644 --- a/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java +++ b/test/jdk/java/net/httpclient/http3/PostHTTP3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,6 +49,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; import javax.net.ssl.SSLContext; @@ -56,24 +57,25 @@ import jdk.test.lib.Utils; import jdk.test.lib.net.SimpleSSLContext; import jdk.httpclient.test.lib.common.HttpServerAdapters; import jdk.httpclient.test.lib.http2.Http2TestServer; -import org.testng.ITestContext; -import org.testng.SkipException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.net.http.HttpClient.Version.HTTP_2; import static java.net.http.HttpClient.Version.HTTP_3; import static java.net.http.HttpOption.Http3DiscoveryMode.ALT_SVC; import static java.net.http.HttpOption.Http3DiscoveryMode.ANY; import static java.net.http.HttpOption.H3_DISCOVERY; -import static org.testng.Assert.*; - +import static org.junit.jupiter.api.Assertions.*; import static java.lang.System.out; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.extension.TestWatcher; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + /* * @test * @library /test/lib /test/jdk/java/net/httpclient/lib @@ -81,7 +83,7 @@ import static java.lang.System.out; * jdk.httpclient.test.lib.common.HttpServerAdapters * jdk.test.lib.Utils * @compile ../ReferenceTracker.java - * @run testng/othervm -Djdk.internal.httpclient.debug=true + * @run junit/othervm -Djdk.internal.httpclient.debug=true * -Djdk.httpclient.HttpClient.log=requests,responses,errors * PostHTTP3Test * @summary Basic HTTP/3 POST test @@ -97,8 +99,8 @@ public class PostHTTP3Test implements HttpServerAdapters { """; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - HttpTestServer h3TestServer; // HTTP/2 ( h2 + h3) - String h3URI; + static HttpTestServer h3TestServer; // HTTP/2 ( h2 + h3) + static String h3URI; static final int ITERATION_COUNT = 4; // a shared executor helps reduce the amount of threads created by the test @@ -116,10 +118,10 @@ public class PostHTTP3Test implements HttpServerAdapters { return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); } - final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; - final Set sharedClientHasH3 = ConcurrentHashMap.newKeySet(); - private volatile HttpClient sharedClient; - private boolean directQuicConnectionSupported; + private static final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private static final Set sharedClientHasH3 = ConcurrentHashMap.newKeySet(); + private static volatile HttpClient sharedClient; + private static boolean directQuicConnectionSupported; static class TestExecutor implements Executor { final AtomicLong tasks = new AtomicLong(); @@ -145,20 +147,37 @@ public class PostHTTP3Test implements HttpServerAdapters { } } - protected boolean stopAfterFirstFailure() { + private static boolean stopAfterFirstFailure() { return Boolean.getBoolean("jdk.internal.httpclient.debug"); } - @BeforeMethod - void beforeMethod(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - var x = new SkipException("Skipping: some test failed"); - x.setStackTrace(new StackTraceElement[0]); - throw x; + static final class TestStopper implements TestWatcher, BeforeEachCallback { + final AtomicReference failed = new AtomicReference<>(); + TestStopper() { } + @Override + public void testFailed(ExtensionContext context, Throwable cause) { + if (stopAfterFirstFailure()) { + String msg = "Aborting due to: " + cause; + failed.compareAndSet(null, msg); + FAILURES.putIfAbsent(context.getDisplayName(), cause); + System.out.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + System.err.printf("%nTEST FAILED: %s%s%n\tAborting due to %s%n%n", + now(), context.getDisplayName(), cause); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + String msg = failed.get(); + Assumptions.assumeTrue(msg == null, msg); } } - @AfterClass + @RegisterExtension + static final TestStopper stopper = new TestStopper(); + + @AfterAll static void printFailedTests() { out.println("\n========================="); try { @@ -179,24 +198,20 @@ public class PostHTTP3Test implements HttpServerAdapters { } } - private String[] uris() { + private static String[] uris() { return new String[] { h3URI, }; } - @DataProvider(name = "variants") - public Object[][] variants(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } + public static Object[][] variants() { String[] uris = uris(); Object[][] result = new Object[uris.length * 2 * 2 * 2][]; int i = 0; for (var version : List.of(Optional.empty(), Optional.of(HTTP_3))) { for (Version firstRequestVersion : List.of(HTTP_2, HTTP_3)) { for (boolean sameClient : List.of(false, true)) { - for (String uri : uris()) { + for (String uri : uris) { result[i++] = new Object[]{uri, firstRequestVersion, sameClient, version}; } } @@ -206,15 +221,6 @@ public class PostHTTP3Test implements HttpServerAdapters { return result; } - @DataProvider(name = "uris") - public Object[][] uris(ITestContext context) { - if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { - return new Object[0][]; - } - Object[][] result = {{h3URI}}; - return result; - } - private HttpClient makeNewClient() { clientCount.incrementAndGet(); HttpClient client = newClientBuilderForH3() @@ -259,7 +265,8 @@ public class PostHTTP3Test implements HttpServerAdapters { } - @Test(dataProvider = "variants") + @ParameterizedTest + @MethodSource("variants") public void testAsync(String uri, Version firstRequestVersion, boolean sameClient, Optional version) throws Exception { System.out.println("Request to " + uri +"/Async/*" + ", firstRequestVersion=" + firstRequestVersion + @@ -287,17 +294,17 @@ public class PostHTTP3Test implements HttpServerAdapters { } HttpResponse response1 = client.send(headBuilder.build(), BodyHandlers.ofString()); - assertEquals(response1.statusCode(), 200, "Unexpected first response code"); - assertEquals(response1.body(), "", "Unexpected first response body"); + assertEquals(200, response1.statusCode(), "Unexpected first response code"); + assertEquals("", response1.body(), "Unexpected first response body"); boolean expectH3 = sameClient && sharedClientHasH3.contains(headURI.getRawAuthority()); if (firstRequestVersion == HTTP_3) { if (expectH3) { out.println("Expecting HEAD response over HTTP_3"); - assertEquals(response1.version(), HTTP_3, "Unexpected first response version"); + assertEquals(HTTP_3, response1.version(), "Unexpected first response version"); } } else { out.println("Expecting HEAD response over HTTP_2"); - assertEquals(response1.version(), HTTP_2, "Unexpected first response version"); + assertEquals(HTTP_2, response1.version(), "Unexpected first response version"); } out.println("HEAD response version: " + response1.version()); if (response1.version() == HTTP_2) { @@ -356,10 +363,10 @@ public class PostHTTP3Test implements HttpServerAdapters { out.println("Checking response: " + u); var response = e.getValue().get(); out.println("Response is: " + response + ", [version: " + response.version() + "]"); - assertEquals(response.statusCode(), 200,"status for " + u); - assertEquals(response.body(), BODY,"body for " + u); + assertEquals(200, response.statusCode(), "status for " + u); + assertEquals(BODY, response.body(), "body for " + u); if (expectH3) { - assertEquals(response.version(), HTTP_3, "version for " + u); + assertEquals(HTTP_3, response.version(), "version for " + u); } if (response.version() == HTTP_3) { h3Count++; @@ -381,7 +388,8 @@ public class PostHTTP3Test implements HttpServerAdapters { System.out.println("test: DONE"); } - @Test(dataProvider = "uris") + @ParameterizedTest + @MethodSource("uris") public void testSync(String h3URI) throws Exception { HttpClient client = makeNewClient(); Builder builder = HttpRequest.newBuilder(URI.create(h3URI + "/Sync/1")) @@ -403,14 +411,14 @@ public class PostHTTP3Test implements HttpServerAdapters { out.println("Response #1: " + response); out.println("Version #1: " + response.version()); out.println("Body #1:\n" + response.body().indent(4)); - assertEquals(response.statusCode(), 200, "first response status"); + assertEquals(200, response.statusCode(), "first response status"); if (directQuicConnectionSupported) { // TODO unreliable assertion //assertEquals(response.version(), HTTP_3, "Unexpected first response version"); } else { - assertEquals(response.version(), HTTP_2, "Unexpected first response version"); + assertEquals(HTTP_2, response.version(), "Unexpected first response version"); } - assertEquals(response.body(), BODY, "first response body"); + assertEquals(BODY, response.body(), "first response body"); request = builder.uri(URI.create(h3URI + "/Sync/2")) .POST(oflines(true, BODY.split("\n"))) @@ -419,9 +427,9 @@ public class PostHTTP3Test implements HttpServerAdapters { out.println("Response #2: " + response); out.println("Version #2: " + response.version()); out.println("Body #2:\n" + response.body().indent(4)); - assertEquals(response.statusCode(), 200, "second response status"); - assertEquals(response.version(), HTTP_3, "second response version"); - assertEquals(response.body(), BODY, "second response body"); + assertEquals(200, response.statusCode(), "second response status"); + assertEquals(HTTP_3, response.version(), "second response version"); + assertEquals(BODY, response.body(), "second response body"); request = builder.uri(URI.create(h3URI + "/Sync/3")) .POST(oflines(true, BODY.split("\n"))) @@ -430,9 +438,9 @@ public class PostHTTP3Test implements HttpServerAdapters { out.println("Response #3: " + response); out.println("Version #3: " + response.version()); out.println("Body #3:\n" + response.body().indent(4)); - assertEquals(response.statusCode(), 200, "third response status"); - assertEquals(response.version(), HTTP_3, "third response version"); - assertEquals(response.body(), BODY, "third response body"); + assertEquals(200, response.statusCode(), "third response status"); + assertEquals(HTTP_3, response.version(), "third response version"); + assertEquals(BODY, response.body(), "third response body"); var tracker = TRACKER.getTracker(client); client = null; @@ -441,8 +449,8 @@ public class PostHTTP3Test implements HttpServerAdapters { if (error != null) throw error; } - @BeforeTest - public void setup() throws Exception { + @BeforeAll + public static void setup() throws Exception { final Http2TestServer h2WithAltService = new Http2TestServer("localhost", true, sslContext) .enableH3AltServiceOnSamePort(); h3TestServer = HttpTestServer.of(h2WithAltService); @@ -454,8 +462,8 @@ public class PostHTTP3Test implements HttpServerAdapters { directQuicConnectionSupported = h2WithAltService.supportsH3DirectConnection(); } - @AfterTest - public void teardown() throws Exception { + @AfterAll + public static void teardown() throws Exception { System.err.println("======================================================="); System.err.println(" Tearing down test"); System.err.println("======================================================="); diff --git a/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java b/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java index 10633340a66..b40cef5d4e6 100644 --- a/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java +++ b/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -251,6 +251,60 @@ public interface HttpServerAdapters { * A version agnostic adapter class for HTTP Server Exchange. */ public static abstract class HttpTestExchange implements AutoCloseable { + /** + * This constant can be passed to {@link #sendResponseHeaders(int, long)} + * to indicate an empty response. + */ + public static final int RSPBODY_EMPTY = 0; + /** + * This constant can be passed to {@link #sendResponseHeaders(int, long)} + * to indicate that the response will be chunked. + */ + public static final int RSPBODY_CHUNKED = -1; + + /** + * {@return the response length to pass to {@link #sendResponseHeaders(int, long)} + * if the response is not chunked} + * @param bytes the response length + */ + public static long fixedRsp(long bytes) { + return bytes == 0 ? RSPBODY_EMPTY : bytes; + } + + /** + * {@return the response length to pass to {@link #sendResponseHeaders(int, long)}} + * This is the response length when `chunked` is false, and + * {@link #RSPBODY_CHUNKED} otherwise. + * @param length The number of bytes to send + * @param chunked Whether the response should be chunked + */ + public static long responseLength(long length, boolean chunked) { + return chunked ? HttpTestExchange.RSPBODY_CHUNKED : fixedRsp(length); + } + + /** + * {@return true if the {@linkplain #getRequestHeaders() request headers} + * contain {@code XFixed: yes}} + */ + public boolean rspFixedRequested() { + return "yes".equals(getRequestHeaders() + .firstValue("XFixed") + .orElse(null)); + } + + /** + * {@return the length to be passed to {@link #sendResponseHeaders(int, long)}, + * taking into account whether using {@linkplain #rspFixedRequested() + * fixed length was requested} in the {@linkplain #getRequestHeaders() + * request headers}.} + * By default, returns {@link #RSPBODY_CHUNKED} unless {@linkplain + * #rspFixedRequested() fixed length was requested}. + * @param length the length to use in content-length if fixed length is used. + */ + public long responseLength(long length) { + return responseLength(length, !rspFixedRequested()); + } + public abstract Version getServerVersion(); public abstract Version getExchangeVersion(); public abstract InputStream getRequestBody(); @@ -265,6 +319,10 @@ public interface HttpServerAdapters { public abstract InetSocketAddress getLocalAddress(); public abstract String getConnectionKey(); public abstract SSLSession getSSLSession(); + public CompletableFuture sendPing() { + throw new UnsupportedOperationException("sendPing not supported on " + + getExchangeVersion()); + } public void serverPush(URI uri, HttpHeaders reqHeaders, byte[] body) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(body); serverPush(uri, reqHeaders, bais); @@ -543,6 +601,11 @@ public interface HttpServerAdapters { throws IOException { exchange.serverPush(uri, reqHeaders, rspHeaders, body); } + @Override + public CompletableFuture sendPing() { + return exchange.sendPing(); + } + @Override public void requestStopSending(long errorCode) { exchange.requestStopSending(errorCode); @@ -701,7 +764,8 @@ public interface HttpServerAdapters { /** * An echo handler that can be used to transfer large amount of data, and - * uses file on the file system to download the input. + * uses file on the file system to download the input. This handler honors + * the {@code XFixed} header. */ // TODO: it would be good if we could merge this with the Http2EchoHandler, // from which this code was copied and adapted. @@ -737,7 +801,7 @@ public interface HttpServerAdapters { assertFileContentsEqual(check, outfile.toPath()); } catch (Throwable x) { System.err.println("Files do not match: " + x); - t.sendResponseHeaders(500, -1); + t.sendResponseHeaders(500, HttpTestExchange.RSPBODY_EMPTY); outfile.delete(); os.close(); return; @@ -747,7 +811,7 @@ public interface HttpServerAdapters { // return the number of bytes received (no echo) String summary = requestHeaders.firstValue("XSummary").orElse(null); if (fixedrequest != null && summary == null) { - t.sendResponseHeaders(200, count); + t.sendResponseHeaders(200, HttpTestExchange.fixedRsp(count)); os = t.getResponseBody(); if (!t.getRequestMethod().equals("HEAD")) { long count1 = is1.transferTo(os); @@ -756,7 +820,7 @@ public interface HttpServerAdapters { System.err.printf("EchoHandler HEAD received, no bytes sent%n"); } } else { - t.sendResponseHeaders(200, -1); + t.sendResponseHeaders(200, HttpTestExchange.RSPBODY_CHUNKED); os = t.getResponseBody(); if (!t.getRequestMethod().equals("HEAD")) { long count1 = is1.transferTo(os); @@ -780,6 +844,14 @@ public interface HttpServerAdapters { } } + /** + * An echo handler that can be used to transfer small amounts of data. + * All the request data is read in memory in a single byte array before + * being sent back. If the handler is {@linkplain #useXFixed() configured + * to honor the {@code XFixed} header}, and the request headers do not + * specify {@code XFixed: yes}, the data is sent back in chunk mode. + * Otherwise, chunked mode is not used (this is the default). + */ public static class HttpTestEchoHandler implements HttpTestHandler { private final boolean printBytes; @@ -791,10 +863,26 @@ public interface HttpServerAdapters { this.printBytes = printBytes; } + /** + * {@return whether the {@code XFixed} header should be + * honored. If this method returns false, chunked mode will + * not be used. If this method returns true, chunked mode + * will be used unless the request headers contain + * {@code XFixed: yes}} + */ + protected boolean useXFixed() { + return false; + } + @Override public void handle(HttpTestExchange t) throws IOException { - try (InputStream is = t.getRequestBody(); - OutputStream os = t.getResponseBody()) { + System.err.printf("EchoHandler received request to %s from %s (version %s)%n", + t.getRequestURI(), t.getRemoteAddress(), t.getExchangeVersion()); + InputStream is = null; + OutputStream os = null; + try { + is = t.getRequestBody(); + os = t.getResponseBody(); byte[] bytes = is.readAllBytes(); if (printBytes) { printBytes(System.out, "Echo server got " @@ -804,12 +892,31 @@ public interface HttpServerAdapters { t.getResponseHeaders().addHeader("Content-type", t.getRequestHeaders().firstValue("Content-type").get()); } - t.sendResponseHeaders(200, bytes.length); - if (!t.getRequestMethod().equals("HEAD")) { + + long responseLength = useXFixed() + ? t.responseLength(bytes.length) + : HttpTestExchange.fixedRsp(bytes.length); + t.sendResponseHeaders(200, responseLength); + if (!t.getRequestMethod().equals("HEAD") && bytes.length > 0) { os.write(bytes); } + } finally { + if (os != null) close(t, os); + if (is != null) close(t, is); } } + protected void close(OutputStream os) throws IOException { + os.close(); + } + protected void close(InputStream is) throws IOException { + is.close(); + } + protected void close(HttpTestExchange t, OutputStream os) throws IOException { + close(os); + } + protected void close(HttpTestExchange t, InputStream is) throws IOException { + close(is); + } } public static class HttpTestRedirectHandler implements HttpTestHandler { @@ -854,6 +961,117 @@ public interface HttpServerAdapters { } } + /** + * A simple FileServerHandler that understand "XFixed" header. + * If the request headers contain {@code XFixed: yes}, a fixed + * length response is sent. Otherwise, the response will be + * chunked. Note that for directories the response is always + * chunked. + */ + class HttpTestFileServerHandler implements HttpTestHandler { + + String docroot; + + public HttpTestFileServerHandler(String docroot) { + this.docroot = docroot; + } + + public void handle(HttpTestExchange t) + throws IOException + { + InputStream is = t.getRequestBody(); + var rspHeaders = t.getResponseHeaders(); + URI uri = t.getRequestURI(); + String path = uri.getPath(); + + int x = 0; + while (is.read() != -1) x++; + is.close(); + File f = new File(docroot, path); + if (!f.exists()) { + notfound(t, path); + return; + } + + String method = t.getRequestMethod(); + if (method.equals("HEAD")) { + rspHeaders.addHeader("Content-Length", Long.toString(f.length())); + t.sendResponseHeaders(200, HttpTestExchange.RSPBODY_EMPTY); + t.close(); + } else if (!method.equals("GET")) { + t.sendResponseHeaders(405, HttpTestExchange.RSPBODY_EMPTY); + t.close(); + return; + } + + if (path.endsWith(".html") || path.endsWith(".htm")) { + rspHeaders.addHeader("Content-Type", "text/html"); + } else { + rspHeaders.addHeader("Content-Type", "text/plain"); + } + if (f.isDirectory()) { + if (!path.endsWith("/")) { + moved (t); + return; + } + rspHeaders.addHeader("Content-Type", "text/html"); + t.sendResponseHeaders(200, HttpTestExchange.RSPBODY_CHUNKED); + String[] list = f.list(); + try (final OutputStream os = t.getResponseBody(); + final PrintStream p = new PrintStream(os)) { + p.println("

    Directory listing for: " + path + "

    "); + p.println("
      "); + for (int i = 0; i < list.length; i++) { + p.println("
    • " + list[i] + "
    • "); + } + p.println("


    "); + p.flush(); + } + } else { + long clen = f.length(); + t.sendResponseHeaders(200, t.responseLength(clen)); + long count = 0; + try (final OutputStream os = t.getResponseBody(); + final FileInputStream fis = new FileInputStream (f)) { + byte[] buf = new byte [16 * 1024]; + int len; + while ((len=fis.read(buf)) != -1) { + os.write(buf, 0, len); + count += len; + } + if (clen != count) { + System.err.println("FileServerHandler: WARNING: count of bytes sent does not match content-length"); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + void moved(HttpTestExchange t) throws IOException { + var req = t.getRequestHeaders(); + var rsp = t.getResponseHeaders(); + URI uri = t.getRequestURI(); + String host = req.firstValue("Host").get(); + String location = "http://"+host+uri.getPath() + "/"; + rsp.addHeader("Content-Type", "text/html"); + rsp.addHeader("Location", location); + t.sendResponseHeaders(301, HttpTestExchange.RSPBODY_EMPTY); + t.close(); + } + + void notfound(HttpTestExchange t, String p) throws IOException { + t.getResponseHeaders().addHeader("Content-Type", "text/html"); + t.sendResponseHeaders(404, HttpTestExchange.RSPBODY_CHUNKED); + OutputStream os = t.getResponseBody(); + String s = "

    File not found

    "; + s = s + p + "

    "; + os.write(s.getBytes()); + os.close(); + t.close(); + } + } + public static boolean expectException(HttpTestExchange e) { HttpTestRequestHeaders h = e.getRequestHeaders(); Optional expectException = h.firstValue("X-expect-exception"); @@ -1144,6 +1362,22 @@ public interface HttpServerAdapters { public abstract InetSocketAddress getAddress(); public abstract Version getVersion(); + /** + * Adds a new handler and return its context. + * @implSpec + * This method just returns {@link #addHandler(HttpTestHandler, String) + * addHandler(context, root)} + * @apiNote + * This is a convenience method to help migrate from + * {@link HttpServer#createContext(String, HttpHandler)}. + * @param root The context root + * @param handler The handler to attach to the context + * @return the context to which the new handler is attached + */ + public HttpTestContext createContext(String root, HttpTestHandler handler) { + return addHandler(handler, root); + } + /** * {@return the HTTP3 test server which is acting as an alt-service for this server, * if any} diff --git a/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/EchoHandler.java b/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/EchoHandler.java deleted file mode 100644 index 047b52b3699..00000000000 --- a/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/EchoHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 - * 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 jdk.httpclient.test.lib.http2; - -import java.io.*; -import java.net.http.HttpHeaders; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import jdk.internal.net.http.common.HttpHeadersBuilder; - -public class EchoHandler implements Http2Handler { - static final Path CWD = Paths.get("."); - - public EchoHandler() {} - - @Override - public void handle(Http2TestExchange t) - throws IOException { - try { - System.err.println("EchoHandler received request to " + t.getRequestURI()); - InputStream is = t.getRequestBody(); - HttpHeaders map = t.getRequestHeaders(); - HttpHeadersBuilder map1 = t.getResponseHeaders(); - map1.addHeader("X-Hello", "world"); - map1.addHeader("X-Bye", "universe"); - String fixedrequest = map.firstValue("XFixed").orElse(null); - File outfile = Files.createTempFile(CWD, "foo", "bar").toFile(); - //System.err.println ("QQQ = " + outfile.toString()); - FileOutputStream fos = new FileOutputStream(outfile); - int count = (int) is.transferTo(fos); - System.err.printf("EchoHandler read %d bytes\n", count); - is.close(); - fos.close(); - InputStream is1 = new FileInputStream(outfile); - OutputStream os = null; - // return the number of bytes received (no echo) - String summary = map.firstValue("XSummary").orElse(null); - if (fixedrequest != null && summary == null) { - t.sendResponseHeaders(200, count); - os = t.getResponseBody(); - int count1 = (int)is1.transferTo(os); - System.err.printf("EchoHandler wrote %d bytes\n", count1); - } else { - t.sendResponseHeaders(200, 0); - os = t.getResponseBody(); - int count1 = (int)is1.transferTo(os); - System.err.printf("EchoHandler wrote %d bytes\n", count1); - - if (summary != null) { - String s = Integer.toString(count); - os.write(s.getBytes()); - } - } - outfile.delete(); - os.close(); - is1.close(); - } catch (Throwable e) { - e.printStackTrace(); - throw new IOException(e); - } - } -} diff --git a/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2EchoHandler.java b/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2EchoHandler.java deleted file mode 100644 index fd0b03ac691..00000000000 --- a/test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2EchoHandler.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2005, 2025, 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 jdk.httpclient.test.lib.http2; - -import java.io.*; -import java.net.http.HttpHeaders; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import jdk.internal.net.http.common.HttpHeadersBuilder; - -import static jdk.test.lib.Asserts.assertFileContentsEqual; - -public class Http2EchoHandler implements Http2Handler { - static final Path CWD = Paths.get("."); - - public Http2EchoHandler() {} - - @Override - public void handle(Http2TestExchange t) - throws IOException { - try { - System.err.printf("EchoHandler received request to %s from %s\n", - t.getRequestURI(), t.getRemoteAddress()); - InputStream is = t.getRequestBody(); - HttpHeaders map = t.getRequestHeaders(); - HttpHeadersBuilder headersBuilder = t.getResponseHeaders(); - headersBuilder.addHeader("X-Hello", "world"); - headersBuilder.addHeader("X-Bye", "universe"); - String fixedrequest = map.firstValue("XFixed").orElse(null); - File outfile = Files.createTempFile(CWD, "foo", "bar").toFile(); - //System.err.println ("QQQ = " + outfile.toString()); - FileOutputStream fos = new FileOutputStream(outfile); - long count = is.transferTo(fos); - System.err.printf("EchoHandler read %s bytes\n", count); - is.close(); - fos.close(); - InputStream is1 = new FileInputStream(outfile); - OutputStream os = null; - - Path check = map.firstValue("X-Compare").map((String s) -> Path.of(s)).orElse(null); - if (check != null) { - System.err.println("EchoHandler checking file match: " + check); - try { - assertFileContentsEqual(check, outfile.toPath()); - } catch (Throwable x) { - System.err.println("Files do not match: " + x); - t.sendResponseHeaders(500, -1); - outfile.delete(); - os.close(); - return; - } - } - - // return the number of bytes received (no echo) - String summary = map.firstValue("XSummary").orElse(null); - if (fixedrequest != null && summary == null) { - t.sendResponseHeaders(200, count); - os = t.getResponseBody(); - long count1 = is1.transferTo(os); - System.err.printf("EchoHandler wrote %s bytes\n", count1); - } else { - t.sendResponseHeaders(200, 0); - os = t.getResponseBody(); - long count1 = is1.transferTo(os); - System.err.printf("EchoHandler wrote %s bytes\n", count1); - - if (summary != null) { - String s = Long.toString(count); - os.write(s.getBytes()); - } - } - outfile.delete(); - os.close(); - is1.close(); - } catch (Throwable e) { - e.printStackTrace(); - throw new IOException(e); - } - } -} diff --git a/test/jdk/java/net/httpclient/quic/AckElicitingTest.java b/test/jdk/java/net/httpclient/quic/AckElicitingTest.java index 47fdb935598..7fbc00f9148 100644 --- a/test/jdk/java/net/httpclient/quic/AckElicitingTest.java +++ b/test/jdk/java/net/httpclient/quic/AckElicitingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,8 +71,6 @@ import jdk.internal.net.quic.QuicTLSEngine; import jdk.internal.net.quic.QuicTransportException; import jdk.internal.net.quic.QuicTransportParametersConsumer; import jdk.test.lib.RandomFactory; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.crypto.AEADBadTagException; import javax.net.ssl.SSLParameters; @@ -80,16 +78,19 @@ import javax.net.ssl.SSLSession; import static jdk.internal.net.http.quic.frames.QuicFrame.*; import static jdk.internal.net.http.quic.frames.ConnectionCloseFrame.CONNECTION_CLOSE_VARIANT; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; -/** +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +/* * @test * @summary tests the logic to decide whether a packet or * a frame is ACK-eliciting. * @library /test/lib - * @run testng AckElicitingTest - * @run testng/othervm -Dseed=-7997973196290088038 AckElicitingTest + * @run junit AckElicitingTest + * @run junit/othervm -Dseed=-7997973196290088038 AckElicitingTest */ public class AckElicitingTest { @@ -307,7 +308,7 @@ public class AckElicitingTest { * {@code obj.ackEliciting()} * @param A concrete subclass of {@link QuicFrame} or {@link QuicPacket} */ - static record TestCase(Class type, + record TestCase(Class type, Function describer, Predicate ackEliciting, T obj, @@ -336,7 +337,7 @@ public class AckElicitingTest { */ public static TestCase of(Class type, T frame, boolean expected) { - return new TestCase(type, TestCase::describeFrame, + return new TestCase<>(type, TestCase::describeFrame, QuicFrame::isAckEliciting, frame, expected); } @@ -349,7 +350,7 @@ public class AckElicitingTest { * @return a new instance of {@code TestCase} */ public static TestCase of(T frame, boolean expected) { - return new TestCase((Class)frame.getClass(), + return new TestCase<>((Class)frame.getClass(), TestCase::describeFrame, QuicFrame::isAckEliciting, frame, expected); @@ -391,7 +392,7 @@ public class AckElicitingTest { * @param a concrete subclass of {@code QuicFrame} * @return a new instance of the given concrete class. */ - T newFrame(Class frameClass) { + static T newFrame(Class frameClass) { var frameType = QuicFrame.frameTypeOf(frameClass); if (frameType == CONNECTION_CLOSE) { if (RANDOM.nextBoolean()) { @@ -454,7 +455,7 @@ public class AckElicitingTest { * @return a list of {@code TestCase} to test all possible concrete * subclasses of {@code QuicFrame} */ - public List> createFramesTests() { + static List> createFramesTests() { List> frames = new ArrayList<>(); frames.add(of(newFrame(AckFrame.class), false)); frames.add(of(newFrame(ConnectionCloseFrame.class), false)); @@ -476,7 +477,7 @@ public class AckElicitingTest { * @param frames a list of frames * @return a new instance of {@code QuicPacket} */ - QuicPacket createPacket(List frames) { + static QuicPacket createPacket(List frames) { PacketType[] values = PacketType.values(); int index = PacketType.NONE.ordinal(); while (index == PacketType.NONE.ordinal()) { @@ -506,9 +507,9 @@ public class AckElicitingTest { * pseudo random list of concrete {@link QuicFrame} instances. * @param ackEliciting whether the returned packet should be * ack eliciting. - * @return + * @return a new QuicPacket */ - QuicPacket createPacket(boolean ackEliciting) { + static QuicPacket createPacket(boolean ackEliciting) { List frames = new ArrayList<>(); int mincount = ackEliciting ? 1 : 0; int ackCount = RANDOM.nextInt(mincount, 5); @@ -542,7 +543,7 @@ public class AckElicitingTest { return createPacket(mergeConsecutivePaddingFrames(frames)); } - private List mergeConsecutivePaddingFrames(List frames) { + private static List mergeConsecutivePaddingFrames(List frames) { var iterator = frames.listIterator(); QuicFrame previous = null; @@ -567,7 +568,7 @@ public class AckElicitingTest { * @return a list of {@code TestCase} to test random instances of * {@code QuicPacket} containing random instances of {@link QuicFrame} */ - public List> createPacketsTests() { + static List> createPacketsTests() { List> packets = new ArrayList<>(); packets.add(of(createPacket(List.of(newFrame(AckFrame.class))), false)); packets.add(of(createPacket(List.of(newFrame(ConnectionCloseFrame.class))), false)); @@ -593,8 +594,7 @@ public class AckElicitingTest { * @return test case to test * {@link QuicFrame#isAckEliciting()} */ - @DataProvider(name = "frames") - public Object[][] framesDataProvider() { + public static Object[][] framesDataProvider() { return createFramesTests().stream() .map(List::of) .map(List::toArray) @@ -607,8 +607,7 @@ public class AckElicitingTest { * @return test case to test * {@link QuicPacket#isAckEliciting()} */ - @DataProvider(name = "packets") - public Object[][] packetsDataProvider() { + public static Object[][] packetsDataProvider() { return createPacketsTests().stream() .map(List::of) .map(List::toArray) @@ -621,8 +620,9 @@ public class AckElicitingTest { * @param test the test inputs * @param a concrete subclass of QuicFrame */ - @Test(dataProvider = "frames") - public void testFrames(TestCase test) { + @ParameterizedTest + @MethodSource("framesDataProvider") + void testFrames(TestCase test) { testAckEliciting(test.type(), test.describer(), test.ackEliciting(), @@ -636,8 +636,9 @@ public class AckElicitingTest { * @param test the test inputs * @param a concrete subclass of QuickPacket */ - @Test(dataProvider = "packets") - public void testPackets(TestCase test) { + @ParameterizedTest + @MethodSource("packetsDataProvider") + void testPackets(TestCase test) { testAckEliciting(test.type(), test.describer(), test.ackEliciting(), @@ -664,7 +665,7 @@ public class AckElicitingTest { type.getSimpleName(), describer.apply(obj), expected); - assertEquals(ackEliciting.test(obj), expected, describer.apply(obj)); + assertEquals(expected, ackEliciting.test(obj), describer.apply(obj)); if (obj instanceof QuicFrame frame) { checkFrame(frame); } else if (obj instanceof QuicPacket packet) { @@ -695,10 +696,10 @@ public class AckElicitingTest { System.out.printf("Comparing frames: %s with %s%n", decoded.getClass().getSimpleName(), expected.getClass().getSimpleName()); - assertEquals(decoded.getClass(), expected.getClass()); - assertEquals(decoded.size(), expected.size()); - assertEquals(decoded.getTypeField(), expected.getTypeField()); - assertEquals(decoded.isAckEliciting(), expected.isAckEliciting()); + assertEquals(expected.getClass(), decoded.getClass()); + assertEquals(expected.size(), decoded.size()); + assertEquals(expected.getTypeField(), decoded.getTypeField()); + assertEquals(expected.isAckEliciting(), decoded.isAckEliciting()); } // This is not a full-fledged test for packet encoding/decoding. @@ -714,13 +715,13 @@ public class AckElicitingTest { encoder.encode(packet, buffer, CONTEXT); buffer.flip(); var decoded = decoder.decode(buffer, CONTEXT); - assertEquals(decoded.size(), packet.size()); - assertEquals(decoded.packetType(), packet.packetType()); - assertEquals(decoded.payloadSize(), packet.payloadSize()); - assertEquals(decoded.isAckEliciting(), packet.isAckEliciting()); + assertEquals(packet.size(), decoded.size()); + assertEquals(packet.packetType(), decoded.packetType()); + assertEquals(packet.payloadSize(), decoded.payloadSize()); + assertEquals(packet.isAckEliciting(), decoded.isAckEliciting()); var frames = packet.frames(); var decodedFrames = decoded.frames(); - assertEquals(decodedFrames.size(), frames.size()); + assertEquals(frames.size(), decodedFrames.size()); } catch (Exception x) { throw new AssertionError(packet.getClass().getName(), x); } diff --git a/test/jdk/java/net/httpclient/quic/AckFrameTest.java b/test/jdk/java/net/httpclient/quic/AckFrameTest.java index 129394f126c..3c8c027e73b 100644 --- a/test/jdk/java/net/httpclient/quic/AckFrameTest.java +++ b/test/jdk/java/net/httpclient/quic/AckFrameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,20 +21,12 @@ * questions. */ -import jdk.internal.net.http.quic.CodingContext; import jdk.internal.net.http.quic.frames.AckFrame; import jdk.internal.net.http.quic.frames.AckFrame.AckFrameBuilder; import jdk.internal.net.http.quic.frames.AckFrame.AckRange; import jdk.internal.net.http.quic.frames.QuicFrame; -import jdk.internal.net.http.quic.packets.QuicPacket; -import jdk.internal.net.http.quic.packets.QuicPacket.PacketNumberSpace; -import jdk.internal.net.http.quic.QuicConnectionId; -import jdk.internal.net.quic.QuicTLSEngine; import jdk.test.lib.RandomFactory; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; @@ -43,66 +35,24 @@ import java.util.Random; import java.util.function.LongPredicate; import java.util.stream.LongStream; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -/** +/* * @test * @summary tests the logic to build an AckFrame * @library /test/lib - * @run testng AckFrameTest + * @run junit AckFrameTest */ public class AckFrameTest { static final Random RANDOM = RandomFactory.getRandom(); - private static abstract class TestCodingContext implements CodingContext { - TestCodingContext() { } - @Override - public int writePacket(QuicPacket packet, ByteBuffer buffer) { - throw new AssertionError("should not come here!"); - } - @Override - public QuicPacket parsePacket(ByteBuffer src) throws IOException { - throw new AssertionError("should not come here!"); - } - @Override - public boolean verifyToken(QuicConnectionId destinationID, byte[] token) { - return true; - } - @Override - public QuicTLSEngine getTLSEngine() { - throw new AssertionError("should not come here!"); - } - } - - static final int CIDLEN = RANDOM.nextInt(5, QuicConnectionId.MAX_CONNECTION_ID_LENGTH + 1); - - private static final TestCodingContext CONTEXT = new TestCodingContext() { - - @Override - public long largestProcessedPN(PacketNumberSpace packetSpace) { - return 0; - } - - @Override - public long largestAckedPN(PacketNumberSpace packetSpace) { - return 0; - } - - @Override - public int connectionIdLength() { - return CIDLEN; - } - - @Override - public QuicConnectionId originalServerConnId() { - return null; - } - }; - - public static record Acknowledged(long first, long last) { + public record Acknowledged(long first, long last) { public boolean contains(long packet) { return first <= packet && last >= packet; } @@ -116,7 +66,7 @@ public class AckFrameTest { return List.copyOf(res); } } - public static record Packet(long packetNumber) { + public record Packet(long packetNumber) { static List ofAcks(List acks) { return packets(acks); } @@ -125,7 +75,7 @@ public class AckFrameTest { } } - public static record TestCase(List acks, List packets, boolean shuffled) { + public record TestCase(List acks, List packets, boolean shuffled) { public TestCase(List acks) { this(acks, Packet.ofAcks(acks), false); } @@ -137,7 +87,7 @@ public class AckFrameTest { } } - List generateTests() { + static List generateTests() { List tests = new ArrayList<>(); List simples = List.of( new TestCase(List.of(new Acknowledged(5,5))), @@ -177,7 +127,7 @@ public class AckFrameTest { return tests; } - List generateAcks() { + static List generateAcks() { int count = RANDOM.nextInt(3, 10); List acks = new ArrayList<>(count); long prev = -1; @@ -202,22 +152,19 @@ public class AckFrameTest { return res; } - @DataProvider(name = "tests") - public Object[][] tests() { + public static Object[][] tests() { return generateTests().stream() .map(List::of) .map(List::toArray) .toArray(Object[][]::new); } - @Test(dataProvider = "tests") + @ParameterizedTest + @MethodSource("tests") public void testAckFrames(TestCase testCase) { AckFrameBuilder builder = new AckFrameBuilder(); List acks = testCase.acks; List packets = testCase.packets; - long largest = packets.stream() - .mapToLong(Packet::packetNumber) - .max().getAsLong(); System.out.printf("%ntestAckFrames(%s, %s)%n", acks, testCase.shuffled); builder.ackDelay(250); packets.stream().mapToLong(Packet::packetNumber).forEach(builder::addAck); @@ -227,8 +174,8 @@ public class AckFrameTest { checkAcknowledging(builder::isAcknowledging, testCase, packets); AckFrameBuilder dup = new AckFrameBuilder(frame); - assertEquals(frame, dup.build()); - assertEquals(frame, builder.build()); + assertEquals(dup.build(), frame); + assertEquals(builder.build(), frame); checkAcknowledging(dup::isAcknowledging, testCase, packets); packets.stream().mapToLong(Packet::packetNumber).forEach(builder::addAck); @@ -255,25 +202,25 @@ public class AckFrameTest { long largest = testCase.packets.stream() .mapToLong(Packet::packetNumber) .max().getAsLong(); - assertEquals(frame.largestAcknowledged(), largest); + assertEquals(largest, frame.largestAcknowledged()); checkAcknowledging(frame::isAcknowledging, testCase, packets); for (var ack : testCase.acks) { checkRangeAcknowledged(frame, ack.first, ack.last); } - assertEquals(frame, reference); + assertEquals(reference, frame); int size = frame.size(); ByteBuffer buffer = ByteBuffer.allocate(size + 10); buffer.position(5); buffer.limit(size + 5); try { frame.encode(buffer); - assertEquals(buffer.position(), buffer.limit()); + assertEquals(buffer.limit(), buffer.position()); buffer.position(5); buffer.limit(buffer.capacity()); var decoded = QuicFrame.decode(buffer); - assertEquals(buffer.position(), size + 5); - assertEquals(decoded, frame); - assertEquals(decoded, reference); + assertEquals(size + 5, buffer.position()); + assertEquals(frame, decoded); + assertEquals(reference, decoded); } catch (Exception e) { throw new AssertionError("Can't encode or decode frame: " + frame, e); } @@ -327,14 +274,14 @@ public class AckFrameTest { if (isAcknowledging != expected && testCase.shuffled) { System.out.printf(" -> %s%n", packets); } - assertEquals(isAcknowledging, expected, String.valueOf(pn)); + assertEquals(expected, isAcknowledging, String.valueOf(pn)); } for (var p : testCase.packets) { boolean isAcknowledging = isAckPredicate.test(p.packetNumber); if (!isAcknowledging && testCase.shuffled) { System.out.printf(" -> %s%n", packets); } - assertEquals(isAcknowledging, true, p.toString()); + assertEquals(true, isAcknowledging, p.toString()); } } @@ -345,9 +292,9 @@ public class AckFrameTest { assertTrue(frame.isAcknowledging(1), "1 should be acked"); assertFalse(frame.isAcknowledging(0), "0 should not be acked"); assertFalse(frame.isAcknowledging(2), "2 should not be acked"); - assertEquals(frame.smallestAcknowledged(), 1); - assertEquals(frame.largestAcknowledged(), 1); - assertEquals(frame.acknowledged().toArray(), new long[] {1L}); + assertEquals(1, frame.smallestAcknowledged()); + assertEquals(1, frame.largestAcknowledged()); + assertEquals(List.of(1L), frame.acknowledged().boxed().toList()); assertTrue(frame.isRangeAcknowledged(1,1), "[1,1] should be acked"); assertFalse(frame.isRangeAcknowledged(0, 1), "[0,1] should not be acked"); assertFalse(frame.isRangeAcknowledged(1, 2), "[1,2] should not be acked"); @@ -358,9 +305,9 @@ public class AckFrameTest { assertTrue(frame.isAcknowledging(1), "1 should be acked"); assertTrue(frame.isAcknowledging(0), "0 should be acked"); assertFalse(frame.isAcknowledging(2), "2 should not be acked"); - assertEquals(frame.smallestAcknowledged(), 0); - assertEquals(frame.largestAcknowledged(), 1); - assertEquals(frame.acknowledged().toArray(), new long[] {1L, 0L}); + assertEquals(0, frame.smallestAcknowledged()); + assertEquals(1, frame.largestAcknowledged()); + assertEquals(List.of(1L, 0L), frame.acknowledged().boxed().toList()); assertTrue(frame.isRangeAcknowledged(0,0), "[0,0] should be acked"); assertTrue(frame.isRangeAcknowledged(1,1), "[1,1] should be acked"); assertTrue(frame.isRangeAcknowledged(0, 1), "[0,1] should be acked"); diff --git a/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java b/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java index 5064bbd5cb3..100a6112de5 100644 --- a/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java +++ b/test/jdk/java/net/httpclient/quic/BuffersReaderVLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,29 +27,26 @@ import java.util.List; import jdk.internal.net.http.quic.BuffersReader; import jdk.internal.net.http.quic.BuffersReader.ListBuffersReader; import jdk.internal.net.http.quic.VariableLengthEncoder; -import jtreg.SkippedException; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.expectThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @library /test/lib * @modules java.net.http/jdk.internal.net.http.quic - * @run testng/othervm BuffersReaderVLTest + * @run junit/othervm BuffersReaderVLTest * @summary Tests to check quic/util methods encode/decodeVariableLength methods * work as expected. */ public class BuffersReaderVLTest { static final Class IAE = IllegalArgumentException.class; - @DataProvider(name = "decode invariants") - public Object[][] decodeInvariants() { + public static Object[][] decodeInvariants() { return new Object[][] { { new byte[]{7}, 7, 1 }, // 00 @@ -61,8 +58,7 @@ public class BuffersReaderVLTest { { new byte[]{-65}, -1, 0 }, }; } - @DataProvider(name = "prefix invariants") - public Object[][] prefixInvariants() { + public static Object[][] prefixInvariants() { return new Object[][] { { Long.MAX_VALUE, 0, IAE }, @@ -101,44 +97,47 @@ public class BuffersReaderVLTest { }; } - @Test(dataProvider = "decode invariants") + @ParameterizedTest + @MethodSource("decodeInvariants") public void testDecode(byte[] values, long expectedLength, int expectedPosition) { ByteBuffer bb = ByteBuffer.wrap(values); BuffersReader br = BuffersReader.list(bb); var actualLength = VariableLengthEncoder.decode(br); - assertEquals(actualLength, expectedLength); + assertEquals(expectedLength, actualLength); var actualPosition = bb.position(); - assertEquals(actualPosition, expectedPosition); - assertEquals(br.position(), expectedPosition); + assertEquals(expectedPosition, actualPosition); + assertEquals(expectedPosition, br.position()); br.release(); - assertEquals(br.read(), expectedPosition); + assertEquals(expectedPosition, br.read()); } - @Test(dataProvider = "decode invariants") + @ParameterizedTest + @MethodSource("decodeInvariants") public void testPeek(byte[] values, long expectedLength, int expectedPosition) { ByteBuffer bb = ByteBuffer.wrap(values); BuffersReader br = BuffersReader.list(bb); var actualLength = VariableLengthEncoder.peekEncodedValue(br, 0); - assertEquals(actualLength, expectedLength); + assertEquals(expectedLength, actualLength); var actualPosition = bb.position(); - assertEquals(actualPosition, 0); - assertEquals(br.position(), 0); + assertEquals(0, actualPosition); + assertEquals(0, br.position()); br.release(); - assertEquals(br.read(), 0); + assertEquals(0, br.read()); } // Encode the given length and then decodes it and compares // the results, asserting various invariants along the way. - @Test(dataProvider = "prefix invariants") + @ParameterizedTest + @MethodSource("prefixInvariants") public void testEncodeDecode(long length, int expectedPrefix, Class exception) { if (exception != null) { assertThrows(exception, () -> VariableLengthEncoder.getEncodedSize(length)); assertThrows(exception, () -> VariableLengthEncoder.encode(ByteBuffer.allocate(16), length)); } else { var actualSize = VariableLengthEncoder.getEncodedSize(length); - assertEquals(actualSize, 1 << expectedPrefix); + assertEquals(1 << expectedPrefix, actualSize); assertTrue(actualSize > 0, "length is negative or zero: " + actualSize); assertTrue(actualSize < 9, "length is too big: " + actualSize); @@ -158,33 +157,33 @@ public class BuffersReaderVLTest { longer.position(offset); // attempt to encode with a buffer too short - expectThrows(IAE, () -> VariableLengthEncoder.encode(shorter, length)); - assertEquals(shorter.position(), offset); - assertEquals(shorter.limit(), shorter.capacity()); + assertThrows(IAE, () -> VariableLengthEncoder.encode(shorter, length)); + assertEquals(offset, shorter.position()); + assertEquals(shorter.capacity(), shorter.limit()); - assertEquals(shorter.mismatch(shorterref), -1); - assertEquals(shorterref.mismatch(shorter), -1); + assertEquals(-1, shorter.mismatch(shorterref)); + assertEquals(-1, shorterref.mismatch(shorter)); // attempt to encode with a buffer that has the exact size var exactres = VariableLengthEncoder.encode(exact, length); - assertEquals(exactres, actualSize); - assertEquals(exact.position(), actualSize + offset); + assertEquals(actualSize, exactres); + assertEquals(actualSize + offset, exact.position()); assertFalse(exact.hasRemaining()); // attempt to encode with a buffer that has more bytes var longres = VariableLengthEncoder.encode(longer, length); - assertEquals(longres, actualSize); - assertEquals(longer.position(), offset + actualSize); - assertEquals(longer.limit(), longer.capacity()); - assertEquals(longer.remaining(), 10); + assertEquals(actualSize, longres); + assertEquals(offset + actualSize, longer.position()); + assertEquals(longer.capacity(), longer.limit()); + assertEquals(10, longer.remaining()); // compare encodings // first reset buffer positions for reading. exact.position(offset); longer.position(offset); - assertEquals(longer.mismatch(exact), actualSize); - assertEquals(exact.mismatch(longer), actualSize); + assertEquals(actualSize, longer.mismatch(exact)); + assertEquals(actualSize, exact.mismatch(longer)); // decode with a buffer that is missing the last // byte... @@ -193,23 +192,23 @@ public class BuffersReaderVLTest { shortSlice.limit(offset + actualSize -1); ListBuffersReader br = BuffersReader.list(shortSlice); var actualLength = VariableLengthEncoder.decode(br); - assertEquals(actualLength, -1L); - assertEquals(shortSlice.position(), offset); - assertEquals(shortSlice.limit(), offset + actualSize - 1); - assertEquals(br.position(), offset); - assertEquals(br.limit(), offset + actualSize - 1); + assertEquals(-1L, actualLength); + assertEquals(offset, shortSlice.position()); + assertEquals(offset + actualSize - 1, shortSlice.limit()); + assertEquals(offset, br.position()); + assertEquals(offset + actualSize - 1, br.limit()); br.release(); // decode with the exact buffer br = BuffersReader.list(exact); actualLength = VariableLengthEncoder.decode(br); - assertEquals(actualLength, length); - assertEquals(exact.position(), offset + actualSize); + assertEquals(length, actualLength); + assertEquals(offset + actualSize, exact.position()); assertFalse(exact.hasRemaining()); - assertEquals(br.position(), offset + actualSize); + assertEquals(offset + actualSize, br.position()); assertFalse(br.hasRemaining()); br.release(); - assertEquals(br.read(), actualSize); + assertEquals(actualSize, br.read()); assertFalse(br.hasRemaining()); @@ -217,14 +216,14 @@ public class BuffersReaderVLTest { long read = br.read(); br.add(longer); actualLength = VariableLengthEncoder.decode(br); - assertEquals(actualLength, length); - assertEquals(longer.position(), offset + actualSize); - assertEquals(longer.remaining(), 10); - assertEquals(br.position(), offset + actualSize); - assertEquals(br.remaining(), 10); + assertEquals(length, actualLength); + assertEquals(offset + actualSize, longer.position()); + assertEquals(10, longer.remaining()); + assertEquals(offset + actualSize, br.position()); + assertEquals(10, br.remaining()); br.release(); - assertEquals(br.read() - read, actualSize); - assertEquals(br.remaining(), 10); + assertEquals(actualSize, br.read() - read); + assertEquals(10, br.remaining()); } } @@ -232,7 +231,8 @@ public class BuffersReaderVLTest { // Encode the given length and then peeks it and compares // the results, asserting various invariants along the way. - @Test(dataProvider = "prefix invariants") + @ParameterizedTest + @MethodSource("prefixInvariants") public void testEncodePeek(long length, int expectedPrefix, Class exception) { if (exception != null) { assertThrows(exception, () -> VariableLengthEncoder.getEncodedSize(length)); @@ -241,7 +241,7 @@ public class BuffersReaderVLTest { } var actualSize = VariableLengthEncoder.getEncodedSize(length); - assertEquals(actualSize, 1 << expectedPrefix); + assertEquals(1 << expectedPrefix, actualSize); assertTrue(actualSize > 0, "length is negative or zero: " + actualSize); assertTrue(actualSize < 9, "length is too big: " + actualSize); @@ -258,24 +258,24 @@ public class BuffersReaderVLTest { // attempt to encode with a buffer that has the exact size var exactres = VariableLengthEncoder.encode(exact, length); - assertEquals(exactres, actualSize); - assertEquals(exact.position(), actualSize + offset); + assertEquals(actualSize, exactres); + assertEquals(actualSize + offset, exact.position()); assertFalse(exact.hasRemaining()); // attempt to encode with a buffer that has more bytes var longres = VariableLengthEncoder.encode(longer, length); - assertEquals(longres, actualSize); - assertEquals(longer.position(), offset + actualSize); - assertEquals(longer.limit(), longer.capacity()); - assertEquals(longer.remaining(), 10); + assertEquals(actualSize, longres); + assertEquals(offset + actualSize, longer.position()); + assertEquals(longer.capacity(), longer.limit()); + assertEquals(10, longer.remaining()); // compare encodings // first reset buffer positions for reading. exact.position(offset); longer.position(offset); - assertEquals(longer.mismatch(exact), actualSize); - assertEquals(exact.mismatch(longer), actualSize); + assertEquals(actualSize, longer.mismatch(exact)); + assertEquals(actualSize, exact.mismatch(longer)); exact.position(0); longer.position(0); exact.limit(exact.capacity()); @@ -288,38 +288,26 @@ public class BuffersReaderVLTest { shortSlice.limit(offset + actualSize - 1); // need at least one byte to decode the size len... var expectedSize = shortSlice.limit() <= offset ? -1 : actualSize; - assertEquals(VariableLengthEncoder.peekEncodedValueSize(shortSlice, offset), expectedSize); + assertEquals(expectedSize, VariableLengthEncoder.peekEncodedValueSize(shortSlice, offset)); var actualLength = VariableLengthEncoder.peekEncodedValue(shortSlice, offset); - assertEquals(actualLength, -1L); - assertEquals(shortSlice.position(), 0); - assertEquals(shortSlice.limit(), offset + actualSize - 1); + assertEquals(-1L, actualLength); + assertEquals(0, shortSlice.position()); + assertEquals(offset + actualSize - 1, shortSlice.limit()); // decode with the exact buffer - assertEquals(VariableLengthEncoder.peekEncodedValueSize(exact, offset), actualSize); + assertEquals(actualSize, VariableLengthEncoder.peekEncodedValueSize(exact, offset)); actualLength = VariableLengthEncoder.peekEncodedValue(exact, offset); - assertEquals(actualLength, length); - assertEquals(exact.position(), 0); - assertEquals(exact.limit(), exact.capacity()); + assertEquals(length, actualLength); + assertEquals(0, exact.position()); + assertEquals(exact.capacity(), exact.limit()); // decode with the longer buffer - assertEquals(VariableLengthEncoder.peekEncodedValueSize(longer, offset), actualSize); + assertEquals(actualSize, VariableLengthEncoder.peekEncodedValueSize(longer, offset)); actualLength = VariableLengthEncoder.peekEncodedValue(longer, offset); - assertEquals(actualLength, length); - assertEquals(longer.position(), 0); - assertEquals(longer.limit(), longer.capacity()); + assertEquals(length, actualLength); + assertEquals(0, longer.position()); + assertEquals(longer.capacity(), longer.limit()); } } - - - private ByteBuffer getTestBuffer(long length, int capacity) { - return switch (capacity) { - case 0 -> ByteBuffer.allocate(1).put((byte) length); - case 1 -> ByteBuffer.allocate(capacity).put((byte) length); - case 2 -> ByteBuffer.allocate(capacity).putShort((short) length); - case 4 -> ByteBuffer.allocate(capacity).putInt((int) length); - case 8 -> ByteBuffer.allocate(capacity).putLong(length); - default -> throw new SkippedException("bad value used for capacity"); - }; - } } diff --git a/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java b/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java index e7fabeeecac..96aeace0898 100644 --- a/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java +++ b/test/jdk/java/net/httpclient/quic/ConnectionIDSTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,12 +29,13 @@ import java.util.List; import java.util.Map; import jdk.internal.net.http.quic.QuicConnectionIdFactory; -import org.testng.annotations.Test; -import static org.testng.Assert.*; -/** +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +/* * @test - * @run testng/othervm ConnectionIDSTest + * @run junit/othervm ConnectionIDSTest */ public class ConnectionIDSTest { @@ -76,14 +77,14 @@ public class ConnectionIDSTest { int expectedLength = Math.min(length, 20); expectedLength = Math.max(9, expectedLength); long token = idFactory.newToken(); - assertEquals(token, previous +1); + assertEquals(previous +1, token); previous = token; var id = idFactory.newConnectionId(length, token); var cid = new ConnID(token, id); System.out.printf("%s: %s/%s%n", length, token, cid); - assertEquals(id.length, expectedLength); - assertEquals(idFactory.getConnectionIdLength(id), expectedLength); - assertEquals(idFactory.getConnectionIdToken(id), token); + assertEquals(expectedLength, id.length); + assertEquals(expectedLength, idFactory.getConnectionIdLength(id)); + assertEquals(token, idFactory.getConnectionIdToken(id)); ids.add(cid); } @@ -101,9 +102,9 @@ public class ConnectionIDSTest { var id = idFactory.newConnectionId(length, token); var cid = new ConnID(expectedToken, id); System.out.printf("%s: %s/%s%n", length, token, cid); - assertEquals(id.length, length); - assertEquals(idFactory.getConnectionIdLength(id), length); - assertEquals(idFactory.getConnectionIdToken(id), expectedToken); + assertEquals(length, id.length); + assertEquals(length, idFactory.getConnectionIdLength(id)); + assertEquals(expectedToken, idFactory.getConnectionIdToken(id)); ids.add(cid); } } @@ -119,15 +120,15 @@ public class ConnectionIDSTest { var id = idFactory.newConnectionId(length, token); var cid = new ConnID(expectedToken, id); System.out.printf("%s: %s/%s%n", length, token, cid); - assertEquals(id.length, length); - assertEquals(idFactory.getConnectionIdLength(id), length); - assertEquals(idFactory.getConnectionIdToken(id), expectedToken); + assertEquals(length, id.length); + assertEquals(length, idFactory.getConnectionIdLength(id)); + assertEquals(expectedToken, idFactory.getConnectionIdToken(id)); ids.add(cid); } } // now verify uniqueness - Map tested = new HashMap(); + Map tested = new HashMap<>(); record duplicates(ConnID first, ConnID second) {} List duplicates = new ArrayList<>(); for (var cid : ids) { @@ -144,9 +145,9 @@ public class ConnectionIDSTest { // and the token value is too big; check and remove them for (var iter = duplicates.iterator(); iter.hasNext(); ) { var dup = iter.next(); - assertEquals(dup.first.token(), dup.second.token()); - assertEquals(dup.first.bytes().length, dup.second.bytes().length); - assertEquals(dup.first.bytes(), dup.second.bytes()); + assertEquals(dup.second.token(), dup.first.token()); + assertEquals(dup.second.bytes().length, dup.first.bytes().length); + assertArrayEquals(dup.second.bytes(), dup.first.bytes()); long mask = 0x00FFFFFF00000000L; for (int i=0; i<3; i++) { mask = mask << 8; @@ -165,6 +166,6 @@ public class ConnectionIDSTest { for (var dup : duplicates) { System.out.println("unexpected duplicate: " + dup); } - assertEquals(duplicates.size(), 0); + assertEquals(0, duplicates.size()); } } diff --git a/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java b/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java index cfc62625605..422d71ca964 100644 --- a/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java +++ b/test/jdk/java/net/httpclient/quic/CryptoWriterQueueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,18 +23,18 @@ import jdk.internal.net.http.quic.frames.CryptoFrame; import jdk.internal.net.http.quic.streams.CryptoWriterQueue; -import org.testng.annotations.Test; import java.nio.ByteBuffer; -import static org.testng.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; -/** +/* * @test * @summary Tests jdk.internal.net.http.quic.streams,CryptoWriterQueue * @modules java.net.http/jdk.internal.net.http.quic.streams * java.net.http/jdk.internal.net.http.quic.frames - * @run testng CryptoWriterQueueTest + * @run junit CryptoWriterQueueTest */ public class CryptoWriterQueueTest { @@ -54,7 +54,7 @@ public class CryptoWriterQueueTest { writerQueue.enqueue(buff2); writerQueue.enqueue(buff3); final int expectedRemaining = buff1.remaining() + buff2.remaining() + buff3.remaining(); - assertEquals(writerQueue.remaining(), expectedRemaining, + assertEquals(expectedRemaining, writerQueue.remaining(), "Unexpected remaining bytes in CryptoWriterQueue"); // create frame(s) from the enqueued buffers final int maxPayloadSize = 1134; diff --git a/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java b/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java index d6d287be9e0..d13b8d9b865 100644 --- a/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java +++ b/test/jdk/java/net/httpclient/quic/KeyUpdateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ -48,12 +48,14 @@ import jdk.internal.net.quic.QuicKeyUnavailableException; import jdk.internal.net.quic.QuicTLSContext; import jdk.internal.net.quic.QuicVersion; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; + import sun.security.ssl.QuicTLSEngineImpl; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /* * @test @@ -78,22 +80,22 @@ import static org.testng.Assert.assertTrue; * jdk.test.lib.net.SimpleSSLContext * @comment the test is run with -Djava.security.properties= to augment * the master java.security file - * @run testng/othervm -Djava.security.properties=${test.src}/quic-tls-keylimits-java.security + * @run junit/othervm -Djava.security.properties=${test.src}/quic-tls-keylimits-java.security * -Djdk.internal.httpclient.debug=true * -Djavax.net.debug=all * KeyUpdateTest */ public class KeyUpdateTest { - private QuicStandaloneServer server; + private static QuicStandaloneServer server; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - private ExecutorService executor; + private static ExecutorService executor; private static final byte[] HELLO_MSG = "Hello Quic".getBytes(StandardCharsets.UTF_8); private static final EchoHandler handler = new EchoHandler(HELLO_MSG.length); - @BeforeClass - public void beforeClass() throws Exception { + @BeforeAll + public static void beforeClass() throws Exception { executor = Executors.newCachedThreadPool(); server = QuicStandaloneServer.newBuilder() .availableVersions(new QuicVersion[]{QuicVersion.QUIC_V1}) @@ -105,8 +107,8 @@ public class KeyUpdateTest { System.out.println("Server started at " + server.getAddress()); } - @AfterClass - public void afterClass() throws Exception { + @AfterAll + public static void afterClass() throws Exception { if (server != null) { System.out.println("Stopping server " + server.getAddress()); server.close(); @@ -163,7 +165,7 @@ public class KeyUpdateTest { // keep track of the 1-RTT key phase that was used by the client connection final int invocation = i; getKeyPhase(conn.underlyingQuicConnection()).ifPresent((keyPhase) -> { - if (clientConnKeyPhases.empty() || clientConnKeyPhases.peek() != keyPhase) { + if (clientConnKeyPhases.empty() || !keyPhase.equals(clientConnKeyPhases.peek())) { // new key phase detected, add it clientConnKeyPhases.push(keyPhase); System.out.println("Detected client 1-RTT key phase " + keyPhase @@ -223,7 +225,7 @@ public class KeyUpdateTest { // keep track of the 1-RTT key phase that was used by the server connection getKeyPhase(conn).ifPresent((keyPhase) -> { if (this.serverConnKeyPhases.empty() - || this.serverConnKeyPhases.peek() != keyPhase) { + || !keyPhase.equals(this.serverConnKeyPhases.peek())) { // new key phase detected, add it this.serverConnKeyPhases.push(keyPhase); System.out.println("Detected server 1-RTT key phase " + keyPhase diff --git a/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java b/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java index cb95620c00e..a1fafba8760 100644 --- a/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java +++ b/test/jdk/java/net/httpclient/quic/OrderedFlowTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 @@ -37,24 +37,24 @@ import jdk.internal.net.http.quic.OrderedFlow; import jdk.internal.net.http.quic.frames.CryptoFrame; import jdk.internal.net.http.quic.frames.QuicFrame; import jdk.internal.net.http.quic.frames.StreamFrame; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -/** +/* * @test * @summary tests the reordering logic implemented by OrderedFlow * and its two concrete subclasses * @library /test/lib - * @run testng OrderedFlowTest - * @run testng/othervm -Dseed=-2680947227866359853 OrderedFlowTest - * @run testng/othervm -Dseed=-273117134353023275 OrderedFlowTest - * @run testng/othervm -Dseed=3649132517916066643 OrderedFlowTest - * @run testng/othervm -Dseed=4568737726943220431 OrderedFlowTest + * @run junit OrderedFlowTest + * @run junit/othervm -Dseed=-2680947227866359853 OrderedFlowTest + * @run junit/othervm -Dseed=-273117134353023275 OrderedFlowTest + * @run junit/othervm -Dseed=3649132517916066643 OrderedFlowTest + * @run junit/othervm -Dseed=4568737726943220431 OrderedFlowTest */ public class OrderedFlowTest { @@ -135,13 +135,13 @@ public class OrderedFlowTest { """; interface FramesFactory { - public T create(int offset, String payload, boolean fin); - public int length(T frame); - public long offset(T frame); - public String getPayload(T frame); - public OrderedFlow flow(); - public Class frameType(); - public Comparator comparator(); + T create(int offset, String payload, boolean fin); + int length(T frame); + long offset(T frame); + String getPayload(T frame); + OrderedFlow flow(); + Class frameType(); + Comparator comparator(); } static class StreamFrameFactory implements FramesFactory { @@ -307,7 +307,7 @@ public class OrderedFlowTest { // not be buffered. static TestData reversed(TestData data) { List sorted = new ArrayList<>(data.frames()); - Collections.sort(sorted, data.framesComparator().reversed()); + sorted.sort(data.framesComparator().reversed()); return new TestData<>(data.frameType(),data.flowSupplier(), data.payloadAccessor(), data.framesComparator(), List.copyOf(sorted), data.expectedResult(), data.duplicates(), true); @@ -336,8 +336,7 @@ public class OrderedFlowTest { return List.copyOf(result); } - @DataProvider(name="CryptoFrame") - Object[][] generateCryptoFrames() { + static Object[][] generateCryptoFrames() { return generateData(new CryptoFrameFactory()) .stream() .map(List::of) @@ -345,8 +344,7 @@ public class OrderedFlowTest { .toArray(Object[][]::new); } - @DataProvider(name="StreamFrame") - Object[][] generateStreanFrames() { + static Object[][] generateStreanFrames() { return generateData(new StreamFrameFactory()) .stream() .map(List::of) @@ -380,21 +378,23 @@ public class OrderedFlowTest { "buffered data %s exceeds or equals payload size %s".formatted(buffered, size)); while (received != null) { var payload = testData.payloadAccessor.apply(received); - assertNotEquals(payload, "", "empty frames not expected: " + received); + assertNotEquals("", payload, "empty frames not expected: " + received); result.append(payload); received = flow.poll(); } } - assertEquals(result.toString(), testData.expectedResult); + assertEquals(testData.expectedResult, result.toString()); } - @Test(dataProvider = "CryptoFrame") - public void testCryptoFlow(TestData testData) { + @ParameterizedTest + @MethodSource("generateCryptoFrames") + void testCryptoFlow(TestData testData) { testOrderedFlow(testData, CryptoFrame::offset); } - @Test(dataProvider = "StreamFrame") - public void testStreamFlow(TestData testData) { + @ParameterizedTest + @MethodSource("generateStreanFrames") + void testStreamFlow(TestData testData) { testOrderedFlow(testData, StreamFrame::offset); } diff --git a/test/jdk/java/net/httpclient/quic/PacerTest.java b/test/jdk/java/net/httpclient/quic/PacerTest.java index d54f4125a46..aebbbce34d3 100644 --- a/test/jdk/java/net/httpclient/quic/PacerTest.java +++ b/test/jdk/java/net/httpclient/quic/PacerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,20 +26,21 @@ import jdk.internal.net.http.quic.QuicCongestionController; import jdk.internal.net.http.quic.QuicPacer; import jdk.internal.net.http.quic.QuicRttEstimator; import jdk.internal.net.http.quic.packets.QuicPacket; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.time.temporal.ChronoUnit; import java.util.Collection; import java.util.List; import java.util.stream.Stream; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test - * @run testng/othervm -Djdk.httpclient.quic.timerFrequency=1000 PacerTest + * @run junit/othervm -Djdk.httpclient.quic.timerFrequency=1000 PacerTest */ public class PacerTest { @@ -136,8 +137,7 @@ public class PacerTest { int initialPermit, int periodicPermit, boolean slowStart) { } - @DataProvider - public Object[][] pacerFirstFlight() { + public static Object[][] pacerFirstFlight() { return List.of( // Should permit initial window before blocking new TestCase(1200, 10, 32, 16, 10, 4, true), @@ -150,7 +150,8 @@ public class PacerTest { .toArray(Object[][]::new); } - @Test(dataProvider = "pacerFirstFlight") + @ParameterizedTest + @MethodSource("pacerFirstFlight") public void testBasicPacing(TestCase test) { int maxDatagramSize = test.maxDatagramSize; int packetsInIW = test.packetsInIW; diff --git a/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java b/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java index 495e8d41403..a96904c8410 100644 --- a/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketEncodingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 @@ -52,8 +52,6 @@ import jdk.internal.net.http.quic.QuicConnectionId; import jdk.internal.net.quic.QuicTLSEngine; import jdk.internal.net.quic.QuicTransportParametersConsumer; import jdk.internal.net.http.quic.VariableLengthEncoder; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.crypto.AEADBadTagException; import javax.net.ssl.SSLParameters; @@ -71,29 +69,32 @@ import java.util.function.IntFunction; import java.util.stream.Collectors; import static jdk.internal.net.http.quic.packets.QuicPacketNumbers.computePacketNumberLength; -import static org.testng.Assert.*; -/** +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +/* * @test * @library /test/lib * @summary test packet encoding and decoding in unencrypted form and without * any network involvement. - * @run testng/othervm -Dseed=2646683818688275736 PacketEncodingTest - * @run testng/othervm -Dseed=-3723256402256409075 PacketEncodingTest - * @run testng/othervm -Dseed=-3689060484817342283 PacketEncodingTest - * @run testng/othervm -Dseed=2425718686525936108 PacketEncodingTest - * @run testng/othervm -Dseed=-2996954753243104355 PacketEncodingTest - * @run testng/othervm -Dseed=8750823652999067800 PacketEncodingTest - * @run testng/othervm -Dseed=2906555779406889127 PacketEncodingTest - * @run testng/othervm -Dseed=902801756808168822 PacketEncodingTest - * @run testng/othervm -Dseed=5643545543196691308 PacketEncodingTest - * @run testng/othervm -Dseed=2646683818688275736 PacketEncodingTest - * @run testng/othervm -Djdk.internal.httpclient.debug=true PacketEncodingTest + * @run junit/othervm -Dseed=2646683818688275736 PacketEncodingTest + * @run junit/othervm -Dseed=-3723256402256409075 PacketEncodingTest + * @run junit/othervm -Dseed=-3689060484817342283 PacketEncodingTest + * @run junit/othervm -Dseed=2425718686525936108 PacketEncodingTest + * @run junit/othervm -Dseed=-2996954753243104355 PacketEncodingTest + * @run junit/othervm -Dseed=8750823652999067800 PacketEncodingTest + * @run junit/othervm -Dseed=2906555779406889127 PacketEncodingTest + * @run junit/othervm -Dseed=902801756808168822 PacketEncodingTest + * @run junit/othervm -Dseed=5643545543196691308 PacketEncodingTest + * @run junit/othervm -Dseed=2646683818688275736 PacketEncodingTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true PacketEncodingTest */ public class PacketEncodingTest { - @DataProvider - public Object[][] longHeaderPacketProvider() { + public static Object[][] longHeaderPacketProvider() { final QuicVersion[] quicVersions = QuicVersion.values(); final List params = new ArrayList<>(); for (final QuicVersion version : quicVersions) { @@ -117,8 +118,7 @@ public class PacketEncodingTest { return params.toArray(Object[][]::new); } - @DataProvider - public Object[][] shortHeaderPacketProvider() { + public static Object[][] shortHeaderPacketProvider() { final QuicVersion[] quicVersions = QuicVersion.values(); final List params = new ArrayList<>(); for (final QuicVersion version : quicVersions) { @@ -141,8 +141,7 @@ public class PacketEncodingTest { return params.toArray(Object[][]::new); } - @DataProvider - public Object[][] versionAndRetryProvider() { + public static Object[][] versionAndRetryProvider() { final QuicVersion[] quicVersions = QuicVersion.values(); final List params = new ArrayList<>(); for (final QuicVersion version : quicVersions) { @@ -393,23 +392,23 @@ public class PacketEncodingTest { QuicConnectionId destConnectionId, List payload) { // Check created packet - assertEquals(packet.headersType(), HeadersType.LONG); - assertEquals(packet.packetType(), packetType); + assertEquals(HeadersType.LONG, packet.headersType()); + assertEquals(packetType, packet.packetType()); boolean hasLength = switch (packetType) { case VERSIONS, RETRY -> false; default -> true; }; - assertEquals(packet.hasLength(), hasLength); - assertEquals(packet.numberSpace(), packetNumberSpace); + assertEquals(hasLength, packet.hasLength()); + assertEquals(packetNumberSpace, packet.numberSpace()); if (payload == null) { assertTrue(packet.frames().isEmpty()); } else { - assertEquals(getBuffers(packet.frames()), getBuffers(payload)); + assertEquals(getBuffers(payload), getBuffers(packet.frames())); } - assertEquals(packet.version(), versionNumber); - assertEquals(packet.packetNumber(), packetNumber); - assertEquals(packet.sourceId(), srcConnectionId); - assertEquals(packet.destinationId(), destConnectionId); + assertEquals(versionNumber, packet.version()); + assertEquals(packetNumber, packet.packetNumber()); + assertEquals(srcConnectionId, packet.sourceId()); + assertEquals(destConnectionId, packet.destinationId()); } @@ -446,11 +445,11 @@ public class PacketEncodingTest { PacketType packetType, int versionNumber, QuicConnectionId srcConnectionId, QuicConnectionId destConnectionId) { - assertEquals(QuicPacketDecoder.peekHeaderType(datagram, offset), HeadersType.LONG); - assertEquals(QuicPacketDecoder.of(datagram, offset).peekPacketType(datagram, offset), packetType); + assertEquals(HeadersType.LONG, QuicPacketDecoder.peekHeaderType(datagram, offset)); + assertEquals(packetType, QuicPacketDecoder.of(datagram, offset).peekPacketType(datagram, offset)); LongHeader header = QuicPacketDecoder.peekLongHeader(datagram, offset); assertNotNull(header, "Could not parse packet header"); - assertEquals(header.version(), versionNumber); + assertEquals(versionNumber, header.version()); assertTrue(header.destinationId() .matches(destConnectionId.asReadOnlyBuffer()), "Destination ID doesn't match"); assertTrue(header.sourceId() @@ -494,10 +493,10 @@ public class PacketEncodingTest { padding.encode(buf); } if (insert) { - assertEquals(buf.position(), remaining); - assertEquals(buf.remaining(), payloadSize - remaining); + assertEquals(remaining, buf.position()); + assertEquals(payloadSize - remaining, buf.remaining()); } else { - assertEquals(buf.remaining(), 0); + assertEquals(0, buf.remaining()); } return List.copyOf(frames); } @@ -507,7 +506,7 @@ public class PacketEncodingTest { int size = outgoingQuicPacket.size(); ByteBuffer buffer = ByteBuffer.allocate(size); encoder.encode(outgoingQuicPacket, buffer, context); - assertEquals(buffer.position(), size, " for " + outgoingQuicPacket); + assertEquals(size, buffer.position(), " for " + outgoingQuicPacket); buffer.flip(); return buffer; } @@ -520,33 +519,34 @@ public class PacketEncodingTest { List payload, int minSize) { // Check created packet - assertEquals(packet.headersType(), HeadersType.SHORT); - assertEquals(packet.packetType(), packetType); - assertEquals(packet.hasLength(), false); - assertEquals(packet.numberSpace(), packetNumberSpace); - assertEquals(getBuffers(packet.frames()), getBuffers(payload, minSize)); - assertEquals(packet.packetNumber(), packetNumber); - assertEquals(packet.destinationId(), destConnectionId); + assertEquals(HeadersType.SHORT, packet.headersType()); + assertEquals(packetType, packet.packetType()); + assertEquals(false, packet.hasLength()); + assertEquals(packetNumberSpace, packet.numberSpace()); + assertEquals(getBuffers(payload, minSize), getBuffers(packet.frames())); + assertEquals(packetNumber, packet.packetNumber()); + assertEquals(destConnectionId, packet.destinationId()); } private void checkShortHeaderPacketAt(ByteBuffer datagram, int offset, PacketType packetType, QuicConnectionId destConnectionId, CodingContext context) { - assertEquals(QuicPacketDecoder.peekHeaderType(datagram, offset), HeadersType.SHORT); - assertEquals(QuicPacketDecoder.of(QuicVersion.QUIC_V1).peekPacketType(datagram, offset), packetType); - assertEquals(QuicPacketDecoder.peekVersion(datagram, offset), 0); + assertEquals(HeadersType.SHORT, QuicPacketDecoder.peekHeaderType(datagram, offset)); + assertEquals(packetType, QuicPacketDecoder.of(QuicVersion.QUIC_V1).peekPacketType(datagram, offset)); + assertEquals(0, QuicPacketDecoder.peekVersion(datagram, offset)); int pos = datagram.position(); if (pos != offset) datagram.position(offset); try { - assertEquals(QuicPacketDecoder.peekShortConnectionId(datagram, destConnectionId.length()) - .mismatch(destConnectionId.asReadOnlyBuffer()), -1); + assertEquals(-1, QuicPacketDecoder.peekShortConnectionId(datagram, destConnectionId.length()) + .mismatch(destConnectionId.asReadOnlyBuffer())); } finally { if (pos != offset) datagram.position(pos); } } - @Test(dataProvider = "longHeaderPacketProvider") + @ParameterizedTest + @MethodSource("longHeaderPacketProvider") public void testInitialPacket(QuicVersion quicVersion, int srcIdLength, int destIdLength, long packetNumber, long largestAcked) throws Exception { System.out.printf("%ntestInitialPacket(qv:%s, scid:%d, dcid:%d, pn:%d, ack:%d)%n", @@ -557,12 +557,12 @@ public class PacketEncodingTest { .newConnectionId(destIdLength, IDS.incrementAndGet()); assert destid.length <= 20; final QuicConnectionId destConnectionId = new PeerConnectionId(destid); - assertEquals(destid.length, destConnectionId.length(), "dcid length"); + assertEquals(destConnectionId.length(), destid.length, "dcid length"); destIdLength = destid.length; byte[] srcid = randomIdBytes(srcIdLength); final QuicConnectionId srcConnectionId = new PeerConnectionId(srcid); - assertEquals(srcid.length, srcConnectionId.length(), "scid length"); + assertEquals(srcConnectionId.length(), srcid.length, "scid length"); int bound = MAX_DATAGRAM_IPV6 - srcIdLength - destid.length - 7 - QuicPacketNumbers.computePacketNumberLength(packetNumber, largestAcked) @@ -603,8 +603,8 @@ public class PacketEncodingTest { byte[] payload = new byte[payloadSize]; List frames = frames(payload, padding != 0); - assertEquals(frames.stream().mapToInt(QuicFrame::size) - .reduce(0, Math::addExact), payloadSize); + assertEquals(payloadSize, frames.stream().mapToInt(QuicFrame::size) + .reduce(0, Math::addExact)); // Create an initial packet @@ -626,7 +626,7 @@ public class PacketEncodingTest { largestAcked, frames2, context); - assertEquals(padding, padding + (1200 - packet2.size())); + assertEquals(padding + (1200 - packet2.size()), padding); } // Check created packet @@ -640,10 +640,10 @@ public class PacketEncodingTest { checkLongHeaderPacket(initialPacket, PacketType.INITIAL, quicVersion.versionNumber(), PacketNumberSpace.INITIAL, packetNumber, srcConnectionId, destConnectionId, frames, padding); - assertEquals(initialPacket.tokenLength(), tokenLength); - assertEquals(initialPacket.token(), token); - assertEquals(initialPacket.hasLength(), true); - assertEquals(initialPacket.length(), packetNumberLength + payloadSize + padding); + assertEquals(tokenLength, initialPacket.tokenLength()); + assertEquals(token, initialPacket.token()); + assertEquals(true, initialPacket.hasLength()); + assertEquals(packetNumberLength + payloadSize + padding, initialPacket.length()); // Check that peeking at the encoded packet returns correct information @@ -682,9 +682,9 @@ public class PacketEncodingTest { datagram.position(0); datagram.limit(datagram.capacity()); decoder.skipPacket(datagram, offset); - assertEquals(datagram.position(), second); + assertEquals(second, datagram.position()); decoder.skipPacket(datagram, second); - assertEquals(datagram.remaining(), offset); + assertEquals(offset, datagram.remaining()); datagram.position(offset); int size = second - offset; @@ -692,23 +692,24 @@ public class PacketEncodingTest { int pos = datagram.position(); System.out.printf("Decoding packet: %d at %d%n", (i+1), pos); var decodedPacket = decoder.decode(datagram, context); - assertEquals(datagram.position(), pos + size); + assertEquals(pos + size, datagram.position()); assertTrue(decodedPacket instanceof InitialPacket, "decoded: " + decodedPacket); InitialPacket initialDecoded = InitialPacket.class.cast(decodedPacket); checkLongHeaderPacket(initialDecoded, PacketType.INITIAL, quicVersion.versionNumber(), PacketNumberSpace.INITIAL, packetNumber, srcConnectionId, destConnectionId, frames, padding); - assertEquals(decodedPacket.size(), packet.size()); - assertEquals(decodedPacket.size(), size); - assertEquals(initialDecoded.tokenLength(), tokenLength); - assertEquals(initialDecoded.token(), token); - assertEquals(initialDecoded.length(), initialPacket.length()); - assertEquals(initialDecoded.length(), packetNumberLength + payloadSize + padding); + assertEquals(packet.size(), decodedPacket.size()); + assertEquals(size, decodedPacket.size()); + assertEquals(tokenLength, initialDecoded.tokenLength()); + assertArrayEquals(token, initialDecoded.token()); + assertEquals(initialPacket.length(), initialDecoded.length()); + assertEquals(packetNumberLength + payloadSize + padding, initialDecoded.length()); } - assertEquals(datagram.position(), second + second - offset); + assertEquals(second + second - offset, datagram.position()); } - @Test(dataProvider = "longHeaderPacketProvider") + @ParameterizedTest + @MethodSource("longHeaderPacketProvider") public void testHandshakePacket(QuicVersion quicVersion, int srcIdLength, int destIdLength, long packetNumber, long largestAcked) throws Exception { System.out.printf("%ntestHandshakePacket(qv:%s, scid:%d, dcid:%d, pn:%d, ack:%d)%n", @@ -757,8 +758,8 @@ public class PacketEncodingTest { checkLongHeaderPacket(handshakePacket, PacketType.HANDSHAKE, quicVersion.versionNumber(), PacketNumberSpace.HANDSHAKE, packetNumber, srcConnectionId, destConnectionId, frames); - assertEquals(handshakePacket.hasLength(), true); - assertEquals(handshakePacket.length(), packetNumberLength + payloadSize); + assertEquals(true, handshakePacket.hasLength()); + assertEquals(packetNumberLength + payloadSize, handshakePacket.length()); // Decode the two packets in the datagram // Check that peeking at the encoded packet returns correct information @@ -797,9 +798,9 @@ public class PacketEncodingTest { datagram.position(0); datagram.limit(datagram.capacity()); decoder.skipPacket(datagram, offset); - assertEquals(datagram.position(), second); + assertEquals(second, datagram.position()); decoder.skipPacket(datagram, second); - assertEquals(datagram.remaining(), offset); + assertEquals(offset, datagram.remaining()); datagram.position(offset); int size = second - offset; @@ -807,21 +808,22 @@ public class PacketEncodingTest { int pos = datagram.position(); System.out.printf("Decoding packet: %d at %d%n", (i+1), pos); var decodedPacket = decoder.decode(datagram, context); - assertEquals(datagram.position(), pos + size); + assertEquals(pos + size, datagram.position()); assertTrue(decodedPacket instanceof HandshakePacket, "decoded: " + decodedPacket); HandshakePacket handshakeDecoded = HandshakePacket.class.cast(decodedPacket); checkLongHeaderPacket(handshakeDecoded, PacketType.HANDSHAKE, quicVersion.versionNumber(), PacketNumberSpace.HANDSHAKE, packetNumber, srcConnectionId, destConnectionId, frames); - assertEquals(decodedPacket.size(), packet.size()); - assertEquals(decodedPacket.size(), size); - assertEquals(handshakeDecoded.length(), handshakePacket.length()); - assertEquals(handshakeDecoded.length(), packetNumberLength + payloadSize); + assertEquals(packet.size(), decodedPacket.size()); + assertEquals(size, decodedPacket.size()); + assertEquals(handshakePacket.length(), handshakeDecoded.length()); + assertEquals(packetNumberLength + payloadSize, handshakeDecoded.length()); } - assertEquals(datagram.position(), second + second - offset); + assertEquals(second + second - offset, datagram.position()); } - @Test(dataProvider = "longHeaderPacketProvider") + @ParameterizedTest + @MethodSource("longHeaderPacketProvider") public void testZeroRTTPacket(QuicVersion quicVersion, int srcIdLength, int destIdLength, long packetNumber, long largestAcked) throws Exception { System.out.printf("%ntestZeroRTTPacket(qv:%s, scid:%d, dcid:%d, pn:%d, ack:%d)%n", @@ -870,8 +872,8 @@ public class PacketEncodingTest { checkLongHeaderPacket(zeroRttPacket, PacketType.ZERORTT, quicVersion.versionNumber(), PacketNumberSpace.APPLICATION, packetNumber, srcConnectionId, destConnectionId, frames); - assertEquals(zeroRttPacket.hasLength(), true); - assertEquals(zeroRttPacket.length(), packetNumberLength + payloadSize); + assertEquals(true, zeroRttPacket.hasLength()); + assertEquals(packetNumberLength + payloadSize, zeroRttPacket.length()); // Check that peeking at the encoded packet returns correct information ByteBuffer encoded = toByteBuffer(encoder, packet, context); @@ -909,9 +911,9 @@ public class PacketEncodingTest { datagram.position(0); datagram.limit(datagram.capacity()); decoder.skipPacket(datagram, offset); - assertEquals(datagram.position(), second); + assertEquals(second, datagram.position()); decoder.skipPacket(datagram, second); - assertEquals(datagram.remaining(), offset); + assertEquals(offset, datagram.remaining()); // Decode the two packets in the datagram datagram.position(offset); @@ -920,21 +922,22 @@ public class PacketEncodingTest { int pos = datagram.position(); System.out.printf("Decoding packet: %d at %d%n", (i+1), pos); var decodedPacket = decoder.decode(datagram, context); - assertEquals(datagram.position(), pos + size); + assertEquals(pos + size, datagram.position()); assertTrue(decodedPacket instanceof ZeroRttPacket, "decoded: " + decodedPacket); ZeroRttPacket zeroRttDecoded = ZeroRttPacket.class.cast(decodedPacket); checkLongHeaderPacket(zeroRttDecoded, PacketType.ZERORTT, quicVersion.versionNumber(), PacketNumberSpace.APPLICATION, packetNumber, srcConnectionId, destConnectionId, frames); - assertEquals(decodedPacket.size(), packet.size()); - assertEquals(decodedPacket.size(), size); - assertEquals(zeroRttDecoded.length(), zeroRttPacket.length()); - assertEquals(zeroRttDecoded.length(), packetNumberLength + payloadSize); + assertEquals(packet.size(), decodedPacket.size()); + assertEquals(size, decodedPacket.size()); + assertEquals(zeroRttPacket.length(), zeroRttDecoded.length()); + assertEquals(packetNumberLength + payloadSize, zeroRttDecoded.length()); } - assertEquals(datagram.position(), second + second - offset); + assertEquals(second + second - offset, datagram.position()); } - @Test(dataProvider = "versionAndRetryProvider") + @ParameterizedTest + @MethodSource("versionAndRetryProvider") public void testVersionNegotiationPacket(QuicVersion quicVersion, int srcIdLength, int destIdLength) throws Exception { System.out.printf("%ntestVersionNegotiationPacket(qv:%s, scid:%d, dcid:%d, pn:%d, ack:%d)%n", @@ -965,9 +968,9 @@ public class PacketEncodingTest { checkLongHeaderPacket(versionPacket, PacketType.VERSIONS, 0, PacketNumberSpace.NONE, -1, srcConnectionId, destConnectionId, null); - assertEquals(versionPacket.hasLength(), false); - assertEquals(versionPacket.supportedVersions(), - versionList.stream().mapToInt(Integer::intValue).toArray()); + assertEquals(false, versionPacket.hasLength()); + assertArrayEquals(versionList.stream().mapToInt(Integer::intValue).toArray(), + versionPacket.supportedVersions()); CodingContext context = new TestCodingContext() { @Override public long largestProcessedPN(PacketNumberSpace packetSpace) { @@ -1009,8 +1012,8 @@ public class PacketEncodingTest { datagram.position(0); datagram.limit(datagram.capacity()); decoder.skipPacket(datagram, offset); - assertEquals(datagram.position(), end); - assertEquals(datagram.remaining(), 0); + assertEquals(end, datagram.position()); + assertEquals(0, datagram.remaining()); // Decode the two packets in the datagram datagram.position(offset); @@ -1019,21 +1022,22 @@ public class PacketEncodingTest { int pos = datagram.position(); System.out.printf("Decoding packet: %d at %d%n", (i+1), pos); var decodedPacket = decoder.decode(datagram, context); - assertEquals(datagram.position(), pos + size); + assertEquals(pos + size, datagram.position()); assertTrue(decodedPacket instanceof VersionNegotiationPacket, "decoded: " + decodedPacket); VersionNegotiationPacket decodedVersion = VersionNegotiationPacket.class.cast(decodedPacket); checkLongHeaderPacket(decodedVersion, PacketType.VERSIONS, 0, PacketNumberSpace.NONE, -1, srcConnectionId, destConnectionId, null); - assertEquals(decodedPacket.size(), packet.size()); - assertEquals(decodedPacket.size(), size); - assertEquals(decodedVersion.supportedVersions(), - versionList.stream().mapToInt(Integer::intValue).toArray()); + assertEquals(packet.size(), decodedPacket.size()); + assertEquals(size, decodedPacket.size()); + assertArrayEquals(versionList.stream().mapToInt(Integer::intValue).toArray(), + decodedVersion.supportedVersions()); } - assertEquals(datagram.position(), end); + assertEquals(end, datagram.position()); } - @Test(dataProvider = "versionAndRetryProvider") + @ParameterizedTest + @MethodSource("versionAndRetryProvider") public void testRetryPacket(QuicVersion quicVersion, int srcIdLength, int destIdLength) throws Exception { System.out.printf("%ntestRetryPacket(qv:%s, scid:%d, dcid:%d, pn:%d, ack:%d)%n", @@ -1067,9 +1071,9 @@ public class PacketEncodingTest { checkLongHeaderPacket(retryPacket, PacketType.RETRY, quicVersion.versionNumber(), PacketNumberSpace.NONE, -1, srcConnectionId, destConnectionId, null); - assertEquals(retryPacket.hasLength(), false); - assertEquals(retryPacket.retryToken(), retryToken); - assertEquals(retryPacket.size(), expectedSize); + assertEquals(false, retryPacket.hasLength()); + assertArrayEquals(retryToken, retryPacket.retryToken()); + assertEquals(expectedSize, retryPacket.size()); CodingContext context = new TestCodingContext() { @Override public long largestProcessedPN(PacketNumberSpace packetSpace) { @@ -1112,8 +1116,8 @@ public class PacketEncodingTest { datagram.position(0); datagram.limit(datagram.capacity()); decoder.skipPacket(datagram, offset); - assertEquals(datagram.position(), end); - assertEquals(datagram.remaining(), 0); + assertEquals(end, datagram.position()); + assertEquals(0, datagram.remaining()); // Decode the two packets in the datagram datagram.position(offset); @@ -1122,21 +1126,22 @@ public class PacketEncodingTest { int pos = datagram.position(); System.out.printf("Decoding packet: %d at %d%n", (i+1), pos); var decodedPacket = decoder.decode(datagram, context); - assertEquals(datagram.position(), pos + size); + assertEquals(pos + size, datagram.position()); assertTrue(decodedPacket instanceof RetryPacket, "decoded: " + decodedPacket); RetryPacket decodedRetry = RetryPacket.class.cast(decodedPacket); checkLongHeaderPacket(decodedRetry, PacketType.RETRY, quicVersion.versionNumber(), PacketNumberSpace.NONE, -1, srcConnectionId, destConnectionId, null); - assertEquals(decodedPacket.size(), packet.size()); - assertEquals(decodedPacket.size(), size); - assertEquals(decodedPacket.size(), expectedSize); - assertEquals(decodedRetry.retryToken(), retryToken); + assertEquals(packet.size(), decodedPacket.size()); + assertEquals(size, decodedPacket.size()); + assertEquals(expectedSize, decodedPacket.size()); + assertArrayEquals(retryToken, decodedRetry.retryToken()); } - assertEquals(datagram.position(), end); + assertEquals(end, datagram.position()); } - @Test(dataProvider = "shortHeaderPacketProvider") + @ParameterizedTest + @MethodSource("shortHeaderPacketProvider") public void testOneRTTPacket(QuicVersion quicVersion, int destIdLength, long packetNumber, long largestAcked) throws Exception { System.out.printf("%ntestOneRTTPacket(qv:%s, dcid:%d, pn:%d, ack:%d)%n", @@ -1186,8 +1191,8 @@ public class PacketEncodingTest { checkShortHeaderPacket(packet, PacketType.ONERTT, PacketNumberSpace.APPLICATION, packetNumber, destConnectionId, frames, minPayloadSize); - assertEquals(packet.hasLength(), false); - assertEquals(packet.size(), expectedSize); + assertEquals(false, packet.hasLength()); + assertEquals(expectedSize, packet.size()); // Check that peeking at the encoded packet returns correct information ByteBuffer encoded = toByteBuffer(encoder, packet, context); @@ -1218,9 +1223,9 @@ public class PacketEncodingTest { datagram.position(0); datagram.limit(end); decoder.skipPacket(datagram, offset); - assertEquals(datagram.position(), offset + expectedSize); - assertEquals(datagram.position(), datagram.limit()); - assertEquals(datagram.position(), datagram.capacity() - offset); + assertEquals(offset + expectedSize, datagram.position()); + assertEquals(datagram.limit(), datagram.position()); + assertEquals(datagram.capacity() - offset, datagram.position()); // Decode the packet in the datagram @@ -1230,7 +1235,7 @@ public class PacketEncodingTest { int pos = datagram.position(); System.out.printf("Decoding packet: %d at %d%n", (i+1), pos); var decodedPacket = decoder.decode(datagram, context); - assertEquals(datagram.position(), pos + size); + assertEquals(pos + size, datagram.position()); assertTrue(decodedPacket instanceof OneRttPacket, "decoded: " + decodedPacket); OneRttPacket oneRttDecoded = OneRttPacket.class.cast(decodedPacket); List expectedFrames = frames; @@ -1258,12 +1263,12 @@ public class PacketEncodingTest { checkShortHeaderPacket(oneRttDecoded, PacketType.ONERTT, PacketNumberSpace.APPLICATION, packetNumber, destConnectionId, expectedFrames, minPayloadSize); - assertEquals(decodedPacket.size(), packet.size()); - assertEquals(decodedPacket.size(), size); + assertEquals(packet.size(), decodedPacket.size()); + assertEquals(size, decodedPacket.size()); } - assertEquals(datagram.position(), offset + size); - assertEquals(datagram.remaining(), 0); - assertEquals(datagram.limit(), end); + assertEquals(offset + size, datagram.position()); + assertEquals(0, datagram.remaining()); + assertEquals(end, datagram.limit()); } @@ -1299,15 +1304,15 @@ public class PacketEncodingTest { ByteBuffer.wrap(new byte[] {16, 17}), ByteBuffer.wrap(new byte[] {18, 19, 20}) ); - assertEquals(Utils.mismatch(match1, match1), -1); - assertEquals(Utils.mismatch(match2, match2), -1); - assertEquals(Utils.mismatch(match3, match3), -1); - assertEquals(Utils.mismatch(match1, match2), -1); - assertEquals(Utils.mismatch(match2, match1), -1); - assertEquals(Utils.mismatch(match1, match3), -1); - assertEquals(Utils.mismatch(match3, match1), -1); - assertEquals(Utils.mismatch(match2, match3), -1); - assertEquals(Utils.mismatch(match3, match2), -1); + assertEquals(-1, Utils.mismatch(match1, match1)); + assertEquals(-1, Utils.mismatch(match2, match2)); + assertEquals(-1, Utils.mismatch(match3, match3)); + assertEquals(-1, Utils.mismatch(match1, match2)); + assertEquals(-1, Utils.mismatch(match2, match1)); + assertEquals(-1, Utils.mismatch(match1, match3)); + assertEquals(-1, Utils.mismatch(match3, match1)); + assertEquals(-1, Utils.mismatch(match2, match3)); + assertEquals(-1, Utils.mismatch(match3, match2)); } @Test @@ -1413,25 +1418,25 @@ public class PacketEncodingTest { ByteBuffer.wrap(new byte[] {18, 19, 20, 41, 42, 43}) ); - assertEquals(Utils.mismatch(nomatch0, nomatch0), -1L); - assertEquals(Utils.mismatch(nomatch10, nomatch10), -1L); - assertEquals(Utils.mismatch(nomatch19, nomatch19), -1L); - assertEquals(Utils.mismatch(morematch1, morematch1), -1L); - assertEquals(Utils.mismatch(morematch2, morematch2), -1L); - assertEquals(Utils.mismatch(morematch3, morematch3), -1L); - assertEquals(Utils.mismatch(morematch2, morematch3), -1L); - assertEquals(Utils.mismatch(morematch3, morematch2), -1L); + assertEquals(-1L, Utils.mismatch(nomatch0, nomatch0)); + assertEquals(-1L, Utils.mismatch(nomatch10, nomatch10)); + assertEquals(-1L, Utils.mismatch(nomatch19, nomatch19)); + assertEquals(-1L, Utils.mismatch(morematch1, morematch1)); + assertEquals(-1L, Utils.mismatch(morematch2, morematch2)); + assertEquals(-1L, Utils.mismatch(morematch3, morematch3)); + assertEquals(-1L, Utils.mismatch(morematch2, morematch3)); + assertEquals(-1L, Utils.mismatch(morematch3, morematch2)); for (var match : List.of(match1, match2, match3)) { - assertEquals(Utils.mismatch(match, nomatch0), 0L); - assertEquals(Utils.mismatch(match, nomatch10), 10L); - assertEquals(Utils.mismatch(match, nomatch19), 19L); - assertEquals(Utils.mismatch(nomatch0, match), 0L); - assertEquals(Utils.mismatch(nomatch10, match), 10L); - assertEquals(Utils.mismatch(nomatch19, match), 19L); + assertEquals(0L, Utils.mismatch(match, nomatch0)); + assertEquals(10L, Utils.mismatch(match, nomatch10)); + assertEquals(19L, Utils.mismatch(match, nomatch19)); + assertEquals(0L, Utils.mismatch(nomatch0, match)); + assertEquals(10L, Utils.mismatch(nomatch10, match)); + assertEquals(19L, Utils.mismatch(nomatch19, match)); for (var morematch : List.of(morematch1, morematch2, morematch3)) { - assertEquals(Utils.mismatch(match, morematch), 20L); - assertEquals(Utils.mismatch(morematch, match), 20L); + assertEquals(20L, Utils.mismatch(match, morematch)); + assertEquals(20L, Utils.mismatch(morematch, match)); } } diff --git a/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java b/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java index 3a4237d0847..c018079ea4e 100644 --- a/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketNumbersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,16 +27,17 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; import jdk.internal.net.http.quic.packets.QuicPacketNumbers; -import org.testng.SkipException; -import org.testng.annotations.Test; -import org.testng.annotations.DataProvider; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.expectThrows; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -/** +/* * @test - * @run testng PacketNumbersTest + * @run junit PacketNumbersTest */ public class PacketNumbersTest { @@ -85,8 +86,7 @@ public class PacketNumbersTest { } } - @DataProvider - public Object[][] encode() { + public static Object[][] encode() { return List.of( // these first three test cases are extracted from RFC 9000, appendix A.2 and A.3 new TestCase("success", 0xa82f9b32L, 0xa82f30eaL, EncodeResult.success(0x9b32)), @@ -127,19 +127,18 @@ public class PacketNumbersTest { .toArray(Object[][]::new); } - @Test(dataProvider = "encode") + @ParameterizedTest + @MethodSource("encode") public void testEncodePacketNumber(TestCase test) { System.out.println(test); if (test.result().assertion()) { - if (!QuicPacketNumbers.class.desiredAssertionStatus()) { - throw new SkipException("needs assertion enabled (-esa)"); - } - Throwable t = expectThrows(test.result().failure(), test::encode); + Assumptions.assumeFalse(!QuicPacketNumbers.class.desiredAssertionStatus(), "needs assertion enabled (-esa)"); + Throwable t = Assertions.assertThrows(test.result().failure(), test::encode); System.out.println("Got expected assertion: " + t); return; } if (test.result().fail()) { - Throwable t = expectThrows(test.result().failure(), test::encode); + Throwable t = Assertions.assertThrows(test.result().failure(), test::encode); System.out.println("Got expected exception: " + t); return; @@ -152,8 +151,8 @@ public class PacketNumbersTest { } // encode the full PN - check that the truncated PN == expected - assertEquals(truncated, test.result().expected()); + assertEquals(test.result().expected(), truncated); // check that decode(encoded) == fullPN - assertEquals(test.decode(), test.fullPN()); + assertEquals(test.fullPN(), test.decode()); } } diff --git a/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java b/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java index 40497ec13da..fe3b748a2fa 100644 --- a/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java +++ b/test/jdk/java/net/httpclient/quic/PacketSpaceManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 @@ -73,34 +73,35 @@ import jdk.internal.net.quic.QuicVersion; import jdk.internal.net.quic.QuicTransportException; import jdk.internal.net.quic.QuicTransportParametersConsumer; import jdk.test.lib.RandomFactory; -import org.testng.Assert; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import javax.crypto.AEADBadTagException; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSession; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -/** +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +/* * @test * @summary tests the logic to build an AckFrame * @library /test/lib * @library ../debug * @build java.net.http/jdk.internal.net.http.common.TestLoggerUtil - * @run testng/othervm PacketSpaceManagerTest - * @run testng/othervm -Dseed=-7947549564260911920 PacketSpaceManagerTest - * @run testng/othervm -Dseed=-5413111674202728207 PacketSpaceManagerTest - * @run testng/othervm -Dseed=-176652423987357212 PacketSpaceManagerTest - * @run testng/othervm -Dseed=6550551791799910315 PacketSpaceManagerTest - * @run testng/othervm -Dseed=-4159871071396382784 PacketSpaceManagerTest - * @run testng/othervm -Dseed=2252276218459363615 PacketSpaceManagerTest - * @run testng/othervm -Dseed=-5130588140709404919 PacketSpaceManagerTest + * @run junit/othervm PacketSpaceManagerTest + * @run junit/othervm -Dseed=-7947549564260911920 PacketSpaceManagerTest + * @run junit/othervm -Dseed=-5413111674202728207 PacketSpaceManagerTest + * @run junit/othervm -Dseed=-176652423987357212 PacketSpaceManagerTest + * @run junit/othervm -Dseed=6550551791799910315 PacketSpaceManagerTest + * @run junit/othervm -Dseed=-4159871071396382784 PacketSpaceManagerTest + * @run junit/othervm -Dseed=2252276218459363615 PacketSpaceManagerTest + * @run junit/othervm -Dseed=-5130588140709404919 PacketSpaceManagerTest */ // -Djdk.internal.httpclient.debug=true public class PacketSpaceManagerTest { @@ -337,7 +338,7 @@ public class PacketSpaceManagerTest { * @param first the first packet acknowledged, inclusive * @param last the last packet acknowledged, inclusive */ - public static record Acknowledged(long first, long last) { + public record Acknowledged(long first, long last) { public Acknowledged { assert first >= 0 && first <= last; } @@ -360,7 +361,7 @@ public class PacketSpaceManagerTest { * @param packetNumber the packet number of the packet to send * @param delay a delay before the next packet should be emitted */ - public static record Packet(long packetNumber, long delay) { + public record Packet(long packetNumber, long delay) { Packet(long packetNumber) { this(packetNumber, RANDOM.nextLong(1, 255)); } @@ -391,7 +392,7 @@ public class PacketSpaceManagerTest { * before it's been emitted). * @param shuffled whether the list of packets is shuffled. */ - public static record TestCase(List acks, + public record TestCase(List acks, List packets, List ackframes, boolean shuffled) { @@ -440,7 +441,7 @@ public class PacketSpaceManagerTest { * a list of special testcases, and a list of random testcases. * @return A list of TestCases to test. */ - List generateTests() { + static List generateTests() { List tests = new ArrayList<>(); List simples = List.of( new TestCase(List.of(new Acknowledged(5,5))), @@ -485,7 +486,7 @@ public class PacketSpaceManagerTest { * A packet should only be present once. * @return a random list of increasing acknowledgement ranges. */ - List generateAcks() { + static List generateAcks() { int count = RANDOM.nextInt(3, 10); List acks = new ArrayList<>(count); long prev = -1; @@ -516,8 +517,7 @@ public class PacketSpaceManagerTest { return res; } - @DataProvider(name = "tests") - public Object[][] tests() { + public static Object[][] tests() { return generateTests().stream() .map(List::of) .map(List::toArray) @@ -757,7 +757,7 @@ public class PacketSpaceManagerTest { final CopyOnWriteArrayList retransmissions = new CopyOnWriteArrayList<>(); final CopyOnWriteArrayList successfulExpectations = new CopyOnWriteArrayList<>(); - static record Retransmission(long packetNumber, Deadline atOrAfter, long largestAckSent) { + record Retransmission(long packetNumber, Deadline atOrAfter, long largestAckSent) { boolean isFor(long number) { return number == packetNumber; } @@ -774,7 +774,7 @@ public class PacketSpaceManagerTest { * the test. * This method checks that the retransmission logic works as * expected. - * @throws Exception + * @throws Exception if the call fails */ // TODO: in the end we need to check that everything that was // expected to happen happened. What is missing is to @@ -890,7 +890,7 @@ public class PacketSpaceManagerTest { .stream().filter(AckFrame.class::isInstance) .map(AckFrame.class::cast) .toList(); - assertEquals(frames.size(), 1, + assertEquals(1, frames.size(), "unexpected ack frames: " + frames); AckFrame ackFrame = ackFrames.get(0); LongStream.range(firstAckPaket, lastAckPacket + 1) @@ -1029,10 +1029,11 @@ public class PacketSpaceManagerTest { void check() { assertFalse(now().isBefore(timeSource.first.plusMillis(timeline))); assertTrue(expectedRetransmissions.isEmpty()); - assertEquals(retransmissions.stream() + assertEquals(successfulExpectations.stream() .map(Retransmission::packetNumber) .filter(pn -> pn <= maxPacketNumber).toList(), - successfulExpectations.stream().map(Retransmission::packetNumber) + retransmissions.stream() + .map(Retransmission::packetNumber) .filter(pn -> pn <= maxPacketNumber).toList()); for (Retransmission r : retransmissions) { if (r.packetNumber > maxPacketNumber || @@ -1040,14 +1041,14 @@ public class PacketSpaceManagerTest { List succesful = successfulExpectations.stream() .filter(s -> s.isFor(r.packetNumber)) .toList(); - assertEquals(succesful.size(), 1); + assertEquals(1, succesful.size()); succesful.forEach(s -> assertFalse(s.atOrAfter.isAfter(r.atOrAfter))); } List acknowledged = new ArrayList<>(acknowledgePackets(allAcks.build())); Collections.sort(acknowledged); - assertEquals(acknowledged, test.packets.stream() - .map(Packet::packetNumber).sorted().toList()); + assertEquals(test.packets.stream() + .map(Packet::packetNumber).sorted().toList(), acknowledged); } // TODO: add a LongStream acknowledged() to AckFrame - write a spliterator @@ -1073,8 +1074,8 @@ public class PacketSpaceManagerTest { default String negation() { return (this == FALSE) ? "doesn't " : ""; } - Assertion TRUE = Assert::assertTrue; - Assertion FALSE = Assert::assertFalse; + Assertion TRUE = Assertions::assertTrue; + Assertion FALSE = Assertions::assertFalse; } static void assertContains(Assertion assertion, List list, long number, String desc) { assertion.check(list.contains(number), @@ -1115,7 +1116,8 @@ public class PacketSpaceManagerTest { } } - @Test(dataProvider = "tests") + @ParameterizedTest + @MethodSource("tests") public void testPacketSpaceManager(TestCase testCase) throws Exception { System.out.printf("%n ------- testPacketSpaceManager ------- %n"); SynchronousTestDriver driver = new SynchronousTestDriver(testCase); diff --git a/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java b/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java index f0d4b316e46..ef0801e6c18 100644 --- a/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java +++ b/test/jdk/java/net/httpclient/quic/QuicFramesDecoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2026, 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,20 +24,20 @@ import jdk.internal.net.http.quic.frames.QuicFrame; import jdk.internal.net.quic.QuicTransportErrors; import jdk.internal.net.quic.QuicTransportException; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.nio.ByteBuffer; import java.util.HexFormat; -import static org.testng.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @library /test/lib * @summary Tests to check QUIC frame decoding errors are handled correctly - * @run testng/othervm QuicFramesDecoderTest + * @run junit/othervm QuicFramesDecoderTest */ public class QuicFramesDecoderTest { @@ -181,7 +181,6 @@ public class QuicFramesDecoderTest { private static final byte[] NEW_CONNECTION_ID_ZERO = HexFormat.of().parseHex("181716"+ "00"+"0f0e0d0c0b0a09080706050403020100"); - @DataProvider public static Object[][] goodFrames() { return new Object[][]{ new Object[]{"ack without ecn", ACK_BASE, false}, @@ -226,7 +225,6 @@ public class QuicFramesDecoderTest { }; } - @DataProvider public static Object[][] badFrames() { return new Object[][]{ new Object[]{"ack without ecn, negative pn", ACK_NEG_BASE}, @@ -242,7 +240,8 @@ public class QuicFramesDecoderTest { }; } - @Test(dataProvider = "goodFrames") + @ParameterizedTest + @MethodSource("goodFrames") public void testReencode(String desc, byte[] frame, boolean bloated) throws Exception { // check if the goodFrames provider indeed contains good frames ByteBuffer buf = ByteBuffer.wrap(frame); @@ -250,16 +249,17 @@ public class QuicFramesDecoderTest { assertFalse(buf.hasRemaining(), buf.remaining() + " bytes left in buffer after parsing"); // some frames deliberately use suboptimal encoding, skip them if (bloated) return; - assertEquals(qf.size(), frame.length, "Frame size mismatch"); + assertEquals(frame.length, qf.size(), "Frame size mismatch"); buf.clear(); ByteBuffer encoded = ByteBuffer.allocate(frame.length); qf.encode(encoded); assertFalse(encoded.hasRemaining(), "Actual frame length mismatch"); encoded.flip(); - assertEquals(buf, encoded, "Encoded buffer is different from the original one"); + assertEquals(encoded, buf, "Encoded buffer is different from the original one"); } - @Test(dataProvider = "goodFrames") + @ParameterizedTest + @MethodSource("goodFrames") public void testToString(String desc, byte[] frame, boolean bloated) throws Exception { // check if the goodFrames provider indeed contains good frames ByteBuffer buf = ByteBuffer.wrap(frame); @@ -268,7 +268,8 @@ public class QuicFramesDecoderTest { System.out.println(qf); // should not throw } - @Test(dataProvider = "goodFrames") + @ParameterizedTest + @MethodSource("goodFrames") public void testTruncatedFrame(String desc, byte[] frame, boolean bloated) throws Exception { // check if parsing a truncated frame throws the right error ByteBuffer buf = ByteBuffer.wrap(frame); @@ -279,12 +280,13 @@ public class QuicFramesDecoderTest { var qf = QuicFrame.decode(buf); fail("Expected the decoder to throw on length " + i + ", got: " + qf); } catch (QuicTransportException e) { - assertEquals(e.getErrorCode(), QuicTransportErrors.FRAME_ENCODING_ERROR.code()); + assertEquals(QuicTransportErrors.FRAME_ENCODING_ERROR.code(), e.getErrorCode()); } } } - @Test(dataProvider = "badFrames") + @ParameterizedTest + @MethodSource("badFrames") public void testBadFrame(String desc, byte[] frame) throws Exception { // check if parsing a bad frame throws the right error ByteBuffer buf = ByteBuffer.wrap(frame); @@ -292,7 +294,7 @@ public class QuicFramesDecoderTest { var qf = QuicFrame.decode(buf); fail("Expected the decoder to throw, got: "+qf); } catch (QuicTransportException e) { - assertEquals(e.getErrorCode(), QuicTransportErrors.FRAME_ENCODING_ERROR.code()); + assertEquals(QuicTransportErrors.FRAME_ENCODING_ERROR.code(), e.getErrorCode()); } } } diff --git a/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java b/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java index 9d5c35f5414..208e284cefd 100644 --- a/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java +++ b/test/jdk/java/net/httpclient/quic/QuicRequestResponseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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 @@ -43,9 +43,10 @@ import jdk.internal.net.http.quic.QuicClient; import jdk.internal.net.quic.QuicTLSContext; import jdk.internal.net.quic.QuicVersion; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /* * @test @@ -54,18 +55,18 @@ import org.testng.annotations.Test; * jdk.httpclient.test.lib.quic.ClientConnection * jdk.httpclient.test.lib.common.TestUtil * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.internal.httpclient.debug=true QuicRequestResponseTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true QuicRequestResponseTest */ public class QuicRequestResponseTest { - private QuicStandaloneServer server; + private static QuicStandaloneServer server; private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); - private ExecutorService executor; + private static ExecutorService executor; private static final byte[] HELLO_MSG = "Hello Quic".getBytes(StandardCharsets.UTF_8); - @BeforeClass - public void beforeClass() throws Exception { + @BeforeAll + public static void beforeClass() throws Exception { executor = Executors.newCachedThreadPool(); server = QuicStandaloneServer.newBuilder() .availableVersions(new QuicVersion[]{QuicVersion.QUIC_V1}) @@ -77,8 +78,8 @@ public class QuicRequestResponseTest { System.out.println("Server started at " + server.getAddress()); } - @AfterClass - public void afterClass() throws Exception { + @AfterAll + public static void afterClass() throws Exception { if (server != null) { System.out.println("Stopping server " + server.getAddress()); server.close(); diff --git a/test/jdk/java/net/httpclient/quic/VariableLengthTest.java b/test/jdk/java/net/httpclient/quic/VariableLengthTest.java index aec3e999812..cf05b91b18f 100644 --- a/test/jdk/java/net/httpclient/quic/VariableLengthTest.java +++ b/test/jdk/java/net/httpclient/quic/VariableLengthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,32 +22,31 @@ */ import jdk.internal.net.http.quic.VariableLengthEncoder; import jtreg.SkippedException; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.io.IOException; import java.nio.ByteBuffer; import java.util.List; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.expectThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test * @library /test/lib * @modules java.net.http/jdk.internal.net.http.quic - * @run testng/othervm VariableLengthTest + * @run junit/othervm VariableLengthTest * @summary Tests to check quic/util methods encode/decodeVariableLength methods * work as expected. */ public class VariableLengthTest { static final Class IAE = IllegalArgumentException.class; - @DataProvider(name = "decode invariants") - public Object[][] decodeInvariants() { + public static Object[][] decodeInvariants() { return new Object[][] { { new byte[]{7}, 7, 1 }, // 00 @@ -59,8 +58,7 @@ public class VariableLengthTest { { new byte[]{-65}, -1, 0 }, }; } - @DataProvider(name = "encode invariants") - public Object[][] encodeInvariants() { + public static Object[][] encodeInvariants() { return new Object[][] { { 7, 1, null }, // 00 @@ -71,8 +69,7 @@ public class VariableLengthTest { { -1, 0, IAE }, }; } - @DataProvider(name = "prefix invariants") - public Object[][] prefixInvariants() { + public static Object[][] prefixInvariants() { return new Object[][] { { Long.MAX_VALUE, 0, IAE }, @@ -111,27 +108,30 @@ public class VariableLengthTest { }; } - @Test(dataProvider = "decode invariants") + @ParameterizedTest + @MethodSource("decodeInvariants") public void testDecode(byte[] values, long expectedLength, int expectedPosition) { ByteBuffer bb = ByteBuffer.wrap(values); var actualLength = VariableLengthEncoder.decode(bb); - assertEquals(actualLength, expectedLength); + assertEquals(expectedLength, actualLength); var actualPosition = bb.position(); - assertEquals(actualPosition, expectedPosition); + assertEquals(expectedPosition, actualPosition); } - @Test(dataProvider = "decode invariants") + @ParameterizedTest + @MethodSource("decodeInvariants") public void testPeek(byte[] values, long expectedLength, int expectedPosition) { ByteBuffer bb = ByteBuffer.wrap(values); var actualLength = VariableLengthEncoder.peekEncodedValue(bb, 0); - assertEquals(actualLength, expectedLength); + assertEquals(expectedLength, actualLength); var actualPosition = bb.position(); - assertEquals(actualPosition, 0); + assertEquals(0, actualPosition); } - @Test(dataProvider = "encode invariants") + @ParameterizedTest + @MethodSource("encodeInvariants") public void testEncode(long length, int capacity, Class exception) throws IOException { var actualBuffer = ByteBuffer.allocate(capacity); var expectedBuffer = getTestBuffer(length, capacity); @@ -140,46 +140,48 @@ public class VariableLengthTest { assertThrows(exception, () -> VariableLengthEncoder.encode(actualBuffer, length)); // if method fails ensure that position hasn't changed var actualPosition = actualBuffer.position(); - assertEquals(actualPosition, capacity); + assertEquals(capacity, actualPosition); } else { VariableLengthEncoder.encode(actualBuffer, length); var actualPosition = actualBuffer.position(); - assertEquals(actualPosition, capacity); + assertEquals(capacity, actualPosition); // check length prefix int firstByte = actualBuffer.get(0) & 0xFF; int lengthPrefix = firstByte & 0xC0; lengthPrefix >>= 6; int expectedValue = (int)(Math.log(capacity) / Math.log(2)); - assertEquals(lengthPrefix, expectedValue); + assertEquals(expectedValue, lengthPrefix); // check length encoded in buffer correctly int b = firstByte & 0x3F; actualBuffer.put(0, (byte) b); - assertEquals(actualBuffer.compareTo(expectedBuffer), 0); + assertEquals(0, actualBuffer.compareTo(expectedBuffer)); } } - @Test(dataProvider = "prefix invariants") + @ParameterizedTest + @MethodSource("prefixInvariants") public void testLengthPrefix(long length, int expectedPrefix, Class exception) { if (exception != null) { assertThrows(exception, () -> VariableLengthEncoder.getVariableLengthPrefix(length)); } else { var actualValue = VariableLengthEncoder.getVariableLengthPrefix(length); - assertEquals(actualValue, expectedPrefix); + assertEquals(expectedPrefix, actualValue); } } // Encode the given length and then decodes it and compares // the results, asserting various invariants along the way. - @Test(dataProvider = "prefix invariants") + @ParameterizedTest + @MethodSource("prefixInvariants") public void testEncodeDecode(long length, int expectedPrefix, Class exception) { if (exception != null) { assertThrows(exception, () -> VariableLengthEncoder.getEncodedSize(length)); assertThrows(exception, () -> VariableLengthEncoder.encode(ByteBuffer.allocate(16), length)); } else { var actualSize = VariableLengthEncoder.getEncodedSize(length); - assertEquals(actualSize, 1 << expectedPrefix); + assertEquals(1 << expectedPrefix, actualSize); assertTrue(actualSize > 0, "length is negative or zero: " + actualSize); assertTrue(actualSize < 9, "length is too big: " + actualSize); @@ -199,33 +201,33 @@ public class VariableLengthTest { longer.position(offset); // attempt to encode with a buffer too short - expectThrows(IAE, () -> VariableLengthEncoder.encode(shorter, length)); - assertEquals(shorter.position(), offset); - assertEquals(shorter.limit(), shorter.capacity()); + assertThrows(IAE, () -> VariableLengthEncoder.encode(shorter, length)); + assertEquals(offset, shorter.position()); + assertEquals(shorter.capacity(), shorter.limit()); - assertEquals(shorter.mismatch(shorterref), -1); - assertEquals(shorterref.mismatch(shorter), -1); + assertEquals(-1, shorter.mismatch(shorterref)); + assertEquals(-1, shorterref.mismatch(shorter)); // attempt to encode with a buffer that has the exact size var exactres = VariableLengthEncoder.encode(exact, length); - assertEquals(exactres, actualSize); - assertEquals(exact.position(), actualSize + offset); + assertEquals(actualSize, exactres); + assertEquals(actualSize + offset, exact.position()); assertFalse(exact.hasRemaining()); // attempt to encode with a buffer that has more bytes var longres = VariableLengthEncoder.encode(longer, length); - assertEquals(longres, actualSize); - assertEquals(longer.position(), offset + actualSize); - assertEquals(longer.limit(), longer.capacity()); - assertEquals(longer.remaining(), 10); + assertEquals(actualSize, longres); + assertEquals(offset + actualSize, longer.position()); + assertEquals(longer.capacity(), longer.limit()); + assertEquals(10, longer.remaining()); // compare encodings // first reset buffer positions for reading. exact.position(offset); longer.position(offset); - assertEquals(longer.mismatch(exact), actualSize); - assertEquals(exact.mismatch(longer), actualSize); + assertEquals(actualSize, longer.mismatch(exact)); + assertEquals(actualSize, exact.mismatch(longer)); // decode with a buffer that is missing the last // byte... @@ -233,21 +235,21 @@ public class VariableLengthTest { shortSlice.position(offset); shortSlice.limit(offset + actualSize -1); var actualLength = VariableLengthEncoder.decode(shortSlice); - assertEquals(actualLength, -1L); - assertEquals(shortSlice.position(), offset); - assertEquals(shortSlice.limit(), offset + actualSize - 1); + assertEquals(-1L, actualLength); + assertEquals(offset, shortSlice.position()); + assertEquals(offset + actualSize - 1, shortSlice.limit()); // decode with the exact buffer actualLength = VariableLengthEncoder.decode(exact); - assertEquals(actualLength, length); - assertEquals(exact.position(), offset + actualSize); + assertEquals(length, actualLength); + assertEquals(offset + actualSize, exact.position()); assertFalse(exact.hasRemaining()); // decode with the longer buffer actualLength = VariableLengthEncoder.decode(longer); - assertEquals(actualLength, length); - assertEquals(longer.position(), offset + actualSize); - assertEquals(longer.remaining(), 10); + assertEquals(length, actualLength); + assertEquals(offset + actualSize, longer.position()); + assertEquals(10, longer.remaining()); } } @@ -255,7 +257,8 @@ public class VariableLengthTest { // Encode the given length and then peeks it and compares // the results, asserting various invariants along the way. - @Test(dataProvider = "prefix invariants") + @ParameterizedTest + @MethodSource("prefixInvariants") public void testEncodePeek(long length, int expectedPrefix, Class exception) { if (exception != null) { assertThrows(exception, () -> VariableLengthEncoder.getEncodedSize(length)); @@ -264,7 +267,7 @@ public class VariableLengthTest { } var actualSize = VariableLengthEncoder.getEncodedSize(length); - assertEquals(actualSize, 1 << expectedPrefix); + assertEquals(1 << expectedPrefix, actualSize); assertTrue(actualSize > 0, "length is negative or zero: " + actualSize); assertTrue(actualSize < 9, "length is too big: " + actualSize); @@ -281,24 +284,24 @@ public class VariableLengthTest { // attempt to encode with a buffer that has the exact size var exactres = VariableLengthEncoder.encode(exact, length); - assertEquals(exactres, actualSize); - assertEquals(exact.position(), actualSize + offset); + assertEquals(actualSize, exactres); + assertEquals(actualSize + offset, exact.position()); assertFalse(exact.hasRemaining()); // attempt to encode with a buffer that has more bytes var longres = VariableLengthEncoder.encode(longer, length); - assertEquals(longres, actualSize); - assertEquals(longer.position(), offset + actualSize); - assertEquals(longer.limit(), longer.capacity()); - assertEquals(longer.remaining(), 10); + assertEquals(actualSize, longres); + assertEquals(offset + actualSize, longer.position()); + assertEquals(longer.capacity(), longer.limit()); + assertEquals(10, longer.remaining()); // compare encodings // first reset buffer positions for reading. exact.position(offset); longer.position(offset); - assertEquals(longer.mismatch(exact), actualSize); - assertEquals(exact.mismatch(longer), actualSize); + assertEquals(actualSize, longer.mismatch(exact)); + assertEquals(actualSize, exact.mismatch(longer)); exact.position(0); longer.position(0); exact.limit(exact.capacity()); @@ -311,25 +314,25 @@ public class VariableLengthTest { shortSlice.limit(offset + actualSize - 1); // need at least one byte to decode the size len... var expectedSize = shortSlice.limit() <= offset ? -1 : actualSize; - assertEquals(VariableLengthEncoder.peekEncodedValueSize(shortSlice, offset), expectedSize); + assertEquals(expectedSize, VariableLengthEncoder.peekEncodedValueSize(shortSlice, offset)); var actualLength = VariableLengthEncoder.peekEncodedValue(shortSlice, offset); - assertEquals(actualLength, -1L); - assertEquals(shortSlice.position(), 0); - assertEquals(shortSlice.limit(), offset + actualSize - 1); + assertEquals(-1L, actualLength); + assertEquals(0, shortSlice.position()); + assertEquals(offset + actualSize - 1, shortSlice.limit()); // decode with the exact buffer - assertEquals(VariableLengthEncoder.peekEncodedValueSize(exact, offset), actualSize); + assertEquals(actualSize, VariableLengthEncoder.peekEncodedValueSize(exact, offset)); actualLength = VariableLengthEncoder.peekEncodedValue(exact, offset); - assertEquals(actualLength, length); - assertEquals(exact.position(), 0); - assertEquals(exact.limit(), exact.capacity()); + assertEquals(length, actualLength); + assertEquals(0, exact.position()); + assertEquals(exact.capacity(), exact.limit()); // decode with the longer buffer - assertEquals(VariableLengthEncoder.peekEncodedValueSize(longer, offset), actualSize); + assertEquals(actualSize, VariableLengthEncoder.peekEncodedValueSize(longer, offset)); actualLength = VariableLengthEncoder.peekEncodedValue(longer, offset); - assertEquals(actualLength, length); - assertEquals(longer.position(), 0); - assertEquals(longer.limit(), longer.capacity()); + assertEquals(length, actualLength); + assertEquals(0, longer.position()); + assertEquals(longer.capacity(), longer.limit()); } } diff --git a/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java b/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java index 973477a63dc..bd5bbae0170 100644 --- a/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java +++ b/test/jdk/java/net/httpclient/quic/VersionNegotiationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,13 +41,15 @@ import jdk.internal.net.http.quic.QuicClient; import jdk.internal.net.quic.QuicTLSContext; import jdk.internal.net.quic.QuicVersion; import jdk.test.lib.net.SimpleSSLContext; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.expectThrows; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /* * @test @@ -57,19 +59,19 @@ import static org.testng.Assert.expectThrows; * jdk.httpclient.test.lib.common.TestUtil * jdk.httpclient.test.lib.quic.ClientConnection * jdk.test.lib.net.SimpleSSLContext - * @run testng/othervm -Djdk.internal.httpclient.debug=true VersionNegotiationTest + * @run junit/othervm -Djdk.internal.httpclient.debug=true VersionNegotiationTest */ public class VersionNegotiationTest { private static final SSLContext sslContext = SimpleSSLContext.findSSLContext(); private static ExecutorService executor; - @BeforeClass + @BeforeAll public static void beforeClass() throws Exception { executor = Executors.newCachedThreadPool(); } - @AfterClass + @AfterAll public static void afterClass() throws Exception { if (executor != null) executor.shutdown(); } @@ -96,7 +98,7 @@ public class VersionNegotiationTest { try (final QuicServer server = createAndStartServer(serverVersion)) { System.out.println("Attempting to connect " + client.getAvailableVersions() + " client to a " + server.getAvailableVersions() + " server"); - final IOException thrown = expectThrows(IOException.class, + final IOException thrown = Assertions.assertThrows(IOException.class, () -> ClientConnection.establishConnection(client, server.getAddress())); // a version negotiation failure (since it happens during a QUIC connection // handshake) gets thrown as a SSLHandshakeException @@ -105,7 +107,7 @@ public class VersionNegotiationTest { } System.out.println("Received (potentially expected) exception: " + sslhe); // additional check to make sure it was thrown for the right reason - assertEquals(sslhe.getMessage(), "QUIC connection establishment failed"); + assertEquals("QUIC connection establishment failed", sslhe.getMessage()); // underlying cause of SSLHandshakeException should be version negotiation failure final Throwable underlyingCause = sslhe.getCause(); assertNotNull(underlyingCause, "missing cause in SSLHandshakeException"); diff --git a/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java b/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java index ed1cbc08de0..d80e473696a 100644 --- a/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/PacketEncryptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,6 @@ import jdk.internal.net.quic.QuicKeyUnavailableException; import jdk.internal.net.quic.QuicTLSContext; import jdk.internal.net.quic.QuicTLSEngine; import jdk.internal.net.quic.QuicTransportException; -import org.testng.annotations.Test; import sun.security.ssl.QuicTLSEngineImpl; import sun.security.ssl.QuicTLSEngineImplAccessor; @@ -40,8 +39,11 @@ import java.util.HexFormat; import java.util.function.IntFunction; import static jdk.internal.net.quic.QuicVersion.QUIC_V1; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; /** * @test @@ -50,7 +52,7 @@ import static org.testng.Assert.fail; * java.base/jdk.internal.net.quic * @build java.base/sun.security.ssl.QuicTLSEngineImplAccessor * @summary known-answer test for packet encryption and decryption - * @run testng/othervm PacketEncryptionTest + * @run junit/othervm PacketEncryptionTest */ public class PacketEncryptionTest { @@ -183,7 +185,7 @@ public class PacketEncryptionTest { clientEngine.encryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_C_PN, new FixedHeaderContent(header), payload, packet); protect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_C_PN_OFFSET, INITIAL_C_PAYLOAD_OFFSET - INITIAL_C_PN_OFFSET, clientEngine, 0x0f); - assertEquals(HexFormat.of().formatHex(packet.array()), ENCRYPTED_C_PAYLOAD); + assertEquals(ENCRYPTED_C_PAYLOAD, HexFormat.of().formatHex(packet.array())); } @Test @@ -202,26 +204,25 @@ public class PacketEncryptionTest { String expectedContents = INITIAL_C_HEADER + INITIAL_C_PAYLOAD; - assertEquals(HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length()), expectedContents); + assertEquals(expectedContents, HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length())); } - @Test(expectedExceptions = AEADBadTagException.class) - public void testDecryptClientInitialPacketBadTag() throws Exception { - QuicTLSEngine serverEngine = getQuicV1Engine(SSLContext.getDefault(), false); - ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); - serverEngine.deriveInitialKeys(QUIC_V1, dcid); - - ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_C_PAYLOAD)); - unprotect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_C_PN_OFFSET, INITIAL_C_PAYLOAD_OFFSET - INITIAL_C_PN_OFFSET, serverEngine, 0x0f); - ByteBuffer src = packet.asReadOnlyBuffer(); - packet.position(INITIAL_C_PAYLOAD_OFFSET); - - // change one byte of AEAD tag - packet.put(packet.limit() - 1, (byte)0); - - serverEngine.decryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_C_PN, -1, - src, INITIAL_C_PAYLOAD_OFFSET, packet); - fail("Decryption should have failed"); + @Test + public void testDecryptClientInitialPacketBadTag() { + Assertions.assertThrows(AEADBadTagException.class, () -> { + QuicTLSEngine serverEngine = getQuicV1Engine(SSLContext.getDefault(), false); + ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); + serverEngine.deriveInitialKeys(QUIC_V1, dcid); + ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_C_PAYLOAD)); + unprotect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_C_PN_OFFSET, INITIAL_C_PAYLOAD_OFFSET - INITIAL_C_PN_OFFSET, serverEngine, 0x0f); + ByteBuffer src = packet.asReadOnlyBuffer(); + packet.position(INITIAL_C_PAYLOAD_OFFSET); + // change one byte of AEAD tag + packet.put(packet.limit() - 1, (byte)0); + serverEngine.decryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_C_PN, -1, + src, INITIAL_C_PAYLOAD_OFFSET, packet); + fail("Decryption should have failed"); + }); } @Test @@ -242,7 +243,7 @@ public class PacketEncryptionTest { serverEngine.encryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_S_PN, new FixedHeaderContent(header), payload, packet); protect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_S_PN_OFFSET, INITIAL_S_PAYLOAD_OFFSET - INITIAL_S_PN_OFFSET, serverEngine, 0x0f); - assertEquals(HexFormat.of().formatHex(packet.array()), ENCRYPTED_S_PAYLOAD); + assertEquals(ENCRYPTED_S_PAYLOAD, HexFormat.of().formatHex(packet.array())); } @Test @@ -261,7 +262,7 @@ public class PacketEncryptionTest { String expectedContents = INITIAL_S_HEADER + INITIAL_S_PAYLOAD; - assertEquals(HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length()), expectedContents); + assertEquals(expectedContents, HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length())); } @Test @@ -302,7 +303,7 @@ public class PacketEncryptionTest { clientEngine.signRetryPacket(QUIC_V1, dcid, src, packet); - assertEquals(HexFormat.of().formatHex(packet.array()), SIGNED_RETRY); + assertEquals(SIGNED_RETRY, HexFormat.of().formatHex(packet.array())); } @Test @@ -315,17 +316,17 @@ public class PacketEncryptionTest { clientEngine.verifyRetryPacket(QUIC_V1, dcid, packet); } - @Test(expectedExceptions = AEADBadTagException.class) - public void testVerifyBadRetry() throws NoSuchAlgorithmException, AEADBadTagException, QuicTransportException { - QuicTLSEngine clientEngine = getQuicV1Engine(SSLContext.getDefault(), true); - ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); - - ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(SIGNED_RETRY)); - - // change one byte of AEAD tag - packet.put(packet.limit() - 1, (byte)0); - clientEngine.verifyRetryPacket(QUIC_V1, dcid, packet); - fail("Verification should have failed"); + @Test + public void testVerifyBadRetry() { + Assertions.assertThrows(AEADBadTagException.class, () -> { + QuicTLSEngine clientEngine = getQuicV1Engine(SSLContext.getDefault(), true); + ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); + ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(SIGNED_RETRY)); + // change one byte of AEAD tag + packet.put(packet.limit() - 1, (byte)0); + clientEngine.verifyRetryPacket(QUIC_V1, dcid, packet); + fail("Verification should have failed"); + }); } @Test @@ -346,7 +347,7 @@ public class PacketEncryptionTest { clientEngine.encryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN , new FixedHeaderContent(header), payload, packet); protect(QuicTLSEngine.KeySpace.ONE_RTT, packet, ONERTT_PN_OFFSET, ONERTT_PAYLOAD_OFFSET - ONERTT_PN_OFFSET, clientEngine, 0x1f); - assertEquals(HexFormat.of().formatHex(packet.array()), ENCRYPTED_ONERTT_PAYLOAD); + assertEquals(ENCRYPTED_ONERTT_PAYLOAD, HexFormat.of().formatHex(packet.array())); } @Test @@ -367,7 +368,7 @@ public class PacketEncryptionTest { String expectedContents = ONERTT_HEADER + ONERTT_PAYLOAD; - assertEquals(HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length()), expectedContents); + assertEquals(expectedContents, HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length())); } @Test @@ -397,25 +398,24 @@ public class PacketEncryptionTest { serverEngine.decryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN, keyPhase, src, ONERTT_PAYLOAD_OFFSET, packet); } - @Test(expectedExceptions = AEADBadTagException.class) - public void testDecryptChaChaBadTag() throws Exception { - QuicTLSEngineImpl serverEngine = (QuicTLSEngineImpl) getQuicV1Engine(SSLContext.getDefault(), false); - // mark the TLS handshake as FINISHED - QuicTLSEngineImplAccessor.completeHandshake(serverEngine); - SecretKey key = new SecretKeySpec(HexFormat.of().parseHex(ONERTT_SECRET), 0, 32, "ChaCha20-Poly1305"); - QuicTLSEngineImplAccessor.testDeriveOneRTTKeys(QUIC_V1, serverEngine, key, key, "TLS_CHACHA20_POLY1305_SHA256", false); - - ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_ONERTT_PAYLOAD)); - unprotect(QuicTLSEngine.KeySpace.ONE_RTT, packet, ONERTT_PN_OFFSET, ONERTT_PAYLOAD_OFFSET - ONERTT_PN_OFFSET, serverEngine, 0x1f); - ByteBuffer src = packet.asReadOnlyBuffer(); - packet.position(ONERTT_PAYLOAD_OFFSET); - - // change one byte of AEAD tag - packet.put(packet.limit() - 1, (byte)0); - - serverEngine.decryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN, (byte) 0, - src, ONERTT_PAYLOAD_OFFSET, packet); - fail("Decryption should have failed"); + @Test + public void testDecryptChaChaBadTag() { + Assertions.assertThrows(AEADBadTagException.class, () -> { + QuicTLSEngineImpl serverEngine = (QuicTLSEngineImpl) getQuicV1Engine(SSLContext.getDefault(), false); + // mark the TLS handshake as FINISHED + QuicTLSEngineImplAccessor.completeHandshake(serverEngine); + SecretKey key = new SecretKeySpec(HexFormat.of().parseHex(ONERTT_SECRET), 0, 32, "ChaCha20-Poly1305"); + QuicTLSEngineImplAccessor.testDeriveOneRTTKeys(QUIC_V1, serverEngine, key, key, "TLS_CHACHA20_POLY1305_SHA256", false); + ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_ONERTT_PAYLOAD)); + unprotect(QuicTLSEngine.KeySpace.ONE_RTT, packet, ONERTT_PN_OFFSET, ONERTT_PAYLOAD_OFFSET - ONERTT_PN_OFFSET, serverEngine, 0x1f); + ByteBuffer src = packet.asReadOnlyBuffer(); + packet.position(ONERTT_PAYLOAD_OFFSET); + // change one byte of AEAD tag + packet.put(packet.limit() - 1, (byte)0); + serverEngine.decryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN, (byte) 0, + src, ONERTT_PAYLOAD_OFFSET, packet); + fail("Decryption should have failed"); + }); } diff --git a/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java b/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java index a506495ed5e..285fa2e4cd4 100644 --- a/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java +++ b/test/jdk/java/net/httpclient/quic/tls/Quicv2PacketEncryptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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,6 @@ import jdk.internal.net.quic.QuicKeyUnavailableException; import jdk.internal.net.quic.QuicTLSContext; import jdk.internal.net.quic.QuicTLSEngine; import jdk.internal.net.quic.QuicTransportException; -import org.testng.annotations.Test; import sun.security.ssl.QuicTLSEngineImpl; import sun.security.ssl.QuicTLSEngineImplAccessor; @@ -40,8 +39,11 @@ import java.util.HexFormat; import java.util.function.IntFunction; import static jdk.internal.net.quic.QuicVersion.QUIC_V2; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; /** * @test @@ -50,7 +52,7 @@ import static org.testng.Assert.fail; * java.base/jdk.internal.net.quic * @build java.base/sun.security.ssl.QuicTLSEngineImplAccessor * @summary known-answer test for packet encryption and decryption with Quic v2 - * @run testng/othervm Quicv2PacketEncryptionTest + * @run junit/othervm Quicv2PacketEncryptionTest */ public class Quicv2PacketEncryptionTest { @@ -182,7 +184,7 @@ public class Quicv2PacketEncryptionTest { clientEngine.encryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_C_PN, new FixedHeaderContent(header), payload, packet); protect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_C_PN_OFFSET, INITIAL_C_PAYLOAD_OFFSET - INITIAL_C_PN_OFFSET, clientEngine, 0x0f); - assertEquals(HexFormat.of().formatHex(packet.array()), ENCRYPTED_C_PAYLOAD); + assertEquals(ENCRYPTED_C_PAYLOAD, HexFormat.of().formatHex(packet.array())); } @Test @@ -200,25 +202,24 @@ public class Quicv2PacketEncryptionTest { String expectedContents = INITIAL_C_HEADER + INITIAL_C_PAYLOAD; - assertEquals(HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length()), expectedContents); + assertEquals(expectedContents, HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length())); } - @Test(expectedExceptions = AEADBadTagException.class) + @Test public void testDecryptClientInitialPacketBadTag() throws Exception { - QuicTLSEngine serverEngine = getQuicV2Engine(SSLContext.getDefault(), false); - ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); - serverEngine.deriveInitialKeys(QUIC_V2, dcid); - - ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_C_PAYLOAD)); - unprotect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_C_PN_OFFSET, INITIAL_C_PAYLOAD_OFFSET - INITIAL_C_PN_OFFSET, serverEngine, 0x0f); - ByteBuffer src = packet.asReadOnlyBuffer(); - packet.position(INITIAL_C_PAYLOAD_OFFSET); - - // change one byte of AEAD tag - packet.put(packet.limit() - 1, (byte)0); - - serverEngine.decryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_C_PN, -1, src, INITIAL_C_PAYLOAD_OFFSET, packet); - fail("Decryption should have failed"); + Assertions.assertThrows(AEADBadTagException.class, () -> { + QuicTLSEngine serverEngine = getQuicV2Engine(SSLContext.getDefault(), false); + ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); + serverEngine.deriveInitialKeys(QUIC_V2, dcid); + ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_C_PAYLOAD)); + unprotect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_C_PN_OFFSET, INITIAL_C_PAYLOAD_OFFSET - INITIAL_C_PN_OFFSET, serverEngine, 0x0f); + ByteBuffer src = packet.asReadOnlyBuffer(); + packet.position(INITIAL_C_PAYLOAD_OFFSET); + // change one byte of AEAD tag + packet.put(packet.limit() - 1, (byte)0); + serverEngine.decryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_C_PN, -1, src, INITIAL_C_PAYLOAD_OFFSET, packet); + fail("Decryption should have failed"); + }); } @Test @@ -239,7 +240,7 @@ public class Quicv2PacketEncryptionTest { serverEngine.encryptPacket(QuicTLSEngine.KeySpace.INITIAL, INITIAL_S_PN, new FixedHeaderContent(header), payload, packet); protect(QuicTLSEngine.KeySpace.INITIAL, packet, INITIAL_S_PN_OFFSET, INITIAL_S_PAYLOAD_OFFSET - INITIAL_S_PN_OFFSET, serverEngine, 0x0f); - assertEquals(HexFormat.of().formatHex(packet.array()), ENCRYPTED_S_PAYLOAD); + assertEquals(ENCRYPTED_S_PAYLOAD, HexFormat.of().formatHex(packet.array())); } @Test @@ -257,7 +258,7 @@ public class Quicv2PacketEncryptionTest { String expectedContents = INITIAL_S_HEADER + INITIAL_S_PAYLOAD; - assertEquals(HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length()), expectedContents); + assertEquals(expectedContents, HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length())); } @Test @@ -298,7 +299,7 @@ public class Quicv2PacketEncryptionTest { clientEngine.signRetryPacket(QUIC_V2, dcid, src, packet); - assertEquals(HexFormat.of().formatHex(packet.array()), SIGNED_RETRY); + assertEquals(SIGNED_RETRY, HexFormat.of().formatHex(packet.array())); } @Test @@ -311,17 +312,17 @@ public class Quicv2PacketEncryptionTest { clientEngine.verifyRetryPacket(QUIC_V2, dcid, packet); } - @Test(expectedExceptions = AEADBadTagException.class) + @Test public void testVerifyBadRetry() throws NoSuchAlgorithmException, AEADBadTagException, QuicTransportException { - QuicTLSEngine clientEngine = getQuicV2Engine(SSLContext.getDefault(), true); - ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); - - ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(SIGNED_RETRY)); - - // change one byte of AEAD tag - packet.put(packet.limit() - 1, (byte)0); - clientEngine.verifyRetryPacket(QUIC_V2, dcid, packet); - fail("Verification should have failed"); + Assertions.assertThrows(AEADBadTagException.class, () -> { + QuicTLSEngine clientEngine = getQuicV2Engine(SSLContext.getDefault(), true); + ByteBuffer dcid = ByteBuffer.wrap(HexFormat.of().parseHex(INITIAL_DCID)); + ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(SIGNED_RETRY)); + // change one byte of AEAD tag + packet.put(packet.limit() - 1, (byte)0); + clientEngine.verifyRetryPacket(QUIC_V2, dcid, packet); + fail("Verification should have failed"); + }); } @Test @@ -342,7 +343,7 @@ public class Quicv2PacketEncryptionTest { clientEngine.encryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN , new FixedHeaderContent(header), payload, packet); protect(QuicTLSEngine.KeySpace.ONE_RTT, packet, ONERTT_PN_OFFSET, ONERTT_PAYLOAD_OFFSET - ONERTT_PN_OFFSET, clientEngine, 0x1f); - assertEquals(HexFormat.of().formatHex(packet.array()), ENCRYPTED_ONERTT_PAYLOAD); + assertEquals(ENCRYPTED_ONERTT_PAYLOAD, HexFormat.of().formatHex(packet.array())); } @Test @@ -362,7 +363,7 @@ public class Quicv2PacketEncryptionTest { String expectedContents = ONERTT_HEADER + ONERTT_PAYLOAD; - assertEquals(HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length()), expectedContents); + assertEquals(expectedContents, HexFormat.of().formatHex(packet.array()).substring(0, expectedContents.length())); } @Test @@ -392,24 +393,23 @@ public class Quicv2PacketEncryptionTest { serverEngine.decryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN, keyphase, src, ONERTT_PAYLOAD_OFFSET, packet); } - @Test(expectedExceptions = AEADBadTagException.class) + @Test public void testDecryptChaChaBadTag() throws Exception { - QuicTLSEngineImpl serverEngine = (QuicTLSEngineImpl) getQuicV2Engine(SSLContext.getDefault(), false); - // mark the TLS handshake as FINISHED - QuicTLSEngineImplAccessor.completeHandshake(serverEngine); - SecretKey key = new SecretKeySpec(HexFormat.of().parseHex(ONERTT_SECRET), 0, 32, "ChaCha20-Poly1305"); - QuicTLSEngineImplAccessor.testDeriveOneRTTKeys(QUIC_V2, serverEngine, key, key, "TLS_CHACHA20_POLY1305_SHA256", false); - - ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_ONERTT_PAYLOAD)); - unprotect(QuicTLSEngine.KeySpace.ONE_RTT, packet, ONERTT_PN_OFFSET, ONERTT_PAYLOAD_OFFSET - ONERTT_PN_OFFSET, serverEngine, 0x1f); - ByteBuffer src = packet.asReadOnlyBuffer(); - packet.position(ONERTT_PAYLOAD_OFFSET); - - // change one byte of AEAD tag - packet.put(packet.limit() - 1, (byte)0); - - serverEngine.decryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN, 0, src, ONERTT_PAYLOAD_OFFSET, packet); - fail("Decryption should have failed"); + Assertions.assertThrows(AEADBadTagException.class, () -> { + QuicTLSEngineImpl serverEngine = (QuicTLSEngineImpl) getQuicV2Engine(SSLContext.getDefault(), false); + // mark the TLS handshake as FINISHED + QuicTLSEngineImplAccessor.completeHandshake(serverEngine); + SecretKey key = new SecretKeySpec(HexFormat.of().parseHex(ONERTT_SECRET), 0, 32, "ChaCha20-Poly1305"); + QuicTLSEngineImplAccessor.testDeriveOneRTTKeys(QUIC_V2, serverEngine, key, key, "TLS_CHACHA20_POLY1305_SHA256", false); + ByteBuffer packet = ByteBuffer.wrap(HexFormat.of().parseHex(ENCRYPTED_ONERTT_PAYLOAD)); + unprotect(QuicTLSEngine.KeySpace.ONE_RTT, packet, ONERTT_PN_OFFSET, ONERTT_PAYLOAD_OFFSET - ONERTT_PN_OFFSET, serverEngine, 0x1f); + ByteBuffer src = packet.asReadOnlyBuffer(); + packet.position(ONERTT_PAYLOAD_OFFSET); + // change one byte of AEAD tag + packet.put(packet.limit() - 1, (byte)0); + serverEngine.decryptPacket(QuicTLSEngine.KeySpace.ONE_RTT, ONERTT_PN, 0, src, ONERTT_PAYLOAD_OFFSET, packet); + fail("Decryption should have failed"); + }); } diff --git a/test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java b/test/jdk/java/nio/channels/SocketChannel/ConnectionRefusedMessage.java similarity index 92% rename from test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java rename to test/jdk/java/nio/channels/SocketChannel/ConnectionRefusedMessage.java index 04490f63efe..d71bc6569cb 100644 --- a/test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java +++ b/test/jdk/java/nio/channels/SocketChannel/ConnectionRefusedMessage.java @@ -42,7 +42,8 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; * @summary Verify that when a SocketChannel is registered with a Selector * with an interest in CONNECT operation, then SocketChannel.finishConnect() * throws the correct exception message, if the connect() fails - * @run junit ${test.main.class} + * @run junit/othervm -Djdk.includeInExceptions=hostInfoExclSocket ${test.main.class} + * @run junit/othervm -Djdk.includeInExceptions=hostInfo -Dcheck.relaxed=true ${test.main.class} */ class ConnectionRefusedMessage { @@ -108,10 +109,14 @@ class ConnectionRefusedMessage { } private static void assertExceptionMessage(final ConnectException ce) { - if (!"Connection refused".equals(ce.getMessage())) { - // propagate the original exception - fail("unexpected exception message: " + ce.getMessage(), ce); + if ("Connection refused".equals(ce.getMessage())) { + return; } + if (Boolean.getBoolean("check.relaxed") && ce.getMessage() != null && ce.getMessage().startsWith("Connection refused")) { + return; + } + // propagate the original exception + fail("unexpected exception message: " + ce.getMessage(), ce); } // Try to find a suitable port to provoke a "Connection Refused" error. diff --git a/test/jdk/java/nio/file/FileStore/Basic.java b/test/jdk/java/nio/file/FileStore/Basic.java index 052348c1f02..14450aa525b 100644 --- a/test/jdk/java/nio/file/FileStore/Basic.java +++ b/test/jdk/java/nio/file/FileStore/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2026, 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,39 +28,53 @@ * @library .. /test/lib * @build jdk.test.lib.Platform * jdk.test.lib.util.FileUtils - * @run main Basic + * @run junit Basic */ -import java.nio.file.*; -import java.nio.file.attribute.*; import java.io.File; import java.io.IOException; +import java.nio.file.AccessDeniedException; +import java.nio.file.FileStore; +import java.nio.file.FileSystemException; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.attribute.AclFileAttributeView; +import java.nio.file.attribute.BasicFileAttributeView; +import java.nio.file.attribute.DosFileAttributeView; +import java.nio.file.attribute.FileAttributeView; +import java.nio.file.attribute.PosixFileAttributeView; +import java.nio.file.attribute.UserDefinedFileAttributeView; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.StreamSupport; + +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.assumeTrue; import jdk.test.lib.Platform; import jdk.test.lib.util.FileUtils; -import static jdk.test.lib.Asserts.*; public class Basic { static final long G = 1024L * 1024L * 1024L; - public static void main(String[] args) throws IOException { - Path dir = TestUtil.createTemporaryDirectory(); - try { - doTests(dir); - } finally { - TestUtil.removeAll(dir); - } + static Path[] factory(@TempDir Path tempDir) { + return new Path[] { tempDir }; } static void checkWithin1GB(String space, long expected, long actual) { long diff = Math.abs(actual - expected); - if (diff > G) { - String msg = String.format("%s: |actual %d - expected %d| = %d (%f G)", + assertTrue(diff <= G, () -> String.format("%s: |actual %d - expected %d| = %d (%f G)", space, actual, expected, diff, - (float)diff/G); - throw new RuntimeException(msg); - } + (float)diff/G)); } static void testFileAttributes(Path file, @@ -68,7 +82,7 @@ public class Basic { String viewName) throws IOException { FileStore store = Files.getFileStore(file); boolean supported = store.supportsFileAttributeView(viewClass); - assertTrue(store.supportsFileAttributeView(viewName) == supported); + assertEquals(store.supportsFileAttributeView(viewName), supported); // If the file attribute view is supported by the FileStore then // Files.getFileAttributeView should return that view if (supported) { @@ -76,103 +90,124 @@ public class Basic { } } - static void doTests(Path dir) throws IOException { - /** - * Test: Directory should be on FileStore that is writable - */ - assertTrue(!Files.getFileStore(dir).isReadOnly()); + /* + * Test: Directory should be on FileStore that is writable + */ + @ParameterizedTest + @MethodSource("factory") + void testDirectoryWritable(Path dir) throws IOException { + assertFalse(Files.getFileStore(dir).isReadOnly()); + } - /** - * Test: Two files should have the same FileStore - */ + /* + * Test: Two files should have the same FileStore + */ + @ParameterizedTest + @MethodSource("factory") + void testEquality(Path dir) throws IOException { Path file1 = Files.createFile(dir.resolve("foo")); Path file2 = Files.createFile(dir.resolve("bar")); FileStore store1 = Files.getFileStore(file1); FileStore store2 = Files.getFileStore(file2); - assertTrue(store1.equals(store2)); - assertTrue(store2.equals(store1)); - assertTrue(store1.hashCode() == store2.hashCode()); + assertEquals(store1, store2); + assertEquals(store2, store1); + assertEquals(store1.hashCode(), store2.hashCode()); + } - if (Platform.isWindows()) { - /** - * Test: FileStore.equals() should not be case sensitive - */ - FileStore upper = Files.getFileStore(Path.of("C:\\")); - FileStore lower = Files.getFileStore(Path.of("c:\\")); - assertTrue(lower.equals(upper)); - } + /* + * Test: FileStore should not be case sensitive + */ + @ParameterizedTest + @MethodSource("factory") + @EnabledOnOs({OS.WINDOWS}) + void testCaseSensitivity(Path dir) throws IOException { + FileStore upper = Files.getFileStore(Path.of("C:\\")); + FileStore lower = Files.getFileStore(Path.of("c:\\")); + assertEquals(lower, upper); + } - /** - * Test: File and FileStore attributes - */ - assertTrue(store1.supportsFileAttributeView("basic")); + /* + * Test: File and FileStore attributes + */ + @ParameterizedTest + @MethodSource("factory") + void testAttributes(Path dir) throws IOException { + Path file = Files.createFile(dir.resolve("foo")); + FileStore store = Files.getFileStore(file); + assertTrue(store.supportsFileAttributeView("basic")); testFileAttributes(dir, BasicFileAttributeView.class, "basic"); testFileAttributes(dir, PosixFileAttributeView.class, "posix"); testFileAttributes(dir, DosFileAttributeView.class, "dos"); testFileAttributes(dir, AclFileAttributeView.class, "acl"); testFileAttributes(dir, UserDefinedFileAttributeView.class, "user"); + } - /** - * Test: Space atributes - */ - File f = file1.toFile(); + /* + * Test: Space attributes + */ + @ParameterizedTest + @MethodSource("factory") + void testSpaceAttributes(Path dir) throws IOException { + Path file = Files.createFile(dir.resolve("foo")); + FileStore store = Files.getFileStore(file); + File f = file.toFile(); // check values are "close" - checkWithin1GB("total", f.getTotalSpace(), store1.getTotalSpace()); - checkWithin1GB("free", f.getFreeSpace(), store1.getUnallocatedSpace()); - checkWithin1GB("usable", f.getUsableSpace(), store1.getUsableSpace()); + checkWithin1GB("total", f.getTotalSpace(), store.getTotalSpace()); + checkWithin1GB("free", f.getFreeSpace(), store.getUnallocatedSpace()); + checkWithin1GB("usable", f.getUsableSpace(), store.getUsableSpace()); // get values by name checkWithin1GB("total", f.getTotalSpace(), - (Long)store1.getAttribute("totalSpace")); + (Long)store.getAttribute("totalSpace")); checkWithin1GB("free", f.getFreeSpace(), - (Long)store1.getAttribute("unallocatedSpace")); + (Long)store.getAttribute("unallocatedSpace")); checkWithin1GB("usable", f.getUsableSpace(), - (Long)store1.getAttribute("usableSpace")); + (Long)store.getAttribute("usableSpace")); + } - /** - * Test: Enumerate all FileStores - */ - if (FileUtils.areMountPointsAccessibleAndUnique()) { - FileStore prev = null; - for (FileStore store: FileSystems.getDefault().getFileStores()) { - System.out.format("%s (name=%s type=%s)\n", store, store.name(), - store.type()); + /* + * Test: Enumerate all FileStores + */ + @ParameterizedTest + @MethodSource("factory") + void testEnumerateFileStores(Path dir) throws IOException { + assumeTrue(FileUtils.areMountPointsAccessibleAndUnique()); + List stores = StreamSupport.stream(FileSystems.getDefault() + .getFileStores().spliterator(), false) + .toList(); + Set uniqueStores = new HashSet<>(stores); + assertEquals(stores.size(), uniqueStores.size(), "FileStores should be unique"); + for (FileStore store: stores) { + System.err.format("%s (name=%s type=%s)\n", store, store.name(), + store.type()); - // check space attributes are accessible - try { - store.getTotalSpace(); - store.getUnallocatedSpace(); - store.getUsableSpace(); - } catch (NoSuchFileException nsfe) { - // ignore exception as the store could have been - // deleted since the iterator was instantiated - System.err.format("%s was not found\n", store); - } catch (AccessDeniedException ade) { - // ignore exception as the lack of ability to access the - // store due to lack of file permission or similar does not - // reflect whether the space attributes would be accessible - // were access to be permitted - System.err.format("%s is inaccessible\n", store); - } catch (FileSystemException fse) { - // On Linux, ignore the FSE if the path is one of the - // /run/user/$UID mounts created by pam_systemd(8) as it - // might be mounted as a fuse.portal filesystem and - // its access attempt might fail with EPERM - if (!Platform.isLinux() || store.toString().indexOf("/run/user") == -1) { - throw new RuntimeException(fse); - } else { - System.err.format("%s error: %s\n", store, fse); - } + // check space attributes are accessible + try { + store.getTotalSpace(); + store.getUnallocatedSpace(); + store.getUsableSpace(); + } catch (NoSuchFileException nsfe) { + // ignore exception as the store could have been + // deleted since the iterator was instantiated + System.err.format("%s was not found\n", store); + } catch (AccessDeniedException ade) { + // ignore exception as the lack of ability to access the + // store due to lack of file permission or similar does not + // reflect whether the space attributes would be accessible + // were access to be permitted + System.err.format("%s is inaccessible\n", store); + } catch (FileSystemException fse) { + // On Linux, ignore the FSE if the path is one of the + // /run/user/$UID mounts created by pam_systemd(8) as it + // might be mounted as a fuse.portal filesystem and + // its access attempt might fail with EPERM + if (!Platform.isLinux() || store.toString().indexOf("/run/user") == -1) { + throw new RuntimeException(fse); + } else { + System.err.format("%s error: %s\n", store, fse); } - - // two distinct FileStores should not be equal - assertTrue(!store.equals(prev)); - prev = store; } - } else { - System.err.println - ("Skipping FileStore check due to file system access failure"); } } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java b/test/jdk/java/security/KeyStore/DisabledKnownType.java similarity index 50% rename from test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java rename to test/jdk/java/security/KeyStore/DisabledKnownType.java index 7cad887a5d9..70b7228f4c2 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java +++ b/test/jdk/java/security/KeyStore/DisabledKnownType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, 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 @@ -19,29 +19,35 @@ * 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 Exercise GC with shared strings - * @requires vm.cds.write.mapped.java.heap - * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib - * @build HelloStringGC jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver ExerciseGC + * @bug 8373690 + * @summary verify that the exception message indicates the keystore type + * when the type is disabled instead of being unrecognized + * @run main/othervm -Djdk.crypto.disabledAlgorithms=KeyStore.PKCS12 DisabledKnownType */ -public class ExerciseGC { + +import java.security.KeyStore; +import java.security.KeyStoreException; + +public class DisabledKnownType { public static void main(String[] args) throws Exception { - SharedStringsUtils.run(args, ExerciseGC::test); - } - public static void test(String[] args) throws Exception { - SharedStringsUtils.buildJarAndWhiteBox("HelloStringGC"); - - SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("HelloStringGC"), - "SharedStringsBasic.txt", "-Xlog:cds,aot+hashtables"); - - SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringGC", - "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeGC"); + String cacertsPath = System.getProperty("java.home") + + "/lib/security/cacerts"; + try { + KeyStore ks = KeyStore.getInstance(new java.io.File(cacertsPath), + "changeit".toCharArray()); + throw new RuntimeException("Expected KeyStoreException not thrown"); + } catch (KeyStoreException kse) { + if (kse.getMessage().contains("PKCS12")) { + System.out.println("Passed: expected ex thrown: " + kse); + } else { + // pass it up + throw kse; + } + } } } + diff --git a/test/jdk/java/security/KeyStore/TestKeyStoreBasic.java b/test/jdk/java/security/KeyStore/TestKeyStoreBasic.java index 8218c9cb48a..e39793cf1b7 100644 --- a/test/jdk/java/security/KeyStore/TestKeyStoreBasic.java +++ b/test/jdk/java/security/KeyStore/TestKeyStoreBasic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, 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,13 +24,18 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.security.*; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.PEMDecoder; +import java.security.PrivateKey; +import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; import java.security.cert.X509Certificate; +import java.time.Instant; /* * @test - * @bug 8048621 8133090 8167371 8236671 + * @bug 8048621 8133090 8167371 8236671 8374808 * @enablePreview * @summary Test basic operations with keystores (jks, jceks, pkcs12) * @author Yu-Ching Valerie PENG @@ -177,6 +182,8 @@ public class TestKeyStoreBasic { // compare the creation date of the 2 key stores for all aliases compareCreationDate(ks, ks2, numEntries); + compareCreationInstant(ks, ks2, numEntries); + // remove the last entry from the 2nd key store numEntries--; ks2.deleteEntry(ALIAS_HEAD + numEntries); @@ -213,6 +220,7 @@ public class TestKeyStoreBasic { // compare the creation date of the 2 key stores for all aliases compareCreationDate(ks, ks2, numEntries); + compareCreationInstant(ks, ks2, numEntries); // check setEntry/getEntry with a password protection algorithm if ("PKCS12".equalsIgnoreCase(ks.getType())) { @@ -284,6 +292,23 @@ public class TestKeyStoreBasic { } } + // compare the creation instants - true if all the same + private void compareCreationInstant(KeyStore o1, KeyStore o2, int range) + throws KeyStoreException { + String alias; + for (int k = 0; k < range; k++) { + alias = ALIAS_HEAD + k; + final Instant instant1 = o1.getCreationInstant(alias); + final Instant instant2 = o2.getCreationInstant(alias); + if (!(instant1.equals(instant2))) { + throw new RuntimeException("ERROR: entry creation time (" + k + + ") differs Instants {" + + instant1 + " - " + + instant2 + "}"); + } + } + } + // checks if an exception was caused by specified exception class private static boolean causedBy(Exception e, Class klass) { Throwable cause = e; diff --git a/test/jdk/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java b/test/jdk/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java index ece63bfe813..c8f882b599d 100644 --- a/test/jdk/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java +++ b/test/jdk/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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 @@ -126,12 +126,19 @@ public class SpliteratorTraversingAndSplittingTest extends SpliteratorTestHelper List exp; + List expRev; + Map mExp; + Map mExpRev; + SpliteratorDataBuilder(List data, List exp) { this.data = data; this.exp = exp; + this.expRev = new ArrayList<>(exp); + Collections.reverse(this.expRev); this.mExp = createMap(exp); + this.mExpRev = createMap(expRev); } Map createMap(List l) { @@ -166,12 +173,23 @@ public class SpliteratorTraversingAndSplittingTest extends SpliteratorTestHelper addMap(m, description); } + void addDescendingMap(Function, ? extends Map> m) { + String description = "new " + m.apply(Collections.emptyMap()).getClass().getName(); + addDescendingMap(m, description); + } + void addMap(Function, ? extends Map> m, String description) { add(description + ".keySet().spliterator()", () -> m.apply(mExp).keySet().spliterator()); add(description + ".values().spliterator()", () -> m.apply(mExp).values().spliterator()); add(description + ".entrySet().spliterator()", mExp.entrySet(), () -> m.apply(mExp).entrySet().spliterator()); } + void addDescendingMap(Function, ? extends Map> m, String description) { + add(description + ".keySet().spliterator()", expRev, () -> m.apply(mExp).keySet().spliterator()); + add(description + ".values().spliterator()", expRev, () -> m.apply(mExp).values().spliterator()); + add(description + ".entrySet().spliterator()", mExpRev.entrySet(), () -> m.apply(mExp).entrySet().spliterator()); + } + StringBuilder joiner(String description) { return new StringBuilder(description). append(" {"). @@ -639,8 +657,14 @@ public class SpliteratorTraversingAndSplittingTest extends SpliteratorTestHelper return cm; }, "new java.util.WeakHashMap(1, size + 1)"); - // @@@ Descending maps etc db.addMap(TreeMap::new); + db.addMap(m -> new TreeMap<>(m).tailMap(Integer.MIN_VALUE)); + db.addMap(m -> new TreeMap<>(m).headMap(Integer.MAX_VALUE)); + db.addMap(m -> new TreeMap<>(m).subMap(Integer.MIN_VALUE, Integer.MAX_VALUE)); + db.addDescendingMap(m -> new TreeMap<>(m).descendingMap()); + db.addDescendingMap(m -> new TreeMap<>(m).descendingMap().tailMap(Integer.MAX_VALUE)); + db.addDescendingMap(m -> new TreeMap<>(m).descendingMap().headMap(Integer.MIN_VALUE)); + db.addDescendingMap(m -> new TreeMap<>(m).descendingMap().subMap(Integer.MAX_VALUE, Integer.MIN_VALUE)); db.addMap(ConcurrentHashMap::new); diff --git a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java index f1f32bee310..641fbf2e495 100644 --- a/test/jdk/java/util/concurrent/tck/JSR166TestCase.java +++ b/test/jdk/java/util/concurrent/tck/JSR166TestCase.java @@ -37,7 +37,9 @@ /* * @test id=default * @summary Conformance testing variant of JSR-166 tck tests. + * @library /test/lib * @build * + * @build jdk.test.lib.Platform * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 JSR166TestCase */ @@ -46,7 +48,9 @@ * @test id=forkjoinpool-common-parallelism * @summary Test implementation details variant of JSR-166 * tck tests with ForkJoinPool common parallelism. + * @library /test/lib * @build * + * @build jdk.test.lib.Platform * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED @@ -68,7 +72,9 @@ * @summary Remaining test implementation details variant of * JSR-166 tck tests apart from ForkJoinPool common * parallelism. + * @library /test/lib * @build * + * @build jdk.test.lib.Platform * @modules java.management java.base/jdk.internal.util * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED @@ -135,6 +141,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Pattern; +import jdk.test.lib.Platform; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestResult; @@ -624,6 +631,13 @@ public class JSR166TestCase extends TestCase { "SynchronousQueue20Test", "ReentrantReadWriteLock20Test" }; + + if (Platform.isS390x()) { + java20TestClassNames = new String[] { + "ForkJoinPool20Test", + }; + } + addNamedTestClasses(suite, java20TestClassNames); } diff --git a/test/jdk/java/util/logging/ParentLoggersTest.java b/test/jdk/java/util/logging/ParentLoggersTest.java index 9150675c017..8aae7e95d74 100644 --- a/test/jdk/java/util/logging/ParentLoggersTest.java +++ b/test/jdk/java/util/logging/ParentLoggersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 6498300 + * @bug 6498300 8377457 * * @summary regression: parent loggers are not properly registered * @author ss45998 @@ -77,6 +77,8 @@ public class ParentLoggersTest { initialLoggerNames.add(logger); } } + System.out.println("# default loggers are: " + defaultLoggers); + System.out.println("# initial loggers are: " + initialLoggerNames); String tstSrc = System.getProperty(TST_SRC_PROP); File fname = new File(tstSrc, LM_PROP_FNAME); @@ -131,7 +133,10 @@ public class ParentLoggersTest { } } - System.out.println(returnedLoggerNames); + System.out.println("# Created loggers are: " + + createdLoggers.stream().map(Logger::getName).toList()); + System.out.println("# Expected loggers are: " + expectedLoggerNames); + System.out.println("# Returned loggers are: " + returnedLoggerNames); return checkNames(expectedLoggerNames, returnedLoggerNames, failMsg); } diff --git a/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java b/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java index 7adcfb9c128..7ca71c9890a 100644 --- a/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java +++ b/test/jdk/java/util/zip/ZipFile/EndOfCenValidation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2026, 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,33 +25,26 @@ * @bug 8272746 * @modules java.base/jdk.internal.util * @summary Verify that ZipFile rejects files with CEN sizes exceeding the implementation limit + * @library /test/lib + * @build jdk.test.lib.util.ZipUtils * @run junit/othervm EndOfCenValidation */ import jdk.internal.util.ArraysSupport; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import java.io.*; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.channels.FileChannel; -import java.nio.charset.StandardCharsets; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.HexFormat; -import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.zip.ZipOutputStream; -import static org.junit.jupiter.api.Assertions.*; +import static jdk.test.lib.util.ZipUtils.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; /** * This test augments {@link TestTooManyEntries}. It creates sparse ZIPs where @@ -65,36 +58,13 @@ import static org.junit.jupiter.api.Assertions.*; public class EndOfCenValidation { // Zip files produced by this test - public static final Path CEN_TOO_LARGE_ZIP = Path.of("cen-size-too-large.zip"); - public static final Path INVALID_CEN_SIZE = Path.of("invalid-zen-size.zip"); - public static final Path BAD_CEN_OFFSET_ZIP = Path.of("bad-cen-offset.zip"); - // Some ZipFile constants for manipulating the 'End of central directory record' (END header) - private static final int ENDHDR = ZipFile.ENDHDR; // End of central directory record size - private static final int ENDSIZ = ZipFile.ENDSIZ; // Offset of CEN size field within ENDHDR - private static final int ENDOFF = ZipFile.ENDOFF; // Offset of CEN offset field within ENDHDR + static final Path CEN_TOO_LARGE_ZIP = Path.of("cen-size-too-large.zip"); + static final Path INVALID_CEN_SIZE = Path.of("invalid-zen-size.zip"); + static final Path BAD_CEN_OFFSET_ZIP = Path.of("bad-cen-offset.zip"); + static final Path BAD_ENTRY_COUNT_ZIP = Path.of("bad-entry-count.zip"); + // Maximum allowed CEN size allowed by ZipFile - private static final int MAX_CEN_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; - - // Expected message when CEN size does not match file size - private static final String INVALID_CEN_BAD_SIZE = "invalid END header (bad central directory size)"; - // Expected message when CEN offset is too large - private static final String INVALID_CEN_BAD_OFFSET = "invalid END header (bad central directory offset)"; - // Expected message when CEN size is too large - private static final String INVALID_CEN_SIZE_TOO_LARGE = "invalid END header (central directory size too large)"; - // Expected message when total entry count is too large - private static final String INVALID_BAD_ENTRY_COUNT = "invalid END header (total entries count too large)"; - - // A valid ZIP file, used as a template - private byte[] zipBytes; - - /** - * Create a valid ZIP file, used as a template - * @throws IOException if an error occurs - */ - @BeforeEach - public void setup() throws IOException { - zipBytes = templateZip(); - } + static final int MAX_CEN_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; /** * Delete big files after test, in case the file system did not support sparse files. @@ -105,6 +75,7 @@ public class EndOfCenValidation { Files.deleteIfExists(CEN_TOO_LARGE_ZIP); Files.deleteIfExists(INVALID_CEN_SIZE); Files.deleteIfExists(BAD_CEN_OFFSET_ZIP); + Files.deleteIfExists(BAD_ENTRY_COUNT_ZIP); } /** @@ -115,14 +86,8 @@ public class EndOfCenValidation { @Test public void shouldRejectTooLargeCenSize() throws IOException { int size = MAX_CEN_SIZE + 1; - Path zip = zipWithModifiedEndRecord(size, true, 0, CEN_TOO_LARGE_ZIP); - - ZipException ex = assertThrows(ZipException.class, () -> { - new ZipFile(zip.toFile()); - }); - - assertEquals(INVALID_CEN_SIZE_TOO_LARGE, ex.getMessage()); + verifyRejection(zip, INVALID_CEN_SIZE_TOO_LARGE); } /** @@ -133,16 +98,9 @@ public class EndOfCenValidation { */ @Test public void shouldRejectInvalidCenSize() throws IOException { - int size = MAX_CEN_SIZE; - Path zip = zipWithModifiedEndRecord(size, false, 0, INVALID_CEN_SIZE); - - ZipException ex = assertThrows(ZipException.class, () -> { - new ZipFile(zip.toFile()); - }); - - assertEquals(INVALID_CEN_BAD_SIZE, ex.getMessage()); + verifyRejection(zip, INVALID_CEN_BAD_SIZE); } /** @@ -153,16 +111,9 @@ public class EndOfCenValidation { */ @Test public void shouldRejectInvalidCenOffset() throws IOException { - int size = MAX_CEN_SIZE; - Path zip = zipWithModifiedEndRecord(size, true, 100, BAD_CEN_OFFSET_ZIP); - - ZipException ex = assertThrows(ZipException.class, () -> { - new ZipFile(zip.toFile()); - }); - - assertEquals(INVALID_CEN_BAD_OFFSET, ex.getMessage()); + verifyRejection(zip, INVALID_CEN_BAD_OFFSET); } /** @@ -181,192 +132,20 @@ public class EndOfCenValidation { Long.MAX_VALUE // Unreasonably large }) public void shouldRejectBadTotalEntries(long totalEntries) throws IOException { - /** - * A small ZIP using the ZIP64 format. - * - * ZIP created using: "echo -n hello | zip zip64.zip -" - * Hex encoded using: "cat zip64.zip | xxd -ps" - * - * The file has the following structure: - * - * 0000 LOCAL HEADER #1 04034B50 - * 0004 Extract Zip Spec 2D '4.5' - * 0005 Extract OS 00 'MS-DOS' - * 0006 General Purpose Flag 0000 - * 0008 Compression Method 0000 'Stored' - * 000A Last Mod Time 5947AB78 'Mon Oct 7 21:27:48 2024' - * 000E CRC 363A3020 - * 0012 Compressed Length FFFFFFFF - * 0016 Uncompressed Length FFFFFFFF - * 001A Filename Length 0001 - * 001C Extra Length 0014 - * 001E Filename '-' - * 001F Extra ID #0001 0001 'ZIP64' - * 0021 Length 0010 - * 0023 Uncompressed Size 0000000000000006 - * 002B Compressed Size 0000000000000006 - * 0033 PAYLOAD hello. - * - * 0039 CENTRAL HEADER #1 02014B50 - * 003D Created Zip Spec 1E '3.0' - * 003E Created OS 03 'Unix' - * 003F Extract Zip Spec 2D '4.5' - * 0040 Extract OS 00 'MS-DOS' - * 0041 General Purpose Flag 0000 - * 0043 Compression Method 0000 'Stored' - * 0045 Last Mod Time 5947AB78 'Mon Oct 7 21:27:48 2024' - * 0049 CRC 363A3020 - * 004D Compressed Length 00000006 - * 0051 Uncompressed Length FFFFFFFF - * 0055 Filename Length 0001 - * 0057 Extra Length 000C - * 0059 Comment Length 0000 - * 005B Disk Start 0000 - * 005D Int File Attributes 0001 - * [Bit 0] 1 Text Data - * 005F Ext File Attributes 11B00000 - * 0063 Local Header Offset 00000000 - * 0067 Filename '-' - * 0068 Extra ID #0001 0001 'ZIP64' - * 006A Length 0008 - * 006C Uncompressed Size 0000000000000006 - * - * 0074 ZIP64 END CENTRAL DIR 06064B50 - * RECORD - * 0078 Size of record 000000000000002C - * 0080 Created Zip Spec 1E '3.0' - * 0081 Created OS 03 'Unix' - * 0082 Extract Zip Spec 2D '4.5' - * 0083 Extract OS 00 'MS-DOS' - * 0084 Number of this disk 00000000 - * 0088 Central Dir Disk no 00000000 - * 008C Entries in this disk 0000000000000001 - * 0094 Total Entries 0000000000000001 - * 009C Size of Central Dir 000000000000003B - * 00A4 Offset to Central dir 0000000000000039 - * - * 00AC ZIP64 END CENTRAL DIR 07064B50 - * LOCATOR - * 00B0 Central Dir Disk no 00000000 - * 00B4 Offset to Central dir 0000000000000074 - * 00BC Total no of Disks 00000001 - * - * 00C0 END CENTRAL HEADER 06054B50 - * 00C4 Number of this disk 0000 - * 00C6 Central Dir Disk no 0000 - * 00C8 Entries in this disk 0001 - * 00CA Total Entries 0001 - * 00CC Size of Central Dir 0000003B - * 00D0 Offset to Central Dir FFFFFFFF - * 00D4 Comment Length 0000 - */ + Path zip = zip64WithModifiedTotalEntries(BAD_ENTRY_COUNT_ZIP, totalEntries); + verifyRejection(zip, INVALID_BAD_ENTRY_COUNT); + } - byte[] zipBytes = HexFormat.of().parseHex(""" - 504b03042d000000000078ab475920303a36ffffffffffffffff01001400 - 2d010010000600000000000000060000000000000068656c6c6f0a504b01 - 021e032d000000000078ab475920303a3606000000ffffffff01000c0000 - 00000001000000b011000000002d010008000600000000000000504b0606 - 2c000000000000001e032d00000000000000000001000000000000000100 - 0000000000003b000000000000003900000000000000504b060700000000 - 740000000000000001000000504b050600000000010001003b000000ffff - ffff0000 - """.replaceAll("\n","")); - - // Buffer to manipulate the above ZIP - ByteBuffer buf = ByteBuffer.wrap(zipBytes).order(ByteOrder.LITTLE_ENDIAN); - // Offset of the 'total entries' in the 'ZIP64 END CENTRAL DIR' record - // Update ZIP64 entry count to a value which cannot possibly fit in the small CEN - buf.putLong(0x94, totalEntries); - // The corresponding END field needs the ZIP64 magic value - buf.putShort(0xCA, (short) 0xFFFF); - // Write the ZIP to disk - Path zipFile = Path.of("bad-entry-count.zip"); - Files.write(zipFile, zipBytes); - - // Verify that the END header is rejected + /** + * Verify that ZipFile rejects the ZIP file with a ZipException + * with the given message + * @param zip ZIP file to open + * @param msg exception message to expect + */ + private static void verifyRejection(Path zip, String msg) { ZipException ex = assertThrows(ZipException.class, () -> { - try (var zf = new ZipFile(zipFile.toFile())) { - } + new ZipFile(zip.toFile()); }); - - assertEquals(INVALID_BAD_ENTRY_COUNT, ex.getMessage()); - } - - /** - * Create an ZIP file with a single entry, then modify the CEN size - * in the 'End of central directory record' (END header) to the given size. - * - * The CEN is optionally "inflated" with trailing zero bytes such that - * its actual size matches the one stated in the END header. - * - * The CEN offset is optiontially adjusted by the given amount - * - * The resulting ZIP is technically not valid, but it does allow us - * to test that large or invalid CEN sizes are rejected - * @param cenSize the CEN size to put in the END record - * @param inflateCen if true, zero-pad the CEN to the desired size - * @param cenOffAdjust Adjust the CEN offset field of the END record with this amount - * @throws IOException if an error occurs - */ - private Path zipWithModifiedEndRecord(int cenSize, - boolean inflateCen, - int cenOffAdjust, - Path zip) throws IOException { - - // A byte buffer for reading the END - ByteBuffer buffer = ByteBuffer.wrap(zipBytes.clone()).order(ByteOrder.LITTLE_ENDIAN); - - // Offset of the END header - int endOffset = buffer.limit() - ENDHDR; - - // Modify the CEN size - int sizeOffset = endOffset + ENDSIZ; - int currentCenSize = buffer.getInt(sizeOffset); - buffer.putInt(sizeOffset, cenSize); - - // Optionally modify the CEN offset - if (cenOffAdjust != 0) { - int offOffset = endOffset + ENDOFF; - int currentCenOff = buffer.getInt(offOffset); - buffer.putInt(offOffset, currentCenOff + cenOffAdjust); - } - - // When creating a sparse file, the file must not already exit - Files.deleteIfExists(zip); - - // Open a FileChannel for writing a sparse file - EnumSet options = EnumSet.of(StandardOpenOption.CREATE_NEW, - StandardOpenOption.WRITE, - StandardOpenOption.SPARSE); - - try (FileChannel channel = FileChannel.open(zip, options)) { - - // Write everything up to END - channel.write(buffer.slice(0, buffer.limit() - ENDHDR)); - - if (inflateCen) { - // Inject "empty bytes" to make the actual CEN size match the END - int injectBytes = cenSize - currentCenSize; - channel.position(channel.position() + injectBytes); - } - // Write the modified END - channel.write(buffer.slice(buffer.limit() - ENDHDR, ENDHDR)); - } - return zip; - } - - /** - * Produce a byte array of a ZIP with a single entry - * - * @throws IOException if an error occurs - */ - private byte[] templateZip() throws IOException { - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - try (ZipOutputStream zo = new ZipOutputStream(bout)) { - ZipEntry entry = new ZipEntry("duke.txt"); - zo.putNextEntry(entry); - zo.write("duke".getBytes(StandardCharsets.UTF_8)); - } - return bout.toByteArray(); + assertEquals(msg, ex.getMessage()); } } diff --git a/test/jdk/java/util/zip/ZipFile/IncorrectEndTot.java b/test/jdk/java/util/zip/ZipFile/IncorrectEndTot.java new file mode 100644 index 00000000000..0b6fc4a35fd --- /dev/null +++ b/test/jdk/java/util/zip/ZipFile/IncorrectEndTot.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2026, 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 Verify that ZipFile::size reports the actual number of entries + * even with an incorrect ENDTOT field + * @run junit IncorrectEndTot + */ + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.file.Files; +import java.util.Collections; +import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class IncorrectEndTot { + + // File to use for this test + File file = new File("incorrect-end-centot.zip"); + + // Return scenarios for correct and incorrect ENDTOT fields + public static Stream scenarios() { + return Stream.of( + Arguments.of(10, 10), // CEN agrees with ENDTOT + Arguments.of(10, 11), // CEN has one less than ENDTOT + Arguments.of(11, 10), // CEN has one more than ENDTOT + Arguments.of(0, 0), // Empty ZIP, correct ENDTOT + Arguments.of(0, 10) // Empty ZIP, incorrect ENDTOT + ); + } + + /** + * Delete the file used by this test + */ + @AfterEach + public void cleanup() { + file.delete(); + } + + /** + * Verify that ZipFile::size reports the actual number of CEN records, + * regardless of the ENDTOT field. + * + * @param actual number of entries in the ZIP file + * @param reported number reported in ENDTOT + * @throws IOException if an unexpected error occurs + */ + @ParameterizedTest + @MethodSource("scenarios") + public void shouldCountActualEntries(int actual, int reported) throws IOException { + createZip(file, actual, reported); + try (ZipFile zf = new ZipFile(file)) { + assertEquals(actual, zf.size()); + assertEquals(actual, Collections.list(zf.entries()).size()); + assertEquals(actual, zf.stream().count()); + } + } + + /** + * Create a ZIP file with a number of entries, possibly reporting an incorrect number in + * the ENDTOT field + * @param file the file to write to + * @param numEntries the number of entries to generate + * @param reported the number of entries to report in the END header's ENDTOT field + * @throws IOException + */ + private static void createZip(File file, int numEntries, int reported) throws IOException { + // Create a ZIP + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try (ZipOutputStream zo = new ZipOutputStream(out)) { + for (int i = 0; i < numEntries; i++) { + zo.putNextEntry(new ZipEntry("entry_" + i)); + } + } + byte[] bytes = out.toByteArray(); + + // Update the ENDTOT field to report a possibly incorrect number + ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); + buf.putShort(bytes.length - ZipFile.ENDHDR + ZipFile.ENDTOT, (short) reported); + + // Write to disk + Files.write(file.toPath(), bytes); + } +} diff --git a/test/jdk/java/util/zip/ZipFile/ZipFileInputStreamSkipTest.java b/test/jdk/java/util/zip/ZipFile/ZipFileInputStreamSkipTest.java index 131f7a5c51c..1b7b93785af 100644 --- a/test/jdk/java/util/zip/ZipFile/ZipFileInputStreamSkipTest.java +++ b/test/jdk/java/util/zip/ZipFile/ZipFileInputStreamSkipTest.java @@ -69,7 +69,7 @@ public class ZipFileInputStreamSkipTest { * @throws IOException If an error occurs creating the Zip Files */ @BeforeAll - private static void createZip() throws IOException { + static void createZip() throws IOException { Entry e0 = Entry.of("Entry-0", ZipEntry.STORED, "Tennis Pro"); Entry e1 = Entry.of("Entry-1", ZipEntry.STORED, "United States Tennis Association"); @@ -98,7 +98,7 @@ public class ZipFileInputStreamSkipTest { * @throws IOException If an error occurs during cleanup */ @AfterAll - private static void cleanUp() throws IOException { + static void cleanUp() throws IOException { Files.deleteIfExists(STORED_ZIPFILE); Files.deleteIfExists(DEFLATED_ZIPFILE); } diff --git a/test/jdk/javax/accessibility/8377428/TestVoiceOverHiddenComponentNavigation.java b/test/jdk/javax/accessibility/8377428/TestVoiceOverHiddenComponentNavigation.java new file mode 100644 index 00000000000..f8af95159c2 --- /dev/null +++ b/test/jdk/javax/accessibility/8377428/TestVoiceOverHiddenComponentNavigation.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2026, 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.accessibility.AccessibleComponent; +import javax.accessibility.AccessibleContext; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; + +/* + * @test + * @key headful + * @bug 8377428 + * @summary manual test for VoiceOver reading hidden components + * @requires os.family == "mac" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual TestVoiceOverHiddenComponentNavigation + */ + +public class TestVoiceOverHiddenComponentNavigation { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = """ + Test UI contains four rows. Each row contains a JButton. + Two of the rows are hidden, and two are visible. + + Follow these steps to test the behaviour: + + 1. Start the VoiceOver (Press Command + F5) application + 2. Move VoiceOver cursor to one of the visible buttons. + 3. Press CTRL + ALT + LEFT to move the VoiceOver cursor back + 4. Repeat step 3 until you reach the "Close" button. + + If VoiceOver ever references a "Hidden Button": then this test + fails. + """; + + PassFailJFrame.builder() + .title("TestVoiceOverHiddenComponentNavigation Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(TestVoiceOverHiddenComponentNavigation::createUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createUI() { + JPanel rows = new JPanel(); + rows.setLayout(new BoxLayout(rows, BoxLayout.Y_AXIS)); + rows.add(createRow("Hidden Button", "Row 1", false, false)); + rows.add(createRow("Hidden Button", "Row 2", false, true)); + rows.add(createRow("Visible Button", "Row 3", true, false)); + rows.add(createRow("Visible Button", "Row 4", true, true)); + + JFrame frame = new JFrame("A Frame hidden JButtons"); + frame.getContentPane().add(rows); + frame.pack(); + return frame; + } + + /** + * Create a row to add to this demo frame. + * + * @param buttonText the button name/text + * @param panelAXName the panel accessible name + * @param isVisible whether JPanel.isVisible() should be true + * @param useNullAXComponent if true then + * AccessibleJPanel.getAccessibleComponent + * returns null. This was added to test a + * particular code path. + * @return a row for the demo frame + */ + private static JPanel createRow(String buttonText, String panelAXName, + boolean isVisible, + boolean useNullAXComponent) { + JPanel returnValue = new JPanel() { + @Override + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJPanel() { + @Override + public AccessibleComponent getAccessibleComponent() { + if (useNullAXComponent) { + return null; + } else { + return super.getAccessibleComponent(); + } + } + }; + accessibleContext.setAccessibleName(panelAXName); + } + return accessibleContext; + } + }; + returnValue.setVisible(isVisible); + JButton button = new JButton(buttonText); + returnValue.add(button); + return returnValue; + } +} \ No newline at end of file diff --git a/test/jdk/javax/accessibility/8377745/VoiceOverHyperlinkRole.java b/test/jdk/javax/accessibility/8377745/VoiceOverHyperlinkRole.java new file mode 100644 index 00000000000..0d18d320360 --- /dev/null +++ b/test/jdk/javax/accessibility/8377745/VoiceOverHyperlinkRole.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2026, 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.accessibility.AccessibleContext; +import javax.accessibility.AccessibleRole; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.border.EmptyBorder; + +/* + * @test + * @key headful + * @bug 8377745 + * @summary manual test for VoiceOver reading links correctly + * @requires os.family == "mac" + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual VoiceOverHyperlinkRole + */ + +public class VoiceOverHyperlinkRole { + public static void main(String[] args) throws Exception { + String INSTRUCTIONS = "INSTRUCTIONS (Mac-only):\n" + + "1. Open VoiceOver\n" + + "2. Move the VoiceOver cursor over the link.\n" + + "3. Observe how VoiceOver identifies the link.\n\n" + + "Expected behavior: VoiceOver should identify it as a " + + "\"link\". It should not say \"text element\", \"text\" " + + "or \"hyperlink\".\n\n" + + "If you select the link using \"Accessibility " + + "Inspector\": it should identify its role as AXLink."; + + PassFailJFrame.builder() + .title("VoiceOverHyperlinkRole Instruction") + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(VoiceOverHyperlinkRole::createUI) + .build() + .awaitAndCheck(); + } + + private static JFrame createUI() { + JPanel p = new JPanel(); + p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); + + p.add(createText("This button uses `AccessibleRole.HYPERLINK:`")); + p.add(createLink(AccessibleRole.HYPERLINK)); + + // for debugging / experimentation: + boolean tryOtherRoles = false; + if (tryOtherRoles) { + p.add(createText( + "This button uses `new AccessibleRole(\"Link\") {}`:")); + p.add(createLink(new AccessibleRole("Link") {})); + p.add(createText( + "This button uses `new AccessibleRole(\"link\") {}`:")); + p.add(createLink(new AccessibleRole("link") {})); + p.add(createText( + "This button uses `new AccessibleRole(\"AXLink\") {}`:")); + p.add(createLink(new AccessibleRole("AXLink") {})); + } + + JFrame frame = new JFrame(); + frame.getContentPane().add(p); + frame.pack(); + return frame; + } + + private static JTextArea createText(String text) { + JTextArea textArea = new JTextArea(text); + textArea.setOpaque(false); + textArea.setEditable(false); + textArea.setBorder(new EmptyBorder(20, 10, 3, 10)); + return textArea; + } + + private static JButton createLink(AccessibleRole role) { + String text = "https://bugs.openjdk.org/"; + JButton button = new JButton(text) { + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJButton() { + @Override + public AccessibleRole getAccessibleRole() { + return role; + } + }; + } + return accessibleContext; + } + }; + button.setContentAreaFilled(false); + button.setBorderPainted(false); + return button; + } +} diff --git a/test/jdk/javax/sound/sampled/Clip/bug5070081.java b/test/jdk/javax/sound/sampled/Clip/bug5070081.java index e7bf7e30de2..89e9d591d28 100644 --- a/test/jdk/javax/sound/sampled/Clip/bug5070081.java +++ b/test/jdk/javax/sound/sampled/Clip/bug5070081.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, 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,8 @@ import javax.sound.sampled.LineUnavailableException; /* * @test - * @bug 5070081 + * @key sound + * @bug 5070081 8376152 * @summary Tests that javax.sound.sampled.Clip does not loses position through * stop/start */ diff --git a/test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconPixelDataTest.java b/test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconPixelDataTest.java new file mode 100644 index 00000000000..c71c7a3e6a9 --- /dev/null +++ b/test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconPixelDataTest.java @@ -0,0 +1,93 @@ +/* + * 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.awt.EventQueue; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.concurrent.atomic.AtomicBoolean; + +import javax.swing.Icon; +import javax.swing.UIManager; +import javax.swing.UIManager.LookAndFeelInfo; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.filechooser.FileSystemView; + +/** + * @test + * @bug 8376253 + * @summary FileSystemView may not report system icons when -Xcheck:jni enabled + * @key headful + * @run main SystemIconPixelDataTest + * @run main/othervm -Xcheck:jni SystemIconPixelDataTest + */ +public final class SystemIconPixelDataTest { + + public static void main(String[] args) throws Exception { + for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { + AtomicBoolean ok = new AtomicBoolean(); + EventQueue.invokeAndWait(() -> ok.set(setLookAndFeel(laf))); + if (ok.get()) { + EventQueue.invokeAndWait(SystemIconPixelDataTest::test); + } + } + } + + private static boolean setLookAndFeel(LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + System.out.println("LookAndFeel: " + laf.getClassName()); + return true; + } catch (UnsupportedLookAndFeelException ignored) { + return false; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static void test() { + FileSystemView fsv = FileSystemView.getFileSystemView(); + File home = fsv.getHomeDirectory(); + Icon icon = fsv.getSystemIcon(home); + if (icon == null) { + return; + } + int w = icon.getIconWidth(); + int h = icon.getIconHeight(); + if (w <= 0 || h <= 0) { + throw new RuntimeException("Invalid icon size: " + w + "x" + h); + } + var img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); + Graphics2D g = img.createGraphics(); + icon.paintIcon(null, g, 0, 0); + g.dispose(); + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + if (img.getRGB(x, y) != 0) { + return; + } + } + } + throw new RuntimeException("All pixels are zero"); + } +} diff --git a/test/jdk/javax/swing/JTable/JTableSerialization.java b/test/jdk/javax/swing/JTable/JTableSerialization.java new file mode 100644 index 00000000000..29d8837bb26 --- /dev/null +++ b/test/jdk/javax/swing/JTable/JTableSerialization.java @@ -0,0 +1,169 @@ +/* + * 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.awt.Component; +import java.awt.EventQueue; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +import static javax.swing.UIManager.getInstalledLookAndFeels; + +/** + * @test + * @bug 6441373 + * @summary Checks that editing/non-editing JTable is serializable + * @run main/timeout=260/othervm -Xmx32m JTableSerialization + */ +public final class JTableSerialization { + + private static JTable table; + private static final int ROW = 1; + private static final int COLUMN = 1; + private static final String SOME_TEST_LABEL = "Some TEST label"; + private static final String TEST_EDIT_VALUE = "Test EDIT value"; + + public static void main(String[] argv) throws Exception { + for (UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { + AtomicBoolean go = new AtomicBoolean(false); + EventQueue.invokeAndWait(() -> go.set(tryLookAndFeel(laf))); + if (!go.get()) { + continue; + } + for (boolean editing : new boolean[]{true, false}) { + EventQueue.invokeAndWait(JTableSerialization::init); + long endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(20); + while (System.nanoTime() < endtime) { + // need to jump to/from EDT to flush all pending events + EventQueue.invokeAndWait(() -> test(editing)); + } + EventQueue.invokeAndWait(JTableSerialization::validate); + } + } + } + + private static void init() { + JLabel label = new JLabel(SOME_TEST_LABEL); + table = new JTable(2, 2); + table.add(label); + table.setValueAt(TEST_EDIT_VALUE, ROW, COLUMN); + checkNonEditingState(table); + } + + private static void test(boolean editing) { + if (editing) { + table.editCellAt(ROW, COLUMN); + checkEditingState(table); + } + table = copyTable(table); + checkNonEditingState(table); + } + + private static void validate() { + Object value = table.getValueAt(ROW, COLUMN); + if (!value.equals(TEST_EDIT_VALUE)) { + throw new RuntimeException("Wrong value: " + value); + } + for (Component component : table.getComponents()) { + if (component instanceof JLabel) { + if (((JLabel) component).getText().equals(SOME_TEST_LABEL)) { + return; + } + } + } + throw new RuntimeException("JLabel is not found"); + } + + + private static void checkNonEditingState(JTable jt) { + if (jt.isEditing()) { + throw new RuntimeException("Should not be editing"); + } + if (jt.getEditorComponent() != null) { + throw new RuntimeException("Editor should be null"); + } + int row = jt.getEditingRow(); + if (row != -1) { + throw new RuntimeException("Expected row -1 but was: " + row); + } + int column = jt.getEditingColumn(); + if (column != -1) { + throw new RuntimeException("Expected column -1 but was: " + column); + } + } + + private static void checkEditingState(JTable jt) { + if (!jt.isEditing()) { + throw new RuntimeException("Should be editing"); + } + if (jt.getEditorComponent() == null) { + throw new RuntimeException("Editor should not be null"); + } + if (jt.getEditingRow() != ROW) { + throw new RuntimeException("Row should be: " + ROW); + } + if (jt.getEditingColumn() != COLUMN) { + throw new RuntimeException("Column should be: " + COLUMN); + } + } + + private static JTable copyTable(JTable jt) { + try { + byte[] bdata; + try (var baos = new ByteArrayOutputStream(); + var oos = new ObjectOutputStream(baos)) + { + oos.writeObject(jt); + bdata = baos.toByteArray(); + } + try (var bais = new ByteArrayInputStream(bdata); + var ois = new ObjectInputStream(bais)) + { + return (JTable) ois.readObject(); + } + } catch (IOException | ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + + private static boolean tryLookAndFeel(UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + System.out.println("LookAndFeel: " + laf.getClassName()); + return true; + } catch (UnsupportedLookAndFeelException ignored) { + return false; + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/test/jdk/javax/swing/ToolTipManager/Test6657026.java b/test/jdk/javax/swing/ToolTipManager/Test6657026.java deleted file mode 100644 index 0678d57f768..00000000000 --- a/test/jdk/javax/swing/ToolTipManager/Test6657026.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2009, 2015, 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 6657026 - * @summary Tests shared ToolTipManager in different application contexts - * @author Sergey Malenkov - * @modules java.desktop/sun.awt - */ - -import sun.awt.SunToolkit; -import javax.swing.ToolTipManager; - -public class Test6657026 implements Runnable { - - private static final int DISMISS = 4000; - private static final int INITIAL = 750; - private static final int RESHOW = 500; - - public static void main(String[] args) throws InterruptedException { - ToolTipManager manager = ToolTipManager.sharedInstance(); - if (DISMISS != manager.getDismissDelay()) { - throw new Error("unexpected dismiss delay"); - } - if (INITIAL != manager.getInitialDelay()) { - throw new Error("unexpected initial delay"); - } - if (RESHOW != manager.getReshowDelay()) { - throw new Error("unexpected reshow delay"); - } - manager.setDismissDelay(DISMISS + 1); - manager.setInitialDelay(INITIAL + 1); - manager.setReshowDelay(RESHOW + 1); - - ThreadGroup group = new ThreadGroup("$$$"); - Thread thread = new Thread(group, new Test6657026()); - thread.start(); - thread.join(); - } - - public void run() { - SunToolkit.createNewAppContext(); - ToolTipManager manager = ToolTipManager.sharedInstance(); - if (DISMISS != manager.getDismissDelay()) { - throw new Error("shared dismiss delay"); - } - if (INITIAL != manager.getInitialDelay()) { - throw new Error("shared initial delay"); - } - if (RESHOW != manager.getReshowDelay()) { - throw new Error("shared reshow delay"); - } - } -} diff --git a/test/jdk/javax/swing/plaf/metal/MetalBumps/Test6657026.java b/test/jdk/javax/swing/plaf/metal/MetalBumps/Test6657026.java deleted file mode 100644 index b5737479325..00000000000 --- a/test/jdk/javax/swing/plaf/metal/MetalBumps/Test6657026.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2009, 2017, 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 6657026 - * @summary Tests shared MetalBumps in different application contexts - * @author Sergey Malenkov - * @modules java.desktop/sun.awt - */ - -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Rectangle; -import java.awt.Shape; -import java.awt.image.BufferedImage; -import java.awt.image.ImageObserver; -import java.text.AttributedCharacterIterator; - -import javax.swing.JToolBar; -import javax.swing.plaf.metal.MetalBorders.ToolBarBorder; - -import sun.awt.SunToolkit; - -public class Test6657026 extends ToolBarBorder implements Runnable { - - public static void main(String[] args) throws Exception { - new Test6657026().test(); - - ThreadGroup group = new ThreadGroup("$$$"); - Thread thread = new Thread(group, new Test6657026()); - thread.start(); - thread.join(); - } - - public void run() { - SunToolkit.createNewAppContext(); - test(); - } - - private void test() { - MyGraphics mg = new MyGraphics(); - ToolBarBorder border = new ToolBarBorder(); - border.paintBorder(mg.component, mg, 0, 0, 10, 10); - if (mg.image != null) { - boolean failed = true; - int value = mg.image.getRGB(0, 0); - for (int x = 0; x < mg.image.getWidth(); x++) { - for (int y = 0; y < mg.image.getHeight(); y++) { - int current = mg.image.getRGB(x, y); - if (current != value) { - mg.image.setRGB(x, y, value); - failed = false; - } - - } - } - if (failed) { - throw new Error("shared metal bumps"); - } - } - } - - private static class MyGraphics extends Graphics { - - private final Component component = new JToolBar() {}; - private BufferedImage image; - - public Graphics create() { - return null; // TODO: check - } - - public void translate(int x, int y) { - // TODO: check - } - - public Color getColor() { - return null; // TODO: check - } - - public void setColor(Color color) { - // TODO: check - } - - public void setPaintMode() { - // TODO: check - } - - public void setXORMode(Color c1) { - // TODO: check - } - - public Font getFont() { - return null; // TODO: check - } - - public void setFont(Font font) { - // TODO: check - } - - public FontMetrics getFontMetrics(Font font) { - return null; // TODO: check - } - - public Rectangle getClipBounds() { - return null; // TODO: check - } - - public void clipRect(int x, int y, int width, int height) { - // TODO: check - } - - public void setClip(int x, int y, int width, int height) { - // TODO: check - } - - public Shape getClip() { - return null; // TODO: check - } - - public void setClip(Shape clip) { - // TODO: check - } - - public void copyArea(int x, int y, int width, int height, int dx, int dy) { - // TODO: check - } - - public void drawLine(int x1, int y1, int x2, int y2) { - // TODO: check - } - - public void fillRect(int x, int y, int width, int height) { - // TODO: check - } - - public void clearRect(int x, int y, int width, int height) { - // TODO: check - } - - public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - // TODO: check - } - - public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { - // TODO: check - } - - public void drawOval(int x, int y, int width, int height) { - // TODO: check - } - - public void fillOval(int x, int y, int width, int height) { - // TODO: check - } - - public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) { - // TODO: check - } - - public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { - // TODO: check - } - - public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { - // TODO: check - } - - public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { - // TODO: check - } - - public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { - // TODO: check - } - - public void drawString(String str, int x, int y) { - // TODO: check - } - - public void drawString(AttributedCharacterIterator iterator, int x, int y) { - // TODO: check - } - - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - return false; // TODO: check - } - - public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) { - return false; // TODO: check - } - - public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) { - return false; // TODO: check - } - - public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) { - return false; // TODO: check - } - - public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) { - if (img instanceof BufferedImage) { - this.image = (BufferedImage) img; - } - return false; // TODO: check - } - - public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) { - return false; // TODO: check - } - - public void dispose() { - // TODO: check - } - } -} diff --git a/test/jdk/javax/swing/plaf/metal/MetalInternalFrameUI/Test6657026.java b/test/jdk/javax/swing/plaf/metal/MetalInternalFrameUI/Test6657026.java deleted file mode 100644 index 158c743375c..00000000000 --- a/test/jdk/javax/swing/plaf/metal/MetalInternalFrameUI/Test6657026.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2009, 2015, 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 6657026 - * @summary Tests shared MetalInternalFrameUI in different application contexts - * @author Sergey Malenkov - * @modules java.desktop/sun.awt - */ - -import sun.awt.SunToolkit; - -import javax.swing.JInternalFrame; -import javax.swing.JPanel; -import javax.swing.UIManager; -import javax.swing.plaf.metal.MetalInternalFrameUI; -import javax.swing.plaf.metal.MetalLookAndFeel; - -public class Test6657026 extends MetalInternalFrameUI implements Runnable { - - public static void main(String[] args) throws Exception { - UIManager.setLookAndFeel(new MetalLookAndFeel()); - - ThreadGroup group = new ThreadGroup("$$$"); - Thread thread = new Thread(group, new Test6657026()); - thread.start(); - thread.join(); - - new JInternalFrame().setContentPane(new JPanel()); - } - - public Test6657026() { - super(null); - } - - public void run() { - SunToolkit.createNewAppContext(); - IS_PALETTE = JInternalFrame.CONTENT_PANE_PROPERTY; - } -} diff --git a/test/jdk/javax/swing/plaf/metal/MetalSliderUI/Test6657026.java b/test/jdk/javax/swing/plaf/metal/MetalSliderUI/Test6657026.java deleted file mode 100644 index b8ea5e2bd07..00000000000 --- a/test/jdk/javax/swing/plaf/metal/MetalSliderUI/Test6657026.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2009, 2015, 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 6657026 7077259 - * @summary Tests shared MetalSliderUI in different application contexts - * @author Sergey Malenkov - * @modules java.desktop/sun.awt - * @run main/othervm -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel Test6657026 - */ - -import javax.swing.JSlider; -import javax.swing.UIManager; -import javax.swing.plaf.metal.MetalLookAndFeel; -import javax.swing.plaf.metal.MetalSliderUI; -import sun.awt.SunToolkit; - -public class Test6657026 extends MetalSliderUI implements Runnable { - - public static void main(String[] args) throws Exception { - JSlider slider = new JSlider(); - test(slider); - - ThreadGroup group = new ThreadGroup("$$$"); - Thread thread = new Thread(group, new Test6657026()); - thread.start(); - thread.join(); - - test(slider); - } - - public void run() { - SunToolkit.createNewAppContext(); - JSlider slider = new JSlider(); - test(slider); - tickLength = -10000; - } - - private static void test(JSlider slider) { - MetalSliderUI ui = (MetalSliderUI) slider.getUI(); - int actual = ui.getTickLength(); - if (actual != 11) { - throw new Error(actual + ", but expected 11"); - } - } -} diff --git a/test/jdk/javax/swing/plaf/metal/MetalTitlePaneBug.java b/test/jdk/javax/swing/plaf/metal/MetalTitlePaneBug.java new file mode 100644 index 00000000000..dde6249752d --- /dev/null +++ b/test/jdk/javax/swing/plaf/metal/MetalTitlePaneBug.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2026, 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 8078744 + * @summary Verifies right half of system menu icon on title bar + * activates when clicked + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @run main/manual MetalTitlePaneBug + */ + +import javax.swing.JFrame; +import javax.swing.UIManager; + +public class MetalTitlePaneBug { + + static final String INSTRUCTIONS = """ + A Frame is shown with a titlepane. + Click on the left edge of the system menu icon on the title pane. + It should show "Restore", "Minimize", "Maximize", "Close" menu. + Click on the right edge of the system menu icon. + It should also show "Restore", "Minimize", "Maximize", "Close" menu. + If it shows, press Pass else press Fail. + """; + + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + PassFailJFrame.builder() + .instructions(INSTRUCTIONS) + .columns(40) + .testUI(MetalTitlePaneBug::createUI) + .build() + .awaitAndCheck(); + } + + static JFrame createUI() { + JFrame.setDefaultLookAndFeelDecorated(true); + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(200, 100); + return frame; + } +} diff --git a/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteVector128LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ByteVector128LoadStoreTests.java index e450e3ead7e..0fa23ef55e1 100644 --- a/test/jdk/jdk/incubator/vector/Byte128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector128LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Byte128VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ByteVector128LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ByteVector128LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_128; @@ -61,14 +61,29 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(byte[] r, byte[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "byteProviderForIOOBE") @@ -957,11 +972,11 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -972,11 +987,11 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); } } @@ -992,7 +1007,7 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(byte[] r, byte[] a, int[] indexMap) { @@ -1005,7 +1020,7 @@ public class Byte128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Byte128VectorTests.java b/test/jdk/jdk/incubator/vector/ByteVector128Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Byte128VectorTests.java rename to test/jdk/jdk/incubator/vector/ByteVector128Tests.java index fae7b678a09..91148fd5d66 100644 --- a/test/jdk/jdk/incubator/vector/Byte128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector128Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteVector128Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Byte128VectorTests extends AbstractVectorTest { +public class ByteVector128Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_128; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(byte actual, byte expected, byte delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(byte actual, byte expected, byte delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final byte CONST_SHIFT = Byte.SIZE / 2; @@ -96,10 +139,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { byte[] ref = f.apply(a[i]); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Byte128VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Byte128VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Byte128VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Byte128VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Byte128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (byte)0); + assertEquals(r[i + k], (byte)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Byte128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (byte)0); + assertEquals(r[i + j], (byte)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Byte128VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Byte128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Byte128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Byte128VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Byte128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(r, a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1025,10 +1068,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1036,10 +1079,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1047,10 +1090,10 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1586,7 +1629,7 @@ public class Byte128VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ByteVector a = io.add((byte)1); //[1,2] ByteVector b = a.neg(); //[-1,-2] byte[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1601,19 +1644,19 @@ public class Byte128VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ByteVector uab0 = zab0.rearrange(unz0,zab1); ByteVector uab1 = zab0.rearrange(unz1,zab1); byte[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,7 +1671,7 @@ public class Byte128VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1662,7 +1705,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ADDByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1675,7 +1718,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::ADD); + assertArraysEquals(r, a, b, ByteVector128Tests::ADD); } static byte add(byte a, byte b) { @@ -1683,7 +1726,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte128VectorTests(IntFunction fa, IntFunction fb) { + static void addByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1694,11 +1737,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::add); + assertArraysEquals(r, a, b, ByteVector128Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1714,11 +1757,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1732,7 +1775,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::add); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::add); } static byte SUB(byte a, byte b) { @@ -1740,7 +1783,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void SUBByte128VectorTests(IntFunction fa, IntFunction fb) { + static void SUBByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1753,7 +1796,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::SUB); + assertArraysEquals(r, a, b, ByteVector128Tests::SUB); } static byte sub(byte a, byte b) { @@ -1761,7 +1804,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte128VectorTests(IntFunction fa, IntFunction fb) { + static void subByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1772,11 +1815,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::sub); + assertArraysEquals(r, a, b, ByteVector128Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void SUBByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1792,11 +1835,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::SUB); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1810,7 +1853,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::sub); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::sub); } static byte MUL(byte a, byte b) { @@ -1818,7 +1861,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MULByte128VectorTests(IntFunction fa, IntFunction fb) { + static void MULByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1831,7 +1874,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::MUL); + assertArraysEquals(r, a, b, ByteVector128Tests::MUL); } static byte mul(byte a, byte b) { @@ -1839,7 +1882,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte128VectorTests(IntFunction fa, IntFunction fb) { + static void mulByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1850,11 +1893,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::mul); + assertArraysEquals(r, a, b, ByteVector128Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void MULByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1870,11 +1913,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::MUL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1888,7 +1931,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::mul); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::mul); } static byte DIV(byte a, byte b) { @@ -1896,7 +1939,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void DIVByte128VectorTests(IntFunction fa, IntFunction fb) { + static void DIVByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1911,7 +1954,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::DIV); + assertArraysEquals(r, a, b, ByteVector128Tests::DIV); } static byte div(byte a, byte b) { @@ -1919,7 +1962,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte128VectorTests(IntFunction fa, IntFunction fb) { + static void divByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1934,11 +1977,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::div); + assertArraysEquals(r, a, b, ByteVector128Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void DIVByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1956,11 +1999,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::DIV); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1978,7 +2021,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::div); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::div); } static byte FIRST_NONZERO(byte a, byte b) { @@ -1986,7 +2029,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void FIRST_NONZEROByte128VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1999,11 +2042,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ByteVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void FIRST_NONZEROByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2019,7 +2062,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::FIRST_NONZERO); } static byte AND(byte a, byte b) { @@ -2027,7 +2070,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ANDByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2040,7 +2083,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::AND); + assertArraysEquals(r, a, b, ByteVector128Tests::AND); } static byte and(byte a, byte b) { @@ -2048,7 +2091,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte128VectorTests(IntFunction fa, IntFunction fb) { + static void andByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2059,11 +2102,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::and); + assertArraysEquals(r, a, b, ByteVector128Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2079,7 +2122,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::AND); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::AND); } static byte AND_NOT(byte a, byte b) { @@ -2087,7 +2130,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void AND_NOTByte128VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2100,11 +2143,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ByteVector128Tests::AND_NOT); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void AND_NOTByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2120,7 +2163,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::AND_NOT); } static byte OR(byte a, byte b) { @@ -2128,7 +2171,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ORByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2141,7 +2184,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::OR); + assertArraysEquals(r, a, b, ByteVector128Tests::OR); } static byte or(byte a, byte b) { @@ -2149,7 +2192,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte128VectorTests(IntFunction fa, IntFunction fb) { + static void orByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2160,11 +2203,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::or); + assertArraysEquals(r, a, b, ByteVector128Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2180,7 +2223,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::OR); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::OR); } static byte XOR(byte a, byte b) { @@ -2188,7 +2231,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void XORByte128VectorTests(IntFunction fa, IntFunction fb) { + static void XORByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2201,11 +2244,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::XOR); + assertArraysEquals(r, a, b, ByteVector128Tests::XOR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void XORByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2221,11 +2264,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::XOR); } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2235,11 +2278,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2252,11 +2295,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector128Tests::add); } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2266,11 +2309,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2283,11 +2326,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector128Tests::sub); } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2297,11 +2340,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2314,11 +2357,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector128Tests::mul); } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2373,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2392,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector128Tests::div); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2406,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2377,11 +2420,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2394,11 +2437,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector128Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2408,11 +2451,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2422,11 +2465,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2439,11 +2482,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector128Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2453,11 +2496,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ByteVector128Tests::OR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2470,11 +2513,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector128Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDByteVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2484,11 +2527,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ByteVector128Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDByteVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2501,7 +2544,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector128Tests::ADD); } static byte LSHL(byte a, byte b) { @@ -2509,7 +2552,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2522,11 +2565,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::LSHL); + assertArraysEquals(r, a, b, ByteVector128Tests::LSHL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2542,7 +2585,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::LSHL); } static byte ASHR(byte a, byte b) { @@ -2550,7 +2593,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2563,11 +2606,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::ASHR); + assertArraysEquals(r, a, b, ByteVector128Tests::ASHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2583,7 +2626,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::ASHR); } static byte LSHR(byte a, byte b) { @@ -2591,7 +2634,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2604,11 +2647,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::LSHR); + assertArraysEquals(r, a, b, ByteVector128Tests::LSHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2624,7 +2667,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::LSHR); } static byte LSHL_unary(byte a, byte b) { @@ -2632,7 +2675,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLByteVector128TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2644,11 +2687,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ByteVector128Tests::LSHL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2663,7 +2706,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector128Tests::LSHL_unary); } static byte LSHR_unary(byte a, byte b) { @@ -2671,7 +2714,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRByteVector128TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2683,11 +2726,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector128Tests::LSHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2702,7 +2745,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector128Tests::LSHR_unary); } static byte ASHR_unary(byte a, byte b) { @@ -2710,7 +2753,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRByteVector128TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2722,11 +2765,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector128Tests::ASHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2741,7 +2784,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector128Tests::ASHR_unary); } static byte ROR(byte a, byte b) { @@ -2749,7 +2792,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte128VectorTests(IntFunction fa, IntFunction fb) { + static void RORByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2762,11 +2805,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::ROR); + assertArraysEquals(r, a, b, ByteVector128Tests::ROR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2782,7 +2825,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::ROR); } static byte ROL(byte a, byte b) { @@ -2790,7 +2833,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ROLByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2803,11 +2846,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::ROL); + assertArraysEquals(r, a, b, ByteVector128Tests::ROL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2823,7 +2866,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::ROL); } static byte ROR_unary(byte a, byte b) { @@ -2831,7 +2874,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORByteVector128TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2843,11 +2886,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ByteVector128Tests::ROR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORByteVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2862,7 +2905,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector128Tests::ROR_unary); } static byte ROL_unary(byte a, byte b) { @@ -2870,7 +2913,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLByteVector128TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2882,11 +2925,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ByteVector128Tests::ROL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2901,14 +2944,14 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector128Tests::ROL_unary); } static byte LSHR_binary_const(byte a) { return (byte)(((a & 0xFF) >>> CONST_SHIFT)); } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHRByte128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRByteVector128TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2919,11 +2962,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ByteVector128Tests::LSHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHRByte128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRByteVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2937,7 +2980,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector128Tests::LSHR_binary_const); } static byte LSHL_binary_const(byte a) { @@ -2945,7 +2988,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHLByte128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLByteVector128TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2956,11 +2999,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ByteVector128Tests::LSHL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHLByte128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLByteVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2974,7 +3017,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector128Tests::LSHL_binary_const); } static byte ASHR_binary_const(byte a) { @@ -2982,7 +3025,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ASHRByte128VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRByteVector128TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2993,11 +3036,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ByteVector128Tests::ASHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ASHRByte128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRByteVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3011,7 +3054,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector128Tests::ASHR_binary_const); } static byte ROR_binary_const(byte a) { @@ -3019,7 +3062,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void RORByte128VectorTestsScalarShiftConst(IntFunction fa) { + static void RORByteVector128TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3030,11 +3073,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ByteVector128Tests::ROR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void RORByte128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORByteVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3048,7 +3091,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector128Tests::ROR_binary_const); } static byte ROL_binary_const(byte a) { @@ -3056,7 +3099,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ROLByte128VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLByteVector128TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3067,11 +3110,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ByteVector128Tests::ROL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ROLByte128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLByteVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3085,14 +3128,14 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector128Tests::ROL_binary_const); } static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MINByte128VectorTestsWithMemOp(IntFunction fa) { + static void MINByteVector128TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3103,13 +3146,13 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte128VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, ByteVector128Tests::MIN); } static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void minByte128VectorTestsWithMemOp(IntFunction fa) { + static void minByteVector128TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3120,13 +3163,13 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte128VectorTests::min); + assertArraysEquals(r, a, (byte)10, ByteVector128Tests::min); } static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINByte128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINByteVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3139,13 +3182,13 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte128VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, mask, ByteVector128Tests::MIN); } static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MAXByte128VectorTestsWithMemOp(IntFunction fa) { + static void MAXByteVector128TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3156,13 +3199,13 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte128VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, ByteVector128Tests::MAX); } static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void maxByte128VectorTestsWithMemOp(IntFunction fa) { + static void maxByteVector128TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3173,13 +3216,13 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte128VectorTests::max); + assertArraysEquals(r, a, (byte)10, ByteVector128Tests::max); } static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXByte128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXByteVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3192,7 +3235,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte128VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, mask, ByteVector128Tests::MAX); } static byte MIN(byte a, byte b) { @@ -3200,7 +3243,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte128VectorTests(IntFunction fa, IntFunction fb) { + static void MINByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3213,7 +3256,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::MIN); + assertArraysEquals(r, a, b, ByteVector128Tests::MIN); } static byte min(byte a, byte b) { @@ -3221,7 +3264,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte128VectorTests(IntFunction fa, IntFunction fb) { + static void minByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3232,7 +3275,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::min); + assertArraysEquals(r, a, b, ByteVector128Tests::min); } static byte MAX(byte a, byte b) { @@ -3240,7 +3283,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte128VectorTests(IntFunction fa, IntFunction fb) { + static void MAXByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3253,7 +3296,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::MAX); + assertArraysEquals(r, a, b, ByteVector128Tests::MAX); } static byte max(byte a, byte b) { @@ -3261,7 +3304,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maxByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3272,7 +3315,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte128VectorTests::max); + assertArraysEquals(r, a, b, ByteVector128Tests::max); } static byte UMIN(byte a, byte b) { @@ -3280,7 +3323,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMINByte128VectorTests(IntFunction fa, IntFunction fb) { + static void UMINByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3293,11 +3336,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::UMIN); + assertArraysEquals(r, a, b, ByteVector128Tests::UMIN); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMINByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3313,7 +3356,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::UMIN); } static byte UMAX(byte a, byte b) { @@ -3321,7 +3364,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMAXByte128VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3334,11 +3377,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::UMAX); + assertArraysEquals(r, a, b, ByteVector128Tests::UMAX); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMAXByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3354,7 +3397,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::UMAX); } static byte SADD(byte a, byte b) { @@ -3362,7 +3405,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SADDByte128VectorTests(IntFunction fa, IntFunction fb) { + static void SADDByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3375,11 +3418,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::SADD); + assertArraysEquals(r, a, b, ByteVector128Tests::SADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SADDByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3395,7 +3438,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::SADD); } static byte SSUB(byte a, byte b) { @@ -3403,7 +3446,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SSUBByte128VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3416,11 +3459,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::SSUB); + assertArraysEquals(r, a, b, ByteVector128Tests::SSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SSUBByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3436,7 +3479,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::SSUB); } static byte SUADD(byte a, byte b) { @@ -3444,7 +3487,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUADDByte128VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3457,11 +3500,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::SUADD); + assertArraysEquals(r, a, b, ByteVector128Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUADDByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3477,7 +3520,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::SUADD); } static byte SUSUB(byte a, byte b) { @@ -3485,7 +3528,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUSUBByte128VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3498,11 +3541,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::SUSUB); + assertArraysEquals(r, a, b, ByteVector128Tests::SUSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUSUBByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3518,11 +3561,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::SUSUB); } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3532,11 +3575,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::MIN); } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3546,11 +3589,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::min); } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3560,11 +3603,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::MAX); } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3574,10 +3617,10 @@ public class Byte128VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte128VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ByteVector128Tests::max); } @Test(dataProvider = "byteSaturatingBinaryOpAssocProvider") - static void SUADDAssocByte128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocByteVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -3594,11 +3637,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Byte128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ByteVector128Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3619,7 +3662,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Byte128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ByteVector128Tests::SUADD); } static byte ANDReduce(byte[] a, int idx) { @@ -3641,7 +3684,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ANDReduceByte128VectorTests(IntFunction fa) { + static void ANDReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3657,7 +3700,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::ANDReduce, Byte128VectorTests::ANDReduceAll); + ByteVector128Tests::ANDReduce, ByteVector128Tests::ANDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3665,20 +3708,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = AND_IDENTITY; - Assert.assertEquals((byte) (id & id), id, + assertEquals((byte) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id & x), x); - Assert.assertEquals((byte) (x & id), x); + assertEquals((byte) (id & x), x); + assertEquals((byte) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id & x), x, + assertEquals((byte) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x & id), x, + assertEquals((byte) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3703,7 +3746,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ANDReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3721,7 +3764,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::ANDReduceMasked, Byte128VectorTests::ANDReduceAllMasked); + ByteVector128Tests::ANDReduceMasked, ByteVector128Tests::ANDReduceAllMasked); } static byte ORReduce(byte[] a, int idx) { @@ -3743,7 +3786,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ORReduceByte128VectorTests(IntFunction fa) { + static void ORReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3759,7 +3802,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::ORReduce, Byte128VectorTests::ORReduceAll); + ByteVector128Tests::ORReduce, ByteVector128Tests::ORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3767,20 +3810,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = OR_IDENTITY; - Assert.assertEquals((byte) (id | id), id, + assertEquals((byte) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id | x), x); - Assert.assertEquals((byte) (x | id), x); + assertEquals((byte) (id | x), x); + assertEquals((byte) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id | x), x, + assertEquals((byte) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x | id), x, + assertEquals((byte) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3805,7 +3848,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ORReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3823,7 +3866,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::ORReduceMasked, Byte128VectorTests::ORReduceAllMasked); + ByteVector128Tests::ORReduceMasked, ByteVector128Tests::ORReduceAllMasked); } static byte XORReduce(byte[] a, int idx) { @@ -3845,7 +3888,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void XORReduceByte128VectorTests(IntFunction fa) { + static void XORReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3861,7 +3904,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::XORReduce, Byte128VectorTests::XORReduceAll); + ByteVector128Tests::XORReduce, ByteVector128Tests::XORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3869,20 +3912,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = XOR_IDENTITY; - Assert.assertEquals((byte) (id ^ id), id, + assertEquals((byte) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id ^ x), x); - Assert.assertEquals((byte) (x ^ id), x); + assertEquals((byte) (id ^ x), x); + assertEquals((byte) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id ^ x), x, + assertEquals((byte) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x ^ id), x, + assertEquals((byte) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3907,7 +3950,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void XORReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3925,7 +3968,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::XORReduceMasked, Byte128VectorTests::XORReduceAllMasked); + ByteVector128Tests::XORReduceMasked, ByteVector128Tests::XORReduceAllMasked); } static byte ADDReduce(byte[] a, int idx) { @@ -3947,7 +3990,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceByte128VectorTests(IntFunction fa) { + static void ADDReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3963,7 +4006,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::ADDReduce, Byte128VectorTests::ADDReduceAll); + ByteVector128Tests::ADDReduce, ByteVector128Tests::ADDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3971,20 +4014,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = ADD_IDENTITY; - Assert.assertEquals((byte) (id + id), id, + assertEquals((byte) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id + x), x); - Assert.assertEquals((byte) (x + id), x); + assertEquals((byte) (id + x), x); + assertEquals((byte) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id + x), x, + assertEquals((byte) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x + id), x, + assertEquals((byte) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4009,7 +4052,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4027,7 +4070,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::ADDReduceMasked, Byte128VectorTests::ADDReduceAllMasked); + ByteVector128Tests::ADDReduceMasked, ByteVector128Tests::ADDReduceAllMasked); } static byte MULReduce(byte[] a, int idx) { @@ -4049,7 +4092,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MULReduceByte128VectorTests(IntFunction fa) { + static void MULReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4065,7 +4108,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::MULReduce, Byte128VectorTests::MULReduceAll); + ByteVector128Tests::MULReduce, ByteVector128Tests::MULReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4073,20 +4116,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MUL_IDENTITY; - Assert.assertEquals((byte) (id * id), id, + assertEquals((byte) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id * x), x); - Assert.assertEquals((byte) (x * id), x); + assertEquals((byte) (id * x), x); + assertEquals((byte) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id * x), x, + assertEquals((byte) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x * id), x, + assertEquals((byte) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4111,7 +4154,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MULReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4129,7 +4172,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::MULReduceMasked, Byte128VectorTests::MULReduceAllMasked); + ByteVector128Tests::MULReduceMasked, ByteVector128Tests::MULReduceAllMasked); } static byte MINReduce(byte[] a, int idx) { @@ -4151,7 +4194,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MINReduceByte128VectorTests(IntFunction fa) { + static void MINReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4167,7 +4210,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::MINReduce, Byte128VectorTests::MINReduceAll); + ByteVector128Tests::MINReduce, ByteVector128Tests::MINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4175,20 +4218,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MIN_IDENTITY; - Assert.assertEquals((byte) Math.min(id, id), id, + assertEquals((byte) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.min(id, x), x); - Assert.assertEquals((byte) Math.min(x, id), x); + assertEquals((byte) Math.min(id, x), x); + assertEquals((byte) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.min(id, x), x, + assertEquals((byte) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.min(x, id), x, + assertEquals((byte) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4213,7 +4256,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4231,7 +4274,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::MINReduceMasked, Byte128VectorTests::MINReduceAllMasked); + ByteVector128Tests::MINReduceMasked, ByteVector128Tests::MINReduceAllMasked); } static byte MAXReduce(byte[] a, int idx) { @@ -4253,7 +4296,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MAXReduceByte128VectorTests(IntFunction fa) { + static void MAXReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4269,7 +4312,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::MAXReduce, Byte128VectorTests::MAXReduceAll); + ByteVector128Tests::MAXReduce, ByteVector128Tests::MAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4277,20 +4320,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MAX_IDENTITY; - Assert.assertEquals((byte) Math.max(id, id), id, + assertEquals((byte) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.max(id, x), x); - Assert.assertEquals((byte) Math.max(x, id), x); + assertEquals((byte) Math.max(id, x), x); + assertEquals((byte) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.max(id, x), x, + assertEquals((byte) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.max(x, id), x, + assertEquals((byte) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4315,7 +4358,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4333,7 +4376,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::MAXReduceMasked, Byte128VectorTests::MAXReduceAllMasked); + ByteVector128Tests::MAXReduceMasked, ByteVector128Tests::MAXReduceAllMasked); } static byte UMINReduce(byte[] a, int idx) { @@ -4355,7 +4398,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMINReduceByte128VectorTests(IntFunction fa) { + static void UMINReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4371,7 +4414,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::UMINReduce, Byte128VectorTests::UMINReduceAll); + ByteVector128Tests::UMINReduce, ByteVector128Tests::UMINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4379,20 +4422,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMIN_IDENTITY; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, id), id, + assertEquals((byte) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x); + assertEquals((byte) VectorMath.minUnsigned(id, x), x); + assertEquals((byte) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x, + assertEquals((byte) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x, + assertEquals((byte) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4417,7 +4460,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMINReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4435,7 +4478,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::UMINReduceMasked, Byte128VectorTests::UMINReduceAllMasked); + ByteVector128Tests::UMINReduceMasked, ByteVector128Tests::UMINReduceAllMasked); } static byte UMAXReduce(byte[] a, int idx) { @@ -4457,7 +4500,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMAXReduceByte128VectorTests(IntFunction fa) { + static void UMAXReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4473,7 +4516,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::UMAXReduce, Byte128VectorTests::UMAXReduceAll); + ByteVector128Tests::UMAXReduce, ByteVector128Tests::UMAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4481,20 +4524,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMAX_IDENTITY; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, id), id, + assertEquals((byte) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x); + assertEquals((byte) VectorMath.maxUnsigned(id, x), x); + assertEquals((byte) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x, + assertEquals((byte) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x, + assertEquals((byte) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4519,7 +4562,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMAXReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::UMAXReduceMasked, Byte128VectorTests::UMAXReduceAllMasked); + ByteVector128Tests::UMAXReduceMasked, ByteVector128Tests::UMAXReduceAllMasked); } static byte FIRST_NONZEROReduce(byte[] a, int idx) { @@ -4559,7 +4602,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void FIRST_NONZEROReduceByte128VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4575,7 +4618,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::FIRST_NONZEROReduce, Byte128VectorTests::FIRST_NONZEROReduceAll); + ByteVector128Tests::FIRST_NONZEROReduce, ByteVector128Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4583,20 +4626,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4621,7 +4664,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void FIRST_NONZEROReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4639,7 +4682,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::FIRST_NONZEROReduceMasked, Byte128VectorTests::FIRST_NONZEROReduceAllMasked); + ByteVector128Tests::FIRST_NONZEROReduceMasked, ByteVector128Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4652,7 +4695,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueByte128VectorTests(IntFunction fm) { + static void anyTrueByteVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4663,7 +4706,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte128VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector128Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4676,7 +4719,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueByte128VectorTests(IntFunction fm) { + static void allTrueByteVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4687,7 +4730,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte128VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector128Tests::allTrue); } static byte SUADDReduce(byte[] a, int idx) { @@ -4709,7 +4752,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingUnaryOpProvider") - static void SUADDReduceByte128VectorTests(IntFunction fa) { + static void SUADDReduceByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4725,7 +4768,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte128VectorTests::SUADDReduce, Byte128VectorTests::SUADDReduceAll); + ByteVector128Tests::SUADDReduce, ByteVector128Tests::SUADDReduceAll); } @Test(dataProvider = "byteSaturatingUnaryOpProvider") @@ -4733,20 +4776,20 @@ public class Byte128VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = SUADD_IDENTITY; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4770,7 +4813,7 @@ public class Byte128VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "byteSaturatingUnaryOpMaskProvider") - static void SUADDReduceByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4788,11 +4831,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::SUADDReduceMasked, Byte128VectorTests::SUADDReduceAllMasked); + ByteVector128Tests::SUADDReduceMasked, ByteVector128Tests::SUADDReduceAllMasked); } @Test(dataProvider = "byteBinaryOpProvider") - static void withByte128VectorTests(IntFunction fa, IntFunction fb) { + static void withByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -4815,7 +4858,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_DEFAULTByte128VectorTests(IntFunction fa) { + static void IS_DEFAULTByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4825,14 +4868,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_DEFAULTMaskedByte128VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4845,7 +4888,7 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4856,7 +4899,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_NEGATIVEByte128VectorTests(IntFunction fa) { + static void IS_NEGATIVEByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4866,14 +4909,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_NEGATIVEMaskedByte128VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4886,14 +4929,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte128VectorTests(IntFunction fa, IntFunction fb) { + static void LTByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4905,14 +4948,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ltByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4924,14 +4967,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4947,14 +4990,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GTByte128VectorTests(IntFunction fa, IntFunction fb) { + static void GTByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4966,14 +5009,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GTByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4989,14 +5032,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte128VectorTests(IntFunction fa, IntFunction fb) { + static void EQByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5008,14 +5051,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte128VectorTests(IntFunction fa, IntFunction fb) { + static void eqByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5027,14 +5070,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5050,14 +5093,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void NEByte128VectorTests(IntFunction fa, IntFunction fb) { + static void NEByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5069,14 +5112,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void NEByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5092,14 +5135,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LEByte128VectorTests(IntFunction fa, IntFunction fb) { + static void LEByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5111,14 +5154,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LEByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5134,14 +5177,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GEByte128VectorTests(IntFunction fa, IntFunction fb) { + static void GEByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5153,14 +5196,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GEByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5176,14 +5219,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULTByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ULTByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5195,14 +5238,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULTByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5218,14 +5261,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGTByte128VectorTests(IntFunction fa, IntFunction fb) { + static void UGTByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5237,14 +5280,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGTByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5260,14 +5303,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULEByte128VectorTests(IntFunction fa, IntFunction fb) { + static void ULEByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5279,14 +5322,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULEByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5302,14 +5345,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGEByte128VectorTests(IntFunction fa, IntFunction fb) { + static void UGEByteVector128Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5321,14 +5364,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGEByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5344,14 +5387,14 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5361,13 +5404,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5381,13 +5424,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5397,13 +5440,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTByteVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5417,13 +5460,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5433,13 +5476,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5453,13 +5496,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5469,13 +5512,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQByteVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5489,7 +5532,7 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); } } } @@ -5499,7 +5542,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte128VectorTests(IntFunction fa, IntFunction fb, + static void blendByteVector128Tests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5515,11 +5558,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte128VectorTests::blend); + assertArraysEquals(r, a, b, mask, ByteVector128Tests::blend); } @Test(dataProvider = "byteUnaryOpShuffleProvider") - static void RearrangeByte128VectorTests(IntFunction fa, + static void RearrangeByteVector128Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5536,7 +5579,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpShuffleMaskProvider") - static void RearrangeByte128VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeByteVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -5554,7 +5597,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void compressByte128VectorTests(IntFunction fa, + static void compressByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5572,7 +5615,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void expandByte128VectorTests(IntFunction fa, + static void expandByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5590,7 +5633,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void getByte128VectorTests(IntFunction fa) { + static void getByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5746,7 +5789,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastByte128VectorTests(IntFunction fa) { + static void BroadcastByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5760,7 +5803,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZeroByte128VectorTests(IntFunction fa) { + static void ZeroByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5770,7 +5813,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static byte[] sliceUnary(byte[] a, int origin, int idx) { @@ -5785,7 +5828,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void sliceUnaryByte128VectorTests(IntFunction fa) { + static void sliceUnaryByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5796,7 +5839,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte128VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ByteVector128Tests::sliceUnary); } static byte[] sliceBinary(byte[] a, byte[] b, int origin, int idx) { @@ -5813,7 +5856,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void sliceBinaryByte128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryByteVector128TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5826,7 +5869,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Byte128VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ByteVector128Tests::sliceBinary); } static byte[] slice(byte[] a, byte[] b, int origin, boolean[] mask, int idx) { @@ -5843,7 +5886,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void sliceByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5860,7 +5903,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Byte128VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ByteVector128Tests::slice); } static byte[] unsliceUnary(byte[] a, int origin, int idx) { @@ -5877,7 +5920,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void unsliceUnaryByte128VectorTests(IntFunction fa) { + static void unsliceUnaryByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5888,7 +5931,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte128VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ByteVector128Tests::unsliceUnary); } static byte[] unsliceBinary(byte[] a, byte[] b, int origin, int part, int idx) { @@ -5914,7 +5957,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void unsliceBinaryByte128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryByteVector128TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5928,7 +5971,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Byte128VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ByteVector128Tests::unsliceBinary); } static byte[] unslice(byte[] a, byte[] b, int origin, int part, boolean[] mask, int idx) { @@ -5968,7 +6011,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void unsliceByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5985,7 +6028,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Byte128VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ByteVector128Tests::unslice); } static byte BITWISE_BLEND(byte a, byte b, byte c) { @@ -5997,7 +6040,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6012,11 +6055,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Byte128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6029,11 +6072,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Byte128VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ByteVector128Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6051,11 +6094,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Byte128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6066,11 +6109,11 @@ public class Byte128VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6081,11 +6124,11 @@ public class Byte128VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6096,11 +6139,11 @@ public class Byte128VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte128VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ByteVector128Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6111,11 +6154,11 @@ public class Byte128VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte128VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector128Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6130,11 +6173,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Byte128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte128VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector128TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6149,11 +6192,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Byte128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6164,11 +6207,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6179,11 +6222,11 @@ public class Byte128VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte128VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector128Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector128TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6197,7 +6240,7 @@ public class Byte128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Byte128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteVector128Tests::BITWISE_BLEND); } static byte NEG(byte a) { @@ -6209,7 +6252,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NEGByte128VectorTests(IntFunction fa) { + static void NEGByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6220,11 +6263,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::NEG); + assertArraysEquals(r, a, ByteVector128Tests::NEG); } @Test(dataProvider = "byteUnaryOpProvider") - static void negByte128VectorTests(IntFunction fa) { + static void negByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6235,11 +6278,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::neg); + assertArraysEquals(r, a, ByteVector128Tests::neg); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NEGMaskedByte128VectorTests(IntFunction fa, + static void NEGMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6253,7 +6296,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::NEG); + assertArraysEquals(r, a, mask, ByteVector128Tests::NEG); } static byte ABS(byte a) { @@ -6265,7 +6308,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ABSByte128VectorTests(IntFunction fa) { + static void ABSByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6276,11 +6319,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::ABS); + assertArraysEquals(r, a, ByteVector128Tests::ABS); } @Test(dataProvider = "byteUnaryOpProvider") - static void absByte128VectorTests(IntFunction fa) { + static void absByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6291,11 +6334,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::abs); + assertArraysEquals(r, a, ByteVector128Tests::abs); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ABSMaskedByte128VectorTests(IntFunction fa, + static void ABSMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6309,7 +6352,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::ABS); + assertArraysEquals(r, a, mask, ByteVector128Tests::ABS); } static byte NOT(byte a) { @@ -6321,7 +6364,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NOTByte128VectorTests(IntFunction fa) { + static void NOTByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6332,11 +6375,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::NOT); + assertArraysEquals(r, a, ByteVector128Tests::NOT); } @Test(dataProvider = "byteUnaryOpProvider") - static void notByte128VectorTests(IntFunction fa) { + static void notByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6347,11 +6390,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::not); + assertArraysEquals(r, a, ByteVector128Tests::not); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NOTMaskedByte128VectorTests(IntFunction fa, + static void NOTMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6365,7 +6408,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::NOT); + assertArraysEquals(r, a, mask, ByteVector128Tests::NOT); } static byte ZOMO(byte a) { @@ -6373,7 +6416,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZOMOByte128VectorTests(IntFunction fa) { + static void ZOMOByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6384,11 +6427,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::ZOMO); + assertArraysEquals(r, a, ByteVector128Tests::ZOMO); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ZOMOMaskedByte128VectorTests(IntFunction fa, + static void ZOMOMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6402,7 +6445,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ByteVector128Tests::ZOMO); } static byte BIT_COUNT(byte a) { @@ -6410,7 +6453,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BIT_COUNTByte128VectorTests(IntFunction fa) { + static void BIT_COUNTByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6421,11 +6464,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ByteVector128Tests::BIT_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void BIT_COUNTMaskedByte128VectorTests(IntFunction fa, + static void BIT_COUNTMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6439,7 +6482,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ByteVector128Tests::BIT_COUNT); } static byte TRAILING_ZEROS_COUNT(byte a) { @@ -6447,7 +6490,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void TRAILING_ZEROS_COUNTByte128VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6458,11 +6501,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector128Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedByte128VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6476,7 +6519,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector128Tests::TRAILING_ZEROS_COUNT); } static byte LEADING_ZEROS_COUNT(byte a) { @@ -6484,7 +6527,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LEADING_ZEROS_COUNTByte128VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6495,11 +6538,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector128Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedByte128VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6513,7 +6556,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector128Tests::LEADING_ZEROS_COUNT); } static byte REVERSE(byte a) { @@ -6521,7 +6564,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSEByte128VectorTests(IntFunction fa) { + static void REVERSEByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6532,11 +6575,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::REVERSE); + assertArraysEquals(r, a, ByteVector128Tests::REVERSE); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSEMaskedByte128VectorTests(IntFunction fa, + static void REVERSEMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6550,7 +6593,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ByteVector128Tests::REVERSE); } static byte REVERSE_BYTES(byte a) { @@ -6558,7 +6601,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSE_BYTESByte128VectorTests(IntFunction fa) { + static void REVERSE_BYTESByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6569,11 +6612,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ByteVector128Tests::REVERSE_BYTES); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedByte128VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedByteVector128Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6587,7 +6630,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ByteVector128Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6595,7 +6638,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandByteVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6608,7 +6651,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::band); + assertArraysEquals(r, a, b, ByteVector128Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6616,7 +6659,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maskorByteVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6629,7 +6672,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::bor); + assertArraysEquals(r, a, b, ByteVector128Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6637,7 +6680,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorByteVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6650,7 +6693,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::bxor); + assertArraysEquals(r, a, b, ByteVector128Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6658,7 +6701,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotByteVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6671,7 +6714,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::bandNot); + assertArraysEquals(r, a, b, ByteVector128Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6679,7 +6722,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqByteVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6692,7 +6735,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte128VectorTests::beq); + assertArraysEquals(r, a, b, ByteVector128Tests::beq); } static boolean unot(boolean a) { @@ -6700,7 +6743,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotByte128VectorTests(IntFunction fa) { + static void masknotByteVector128Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6711,7 +6754,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte128VectorTests::unot); + assertArraysEquals(r, a, ByteVector128Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6720,15 +6763,15 @@ public class Byte128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongByte128VectorTests(IntFunction fa) { + static void maskFromToLongByteVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6742,7 +6785,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltByteVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6752,13 +6795,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqByteVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6768,13 +6811,13 @@ public class Byte128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteUnaryOpProvider") - static void toIntArrayByte128VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6785,7 +6828,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toLongArrayByte128VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6796,7 +6839,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toDoubleArrayByte128VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6807,7 +6850,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toStringByte128VectorTestsSmokeTest(IntFunction fa) { + static void toStringByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6820,7 +6863,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void hashCodeByte128VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6834,7 +6877,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void reinterpretAsBytesByte128VectorTestsSmokeTest(IntFunction fa) { + static void reinterpretAsBytesByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6864,7 +6907,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceLongByte128VectorTests(IntFunction fa) { + static void ADDReduceLongByteVector128Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6880,7 +6923,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Byte128VectorTests::ADDReduceLong, Byte128VectorTests::ADDReduceAllLong); + ByteVector128Tests::ADDReduceLong, ByteVector128Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(byte[] a, int idx, boolean[] mask) { @@ -6903,7 +6946,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceLongByte128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongByteVector128TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6921,11 +6964,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Byte128VectorTests::ADDReduceLongMasked, Byte128VectorTests::ADDReduceAllLongMasked); + ByteVector128Tests::ADDReduceLongMasked, ByteVector128Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastLongByte128VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongByteVector128TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6936,7 +6979,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendByteVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6950,12 +6993,12 @@ public class Byte128VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte128VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector128Tests::blend); } @Test(dataProvider = "byteUnaryOpSelectFromProvider") - static void SelectFromByte128VectorTests(IntFunction fa, + static void SelectFromByteVector128Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); byte[] order = fs.apply(a.length, SPECIES.length()); @@ -6971,7 +7014,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorByte128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorByteVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] idx = fc.apply(SPECIES.length()); @@ -6989,7 +7032,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpSelectFromMaskProvider") - static void SelectFromByte128VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromByteVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -7008,7 +7051,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousByte128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousByteVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7019,12 +7062,12 @@ public class Byte128VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringByte128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringByteVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7038,7 +7081,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsByte128VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsByteVector128TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7047,12 +7090,12 @@ public class Byte128VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsByte128VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsByteVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7062,13 +7105,13 @@ public class Byte128VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeByte128VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeByteVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7090,7 +7133,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountByte128VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountByteVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7101,7 +7144,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte128VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ByteVector128Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7115,7 +7158,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueByte128VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueByteVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7126,7 +7169,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte128VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ByteVector128Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7140,7 +7183,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueByte128VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueByteVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7151,11 +7194,11 @@ public class Byte128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte128VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ByteVector128Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressByte128VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressByteVector128TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7165,7 +7208,7 @@ public class Byte128VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7183,7 +7226,7 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeByte128VectorTestsSmokeTest(int offset) { + static void indexInRangeByteVector128TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7191,13 +7234,13 @@ public class Byte128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongByte128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongByteVector128TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7205,7 +7248,7 @@ public class Byte128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7224,36 +7267,36 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundByte128VectorTestsSmokeTest(int length) { + static void loopBoundByteVector128TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongByte128VectorTestsSmokeTest(int _length) { + static void loopBoundLongByteVector128TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeByte128VectorTestsSmokeTest() { + static void ElementSizeByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Byte.SIZE); + assertEquals(elsize, Byte.SIZE); } @Test - static void VectorShapeByte128VectorTestsSmokeTest() { + static void VectorShapeByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_128_BIT)); } @Test - static void ShapeWithLanesByte128VectorTestsSmokeTest() { + static void ShapeWithLanesByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(byte.class); @@ -7261,32 +7304,32 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeByte128VectorTestsSmokeTest() { + static void ElementTypeByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementType() == byte.class); } @Test - static void SpeciesElementSizeByte128VectorTestsSmokeTest() { + static void SpeciesElementSizeByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementSize() == Byte.SIZE); } @Test - static void VectorTypeByte128VectorTestsSmokeTest() { + static void VectorTypeByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesByte128VectorTestsSmokeTest() { + static void WithLanesByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(byte.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeByte128VectorTestsSmokeTest() { + static void WithShapeByteVector128TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7294,9 +7337,9 @@ public class Byte128VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueByte128VectorTestsSmokeTest() { + static void MaskAllTrueByteVector128TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteVector256LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ByteVector256LoadStoreTests.java index a818043aedc..f57bc3e65b9 100644 --- a/test/jdk/jdk/incubator/vector/Byte256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector256LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Byte256VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ByteVector256LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ByteVector256LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_256; @@ -61,14 +61,29 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(byte[] r, byte[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "byteProviderForIOOBE") @@ -957,11 +972,11 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -972,11 +987,11 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); } } @@ -992,7 +1007,7 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(byte[] r, byte[] a, int[] indexMap) { @@ -1005,7 +1020,7 @@ public class Byte256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Byte512VectorTests.java b/test/jdk/jdk/incubator/vector/ByteVector256Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Byte512VectorTests.java rename to test/jdk/jdk/incubator/vector/ByteVector256Tests.java index 5ad3bbdbc05..1173a4b7783 100644 --- a/test/jdk/jdk/incubator/vector/Byte512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector256Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteVector256Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Byte512VectorTests extends AbstractVectorTest { +public class ByteVector256Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = - ByteVector.SPECIES_512; + ByteVector.SPECIES_256; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(byte actual, byte expected, byte delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(byte actual, byte expected, byte delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final byte CONST_SHIFT = Byte.SIZE / 2; @@ -78,7 +121,7 @@ public class Byte512VectorTests extends AbstractVectorTest { private static final byte UMIN_IDENTITY = (byte)-1; // Maximum unsigned value private static final byte XOR_IDENTITY = (byte)0; - static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); static void assertArraysStrictlyEquals(byte[] r, byte[] a) { for (int i = 0; i < a.length; i++) { @@ -96,10 +139,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { byte[] ref = f.apply(a[i]); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Byte512VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Byte512VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Byte512VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Byte512VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Byte512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (byte)0); + assertEquals(r[i + k], (byte)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Byte512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (byte)0); + assertEquals(r[i + j], (byte)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Byte512VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Byte512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Byte512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Byte512VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Byte512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(r, a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1025,10 +1068,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1036,10 +1079,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1047,10 +1090,10 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1586,7 +1629,7 @@ public class Byte512VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ByteVector a = io.add((byte)1); //[1,2] ByteVector b = a.neg(); //[-1,-2] byte[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1601,19 +1644,19 @@ public class Byte512VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ByteVector uab0 = zab0.rearrange(unz0,zab1); ByteVector uab1 = zab0.rearrange(unz1,zab1); byte[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,7 +1671,7 @@ public class Byte512VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1662,7 +1705,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ADDByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1675,7 +1718,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::ADD); + assertArraysEquals(r, a, b, ByteVector256Tests::ADD); } static byte add(byte a, byte b) { @@ -1683,7 +1726,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte512VectorTests(IntFunction fa, IntFunction fb) { + static void addByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1694,11 +1737,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::add); + assertArraysEquals(r, a, b, ByteVector256Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1714,11 +1757,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1732,7 +1775,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::add); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::add); } static byte SUB(byte a, byte b) { @@ -1740,7 +1783,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void SUBByte512VectorTests(IntFunction fa, IntFunction fb) { + static void SUBByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1753,7 +1796,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::SUB); + assertArraysEquals(r, a, b, ByteVector256Tests::SUB); } static byte sub(byte a, byte b) { @@ -1761,7 +1804,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte512VectorTests(IntFunction fa, IntFunction fb) { + static void subByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1772,11 +1815,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::sub); + assertArraysEquals(r, a, b, ByteVector256Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void SUBByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1792,11 +1835,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::SUB); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1810,7 +1853,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::sub); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::sub); } static byte MUL(byte a, byte b) { @@ -1818,7 +1861,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MULByte512VectorTests(IntFunction fa, IntFunction fb) { + static void MULByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1831,7 +1874,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::MUL); + assertArraysEquals(r, a, b, ByteVector256Tests::MUL); } static byte mul(byte a, byte b) { @@ -1839,7 +1882,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte512VectorTests(IntFunction fa, IntFunction fb) { + static void mulByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1850,11 +1893,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::mul); + assertArraysEquals(r, a, b, ByteVector256Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void MULByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1870,11 +1913,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::MUL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1888,7 +1931,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::mul); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::mul); } static byte DIV(byte a, byte b) { @@ -1896,7 +1939,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void DIVByte512VectorTests(IntFunction fa, IntFunction fb) { + static void DIVByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1911,7 +1954,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::DIV); + assertArraysEquals(r, a, b, ByteVector256Tests::DIV); } static byte div(byte a, byte b) { @@ -1919,7 +1962,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte512VectorTests(IntFunction fa, IntFunction fb) { + static void divByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1934,11 +1977,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::div); + assertArraysEquals(r, a, b, ByteVector256Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void DIVByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1956,11 +1999,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::DIV); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1978,7 +2021,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::div); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::div); } static byte FIRST_NONZERO(byte a, byte b) { @@ -1986,7 +2029,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void FIRST_NONZEROByte512VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1999,11 +2042,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ByteVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void FIRST_NONZEROByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2019,7 +2062,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::FIRST_NONZERO); } static byte AND(byte a, byte b) { @@ -2027,7 +2070,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ANDByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2040,7 +2083,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::AND); + assertArraysEquals(r, a, b, ByteVector256Tests::AND); } static byte and(byte a, byte b) { @@ -2048,7 +2091,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte512VectorTests(IntFunction fa, IntFunction fb) { + static void andByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2059,11 +2102,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::and); + assertArraysEquals(r, a, b, ByteVector256Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2079,7 +2122,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::AND); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::AND); } static byte AND_NOT(byte a, byte b) { @@ -2087,7 +2130,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void AND_NOTByte512VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2100,11 +2143,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ByteVector256Tests::AND_NOT); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void AND_NOTByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2120,7 +2163,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::AND_NOT); } static byte OR(byte a, byte b) { @@ -2128,7 +2171,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ORByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2141,7 +2184,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::OR); + assertArraysEquals(r, a, b, ByteVector256Tests::OR); } static byte or(byte a, byte b) { @@ -2149,7 +2192,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte512VectorTests(IntFunction fa, IntFunction fb) { + static void orByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2160,11 +2203,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::or); + assertArraysEquals(r, a, b, ByteVector256Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2180,7 +2223,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::OR); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::OR); } static byte XOR(byte a, byte b) { @@ -2188,7 +2231,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void XORByte512VectorTests(IntFunction fa, IntFunction fb) { + static void XORByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2201,11 +2244,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::XOR); + assertArraysEquals(r, a, b, ByteVector256Tests::XOR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void XORByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2221,11 +2264,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::XOR); } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2235,11 +2278,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2252,11 +2295,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector256Tests::add); } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2266,11 +2309,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2283,11 +2326,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector256Tests::sub); } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2297,11 +2340,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2314,11 +2357,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector256Tests::mul); } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2373,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2392,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector256Tests::div); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2406,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2377,11 +2420,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2394,11 +2437,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector256Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2408,11 +2451,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2422,11 +2465,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2439,11 +2482,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector256Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2453,11 +2496,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ByteVector256Tests::OR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2470,11 +2513,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector256Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDByteVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2484,11 +2527,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ByteVector256Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDByteVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2501,7 +2544,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector256Tests::ADD); } static byte LSHL(byte a, byte b) { @@ -2509,7 +2552,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2522,11 +2565,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::LSHL); + assertArraysEquals(r, a, b, ByteVector256Tests::LSHL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2542,7 +2585,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::LSHL); } static byte ASHR(byte a, byte b) { @@ -2550,7 +2593,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2563,11 +2606,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::ASHR); + assertArraysEquals(r, a, b, ByteVector256Tests::ASHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2583,7 +2626,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::ASHR); } static byte LSHR(byte a, byte b) { @@ -2591,7 +2634,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2604,11 +2647,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::LSHR); + assertArraysEquals(r, a, b, ByteVector256Tests::LSHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2624,7 +2667,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::LSHR); } static byte LSHL_unary(byte a, byte b) { @@ -2632,7 +2675,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLByteVector256TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2644,11 +2687,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ByteVector256Tests::LSHL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2663,7 +2706,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector256Tests::LSHL_unary); } static byte LSHR_unary(byte a, byte b) { @@ -2671,7 +2714,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRByteVector256TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2683,11 +2726,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector256Tests::LSHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2702,7 +2745,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector256Tests::LSHR_unary); } static byte ASHR_unary(byte a, byte b) { @@ -2710,7 +2753,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRByteVector256TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2722,11 +2765,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector256Tests::ASHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2741,7 +2784,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector256Tests::ASHR_unary); } static byte ROR(byte a, byte b) { @@ -2749,7 +2792,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte512VectorTests(IntFunction fa, IntFunction fb) { + static void RORByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2762,11 +2805,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::ROR); + assertArraysEquals(r, a, b, ByteVector256Tests::ROR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2782,7 +2825,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::ROR); } static byte ROL(byte a, byte b) { @@ -2790,7 +2833,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ROLByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2803,11 +2846,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::ROL); + assertArraysEquals(r, a, b, ByteVector256Tests::ROL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2823,7 +2866,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::ROL); } static byte ROR_unary(byte a, byte b) { @@ -2831,7 +2874,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORByteVector256TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2843,11 +2886,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ByteVector256Tests::ROR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORByteVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2862,7 +2905,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector256Tests::ROR_unary); } static byte ROL_unary(byte a, byte b) { @@ -2870,7 +2913,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLByteVector256TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2882,11 +2925,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ByteVector256Tests::ROL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2901,14 +2944,14 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector256Tests::ROL_unary); } static byte LSHR_binary_const(byte a) { return (byte)(((a & 0xFF) >>> CONST_SHIFT)); } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHRByte512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRByteVector256TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2919,11 +2962,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ByteVector256Tests::LSHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHRByte512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRByteVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2937,7 +2980,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector256Tests::LSHR_binary_const); } static byte LSHL_binary_const(byte a) { @@ -2945,7 +2988,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHLByte512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLByteVector256TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2956,11 +2999,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ByteVector256Tests::LSHL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHLByte512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLByteVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2974,7 +3017,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector256Tests::LSHL_binary_const); } static byte ASHR_binary_const(byte a) { @@ -2982,7 +3025,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ASHRByte512VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRByteVector256TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2993,11 +3036,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ByteVector256Tests::ASHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ASHRByte512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRByteVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3011,7 +3054,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector256Tests::ASHR_binary_const); } static byte ROR_binary_const(byte a) { @@ -3019,7 +3062,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void RORByte512VectorTestsScalarShiftConst(IntFunction fa) { + static void RORByteVector256TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3030,11 +3073,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ByteVector256Tests::ROR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void RORByte512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORByteVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3048,7 +3091,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector256Tests::ROR_binary_const); } static byte ROL_binary_const(byte a) { @@ -3056,7 +3099,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ROLByte512VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLByteVector256TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3067,11 +3110,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ByteVector256Tests::ROL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ROLByte512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLByteVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3085,14 +3128,14 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector256Tests::ROL_binary_const); } static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MINByte512VectorTestsWithMemOp(IntFunction fa) { + static void MINByteVector256TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3103,13 +3146,13 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte512VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, ByteVector256Tests::MIN); } static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void minByte512VectorTestsWithMemOp(IntFunction fa) { + static void minByteVector256TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3120,13 +3163,13 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte512VectorTests::min); + assertArraysEquals(r, a, (byte)10, ByteVector256Tests::min); } static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINByte512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINByteVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3139,13 +3182,13 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte512VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, mask, ByteVector256Tests::MIN); } static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MAXByte512VectorTestsWithMemOp(IntFunction fa) { + static void MAXByteVector256TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3156,13 +3199,13 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte512VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, ByteVector256Tests::MAX); } static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void maxByte512VectorTestsWithMemOp(IntFunction fa) { + static void maxByteVector256TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3173,13 +3216,13 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte512VectorTests::max); + assertArraysEquals(r, a, (byte)10, ByteVector256Tests::max); } static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXByte512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXByteVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3192,7 +3235,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte512VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, mask, ByteVector256Tests::MAX); } static byte MIN(byte a, byte b) { @@ -3200,7 +3243,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte512VectorTests(IntFunction fa, IntFunction fb) { + static void MINByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3213,7 +3256,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::MIN); + assertArraysEquals(r, a, b, ByteVector256Tests::MIN); } static byte min(byte a, byte b) { @@ -3221,7 +3264,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte512VectorTests(IntFunction fa, IntFunction fb) { + static void minByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3232,7 +3275,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::min); + assertArraysEquals(r, a, b, ByteVector256Tests::min); } static byte MAX(byte a, byte b) { @@ -3240,7 +3283,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte512VectorTests(IntFunction fa, IntFunction fb) { + static void MAXByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3253,7 +3296,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::MAX); + assertArraysEquals(r, a, b, ByteVector256Tests::MAX); } static byte max(byte a, byte b) { @@ -3261,7 +3304,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maxByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3272,7 +3315,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte512VectorTests::max); + assertArraysEquals(r, a, b, ByteVector256Tests::max); } static byte UMIN(byte a, byte b) { @@ -3280,7 +3323,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMINByte512VectorTests(IntFunction fa, IntFunction fb) { + static void UMINByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3293,11 +3336,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::UMIN); + assertArraysEquals(r, a, b, ByteVector256Tests::UMIN); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMINByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3313,7 +3356,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::UMIN); } static byte UMAX(byte a, byte b) { @@ -3321,7 +3364,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMAXByte512VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3334,11 +3377,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::UMAX); + assertArraysEquals(r, a, b, ByteVector256Tests::UMAX); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMAXByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3354,7 +3397,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::UMAX); } static byte SADD(byte a, byte b) { @@ -3362,7 +3405,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SADDByte512VectorTests(IntFunction fa, IntFunction fb) { + static void SADDByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3375,11 +3418,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::SADD); + assertArraysEquals(r, a, b, ByteVector256Tests::SADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SADDByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3395,7 +3438,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::SADD); } static byte SSUB(byte a, byte b) { @@ -3403,7 +3446,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SSUBByte512VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3416,11 +3459,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::SSUB); + assertArraysEquals(r, a, b, ByteVector256Tests::SSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SSUBByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3436,7 +3479,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::SSUB); } static byte SUADD(byte a, byte b) { @@ -3444,7 +3487,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUADDByte512VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3457,11 +3500,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::SUADD); + assertArraysEquals(r, a, b, ByteVector256Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUADDByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3477,7 +3520,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::SUADD); } static byte SUSUB(byte a, byte b) { @@ -3485,7 +3528,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUSUBByte512VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3498,11 +3541,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::SUSUB); + assertArraysEquals(r, a, b, ByteVector256Tests::SUSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUSUBByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3518,11 +3561,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::SUSUB); } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3532,11 +3575,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::MIN); } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3546,11 +3589,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::min); } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3560,11 +3603,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::MAX); } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3574,10 +3617,10 @@ public class Byte512VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte512VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ByteVector256Tests::max); } @Test(dataProvider = "byteSaturatingBinaryOpAssocProvider") - static void SUADDAssocByte512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocByteVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -3594,11 +3637,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Byte512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ByteVector256Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3619,7 +3662,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Byte512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ByteVector256Tests::SUADD); } static byte ANDReduce(byte[] a, int idx) { @@ -3641,7 +3684,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ANDReduceByte512VectorTests(IntFunction fa) { + static void ANDReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3657,7 +3700,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::ANDReduce, Byte512VectorTests::ANDReduceAll); + ByteVector256Tests::ANDReduce, ByteVector256Tests::ANDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3665,20 +3708,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = AND_IDENTITY; - Assert.assertEquals((byte) (id & id), id, + assertEquals((byte) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id & x), x); - Assert.assertEquals((byte) (x & id), x); + assertEquals((byte) (id & x), x); + assertEquals((byte) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id & x), x, + assertEquals((byte) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x & id), x, + assertEquals((byte) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3703,7 +3746,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ANDReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3721,7 +3764,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::ANDReduceMasked, Byte512VectorTests::ANDReduceAllMasked); + ByteVector256Tests::ANDReduceMasked, ByteVector256Tests::ANDReduceAllMasked); } static byte ORReduce(byte[] a, int idx) { @@ -3743,7 +3786,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ORReduceByte512VectorTests(IntFunction fa) { + static void ORReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3759,7 +3802,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::ORReduce, Byte512VectorTests::ORReduceAll); + ByteVector256Tests::ORReduce, ByteVector256Tests::ORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3767,20 +3810,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = OR_IDENTITY; - Assert.assertEquals((byte) (id | id), id, + assertEquals((byte) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id | x), x); - Assert.assertEquals((byte) (x | id), x); + assertEquals((byte) (id | x), x); + assertEquals((byte) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id | x), x, + assertEquals((byte) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x | id), x, + assertEquals((byte) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3805,7 +3848,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ORReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3823,7 +3866,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::ORReduceMasked, Byte512VectorTests::ORReduceAllMasked); + ByteVector256Tests::ORReduceMasked, ByteVector256Tests::ORReduceAllMasked); } static byte XORReduce(byte[] a, int idx) { @@ -3845,7 +3888,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void XORReduceByte512VectorTests(IntFunction fa) { + static void XORReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3861,7 +3904,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::XORReduce, Byte512VectorTests::XORReduceAll); + ByteVector256Tests::XORReduce, ByteVector256Tests::XORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3869,20 +3912,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = XOR_IDENTITY; - Assert.assertEquals((byte) (id ^ id), id, + assertEquals((byte) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id ^ x), x); - Assert.assertEquals((byte) (x ^ id), x); + assertEquals((byte) (id ^ x), x); + assertEquals((byte) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id ^ x), x, + assertEquals((byte) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x ^ id), x, + assertEquals((byte) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3907,7 +3950,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void XORReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3925,7 +3968,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::XORReduceMasked, Byte512VectorTests::XORReduceAllMasked); + ByteVector256Tests::XORReduceMasked, ByteVector256Tests::XORReduceAllMasked); } static byte ADDReduce(byte[] a, int idx) { @@ -3947,7 +3990,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceByte512VectorTests(IntFunction fa) { + static void ADDReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3963,7 +4006,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::ADDReduce, Byte512VectorTests::ADDReduceAll); + ByteVector256Tests::ADDReduce, ByteVector256Tests::ADDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3971,20 +4014,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = ADD_IDENTITY; - Assert.assertEquals((byte) (id + id), id, + assertEquals((byte) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id + x), x); - Assert.assertEquals((byte) (x + id), x); + assertEquals((byte) (id + x), x); + assertEquals((byte) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id + x), x, + assertEquals((byte) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x + id), x, + assertEquals((byte) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4009,7 +4052,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4027,7 +4070,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::ADDReduceMasked, Byte512VectorTests::ADDReduceAllMasked); + ByteVector256Tests::ADDReduceMasked, ByteVector256Tests::ADDReduceAllMasked); } static byte MULReduce(byte[] a, int idx) { @@ -4049,7 +4092,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MULReduceByte512VectorTests(IntFunction fa) { + static void MULReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4065,7 +4108,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::MULReduce, Byte512VectorTests::MULReduceAll); + ByteVector256Tests::MULReduce, ByteVector256Tests::MULReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4073,20 +4116,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MUL_IDENTITY; - Assert.assertEquals((byte) (id * id), id, + assertEquals((byte) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id * x), x); - Assert.assertEquals((byte) (x * id), x); + assertEquals((byte) (id * x), x); + assertEquals((byte) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id * x), x, + assertEquals((byte) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x * id), x, + assertEquals((byte) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4111,7 +4154,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MULReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4129,7 +4172,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::MULReduceMasked, Byte512VectorTests::MULReduceAllMasked); + ByteVector256Tests::MULReduceMasked, ByteVector256Tests::MULReduceAllMasked); } static byte MINReduce(byte[] a, int idx) { @@ -4151,7 +4194,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MINReduceByte512VectorTests(IntFunction fa) { + static void MINReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4167,7 +4210,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::MINReduce, Byte512VectorTests::MINReduceAll); + ByteVector256Tests::MINReduce, ByteVector256Tests::MINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4175,20 +4218,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MIN_IDENTITY; - Assert.assertEquals((byte) Math.min(id, id), id, + assertEquals((byte) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.min(id, x), x); - Assert.assertEquals((byte) Math.min(x, id), x); + assertEquals((byte) Math.min(id, x), x); + assertEquals((byte) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.min(id, x), x, + assertEquals((byte) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.min(x, id), x, + assertEquals((byte) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4213,7 +4256,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4231,7 +4274,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::MINReduceMasked, Byte512VectorTests::MINReduceAllMasked); + ByteVector256Tests::MINReduceMasked, ByteVector256Tests::MINReduceAllMasked); } static byte MAXReduce(byte[] a, int idx) { @@ -4253,7 +4296,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MAXReduceByte512VectorTests(IntFunction fa) { + static void MAXReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4269,7 +4312,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::MAXReduce, Byte512VectorTests::MAXReduceAll); + ByteVector256Tests::MAXReduce, ByteVector256Tests::MAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4277,20 +4320,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MAX_IDENTITY; - Assert.assertEquals((byte) Math.max(id, id), id, + assertEquals((byte) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.max(id, x), x); - Assert.assertEquals((byte) Math.max(x, id), x); + assertEquals((byte) Math.max(id, x), x); + assertEquals((byte) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.max(id, x), x, + assertEquals((byte) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.max(x, id), x, + assertEquals((byte) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4315,7 +4358,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4333,7 +4376,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::MAXReduceMasked, Byte512VectorTests::MAXReduceAllMasked); + ByteVector256Tests::MAXReduceMasked, ByteVector256Tests::MAXReduceAllMasked); } static byte UMINReduce(byte[] a, int idx) { @@ -4355,7 +4398,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMINReduceByte512VectorTests(IntFunction fa) { + static void UMINReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4371,7 +4414,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::UMINReduce, Byte512VectorTests::UMINReduceAll); + ByteVector256Tests::UMINReduce, ByteVector256Tests::UMINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4379,20 +4422,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMIN_IDENTITY; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, id), id, + assertEquals((byte) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x); + assertEquals((byte) VectorMath.minUnsigned(id, x), x); + assertEquals((byte) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x, + assertEquals((byte) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x, + assertEquals((byte) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4417,7 +4460,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMINReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4435,7 +4478,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::UMINReduceMasked, Byte512VectorTests::UMINReduceAllMasked); + ByteVector256Tests::UMINReduceMasked, ByteVector256Tests::UMINReduceAllMasked); } static byte UMAXReduce(byte[] a, int idx) { @@ -4457,7 +4500,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMAXReduceByte512VectorTests(IntFunction fa) { + static void UMAXReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4473,7 +4516,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::UMAXReduce, Byte512VectorTests::UMAXReduceAll); + ByteVector256Tests::UMAXReduce, ByteVector256Tests::UMAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4481,20 +4524,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMAX_IDENTITY; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, id), id, + assertEquals((byte) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x); + assertEquals((byte) VectorMath.maxUnsigned(id, x), x); + assertEquals((byte) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x, + assertEquals((byte) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x, + assertEquals((byte) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4519,7 +4562,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMAXReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::UMAXReduceMasked, Byte512VectorTests::UMAXReduceAllMasked); + ByteVector256Tests::UMAXReduceMasked, ByteVector256Tests::UMAXReduceAllMasked); } static byte FIRST_NONZEROReduce(byte[] a, int idx) { @@ -4559,7 +4602,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void FIRST_NONZEROReduceByte512VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4575,7 +4618,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::FIRST_NONZEROReduce, Byte512VectorTests::FIRST_NONZEROReduceAll); + ByteVector256Tests::FIRST_NONZEROReduce, ByteVector256Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4583,20 +4626,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4621,7 +4664,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void FIRST_NONZEROReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4639,7 +4682,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::FIRST_NONZEROReduceMasked, Byte512VectorTests::FIRST_NONZEROReduceAllMasked); + ByteVector256Tests::FIRST_NONZEROReduceMasked, ByteVector256Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4652,7 +4695,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueByte512VectorTests(IntFunction fm) { + static void anyTrueByteVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4663,7 +4706,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte512VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector256Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4676,7 +4719,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueByte512VectorTests(IntFunction fm) { + static void allTrueByteVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4687,7 +4730,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte512VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector256Tests::allTrue); } static byte SUADDReduce(byte[] a, int idx) { @@ -4709,7 +4752,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingUnaryOpProvider") - static void SUADDReduceByte512VectorTests(IntFunction fa) { + static void SUADDReduceByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4725,7 +4768,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte512VectorTests::SUADDReduce, Byte512VectorTests::SUADDReduceAll); + ByteVector256Tests::SUADDReduce, ByteVector256Tests::SUADDReduceAll); } @Test(dataProvider = "byteSaturatingUnaryOpProvider") @@ -4733,20 +4776,20 @@ public class Byte512VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = SUADD_IDENTITY; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4770,7 +4813,7 @@ public class Byte512VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "byteSaturatingUnaryOpMaskProvider") - static void SUADDReduceByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4788,11 +4831,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::SUADDReduceMasked, Byte512VectorTests::SUADDReduceAllMasked); + ByteVector256Tests::SUADDReduceMasked, ByteVector256Tests::SUADDReduceAllMasked); } @Test(dataProvider = "byteBinaryOpProvider") - static void withByte512VectorTests(IntFunction fa, IntFunction fb) { + static void withByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -4815,7 +4858,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_DEFAULTByte512VectorTests(IntFunction fa) { + static void IS_DEFAULTByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4825,14 +4868,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_DEFAULTMaskedByte512VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4845,7 +4888,7 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4856,7 +4899,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_NEGATIVEByte512VectorTests(IntFunction fa) { + static void IS_NEGATIVEByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4866,14 +4909,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_NEGATIVEMaskedByte512VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4886,14 +4929,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte512VectorTests(IntFunction fa, IntFunction fb) { + static void LTByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4905,14 +4948,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ltByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4924,14 +4967,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4947,14 +4990,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GTByte512VectorTests(IntFunction fa, IntFunction fb) { + static void GTByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4966,14 +5009,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GTByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4989,14 +5032,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte512VectorTests(IntFunction fa, IntFunction fb) { + static void EQByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5008,14 +5051,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte512VectorTests(IntFunction fa, IntFunction fb) { + static void eqByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5027,14 +5070,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5050,14 +5093,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void NEByte512VectorTests(IntFunction fa, IntFunction fb) { + static void NEByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5069,14 +5112,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void NEByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5092,14 +5135,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LEByte512VectorTests(IntFunction fa, IntFunction fb) { + static void LEByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5111,14 +5154,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LEByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5134,14 +5177,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GEByte512VectorTests(IntFunction fa, IntFunction fb) { + static void GEByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5153,14 +5196,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GEByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5176,14 +5219,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULTByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ULTByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5195,14 +5238,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULTByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5218,14 +5261,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGTByte512VectorTests(IntFunction fa, IntFunction fb) { + static void UGTByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5237,14 +5280,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGTByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5260,14 +5303,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULEByte512VectorTests(IntFunction fa, IntFunction fb) { + static void ULEByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5279,14 +5322,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULEByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5302,14 +5345,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGEByte512VectorTests(IntFunction fa, IntFunction fb) { + static void UGEByteVector256Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5321,14 +5364,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGEByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5344,14 +5387,14 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5361,13 +5404,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5381,13 +5424,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5397,13 +5440,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTByteVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5417,13 +5460,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5433,13 +5476,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5453,13 +5496,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5469,13 +5512,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQByteVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5489,7 +5532,7 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); } } } @@ -5499,7 +5542,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte512VectorTests(IntFunction fa, IntFunction fb, + static void blendByteVector256Tests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5515,11 +5558,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte512VectorTests::blend); + assertArraysEquals(r, a, b, mask, ByteVector256Tests::blend); } @Test(dataProvider = "byteUnaryOpShuffleProvider") - static void RearrangeByte512VectorTests(IntFunction fa, + static void RearrangeByteVector256Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5536,7 +5579,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpShuffleMaskProvider") - static void RearrangeByte512VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeByteVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -5554,7 +5597,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void compressByte512VectorTests(IntFunction fa, + static void compressByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5572,7 +5615,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void expandByte512VectorTests(IntFunction fa, + static void expandByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5590,7 +5633,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void getByte512VectorTests(IntFunction fa) { + static void getByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5746,7 +5789,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastByte512VectorTests(IntFunction fa) { + static void BroadcastByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5760,7 +5803,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZeroByte512VectorTests(IntFunction fa) { + static void ZeroByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5770,7 +5813,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static byte[] sliceUnary(byte[] a, int origin, int idx) { @@ -5785,7 +5828,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void sliceUnaryByte512VectorTests(IntFunction fa) { + static void sliceUnaryByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5796,7 +5839,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte512VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ByteVector256Tests::sliceUnary); } static byte[] sliceBinary(byte[] a, byte[] b, int origin, int idx) { @@ -5813,7 +5856,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void sliceBinaryByte512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryByteVector256TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5826,7 +5869,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Byte512VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ByteVector256Tests::sliceBinary); } static byte[] slice(byte[] a, byte[] b, int origin, boolean[] mask, int idx) { @@ -5843,7 +5886,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void sliceByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5860,7 +5903,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Byte512VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ByteVector256Tests::slice); } static byte[] unsliceUnary(byte[] a, int origin, int idx) { @@ -5877,7 +5920,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void unsliceUnaryByte512VectorTests(IntFunction fa) { + static void unsliceUnaryByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5888,7 +5931,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte512VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ByteVector256Tests::unsliceUnary); } static byte[] unsliceBinary(byte[] a, byte[] b, int origin, int part, int idx) { @@ -5914,7 +5957,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void unsliceBinaryByte512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryByteVector256TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5928,7 +5971,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Byte512VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ByteVector256Tests::unsliceBinary); } static byte[] unslice(byte[] a, byte[] b, int origin, int part, boolean[] mask, int idx) { @@ -5968,7 +6011,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void unsliceByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5985,7 +6028,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Byte512VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ByteVector256Tests::unslice); } static byte BITWISE_BLEND(byte a, byte b, byte c) { @@ -5997,7 +6040,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6012,11 +6055,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6029,11 +6072,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Byte512VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ByteVector256Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6051,11 +6094,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6066,11 +6109,11 @@ public class Byte512VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6081,11 +6124,11 @@ public class Byte512VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6096,11 +6139,11 @@ public class Byte512VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ByteVector256Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6111,11 +6154,11 @@ public class Byte512VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector256Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6130,11 +6173,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte512VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector256TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6149,11 +6192,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6164,11 +6207,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6179,11 +6222,11 @@ public class Byte512VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector256Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector256TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6197,7 +6240,7 @@ public class Byte512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteVector256Tests::BITWISE_BLEND); } static byte NEG(byte a) { @@ -6209,7 +6252,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NEGByte512VectorTests(IntFunction fa) { + static void NEGByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6220,11 +6263,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::NEG); + assertArraysEquals(r, a, ByteVector256Tests::NEG); } @Test(dataProvider = "byteUnaryOpProvider") - static void negByte512VectorTests(IntFunction fa) { + static void negByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6235,11 +6278,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::neg); + assertArraysEquals(r, a, ByteVector256Tests::neg); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NEGMaskedByte512VectorTests(IntFunction fa, + static void NEGMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6253,7 +6296,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::NEG); + assertArraysEquals(r, a, mask, ByteVector256Tests::NEG); } static byte ABS(byte a) { @@ -6265,7 +6308,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ABSByte512VectorTests(IntFunction fa) { + static void ABSByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6276,11 +6319,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::ABS); + assertArraysEquals(r, a, ByteVector256Tests::ABS); } @Test(dataProvider = "byteUnaryOpProvider") - static void absByte512VectorTests(IntFunction fa) { + static void absByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6291,11 +6334,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::abs); + assertArraysEquals(r, a, ByteVector256Tests::abs); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ABSMaskedByte512VectorTests(IntFunction fa, + static void ABSMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6309,7 +6352,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::ABS); + assertArraysEquals(r, a, mask, ByteVector256Tests::ABS); } static byte NOT(byte a) { @@ -6321,7 +6364,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NOTByte512VectorTests(IntFunction fa) { + static void NOTByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6332,11 +6375,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::NOT); + assertArraysEquals(r, a, ByteVector256Tests::NOT); } @Test(dataProvider = "byteUnaryOpProvider") - static void notByte512VectorTests(IntFunction fa) { + static void notByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6347,11 +6390,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::not); + assertArraysEquals(r, a, ByteVector256Tests::not); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NOTMaskedByte512VectorTests(IntFunction fa, + static void NOTMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6365,7 +6408,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::NOT); + assertArraysEquals(r, a, mask, ByteVector256Tests::NOT); } static byte ZOMO(byte a) { @@ -6373,7 +6416,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZOMOByte512VectorTests(IntFunction fa) { + static void ZOMOByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6384,11 +6427,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::ZOMO); + assertArraysEquals(r, a, ByteVector256Tests::ZOMO); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ZOMOMaskedByte512VectorTests(IntFunction fa, + static void ZOMOMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6402,7 +6445,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ByteVector256Tests::ZOMO); } static byte BIT_COUNT(byte a) { @@ -6410,7 +6453,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BIT_COUNTByte512VectorTests(IntFunction fa) { + static void BIT_COUNTByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6421,11 +6464,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ByteVector256Tests::BIT_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void BIT_COUNTMaskedByte512VectorTests(IntFunction fa, + static void BIT_COUNTMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6439,7 +6482,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ByteVector256Tests::BIT_COUNT); } static byte TRAILING_ZEROS_COUNT(byte a) { @@ -6447,7 +6490,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void TRAILING_ZEROS_COUNTByte512VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6458,11 +6501,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector256Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedByte512VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6476,7 +6519,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector256Tests::TRAILING_ZEROS_COUNT); } static byte LEADING_ZEROS_COUNT(byte a) { @@ -6484,7 +6527,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LEADING_ZEROS_COUNTByte512VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6495,11 +6538,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector256Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedByte512VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6513,7 +6556,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector256Tests::LEADING_ZEROS_COUNT); } static byte REVERSE(byte a) { @@ -6521,7 +6564,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSEByte512VectorTests(IntFunction fa) { + static void REVERSEByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6532,11 +6575,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::REVERSE); + assertArraysEquals(r, a, ByteVector256Tests::REVERSE); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSEMaskedByte512VectorTests(IntFunction fa, + static void REVERSEMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6550,7 +6593,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ByteVector256Tests::REVERSE); } static byte REVERSE_BYTES(byte a) { @@ -6558,7 +6601,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSE_BYTESByte512VectorTests(IntFunction fa) { + static void REVERSE_BYTESByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6569,11 +6612,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ByteVector256Tests::REVERSE_BYTES); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedByte512VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedByteVector256Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6587,7 +6630,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ByteVector256Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6595,7 +6638,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandByteVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6608,7 +6651,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::band); + assertArraysEquals(r, a, b, ByteVector256Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6616,7 +6659,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maskorByteVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6629,7 +6672,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::bor); + assertArraysEquals(r, a, b, ByteVector256Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6637,7 +6680,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorByteVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6650,7 +6693,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::bxor); + assertArraysEquals(r, a, b, ByteVector256Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6658,7 +6701,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotByteVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6671,7 +6714,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::bandNot); + assertArraysEquals(r, a, b, ByteVector256Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6679,7 +6722,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqByteVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6692,7 +6735,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte512VectorTests::beq); + assertArraysEquals(r, a, b, ByteVector256Tests::beq); } static boolean unot(boolean a) { @@ -6700,7 +6743,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotByte512VectorTests(IntFunction fa) { + static void masknotByteVector256Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6711,7 +6754,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte512VectorTests::unot); + assertArraysEquals(r, a, ByteVector256Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6720,15 +6763,15 @@ public class Byte512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongByte512VectorTests(IntFunction fa) { + static void maskFromToLongByteVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6742,7 +6785,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltByteVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6752,13 +6795,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqByteVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6768,13 +6811,13 @@ public class Byte512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteUnaryOpProvider") - static void toIntArrayByte512VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6785,7 +6828,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toLongArrayByte512VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6796,7 +6839,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toDoubleArrayByte512VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6807,7 +6850,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toStringByte512VectorTestsSmokeTest(IntFunction fa) { + static void toStringByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6820,7 +6863,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void hashCodeByte512VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6834,7 +6877,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void reinterpretAsBytesByte512VectorTestsSmokeTest(IntFunction fa) { + static void reinterpretAsBytesByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6864,7 +6907,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceLongByte512VectorTests(IntFunction fa) { + static void ADDReduceLongByteVector256Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6880,7 +6923,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Byte512VectorTests::ADDReduceLong, Byte512VectorTests::ADDReduceAllLong); + ByteVector256Tests::ADDReduceLong, ByteVector256Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(byte[] a, int idx, boolean[] mask) { @@ -6903,7 +6946,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceLongByte512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongByteVector256TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6921,11 +6964,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Byte512VectorTests::ADDReduceLongMasked, Byte512VectorTests::ADDReduceAllLongMasked); + ByteVector256Tests::ADDReduceLongMasked, ByteVector256Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastLongByte512VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongByteVector256TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6936,7 +6979,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendByteVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6950,12 +6993,12 @@ public class Byte512VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte512VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector256Tests::blend); } @Test(dataProvider = "byteUnaryOpSelectFromProvider") - static void SelectFromByte512VectorTests(IntFunction fa, + static void SelectFromByteVector256Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); byte[] order = fs.apply(a.length, SPECIES.length()); @@ -6971,7 +7014,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorByte512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorByteVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] idx = fc.apply(SPECIES.length()); @@ -6989,7 +7032,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpSelectFromMaskProvider") - static void SelectFromByte512VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromByteVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -7008,7 +7051,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousByte512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousByteVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7019,12 +7062,12 @@ public class Byte512VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringByte512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringByteVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7038,7 +7081,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsByte512VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsByteVector256TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7047,12 +7090,12 @@ public class Byte512VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsByte512VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsByteVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7062,13 +7105,13 @@ public class Byte512VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeByte512VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeByteVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7090,7 +7133,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountByte512VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountByteVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7101,7 +7144,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte512VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ByteVector256Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7115,7 +7158,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueByte512VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueByteVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7126,7 +7169,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte512VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ByteVector256Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7140,7 +7183,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueByte512VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueByteVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7151,11 +7194,11 @@ public class Byte512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte512VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ByteVector256Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressByte512VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressByteVector256TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7165,7 +7208,7 @@ public class Byte512VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7183,7 +7226,7 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeByte512VectorTestsSmokeTest(int offset) { + static void indexInRangeByteVector256TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7191,13 +7234,13 @@ public class Byte512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongByte512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongByteVector256TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7205,7 +7248,7 @@ public class Byte512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7224,36 +7267,36 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundByte512VectorTestsSmokeTest(int length) { + static void loopBoundByteVector256TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongByte512VectorTestsSmokeTest(int _length) { + static void loopBoundLongByteVector256TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeByte512VectorTestsSmokeTest() { + static void ElementSizeByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Byte.SIZE); + assertEquals(elsize, Byte.SIZE); } @Test - static void VectorShapeByte512VectorTestsSmokeTest() { + static void VectorShapeByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); - assert(vsh.equals(VectorShape.S_512_BIT)); + assert(vsh.equals(VectorShape.S_256_BIT)); } @Test - static void ShapeWithLanesByte512VectorTestsSmokeTest() { + static void ShapeWithLanesByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(byte.class); @@ -7261,32 +7304,32 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeByte512VectorTestsSmokeTest() { + static void ElementTypeByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementType() == byte.class); } @Test - static void SpeciesElementSizeByte512VectorTestsSmokeTest() { + static void SpeciesElementSizeByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementSize() == Byte.SIZE); } @Test - static void VectorTypeByte512VectorTestsSmokeTest() { + static void VectorTypeByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesByte512VectorTestsSmokeTest() { + static void WithLanesByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(byte.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeByte512VectorTestsSmokeTest() { + static void WithShapeByteVector256TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7294,9 +7337,9 @@ public class Byte512VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueByte512VectorTestsSmokeTest() { + static void MaskAllTrueByteVector256TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteVector512LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ByteVector512LoadStoreTests.java index 7df9c1fbf10..0a9189927b1 100644 --- a/test/jdk/jdk/incubator/vector/Byte512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector512LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Byte512VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ByteVector512LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ByteVector512LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_512; @@ -61,14 +61,29 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(byte[] r, byte[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "byteProviderForIOOBE") @@ -957,11 +972,11 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -972,11 +987,11 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); } } @@ -992,7 +1007,7 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(byte[] r, byte[] a, int[] indexMap) { @@ -1005,7 +1020,7 @@ public class Byte512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Byte256VectorTests.java b/test/jdk/jdk/incubator/vector/ByteVector512Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Byte256VectorTests.java rename to test/jdk/jdk/incubator/vector/ByteVector512Tests.java index 0e59db7d05d..02da1889dc8 100644 --- a/test/jdk/jdk/incubator/vector/Byte256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector512Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteVector512Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Byte256VectorTests extends AbstractVectorTest { +public class ByteVector512Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = - ByteVector.SPECIES_256; + ByteVector.SPECIES_512; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(byte actual, byte expected, byte delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(byte actual, byte expected, byte delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final byte CONST_SHIFT = Byte.SIZE / 2; @@ -78,7 +121,7 @@ public class Byte256VectorTests extends AbstractVectorTest { private static final byte UMIN_IDENTITY = (byte)-1; // Maximum unsigned value private static final byte XOR_IDENTITY = (byte)0; - static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); static void assertArraysStrictlyEquals(byte[] r, byte[] a) { for (int i = 0; i < a.length; i++) { @@ -96,10 +139,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { byte[] ref = f.apply(a[i]); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Byte256VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Byte256VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Byte256VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Byte256VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Byte256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (byte)0); + assertEquals(r[i + k], (byte)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Byte256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (byte)0); + assertEquals(r[i + j], (byte)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Byte256VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Byte256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Byte256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Byte256VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Byte256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(r, a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1025,10 +1068,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1036,10 +1079,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1047,10 +1090,10 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1586,7 +1629,7 @@ public class Byte256VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ByteVector a = io.add((byte)1); //[1,2] ByteVector b = a.neg(); //[-1,-2] byte[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1601,19 +1644,19 @@ public class Byte256VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ByteVector uab0 = zab0.rearrange(unz0,zab1); ByteVector uab1 = zab0.rearrange(unz1,zab1); byte[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,7 +1671,7 @@ public class Byte256VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1662,7 +1705,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ADDByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1675,7 +1718,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::ADD); + assertArraysEquals(r, a, b, ByteVector512Tests::ADD); } static byte add(byte a, byte b) { @@ -1683,7 +1726,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte256VectorTests(IntFunction fa, IntFunction fb) { + static void addByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1694,11 +1737,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::add); + assertArraysEquals(r, a, b, ByteVector512Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1714,11 +1757,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1732,7 +1775,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::add); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::add); } static byte SUB(byte a, byte b) { @@ -1740,7 +1783,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void SUBByte256VectorTests(IntFunction fa, IntFunction fb) { + static void SUBByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1753,7 +1796,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::SUB); + assertArraysEquals(r, a, b, ByteVector512Tests::SUB); } static byte sub(byte a, byte b) { @@ -1761,7 +1804,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte256VectorTests(IntFunction fa, IntFunction fb) { + static void subByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1772,11 +1815,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::sub); + assertArraysEquals(r, a, b, ByteVector512Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void SUBByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1792,11 +1835,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::SUB); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1810,7 +1853,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::sub); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::sub); } static byte MUL(byte a, byte b) { @@ -1818,7 +1861,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MULByte256VectorTests(IntFunction fa, IntFunction fb) { + static void MULByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1831,7 +1874,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::MUL); + assertArraysEquals(r, a, b, ByteVector512Tests::MUL); } static byte mul(byte a, byte b) { @@ -1839,7 +1882,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte256VectorTests(IntFunction fa, IntFunction fb) { + static void mulByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1850,11 +1893,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::mul); + assertArraysEquals(r, a, b, ByteVector512Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void MULByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1870,11 +1913,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::MUL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1888,7 +1931,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::mul); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::mul); } static byte DIV(byte a, byte b) { @@ -1896,7 +1939,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void DIVByte256VectorTests(IntFunction fa, IntFunction fb) { + static void DIVByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1911,7 +1954,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::DIV); + assertArraysEquals(r, a, b, ByteVector512Tests::DIV); } static byte div(byte a, byte b) { @@ -1919,7 +1962,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte256VectorTests(IntFunction fa, IntFunction fb) { + static void divByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1934,11 +1977,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::div); + assertArraysEquals(r, a, b, ByteVector512Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void DIVByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1956,11 +1999,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::DIV); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1978,7 +2021,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::div); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::div); } static byte FIRST_NONZERO(byte a, byte b) { @@ -1986,7 +2029,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void FIRST_NONZEROByte256VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1999,11 +2042,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ByteVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void FIRST_NONZEROByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2019,7 +2062,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::FIRST_NONZERO); } static byte AND(byte a, byte b) { @@ -2027,7 +2070,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ANDByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2040,7 +2083,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::AND); + assertArraysEquals(r, a, b, ByteVector512Tests::AND); } static byte and(byte a, byte b) { @@ -2048,7 +2091,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte256VectorTests(IntFunction fa, IntFunction fb) { + static void andByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2059,11 +2102,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::and); + assertArraysEquals(r, a, b, ByteVector512Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2079,7 +2122,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::AND); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::AND); } static byte AND_NOT(byte a, byte b) { @@ -2087,7 +2130,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void AND_NOTByte256VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2100,11 +2143,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ByteVector512Tests::AND_NOT); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void AND_NOTByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2120,7 +2163,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::AND_NOT); } static byte OR(byte a, byte b) { @@ -2128,7 +2171,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ORByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2141,7 +2184,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::OR); + assertArraysEquals(r, a, b, ByteVector512Tests::OR); } static byte or(byte a, byte b) { @@ -2149,7 +2192,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte256VectorTests(IntFunction fa, IntFunction fb) { + static void orByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2160,11 +2203,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::or); + assertArraysEquals(r, a, b, ByteVector512Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2180,7 +2223,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::OR); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::OR); } static byte XOR(byte a, byte b) { @@ -2188,7 +2231,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void XORByte256VectorTests(IntFunction fa, IntFunction fb) { + static void XORByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2201,11 +2244,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::XOR); + assertArraysEquals(r, a, b, ByteVector512Tests::XOR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void XORByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2221,11 +2264,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::XOR); } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2235,11 +2278,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2252,11 +2295,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector512Tests::add); } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2266,11 +2309,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2283,11 +2326,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector512Tests::sub); } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2297,11 +2340,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2314,11 +2357,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector512Tests::mul); } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2373,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2392,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector512Tests::div); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2406,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2377,11 +2420,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2394,11 +2437,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector512Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2408,11 +2451,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2422,11 +2465,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2439,11 +2482,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector512Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2453,11 +2496,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ByteVector512Tests::OR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2470,11 +2513,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector512Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDByteVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2484,11 +2527,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ByteVector512Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDByteVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2501,7 +2544,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector512Tests::ADD); } static byte LSHL(byte a, byte b) { @@ -2509,7 +2552,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2522,11 +2565,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::LSHL); + assertArraysEquals(r, a, b, ByteVector512Tests::LSHL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2542,7 +2585,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::LSHL); } static byte ASHR(byte a, byte b) { @@ -2550,7 +2593,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2563,11 +2606,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::ASHR); + assertArraysEquals(r, a, b, ByteVector512Tests::ASHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2583,7 +2626,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::ASHR); } static byte LSHR(byte a, byte b) { @@ -2591,7 +2634,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2604,11 +2647,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::LSHR); + assertArraysEquals(r, a, b, ByteVector512Tests::LSHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2624,7 +2667,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::LSHR); } static byte LSHL_unary(byte a, byte b) { @@ -2632,7 +2675,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLByteVector512TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2644,11 +2687,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ByteVector512Tests::LSHL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2663,7 +2706,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector512Tests::LSHL_unary); } static byte LSHR_unary(byte a, byte b) { @@ -2671,7 +2714,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRByteVector512TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2683,11 +2726,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector512Tests::LSHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2702,7 +2745,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector512Tests::LSHR_unary); } static byte ASHR_unary(byte a, byte b) { @@ -2710,7 +2753,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRByteVector512TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2722,11 +2765,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector512Tests::ASHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2741,7 +2784,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector512Tests::ASHR_unary); } static byte ROR(byte a, byte b) { @@ -2749,7 +2792,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte256VectorTests(IntFunction fa, IntFunction fb) { + static void RORByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2762,11 +2805,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::ROR); + assertArraysEquals(r, a, b, ByteVector512Tests::ROR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2782,7 +2825,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::ROR); } static byte ROL(byte a, byte b) { @@ -2790,7 +2833,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ROLByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2803,11 +2846,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::ROL); + assertArraysEquals(r, a, b, ByteVector512Tests::ROL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2823,7 +2866,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::ROL); } static byte ROR_unary(byte a, byte b) { @@ -2831,7 +2874,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORByteVector512TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2843,11 +2886,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ByteVector512Tests::ROR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORByteVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2862,7 +2905,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector512Tests::ROR_unary); } static byte ROL_unary(byte a, byte b) { @@ -2870,7 +2913,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLByteVector512TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2882,11 +2925,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ByteVector512Tests::ROL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2901,14 +2944,14 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector512Tests::ROL_unary); } static byte LSHR_binary_const(byte a) { return (byte)(((a & 0xFF) >>> CONST_SHIFT)); } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHRByte256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRByteVector512TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2919,11 +2962,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ByteVector512Tests::LSHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHRByte256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRByteVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2937,7 +2980,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector512Tests::LSHR_binary_const); } static byte LSHL_binary_const(byte a) { @@ -2945,7 +2988,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHLByte256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLByteVector512TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2956,11 +2999,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ByteVector512Tests::LSHL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHLByte256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLByteVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2974,7 +3017,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector512Tests::LSHL_binary_const); } static byte ASHR_binary_const(byte a) { @@ -2982,7 +3025,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ASHRByte256VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRByteVector512TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2993,11 +3036,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ByteVector512Tests::ASHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ASHRByte256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRByteVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3011,7 +3054,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector512Tests::ASHR_binary_const); } static byte ROR_binary_const(byte a) { @@ -3019,7 +3062,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void RORByte256VectorTestsScalarShiftConst(IntFunction fa) { + static void RORByteVector512TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3030,11 +3073,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ByteVector512Tests::ROR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void RORByte256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORByteVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3048,7 +3091,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector512Tests::ROR_binary_const); } static byte ROL_binary_const(byte a) { @@ -3056,7 +3099,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ROLByte256VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLByteVector512TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3067,11 +3110,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ByteVector512Tests::ROL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ROLByte256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLByteVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3085,14 +3128,14 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector512Tests::ROL_binary_const); } static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MINByte256VectorTestsWithMemOp(IntFunction fa) { + static void MINByteVector512TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3103,13 +3146,13 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte256VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, ByteVector512Tests::MIN); } static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void minByte256VectorTestsWithMemOp(IntFunction fa) { + static void minByteVector512TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3120,13 +3163,13 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte256VectorTests::min); + assertArraysEquals(r, a, (byte)10, ByteVector512Tests::min); } static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINByte256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINByteVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3139,13 +3182,13 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte256VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, mask, ByteVector512Tests::MIN); } static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MAXByte256VectorTestsWithMemOp(IntFunction fa) { + static void MAXByteVector512TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3156,13 +3199,13 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte256VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, ByteVector512Tests::MAX); } static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void maxByte256VectorTestsWithMemOp(IntFunction fa) { + static void maxByteVector512TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3173,13 +3216,13 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte256VectorTests::max); + assertArraysEquals(r, a, (byte)10, ByteVector512Tests::max); } static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXByte256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXByteVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3192,7 +3235,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte256VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, mask, ByteVector512Tests::MAX); } static byte MIN(byte a, byte b) { @@ -3200,7 +3243,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte256VectorTests(IntFunction fa, IntFunction fb) { + static void MINByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3213,7 +3256,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::MIN); + assertArraysEquals(r, a, b, ByteVector512Tests::MIN); } static byte min(byte a, byte b) { @@ -3221,7 +3264,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte256VectorTests(IntFunction fa, IntFunction fb) { + static void minByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3232,7 +3275,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::min); + assertArraysEquals(r, a, b, ByteVector512Tests::min); } static byte MAX(byte a, byte b) { @@ -3240,7 +3283,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte256VectorTests(IntFunction fa, IntFunction fb) { + static void MAXByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3253,7 +3296,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::MAX); + assertArraysEquals(r, a, b, ByteVector512Tests::MAX); } static byte max(byte a, byte b) { @@ -3261,7 +3304,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maxByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3272,7 +3315,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte256VectorTests::max); + assertArraysEquals(r, a, b, ByteVector512Tests::max); } static byte UMIN(byte a, byte b) { @@ -3280,7 +3323,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMINByte256VectorTests(IntFunction fa, IntFunction fb) { + static void UMINByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3293,11 +3336,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::UMIN); + assertArraysEquals(r, a, b, ByteVector512Tests::UMIN); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMINByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3313,7 +3356,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::UMIN); } static byte UMAX(byte a, byte b) { @@ -3321,7 +3364,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMAXByte256VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3334,11 +3377,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::UMAX); + assertArraysEquals(r, a, b, ByteVector512Tests::UMAX); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMAXByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3354,7 +3397,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::UMAX); } static byte SADD(byte a, byte b) { @@ -3362,7 +3405,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SADDByte256VectorTests(IntFunction fa, IntFunction fb) { + static void SADDByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3375,11 +3418,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::SADD); + assertArraysEquals(r, a, b, ByteVector512Tests::SADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SADDByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3395,7 +3438,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::SADD); } static byte SSUB(byte a, byte b) { @@ -3403,7 +3446,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SSUBByte256VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3416,11 +3459,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::SSUB); + assertArraysEquals(r, a, b, ByteVector512Tests::SSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SSUBByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3436,7 +3479,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::SSUB); } static byte SUADD(byte a, byte b) { @@ -3444,7 +3487,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUADDByte256VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3457,11 +3500,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::SUADD); + assertArraysEquals(r, a, b, ByteVector512Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUADDByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3477,7 +3520,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::SUADD); } static byte SUSUB(byte a, byte b) { @@ -3485,7 +3528,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUSUBByte256VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3498,11 +3541,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::SUSUB); + assertArraysEquals(r, a, b, ByteVector512Tests::SUSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUSUBByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3518,11 +3561,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::SUSUB); } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3532,11 +3575,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::MIN); } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3546,11 +3589,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::min); } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3560,11 +3603,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::MAX); } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3574,10 +3617,10 @@ public class Byte256VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte256VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ByteVector512Tests::max); } @Test(dataProvider = "byteSaturatingBinaryOpAssocProvider") - static void SUADDAssocByte256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocByteVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -3594,11 +3637,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Byte256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ByteVector512Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3619,7 +3662,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Byte256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ByteVector512Tests::SUADD); } static byte ANDReduce(byte[] a, int idx) { @@ -3641,7 +3684,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ANDReduceByte256VectorTests(IntFunction fa) { + static void ANDReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3657,7 +3700,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::ANDReduce, Byte256VectorTests::ANDReduceAll); + ByteVector512Tests::ANDReduce, ByteVector512Tests::ANDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3665,20 +3708,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = AND_IDENTITY; - Assert.assertEquals((byte) (id & id), id, + assertEquals((byte) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id & x), x); - Assert.assertEquals((byte) (x & id), x); + assertEquals((byte) (id & x), x); + assertEquals((byte) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id & x), x, + assertEquals((byte) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x & id), x, + assertEquals((byte) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3703,7 +3746,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ANDReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3721,7 +3764,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::ANDReduceMasked, Byte256VectorTests::ANDReduceAllMasked); + ByteVector512Tests::ANDReduceMasked, ByteVector512Tests::ANDReduceAllMasked); } static byte ORReduce(byte[] a, int idx) { @@ -3743,7 +3786,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ORReduceByte256VectorTests(IntFunction fa) { + static void ORReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3759,7 +3802,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::ORReduce, Byte256VectorTests::ORReduceAll); + ByteVector512Tests::ORReduce, ByteVector512Tests::ORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3767,20 +3810,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = OR_IDENTITY; - Assert.assertEquals((byte) (id | id), id, + assertEquals((byte) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id | x), x); - Assert.assertEquals((byte) (x | id), x); + assertEquals((byte) (id | x), x); + assertEquals((byte) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id | x), x, + assertEquals((byte) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x | id), x, + assertEquals((byte) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3805,7 +3848,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ORReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3823,7 +3866,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::ORReduceMasked, Byte256VectorTests::ORReduceAllMasked); + ByteVector512Tests::ORReduceMasked, ByteVector512Tests::ORReduceAllMasked); } static byte XORReduce(byte[] a, int idx) { @@ -3845,7 +3888,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void XORReduceByte256VectorTests(IntFunction fa) { + static void XORReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3861,7 +3904,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::XORReduce, Byte256VectorTests::XORReduceAll); + ByteVector512Tests::XORReduce, ByteVector512Tests::XORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3869,20 +3912,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = XOR_IDENTITY; - Assert.assertEquals((byte) (id ^ id), id, + assertEquals((byte) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id ^ x), x); - Assert.assertEquals((byte) (x ^ id), x); + assertEquals((byte) (id ^ x), x); + assertEquals((byte) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id ^ x), x, + assertEquals((byte) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x ^ id), x, + assertEquals((byte) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3907,7 +3950,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void XORReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3925,7 +3968,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::XORReduceMasked, Byte256VectorTests::XORReduceAllMasked); + ByteVector512Tests::XORReduceMasked, ByteVector512Tests::XORReduceAllMasked); } static byte ADDReduce(byte[] a, int idx) { @@ -3947,7 +3990,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceByte256VectorTests(IntFunction fa) { + static void ADDReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3963,7 +4006,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::ADDReduce, Byte256VectorTests::ADDReduceAll); + ByteVector512Tests::ADDReduce, ByteVector512Tests::ADDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3971,20 +4014,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = ADD_IDENTITY; - Assert.assertEquals((byte) (id + id), id, + assertEquals((byte) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id + x), x); - Assert.assertEquals((byte) (x + id), x); + assertEquals((byte) (id + x), x); + assertEquals((byte) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id + x), x, + assertEquals((byte) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x + id), x, + assertEquals((byte) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4009,7 +4052,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4027,7 +4070,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::ADDReduceMasked, Byte256VectorTests::ADDReduceAllMasked); + ByteVector512Tests::ADDReduceMasked, ByteVector512Tests::ADDReduceAllMasked); } static byte MULReduce(byte[] a, int idx) { @@ -4049,7 +4092,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MULReduceByte256VectorTests(IntFunction fa) { + static void MULReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4065,7 +4108,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::MULReduce, Byte256VectorTests::MULReduceAll); + ByteVector512Tests::MULReduce, ByteVector512Tests::MULReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4073,20 +4116,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MUL_IDENTITY; - Assert.assertEquals((byte) (id * id), id, + assertEquals((byte) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id * x), x); - Assert.assertEquals((byte) (x * id), x); + assertEquals((byte) (id * x), x); + assertEquals((byte) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id * x), x, + assertEquals((byte) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x * id), x, + assertEquals((byte) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4111,7 +4154,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MULReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4129,7 +4172,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::MULReduceMasked, Byte256VectorTests::MULReduceAllMasked); + ByteVector512Tests::MULReduceMasked, ByteVector512Tests::MULReduceAllMasked); } static byte MINReduce(byte[] a, int idx) { @@ -4151,7 +4194,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MINReduceByte256VectorTests(IntFunction fa) { + static void MINReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4167,7 +4210,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::MINReduce, Byte256VectorTests::MINReduceAll); + ByteVector512Tests::MINReduce, ByteVector512Tests::MINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4175,20 +4218,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MIN_IDENTITY; - Assert.assertEquals((byte) Math.min(id, id), id, + assertEquals((byte) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.min(id, x), x); - Assert.assertEquals((byte) Math.min(x, id), x); + assertEquals((byte) Math.min(id, x), x); + assertEquals((byte) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.min(id, x), x, + assertEquals((byte) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.min(x, id), x, + assertEquals((byte) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4213,7 +4256,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4231,7 +4274,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::MINReduceMasked, Byte256VectorTests::MINReduceAllMasked); + ByteVector512Tests::MINReduceMasked, ByteVector512Tests::MINReduceAllMasked); } static byte MAXReduce(byte[] a, int idx) { @@ -4253,7 +4296,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MAXReduceByte256VectorTests(IntFunction fa) { + static void MAXReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4269,7 +4312,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::MAXReduce, Byte256VectorTests::MAXReduceAll); + ByteVector512Tests::MAXReduce, ByteVector512Tests::MAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4277,20 +4320,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MAX_IDENTITY; - Assert.assertEquals((byte) Math.max(id, id), id, + assertEquals((byte) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.max(id, x), x); - Assert.assertEquals((byte) Math.max(x, id), x); + assertEquals((byte) Math.max(id, x), x); + assertEquals((byte) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.max(id, x), x, + assertEquals((byte) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.max(x, id), x, + assertEquals((byte) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4315,7 +4358,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4333,7 +4376,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::MAXReduceMasked, Byte256VectorTests::MAXReduceAllMasked); + ByteVector512Tests::MAXReduceMasked, ByteVector512Tests::MAXReduceAllMasked); } static byte UMINReduce(byte[] a, int idx) { @@ -4355,7 +4398,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMINReduceByte256VectorTests(IntFunction fa) { + static void UMINReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4371,7 +4414,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::UMINReduce, Byte256VectorTests::UMINReduceAll); + ByteVector512Tests::UMINReduce, ByteVector512Tests::UMINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4379,20 +4422,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMIN_IDENTITY; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, id), id, + assertEquals((byte) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x); + assertEquals((byte) VectorMath.minUnsigned(id, x), x); + assertEquals((byte) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x, + assertEquals((byte) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x, + assertEquals((byte) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4417,7 +4460,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMINReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4435,7 +4478,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::UMINReduceMasked, Byte256VectorTests::UMINReduceAllMasked); + ByteVector512Tests::UMINReduceMasked, ByteVector512Tests::UMINReduceAllMasked); } static byte UMAXReduce(byte[] a, int idx) { @@ -4457,7 +4500,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMAXReduceByte256VectorTests(IntFunction fa) { + static void UMAXReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4473,7 +4516,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::UMAXReduce, Byte256VectorTests::UMAXReduceAll); + ByteVector512Tests::UMAXReduce, ByteVector512Tests::UMAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4481,20 +4524,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMAX_IDENTITY; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, id), id, + assertEquals((byte) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x); + assertEquals((byte) VectorMath.maxUnsigned(id, x), x); + assertEquals((byte) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x, + assertEquals((byte) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x, + assertEquals((byte) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4519,7 +4562,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMAXReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::UMAXReduceMasked, Byte256VectorTests::UMAXReduceAllMasked); + ByteVector512Tests::UMAXReduceMasked, ByteVector512Tests::UMAXReduceAllMasked); } static byte FIRST_NONZEROReduce(byte[] a, int idx) { @@ -4559,7 +4602,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void FIRST_NONZEROReduceByte256VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4575,7 +4618,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::FIRST_NONZEROReduce, Byte256VectorTests::FIRST_NONZEROReduceAll); + ByteVector512Tests::FIRST_NONZEROReduce, ByteVector512Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4583,20 +4626,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4621,7 +4664,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void FIRST_NONZEROReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4639,7 +4682,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::FIRST_NONZEROReduceMasked, Byte256VectorTests::FIRST_NONZEROReduceAllMasked); + ByteVector512Tests::FIRST_NONZEROReduceMasked, ByteVector512Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4652,7 +4695,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueByte256VectorTests(IntFunction fm) { + static void anyTrueByteVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4663,7 +4706,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte256VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector512Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4676,7 +4719,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueByte256VectorTests(IntFunction fm) { + static void allTrueByteVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4687,7 +4730,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte256VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector512Tests::allTrue); } static byte SUADDReduce(byte[] a, int idx) { @@ -4709,7 +4752,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingUnaryOpProvider") - static void SUADDReduceByte256VectorTests(IntFunction fa) { + static void SUADDReduceByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4725,7 +4768,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte256VectorTests::SUADDReduce, Byte256VectorTests::SUADDReduceAll); + ByteVector512Tests::SUADDReduce, ByteVector512Tests::SUADDReduceAll); } @Test(dataProvider = "byteSaturatingUnaryOpProvider") @@ -4733,20 +4776,20 @@ public class Byte256VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = SUADD_IDENTITY; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4770,7 +4813,7 @@ public class Byte256VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "byteSaturatingUnaryOpMaskProvider") - static void SUADDReduceByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4788,11 +4831,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::SUADDReduceMasked, Byte256VectorTests::SUADDReduceAllMasked); + ByteVector512Tests::SUADDReduceMasked, ByteVector512Tests::SUADDReduceAllMasked); } @Test(dataProvider = "byteBinaryOpProvider") - static void withByte256VectorTests(IntFunction fa, IntFunction fb) { + static void withByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -4815,7 +4858,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_DEFAULTByte256VectorTests(IntFunction fa) { + static void IS_DEFAULTByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4825,14 +4868,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_DEFAULTMaskedByte256VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4845,7 +4888,7 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4856,7 +4899,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_NEGATIVEByte256VectorTests(IntFunction fa) { + static void IS_NEGATIVEByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4866,14 +4909,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_NEGATIVEMaskedByte256VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4886,14 +4929,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte256VectorTests(IntFunction fa, IntFunction fb) { + static void LTByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4905,14 +4948,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ltByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4924,14 +4967,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4947,14 +4990,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GTByte256VectorTests(IntFunction fa, IntFunction fb) { + static void GTByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4966,14 +5009,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GTByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4989,14 +5032,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte256VectorTests(IntFunction fa, IntFunction fb) { + static void EQByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5008,14 +5051,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte256VectorTests(IntFunction fa, IntFunction fb) { + static void eqByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5027,14 +5070,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5050,14 +5093,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void NEByte256VectorTests(IntFunction fa, IntFunction fb) { + static void NEByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5069,14 +5112,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void NEByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5092,14 +5135,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LEByte256VectorTests(IntFunction fa, IntFunction fb) { + static void LEByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5111,14 +5154,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LEByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5134,14 +5177,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GEByte256VectorTests(IntFunction fa, IntFunction fb) { + static void GEByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5153,14 +5196,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GEByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5176,14 +5219,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULTByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ULTByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5195,14 +5238,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULTByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5218,14 +5261,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGTByte256VectorTests(IntFunction fa, IntFunction fb) { + static void UGTByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5237,14 +5280,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGTByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5260,14 +5303,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULEByte256VectorTests(IntFunction fa, IntFunction fb) { + static void ULEByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5279,14 +5322,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULEByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5302,14 +5345,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGEByte256VectorTests(IntFunction fa, IntFunction fb) { + static void UGEByteVector512Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5321,14 +5364,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGEByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5344,14 +5387,14 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5361,13 +5404,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5381,13 +5424,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5397,13 +5440,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTByteVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5417,13 +5460,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5433,13 +5476,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5453,13 +5496,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5469,13 +5512,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQByteVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5489,7 +5532,7 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); } } } @@ -5499,7 +5542,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte256VectorTests(IntFunction fa, IntFunction fb, + static void blendByteVector512Tests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5515,11 +5558,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte256VectorTests::blend); + assertArraysEquals(r, a, b, mask, ByteVector512Tests::blend); } @Test(dataProvider = "byteUnaryOpShuffleProvider") - static void RearrangeByte256VectorTests(IntFunction fa, + static void RearrangeByteVector512Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5536,7 +5579,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpShuffleMaskProvider") - static void RearrangeByte256VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeByteVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -5554,7 +5597,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void compressByte256VectorTests(IntFunction fa, + static void compressByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5572,7 +5615,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void expandByte256VectorTests(IntFunction fa, + static void expandByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5590,7 +5633,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void getByte256VectorTests(IntFunction fa) { + static void getByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5746,7 +5789,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastByte256VectorTests(IntFunction fa) { + static void BroadcastByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5760,7 +5803,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZeroByte256VectorTests(IntFunction fa) { + static void ZeroByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5770,7 +5813,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static byte[] sliceUnary(byte[] a, int origin, int idx) { @@ -5785,7 +5828,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void sliceUnaryByte256VectorTests(IntFunction fa) { + static void sliceUnaryByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5796,7 +5839,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte256VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ByteVector512Tests::sliceUnary); } static byte[] sliceBinary(byte[] a, byte[] b, int origin, int idx) { @@ -5813,7 +5856,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void sliceBinaryByte256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryByteVector512TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5826,7 +5869,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Byte256VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ByteVector512Tests::sliceBinary); } static byte[] slice(byte[] a, byte[] b, int origin, boolean[] mask, int idx) { @@ -5843,7 +5886,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void sliceByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5860,7 +5903,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Byte256VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ByteVector512Tests::slice); } static byte[] unsliceUnary(byte[] a, int origin, int idx) { @@ -5877,7 +5920,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void unsliceUnaryByte256VectorTests(IntFunction fa) { + static void unsliceUnaryByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5888,7 +5931,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte256VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ByteVector512Tests::unsliceUnary); } static byte[] unsliceBinary(byte[] a, byte[] b, int origin, int part, int idx) { @@ -5914,7 +5957,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void unsliceBinaryByte256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryByteVector512TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5928,7 +5971,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Byte256VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ByteVector512Tests::unsliceBinary); } static byte[] unslice(byte[] a, byte[] b, int origin, int part, boolean[] mask, int idx) { @@ -5968,7 +6011,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void unsliceByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5985,7 +6028,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Byte256VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ByteVector512Tests::unslice); } static byte BITWISE_BLEND(byte a, byte b, byte c) { @@ -5997,7 +6040,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6012,11 +6055,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Byte256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6029,11 +6072,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Byte256VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ByteVector512Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6051,11 +6094,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Byte256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6066,11 +6109,11 @@ public class Byte256VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6081,11 +6124,11 @@ public class Byte256VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6096,11 +6139,11 @@ public class Byte256VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte256VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ByteVector512Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6111,11 +6154,11 @@ public class Byte256VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte256VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector512Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6130,11 +6173,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Byte256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte256VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector512TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6149,11 +6192,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Byte256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6164,11 +6207,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6179,11 +6222,11 @@ public class Byte256VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte256VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector512Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte256VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector512TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6197,7 +6240,7 @@ public class Byte256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Byte256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteVector512Tests::BITWISE_BLEND); } static byte NEG(byte a) { @@ -6209,7 +6252,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NEGByte256VectorTests(IntFunction fa) { + static void NEGByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6220,11 +6263,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::NEG); + assertArraysEquals(r, a, ByteVector512Tests::NEG); } @Test(dataProvider = "byteUnaryOpProvider") - static void negByte256VectorTests(IntFunction fa) { + static void negByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6235,11 +6278,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::neg); + assertArraysEquals(r, a, ByteVector512Tests::neg); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NEGMaskedByte256VectorTests(IntFunction fa, + static void NEGMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6253,7 +6296,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::NEG); + assertArraysEquals(r, a, mask, ByteVector512Tests::NEG); } static byte ABS(byte a) { @@ -6265,7 +6308,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ABSByte256VectorTests(IntFunction fa) { + static void ABSByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6276,11 +6319,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::ABS); + assertArraysEquals(r, a, ByteVector512Tests::ABS); } @Test(dataProvider = "byteUnaryOpProvider") - static void absByte256VectorTests(IntFunction fa) { + static void absByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6291,11 +6334,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::abs); + assertArraysEquals(r, a, ByteVector512Tests::abs); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ABSMaskedByte256VectorTests(IntFunction fa, + static void ABSMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6309,7 +6352,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::ABS); + assertArraysEquals(r, a, mask, ByteVector512Tests::ABS); } static byte NOT(byte a) { @@ -6321,7 +6364,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NOTByte256VectorTests(IntFunction fa) { + static void NOTByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6332,11 +6375,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::NOT); + assertArraysEquals(r, a, ByteVector512Tests::NOT); } @Test(dataProvider = "byteUnaryOpProvider") - static void notByte256VectorTests(IntFunction fa) { + static void notByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6347,11 +6390,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::not); + assertArraysEquals(r, a, ByteVector512Tests::not); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NOTMaskedByte256VectorTests(IntFunction fa, + static void NOTMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6365,7 +6408,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::NOT); + assertArraysEquals(r, a, mask, ByteVector512Tests::NOT); } static byte ZOMO(byte a) { @@ -6373,7 +6416,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZOMOByte256VectorTests(IntFunction fa) { + static void ZOMOByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6384,11 +6427,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::ZOMO); + assertArraysEquals(r, a, ByteVector512Tests::ZOMO); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ZOMOMaskedByte256VectorTests(IntFunction fa, + static void ZOMOMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6402,7 +6445,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ByteVector512Tests::ZOMO); } static byte BIT_COUNT(byte a) { @@ -6410,7 +6453,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BIT_COUNTByte256VectorTests(IntFunction fa) { + static void BIT_COUNTByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6421,11 +6464,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ByteVector512Tests::BIT_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void BIT_COUNTMaskedByte256VectorTests(IntFunction fa, + static void BIT_COUNTMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6439,7 +6482,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ByteVector512Tests::BIT_COUNT); } static byte TRAILING_ZEROS_COUNT(byte a) { @@ -6447,7 +6490,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void TRAILING_ZEROS_COUNTByte256VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6458,11 +6501,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector512Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedByte256VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6476,7 +6519,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector512Tests::TRAILING_ZEROS_COUNT); } static byte LEADING_ZEROS_COUNT(byte a) { @@ -6484,7 +6527,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LEADING_ZEROS_COUNTByte256VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6495,11 +6538,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector512Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedByte256VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6513,7 +6556,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector512Tests::LEADING_ZEROS_COUNT); } static byte REVERSE(byte a) { @@ -6521,7 +6564,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSEByte256VectorTests(IntFunction fa) { + static void REVERSEByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6532,11 +6575,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::REVERSE); + assertArraysEquals(r, a, ByteVector512Tests::REVERSE); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSEMaskedByte256VectorTests(IntFunction fa, + static void REVERSEMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6550,7 +6593,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ByteVector512Tests::REVERSE); } static byte REVERSE_BYTES(byte a) { @@ -6558,7 +6601,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSE_BYTESByte256VectorTests(IntFunction fa) { + static void REVERSE_BYTESByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6569,11 +6612,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ByteVector512Tests::REVERSE_BYTES); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedByte256VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedByteVector512Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6587,7 +6630,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ByteVector512Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6595,7 +6638,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandByteVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6608,7 +6651,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::band); + assertArraysEquals(r, a, b, ByteVector512Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6616,7 +6659,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maskorByteVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6629,7 +6672,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::bor); + assertArraysEquals(r, a, b, ByteVector512Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6637,7 +6680,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorByteVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6650,7 +6693,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::bxor); + assertArraysEquals(r, a, b, ByteVector512Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6658,7 +6701,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotByteVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6671,7 +6714,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::bandNot); + assertArraysEquals(r, a, b, ByteVector512Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6679,7 +6722,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqByteVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6692,7 +6735,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte256VectorTests::beq); + assertArraysEquals(r, a, b, ByteVector512Tests::beq); } static boolean unot(boolean a) { @@ -6700,7 +6743,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotByte256VectorTests(IntFunction fa) { + static void masknotByteVector512Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6711,7 +6754,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte256VectorTests::unot); + assertArraysEquals(r, a, ByteVector512Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6720,15 +6763,15 @@ public class Byte256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongByte256VectorTests(IntFunction fa) { + static void maskFromToLongByteVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6742,7 +6785,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltByteVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6752,13 +6795,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqByteVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6768,13 +6811,13 @@ public class Byte256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteUnaryOpProvider") - static void toIntArrayByte256VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6785,7 +6828,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toLongArrayByte256VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6796,7 +6839,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toDoubleArrayByte256VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6807,7 +6850,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toStringByte256VectorTestsSmokeTest(IntFunction fa) { + static void toStringByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6820,7 +6863,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void hashCodeByte256VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6834,7 +6877,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void reinterpretAsBytesByte256VectorTestsSmokeTest(IntFunction fa) { + static void reinterpretAsBytesByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6864,7 +6907,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceLongByte256VectorTests(IntFunction fa) { + static void ADDReduceLongByteVector512Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6880,7 +6923,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Byte256VectorTests::ADDReduceLong, Byte256VectorTests::ADDReduceAllLong); + ByteVector512Tests::ADDReduceLong, ByteVector512Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(byte[] a, int idx, boolean[] mask) { @@ -6903,7 +6946,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceLongByte256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongByteVector512TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6921,11 +6964,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Byte256VectorTests::ADDReduceLongMasked, Byte256VectorTests::ADDReduceAllLongMasked); + ByteVector512Tests::ADDReduceLongMasked, ByteVector512Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastLongByte256VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongByteVector512TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6936,7 +6979,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendByteVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6950,12 +6993,12 @@ public class Byte256VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte256VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector512Tests::blend); } @Test(dataProvider = "byteUnaryOpSelectFromProvider") - static void SelectFromByte256VectorTests(IntFunction fa, + static void SelectFromByteVector512Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); byte[] order = fs.apply(a.length, SPECIES.length()); @@ -6971,7 +7014,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorByte256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorByteVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] idx = fc.apply(SPECIES.length()); @@ -6989,7 +7032,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpSelectFromMaskProvider") - static void SelectFromByte256VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromByteVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -7008,7 +7051,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousByte256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousByteVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7019,12 +7062,12 @@ public class Byte256VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringByte256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringByteVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7038,7 +7081,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsByte256VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsByteVector512TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7047,12 +7090,12 @@ public class Byte256VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsByte256VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsByteVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7062,13 +7105,13 @@ public class Byte256VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeByte256VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeByteVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7090,7 +7133,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountByte256VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountByteVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7101,7 +7144,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte256VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ByteVector512Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7115,7 +7158,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueByte256VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueByteVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7126,7 +7169,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte256VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ByteVector512Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7140,7 +7183,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueByte256VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueByteVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7151,11 +7194,11 @@ public class Byte256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte256VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ByteVector512Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressByte256VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressByteVector512TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7165,7 +7208,7 @@ public class Byte256VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7183,7 +7226,7 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeByte256VectorTestsSmokeTest(int offset) { + static void indexInRangeByteVector512TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7191,13 +7234,13 @@ public class Byte256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongByte256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongByteVector512TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7205,7 +7248,7 @@ public class Byte256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7224,36 +7267,36 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundByte256VectorTestsSmokeTest(int length) { + static void loopBoundByteVector512TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongByte256VectorTestsSmokeTest(int _length) { + static void loopBoundLongByteVector512TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeByte256VectorTestsSmokeTest() { + static void ElementSizeByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Byte.SIZE); + assertEquals(elsize, Byte.SIZE); } @Test - static void VectorShapeByte256VectorTestsSmokeTest() { + static void VectorShapeByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); - assert(vsh.equals(VectorShape.S_256_BIT)); + assert(vsh.equals(VectorShape.S_512_BIT)); } @Test - static void ShapeWithLanesByte256VectorTestsSmokeTest() { + static void ShapeWithLanesByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(byte.class); @@ -7261,32 +7304,32 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeByte256VectorTestsSmokeTest() { + static void ElementTypeByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementType() == byte.class); } @Test - static void SpeciesElementSizeByte256VectorTestsSmokeTest() { + static void SpeciesElementSizeByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementSize() == Byte.SIZE); } @Test - static void VectorTypeByte256VectorTestsSmokeTest() { + static void VectorTypeByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesByte256VectorTestsSmokeTest() { + static void WithLanesByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(byte.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeByte256VectorTestsSmokeTest() { + static void WithShapeByteVector512TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7294,9 +7337,9 @@ public class Byte256VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueByte256VectorTestsSmokeTest() { + static void MaskAllTrueByteVector512TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteVector64LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ByteVector64LoadStoreTests.java index 870b9f9b8fb..2b9637d28dc 100644 --- a/test/jdk/jdk/incubator/vector/Byte64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector64LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Byte64VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ByteVector64LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ByteVector64LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_64; @@ -61,14 +61,29 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 64); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(byte[] r, byte[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "byteProviderForIOOBE") @@ -957,11 +972,11 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -972,11 +987,11 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); } } @@ -992,7 +1007,7 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(byte[] r, byte[] a, int[] indexMap) { @@ -1005,7 +1020,7 @@ public class Byte64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Byte64VectorTests.java b/test/jdk/jdk/incubator/vector/ByteVector64Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Byte64VectorTests.java rename to test/jdk/jdk/incubator/vector/ByteVector64Tests.java index e28fb2b2001..ce671440d2e 100644 --- a/test/jdk/jdk/incubator/vector/Byte64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVector64Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Byte64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteVector64Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Byte64VectorTests extends AbstractVectorTest { +public class ByteVector64Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_64; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(byte actual, byte expected, byte delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(byte actual, byte expected, byte delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final byte CONST_SHIFT = Byte.SIZE / 2; @@ -96,10 +139,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { byte[] ref = f.apply(a[i]); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Byte64VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Byte64VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Byte64VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Byte64VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Byte64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (byte)0); + assertEquals(r[i + k], (byte)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Byte64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (byte)0); + assertEquals(r[i + j], (byte)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Byte64VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Byte64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Byte64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Byte64VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Byte64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(r, a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1025,10 +1068,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1036,10 +1079,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1047,10 +1090,10 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1586,7 +1629,7 @@ public class Byte64VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ByteVector a = io.add((byte)1); //[1,2] ByteVector b = a.neg(); //[-1,-2] byte[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1601,19 +1644,19 @@ public class Byte64VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ByteVector uab0 = zab0.rearrange(unz0,zab1); ByteVector uab1 = zab0.rearrange(unz1,zab1); byte[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,7 +1671,7 @@ public class Byte64VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1662,7 +1705,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ADDByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1675,7 +1718,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::ADD); + assertArraysEquals(r, a, b, ByteVector64Tests::ADD); } static byte add(byte a, byte b) { @@ -1683,7 +1726,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte64VectorTests(IntFunction fa, IntFunction fb) { + static void addByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1694,11 +1737,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::add); + assertArraysEquals(r, a, b, ByteVector64Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1714,11 +1757,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1732,7 +1775,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::add); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::add); } static byte SUB(byte a, byte b) { @@ -1740,7 +1783,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void SUBByte64VectorTests(IntFunction fa, IntFunction fb) { + static void SUBByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1753,7 +1796,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::SUB); + assertArraysEquals(r, a, b, ByteVector64Tests::SUB); } static byte sub(byte a, byte b) { @@ -1761,7 +1804,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte64VectorTests(IntFunction fa, IntFunction fb) { + static void subByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1772,11 +1815,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::sub); + assertArraysEquals(r, a, b, ByteVector64Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void SUBByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1792,11 +1835,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::SUB); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1810,7 +1853,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::sub); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::sub); } static byte MUL(byte a, byte b) { @@ -1818,7 +1861,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MULByte64VectorTests(IntFunction fa, IntFunction fb) { + static void MULByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1831,7 +1874,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::MUL); + assertArraysEquals(r, a, b, ByteVector64Tests::MUL); } static byte mul(byte a, byte b) { @@ -1839,7 +1882,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte64VectorTests(IntFunction fa, IntFunction fb) { + static void mulByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1850,11 +1893,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::mul); + assertArraysEquals(r, a, b, ByteVector64Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void MULByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1870,11 +1913,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::MUL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1888,7 +1931,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::mul); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::mul); } static byte DIV(byte a, byte b) { @@ -1896,7 +1939,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void DIVByte64VectorTests(IntFunction fa, IntFunction fb) { + static void DIVByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1911,7 +1954,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::DIV); + assertArraysEquals(r, a, b, ByteVector64Tests::DIV); } static byte div(byte a, byte b) { @@ -1919,7 +1962,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte64VectorTests(IntFunction fa, IntFunction fb) { + static void divByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1934,11 +1977,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::div); + assertArraysEquals(r, a, b, ByteVector64Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void DIVByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1956,11 +1999,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::DIV); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1978,7 +2021,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::div); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::div); } static byte FIRST_NONZERO(byte a, byte b) { @@ -1986,7 +2029,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void FIRST_NONZEROByte64VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1999,11 +2042,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ByteVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void FIRST_NONZEROByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2019,7 +2062,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::FIRST_NONZERO); } static byte AND(byte a, byte b) { @@ -2027,7 +2070,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ANDByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2040,7 +2083,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::AND); + assertArraysEquals(r, a, b, ByteVector64Tests::AND); } static byte and(byte a, byte b) { @@ -2048,7 +2091,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte64VectorTests(IntFunction fa, IntFunction fb) { + static void andByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2059,11 +2102,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::and); + assertArraysEquals(r, a, b, ByteVector64Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2079,7 +2122,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::AND); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::AND); } static byte AND_NOT(byte a, byte b) { @@ -2087,7 +2130,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void AND_NOTByte64VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2100,11 +2143,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ByteVector64Tests::AND_NOT); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void AND_NOTByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2120,7 +2163,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::AND_NOT); } static byte OR(byte a, byte b) { @@ -2128,7 +2171,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ORByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2141,7 +2184,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::OR); + assertArraysEquals(r, a, b, ByteVector64Tests::OR); } static byte or(byte a, byte b) { @@ -2149,7 +2192,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte64VectorTests(IntFunction fa, IntFunction fb) { + static void orByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2160,11 +2203,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::or); + assertArraysEquals(r, a, b, ByteVector64Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2180,7 +2223,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::OR); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::OR); } static byte XOR(byte a, byte b) { @@ -2188,7 +2231,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void XORByte64VectorTests(IntFunction fa, IntFunction fb) { + static void XORByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2201,11 +2244,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::XOR); + assertArraysEquals(r, a, b, ByteVector64Tests::XOR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void XORByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2221,11 +2264,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::XOR); } @Test(dataProvider = "byteBinaryOpProvider") - static void addByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2235,11 +2278,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2252,11 +2295,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector64Tests::add); } @Test(dataProvider = "byteBinaryOpProvider") - static void subByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2266,11 +2309,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2283,11 +2326,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector64Tests::sub); } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2297,11 +2340,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2314,11 +2357,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector64Tests::mul); } @Test(dataProvider = "byteBinaryOpProvider") - static void divByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2373,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2392,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector64Tests::div); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2406,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void orByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2377,11 +2420,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2394,11 +2437,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector64Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2408,11 +2451,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void andByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2422,11 +2465,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2439,11 +2482,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Byte64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ByteVector64Tests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByte64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2453,11 +2496,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ByteVector64Tests::OR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByte64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2470,11 +2513,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector64Tests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByte64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDByteVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2484,11 +2527,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Byte64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ByteVector64Tests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByte64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDByteVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2501,7 +2544,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector64Tests::ADD); } static byte LSHL(byte a, byte b) { @@ -2509,7 +2552,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2522,11 +2565,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::LSHL); + assertArraysEquals(r, a, b, ByteVector64Tests::LSHL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2542,7 +2585,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::LSHL); } static byte ASHR(byte a, byte b) { @@ -2550,7 +2593,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2563,11 +2606,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::ASHR); + assertArraysEquals(r, a, b, ByteVector64Tests::ASHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2583,7 +2626,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::ASHR); } static byte LSHR(byte a, byte b) { @@ -2591,7 +2634,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2604,11 +2647,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::LSHR); + assertArraysEquals(r, a, b, ByteVector64Tests::LSHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2624,7 +2667,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::LSHR); } static byte LSHL_unary(byte a, byte b) { @@ -2632,7 +2675,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByte64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLByteVector64TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2644,11 +2687,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ByteVector64Tests::LSHL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByte64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2663,7 +2706,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector64Tests::LSHL_unary); } static byte LSHR_unary(byte a, byte b) { @@ -2671,7 +2714,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByte64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRByteVector64TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2683,11 +2726,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector64Tests::LSHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByte64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2702,7 +2745,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector64Tests::LSHR_unary); } static byte ASHR_unary(byte a, byte b) { @@ -2710,7 +2753,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByte64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRByteVector64TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2722,11 +2765,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ByteVector64Tests::ASHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByte64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2741,7 +2784,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector64Tests::ASHR_unary); } static byte ROR(byte a, byte b) { @@ -2749,7 +2792,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte64VectorTests(IntFunction fa, IntFunction fb) { + static void RORByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2762,11 +2805,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::ROR); + assertArraysEquals(r, a, b, ByteVector64Tests::ROR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2782,7 +2825,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::ROR); } static byte ROL(byte a, byte b) { @@ -2790,7 +2833,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ROLByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2803,11 +2846,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::ROL); + assertArraysEquals(r, a, b, ByteVector64Tests::ROL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2823,7 +2866,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::ROL); } static byte ROR_unary(byte a, byte b) { @@ -2831,7 +2874,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByte64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORByteVector64TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2843,11 +2886,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ByteVector64Tests::ROR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByte64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORByteVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2862,7 +2905,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector64Tests::ROR_unary); } static byte ROL_unary(byte a, byte b) { @@ -2870,7 +2913,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByte64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLByteVector64TestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2882,11 +2925,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Byte64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ByteVector64Tests::ROL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByte64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLByteVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2901,14 +2944,14 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Byte64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVector64Tests::ROL_unary); } static byte LSHR_binary_const(byte a) { return (byte)(((a & 0xFF) >>> CONST_SHIFT)); } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHRByte64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRByteVector64TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2919,11 +2962,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ByteVector64Tests::LSHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHRByte64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRByteVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2937,7 +2980,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector64Tests::LSHR_binary_const); } static byte LSHL_binary_const(byte a) { @@ -2945,7 +2988,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHLByte64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLByteVector64TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2956,11 +2999,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ByteVector64Tests::LSHL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHLByte64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLByteVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2974,7 +3017,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector64Tests::LSHL_binary_const); } static byte ASHR_binary_const(byte a) { @@ -2982,7 +3025,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ASHRByte64VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRByteVector64TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2993,11 +3036,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ByteVector64Tests::ASHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ASHRByte64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRByteVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3011,7 +3054,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector64Tests::ASHR_binary_const); } static byte ROR_binary_const(byte a) { @@ -3019,7 +3062,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void RORByte64VectorTestsScalarShiftConst(IntFunction fa) { + static void RORByteVector64TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3030,11 +3073,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ByteVector64Tests::ROR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void RORByte64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORByteVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3048,7 +3091,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector64Tests::ROR_binary_const); } static byte ROL_binary_const(byte a) { @@ -3056,7 +3099,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ROLByte64VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLByteVector64TestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3067,11 +3110,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Byte64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ByteVector64Tests::ROL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ROLByte64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLByteVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3085,14 +3128,14 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Byte64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVector64Tests::ROL_binary_const); } static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MINByte64VectorTestsWithMemOp(IntFunction fa) { + static void MINByteVector64TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3103,13 +3146,13 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte64VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, ByteVector64Tests::MIN); } static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void minByte64VectorTestsWithMemOp(IntFunction fa) { + static void minByteVector64TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3120,13 +3163,13 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte64VectorTests::min); + assertArraysEquals(r, a, (byte)10, ByteVector64Tests::min); } static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINByte64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINByteVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3139,13 +3182,13 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte64VectorTests::MIN); + assertArraysEquals(r, a, (byte)10, mask, ByteVector64Tests::MIN); } static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MAXByte64VectorTestsWithMemOp(IntFunction fa) { + static void MAXByteVector64TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3156,13 +3199,13 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte64VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, ByteVector64Tests::MAX); } static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void maxByte64VectorTestsWithMemOp(IntFunction fa) { + static void maxByteVector64TestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3173,13 +3216,13 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, Byte64VectorTests::max); + assertArraysEquals(r, a, (byte)10, ByteVector64Tests::max); } static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXByte64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXByteVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3192,7 +3235,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, Byte64VectorTests::MAX); + assertArraysEquals(r, a, (byte)10, mask, ByteVector64Tests::MAX); } static byte MIN(byte a, byte b) { @@ -3200,7 +3243,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte64VectorTests(IntFunction fa, IntFunction fb) { + static void MINByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3213,7 +3256,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::MIN); + assertArraysEquals(r, a, b, ByteVector64Tests::MIN); } static byte min(byte a, byte b) { @@ -3221,7 +3264,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte64VectorTests(IntFunction fa, IntFunction fb) { + static void minByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3232,7 +3275,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::min); + assertArraysEquals(r, a, b, ByteVector64Tests::min); } static byte MAX(byte a, byte b) { @@ -3240,7 +3283,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte64VectorTests(IntFunction fa, IntFunction fb) { + static void MAXByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3253,7 +3296,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::MAX); + assertArraysEquals(r, a, b, ByteVector64Tests::MAX); } static byte max(byte a, byte b) { @@ -3261,7 +3304,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maxByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3272,7 +3315,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Byte64VectorTests::max); + assertArraysEquals(r, a, b, ByteVector64Tests::max); } static byte UMIN(byte a, byte b) { @@ -3280,7 +3323,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMINByte64VectorTests(IntFunction fa, IntFunction fb) { + static void UMINByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3293,11 +3336,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::UMIN); + assertArraysEquals(r, a, b, ByteVector64Tests::UMIN); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMINByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3313,7 +3356,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::UMIN); } static byte UMAX(byte a, byte b) { @@ -3321,7 +3364,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMAXByte64VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3334,11 +3377,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::UMAX); + assertArraysEquals(r, a, b, ByteVector64Tests::UMAX); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMAXByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3354,7 +3397,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::UMAX); } static byte SADD(byte a, byte b) { @@ -3362,7 +3405,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SADDByte64VectorTests(IntFunction fa, IntFunction fb) { + static void SADDByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3375,11 +3418,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::SADD); + assertArraysEquals(r, a, b, ByteVector64Tests::SADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SADDByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3395,7 +3438,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::SADD); } static byte SSUB(byte a, byte b) { @@ -3403,7 +3446,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SSUBByte64VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3416,11 +3459,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::SSUB); + assertArraysEquals(r, a, b, ByteVector64Tests::SSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SSUBByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3436,7 +3479,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::SSUB); } static byte SUADD(byte a, byte b) { @@ -3444,7 +3487,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUADDByte64VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3457,11 +3500,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::SUADD); + assertArraysEquals(r, a, b, ByteVector64Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUADDByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3477,7 +3520,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::SUADD); } static byte SUSUB(byte a, byte b) { @@ -3485,7 +3528,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUSUBByte64VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3498,11 +3541,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::SUSUB); + assertArraysEquals(r, a, b, ByteVector64Tests::SUSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUSUBByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3518,11 +3561,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::SUSUB); } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3532,11 +3575,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::MIN); } @Test(dataProvider = "byteBinaryOpProvider") - static void minByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3546,11 +3589,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::min); } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3560,11 +3603,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::MAX); } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3574,10 +3617,10 @@ public class Byte64VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Byte64VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ByteVector64Tests::max); } @Test(dataProvider = "byteSaturatingBinaryOpAssocProvider") - static void SUADDAssocByte64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocByteVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -3594,11 +3637,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Byte64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ByteVector64Tests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3619,7 +3662,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Byte64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ByteVector64Tests::SUADD); } static byte ANDReduce(byte[] a, int idx) { @@ -3641,7 +3684,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ANDReduceByte64VectorTests(IntFunction fa) { + static void ANDReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3657,7 +3700,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::ANDReduce, Byte64VectorTests::ANDReduceAll); + ByteVector64Tests::ANDReduce, ByteVector64Tests::ANDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3665,20 +3708,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = AND_IDENTITY; - Assert.assertEquals((byte) (id & id), id, + assertEquals((byte) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id & x), x); - Assert.assertEquals((byte) (x & id), x); + assertEquals((byte) (id & x), x); + assertEquals((byte) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id & x), x, + assertEquals((byte) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x & id), x, + assertEquals((byte) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3703,7 +3746,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ANDReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3721,7 +3764,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::ANDReduceMasked, Byte64VectorTests::ANDReduceAllMasked); + ByteVector64Tests::ANDReduceMasked, ByteVector64Tests::ANDReduceAllMasked); } static byte ORReduce(byte[] a, int idx) { @@ -3743,7 +3786,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ORReduceByte64VectorTests(IntFunction fa) { + static void ORReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3759,7 +3802,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::ORReduce, Byte64VectorTests::ORReduceAll); + ByteVector64Tests::ORReduce, ByteVector64Tests::ORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3767,20 +3810,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = OR_IDENTITY; - Assert.assertEquals((byte) (id | id), id, + assertEquals((byte) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id | x), x); - Assert.assertEquals((byte) (x | id), x); + assertEquals((byte) (id | x), x); + assertEquals((byte) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id | x), x, + assertEquals((byte) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x | id), x, + assertEquals((byte) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3805,7 +3848,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ORReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3823,7 +3866,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::ORReduceMasked, Byte64VectorTests::ORReduceAllMasked); + ByteVector64Tests::ORReduceMasked, ByteVector64Tests::ORReduceAllMasked); } static byte XORReduce(byte[] a, int idx) { @@ -3845,7 +3888,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void XORReduceByte64VectorTests(IntFunction fa) { + static void XORReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3861,7 +3904,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::XORReduce, Byte64VectorTests::XORReduceAll); + ByteVector64Tests::XORReduce, ByteVector64Tests::XORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3869,20 +3912,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = XOR_IDENTITY; - Assert.assertEquals((byte) (id ^ id), id, + assertEquals((byte) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id ^ x), x); - Assert.assertEquals((byte) (x ^ id), x); + assertEquals((byte) (id ^ x), x); + assertEquals((byte) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id ^ x), x, + assertEquals((byte) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x ^ id), x, + assertEquals((byte) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3907,7 +3950,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void XORReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3925,7 +3968,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::XORReduceMasked, Byte64VectorTests::XORReduceAllMasked); + ByteVector64Tests::XORReduceMasked, ByteVector64Tests::XORReduceAllMasked); } static byte ADDReduce(byte[] a, int idx) { @@ -3947,7 +3990,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceByte64VectorTests(IntFunction fa) { + static void ADDReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3963,7 +4006,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::ADDReduce, Byte64VectorTests::ADDReduceAll); + ByteVector64Tests::ADDReduce, ByteVector64Tests::ADDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3971,20 +4014,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = ADD_IDENTITY; - Assert.assertEquals((byte) (id + id), id, + assertEquals((byte) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id + x), x); - Assert.assertEquals((byte) (x + id), x); + assertEquals((byte) (id + x), x); + assertEquals((byte) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id + x), x, + assertEquals((byte) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x + id), x, + assertEquals((byte) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4009,7 +4052,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4027,7 +4070,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::ADDReduceMasked, Byte64VectorTests::ADDReduceAllMasked); + ByteVector64Tests::ADDReduceMasked, ByteVector64Tests::ADDReduceAllMasked); } static byte MULReduce(byte[] a, int idx) { @@ -4049,7 +4092,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MULReduceByte64VectorTests(IntFunction fa) { + static void MULReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4065,7 +4108,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::MULReduce, Byte64VectorTests::MULReduceAll); + ByteVector64Tests::MULReduce, ByteVector64Tests::MULReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4073,20 +4116,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MUL_IDENTITY; - Assert.assertEquals((byte) (id * id), id, + assertEquals((byte) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id * x), x); - Assert.assertEquals((byte) (x * id), x); + assertEquals((byte) (id * x), x); + assertEquals((byte) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id * x), x, + assertEquals((byte) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x * id), x, + assertEquals((byte) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4111,7 +4154,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MULReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4129,7 +4172,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::MULReduceMasked, Byte64VectorTests::MULReduceAllMasked); + ByteVector64Tests::MULReduceMasked, ByteVector64Tests::MULReduceAllMasked); } static byte MINReduce(byte[] a, int idx) { @@ -4151,7 +4194,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MINReduceByte64VectorTests(IntFunction fa) { + static void MINReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4167,7 +4210,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::MINReduce, Byte64VectorTests::MINReduceAll); + ByteVector64Tests::MINReduce, ByteVector64Tests::MINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4175,20 +4218,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MIN_IDENTITY; - Assert.assertEquals((byte) Math.min(id, id), id, + assertEquals((byte) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.min(id, x), x); - Assert.assertEquals((byte) Math.min(x, id), x); + assertEquals((byte) Math.min(id, x), x); + assertEquals((byte) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.min(id, x), x, + assertEquals((byte) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.min(x, id), x, + assertEquals((byte) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4213,7 +4256,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4231,7 +4274,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::MINReduceMasked, Byte64VectorTests::MINReduceAllMasked); + ByteVector64Tests::MINReduceMasked, ByteVector64Tests::MINReduceAllMasked); } static byte MAXReduce(byte[] a, int idx) { @@ -4253,7 +4296,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MAXReduceByte64VectorTests(IntFunction fa) { + static void MAXReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4269,7 +4312,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::MAXReduce, Byte64VectorTests::MAXReduceAll); + ByteVector64Tests::MAXReduce, ByteVector64Tests::MAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4277,20 +4320,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MAX_IDENTITY; - Assert.assertEquals((byte) Math.max(id, id), id, + assertEquals((byte) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.max(id, x), x); - Assert.assertEquals((byte) Math.max(x, id), x); + assertEquals((byte) Math.max(id, x), x); + assertEquals((byte) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.max(id, x), x, + assertEquals((byte) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.max(x, id), x, + assertEquals((byte) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4315,7 +4358,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4333,7 +4376,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::MAXReduceMasked, Byte64VectorTests::MAXReduceAllMasked); + ByteVector64Tests::MAXReduceMasked, ByteVector64Tests::MAXReduceAllMasked); } static byte UMINReduce(byte[] a, int idx) { @@ -4355,7 +4398,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMINReduceByte64VectorTests(IntFunction fa) { + static void UMINReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4371,7 +4414,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::UMINReduce, Byte64VectorTests::UMINReduceAll); + ByteVector64Tests::UMINReduce, ByteVector64Tests::UMINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4379,20 +4422,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMIN_IDENTITY; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, id), id, + assertEquals((byte) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x); + assertEquals((byte) VectorMath.minUnsigned(id, x), x); + assertEquals((byte) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x, + assertEquals((byte) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x, + assertEquals((byte) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4417,7 +4460,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMINReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4435,7 +4478,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::UMINReduceMasked, Byte64VectorTests::UMINReduceAllMasked); + ByteVector64Tests::UMINReduceMasked, ByteVector64Tests::UMINReduceAllMasked); } static byte UMAXReduce(byte[] a, int idx) { @@ -4457,7 +4500,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMAXReduceByte64VectorTests(IntFunction fa) { + static void UMAXReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4473,7 +4516,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::UMAXReduce, Byte64VectorTests::UMAXReduceAll); + ByteVector64Tests::UMAXReduce, ByteVector64Tests::UMAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4481,20 +4524,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMAX_IDENTITY; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, id), id, + assertEquals((byte) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x); + assertEquals((byte) VectorMath.maxUnsigned(id, x), x); + assertEquals((byte) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x, + assertEquals((byte) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x, + assertEquals((byte) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4519,7 +4562,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMAXReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::UMAXReduceMasked, Byte64VectorTests::UMAXReduceAllMasked); + ByteVector64Tests::UMAXReduceMasked, ByteVector64Tests::UMAXReduceAllMasked); } static byte FIRST_NONZEROReduce(byte[] a, int idx) { @@ -4559,7 +4602,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void FIRST_NONZEROReduceByte64VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4575,7 +4618,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::FIRST_NONZEROReduce, Byte64VectorTests::FIRST_NONZEROReduceAll); + ByteVector64Tests::FIRST_NONZEROReduce, ByteVector64Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4583,20 +4626,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4621,7 +4664,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void FIRST_NONZEROReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4639,7 +4682,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::FIRST_NONZEROReduceMasked, Byte64VectorTests::FIRST_NONZEROReduceAllMasked); + ByteVector64Tests::FIRST_NONZEROReduceMasked, ByteVector64Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4652,7 +4695,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueByte64VectorTests(IntFunction fm) { + static void anyTrueByteVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4663,7 +4706,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte64VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector64Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4676,7 +4719,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueByte64VectorTests(IntFunction fm) { + static void allTrueByteVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4687,7 +4730,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Byte64VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ByteVector64Tests::allTrue); } static byte SUADDReduce(byte[] a, int idx) { @@ -4709,7 +4752,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingUnaryOpProvider") - static void SUADDReduceByte64VectorTests(IntFunction fa) { + static void SUADDReduceByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4725,7 +4768,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Byte64VectorTests::SUADDReduce, Byte64VectorTests::SUADDReduceAll); + ByteVector64Tests::SUADDReduce, ByteVector64Tests::SUADDReduceAll); } @Test(dataProvider = "byteSaturatingUnaryOpProvider") @@ -4733,20 +4776,20 @@ public class Byte64VectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = SUADD_IDENTITY; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4770,7 +4813,7 @@ public class Byte64VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "byteSaturatingUnaryOpMaskProvider") - static void SUADDReduceByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4788,11 +4831,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::SUADDReduceMasked, Byte64VectorTests::SUADDReduceAllMasked); + ByteVector64Tests::SUADDReduceMasked, ByteVector64Tests::SUADDReduceAllMasked); } @Test(dataProvider = "byteBinaryOpProvider") - static void withByte64VectorTests(IntFunction fa, IntFunction fb) { + static void withByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -4815,7 +4858,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_DEFAULTByte64VectorTests(IntFunction fa) { + static void IS_DEFAULTByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4825,14 +4868,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_DEFAULTMaskedByte64VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4845,7 +4888,7 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4856,7 +4899,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_NEGATIVEByte64VectorTests(IntFunction fa) { + static void IS_NEGATIVEByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4866,14 +4909,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_NEGATIVEMaskedByte64VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4886,14 +4929,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte64VectorTests(IntFunction fa, IntFunction fb) { + static void LTByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4905,14 +4948,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ltByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4924,14 +4967,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4947,14 +4990,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GTByte64VectorTests(IntFunction fa, IntFunction fb) { + static void GTByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4966,14 +5009,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GTByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4989,14 +5032,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte64VectorTests(IntFunction fa, IntFunction fb) { + static void EQByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5008,14 +5051,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte64VectorTests(IntFunction fa, IntFunction fb) { + static void eqByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5027,14 +5070,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5050,14 +5093,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void NEByte64VectorTests(IntFunction fa, IntFunction fb) { + static void NEByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5069,14 +5112,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void NEByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5092,14 +5135,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LEByte64VectorTests(IntFunction fa, IntFunction fb) { + static void LEByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5111,14 +5154,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LEByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5134,14 +5177,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GEByte64VectorTests(IntFunction fa, IntFunction fb) { + static void GEByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5153,14 +5196,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GEByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5176,14 +5219,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULTByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ULTByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5195,14 +5238,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULTByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5218,14 +5261,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGTByte64VectorTests(IntFunction fa, IntFunction fb) { + static void UGTByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5237,14 +5280,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGTByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5260,14 +5303,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULEByte64VectorTests(IntFunction fa, IntFunction fb) { + static void ULEByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5279,14 +5322,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULEByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5302,14 +5345,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGEByte64VectorTests(IntFunction fa, IntFunction fb) { + static void UGEByteVector64Tests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5321,14 +5364,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGEByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5344,14 +5387,14 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5361,13 +5404,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5381,13 +5424,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByte64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5397,13 +5440,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByte64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTByteVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5417,13 +5460,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5433,13 +5476,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5453,13 +5496,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByte64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5469,13 +5512,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByte64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQByteVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5489,7 +5532,7 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); } } } @@ -5499,7 +5542,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte64VectorTests(IntFunction fa, IntFunction fb, + static void blendByteVector64Tests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5515,11 +5558,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Byte64VectorTests::blend); + assertArraysEquals(r, a, b, mask, ByteVector64Tests::blend); } @Test(dataProvider = "byteUnaryOpShuffleProvider") - static void RearrangeByte64VectorTests(IntFunction fa, + static void RearrangeByteVector64Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5536,7 +5579,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpShuffleMaskProvider") - static void RearrangeByte64VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeByteVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -5554,7 +5597,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void compressByte64VectorTests(IntFunction fa, + static void compressByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5572,7 +5615,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void expandByte64VectorTests(IntFunction fa, + static void expandByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5590,7 +5633,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void getByte64VectorTests(IntFunction fa) { + static void getByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5746,7 +5789,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastByte64VectorTests(IntFunction fa) { + static void BroadcastByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5760,7 +5803,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZeroByte64VectorTests(IntFunction fa) { + static void ZeroByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5770,7 +5813,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static byte[] sliceUnary(byte[] a, int origin, int idx) { @@ -5785,7 +5828,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void sliceUnaryByte64VectorTests(IntFunction fa) { + static void sliceUnaryByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5796,7 +5839,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte64VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ByteVector64Tests::sliceUnary); } static byte[] sliceBinary(byte[] a, byte[] b, int origin, int idx) { @@ -5813,7 +5856,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void sliceBinaryByte64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryByteVector64TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5826,7 +5869,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Byte64VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ByteVector64Tests::sliceBinary); } static byte[] slice(byte[] a, byte[] b, int origin, boolean[] mask, int idx) { @@ -5843,7 +5886,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void sliceByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5860,7 +5903,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Byte64VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ByteVector64Tests::slice); } static byte[] unsliceUnary(byte[] a, int origin, int idx) { @@ -5877,7 +5920,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void unsliceUnaryByte64VectorTests(IntFunction fa) { + static void unsliceUnaryByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5888,7 +5931,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Byte64VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ByteVector64Tests::unsliceUnary); } static byte[] unsliceBinary(byte[] a, byte[] b, int origin, int part, int idx) { @@ -5914,7 +5957,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void unsliceBinaryByte64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryByteVector64TestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5928,7 +5971,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Byte64VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ByteVector64Tests::unsliceBinary); } static byte[] unslice(byte[] a, byte[] b, int origin, int part, boolean[] mask, int idx) { @@ -5968,7 +6011,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void unsliceByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5985,7 +6028,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Byte64VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ByteVector64Tests::unslice); } static byte BITWISE_BLEND(byte a, byte b, byte c) { @@ -5997,7 +6040,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6012,11 +6055,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Byte64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6029,11 +6072,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Byte64VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ByteVector64Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6051,11 +6094,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Byte64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6066,11 +6109,11 @@ public class Byte64VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6081,11 +6124,11 @@ public class Byte64VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6096,11 +6139,11 @@ public class Byte64VectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Byte64VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ByteVector64Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6111,11 +6154,11 @@ public class Byte64VectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Byte64VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVector64Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6130,11 +6173,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Byte64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte64VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector64TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6149,11 +6192,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Byte64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByte64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6164,11 +6207,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByte64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6179,11 +6222,11 @@ public class Byte64VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Byte64VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVector64Tests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByte64VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVector64TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6197,7 +6240,7 @@ public class Byte64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Byte64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteVector64Tests::BITWISE_BLEND); } static byte NEG(byte a) { @@ -6209,7 +6252,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NEGByte64VectorTests(IntFunction fa) { + static void NEGByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6220,11 +6263,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::NEG); + assertArraysEquals(r, a, ByteVector64Tests::NEG); } @Test(dataProvider = "byteUnaryOpProvider") - static void negByte64VectorTests(IntFunction fa) { + static void negByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6235,11 +6278,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::neg); + assertArraysEquals(r, a, ByteVector64Tests::neg); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NEGMaskedByte64VectorTests(IntFunction fa, + static void NEGMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6253,7 +6296,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::NEG); + assertArraysEquals(r, a, mask, ByteVector64Tests::NEG); } static byte ABS(byte a) { @@ -6265,7 +6308,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ABSByte64VectorTests(IntFunction fa) { + static void ABSByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6276,11 +6319,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::ABS); + assertArraysEquals(r, a, ByteVector64Tests::ABS); } @Test(dataProvider = "byteUnaryOpProvider") - static void absByte64VectorTests(IntFunction fa) { + static void absByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6291,11 +6334,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::abs); + assertArraysEquals(r, a, ByteVector64Tests::abs); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ABSMaskedByte64VectorTests(IntFunction fa, + static void ABSMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6309,7 +6352,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::ABS); + assertArraysEquals(r, a, mask, ByteVector64Tests::ABS); } static byte NOT(byte a) { @@ -6321,7 +6364,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NOTByte64VectorTests(IntFunction fa) { + static void NOTByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6332,11 +6375,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::NOT); + assertArraysEquals(r, a, ByteVector64Tests::NOT); } @Test(dataProvider = "byteUnaryOpProvider") - static void notByte64VectorTests(IntFunction fa) { + static void notByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6347,11 +6390,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::not); + assertArraysEquals(r, a, ByteVector64Tests::not); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NOTMaskedByte64VectorTests(IntFunction fa, + static void NOTMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6365,7 +6408,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::NOT); + assertArraysEquals(r, a, mask, ByteVector64Tests::NOT); } static byte ZOMO(byte a) { @@ -6373,7 +6416,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZOMOByte64VectorTests(IntFunction fa) { + static void ZOMOByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6384,11 +6427,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::ZOMO); + assertArraysEquals(r, a, ByteVector64Tests::ZOMO); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ZOMOMaskedByte64VectorTests(IntFunction fa, + static void ZOMOMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6402,7 +6445,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ByteVector64Tests::ZOMO); } static byte BIT_COUNT(byte a) { @@ -6410,7 +6453,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BIT_COUNTByte64VectorTests(IntFunction fa) { + static void BIT_COUNTByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6421,11 +6464,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ByteVector64Tests::BIT_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void BIT_COUNTMaskedByte64VectorTests(IntFunction fa, + static void BIT_COUNTMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6439,7 +6482,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ByteVector64Tests::BIT_COUNT); } static byte TRAILING_ZEROS_COUNT(byte a) { @@ -6447,7 +6490,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void TRAILING_ZEROS_COUNTByte64VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6458,11 +6501,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector64Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedByte64VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6476,7 +6519,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector64Tests::TRAILING_ZEROS_COUNT); } static byte LEADING_ZEROS_COUNT(byte a) { @@ -6484,7 +6527,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LEADING_ZEROS_COUNTByte64VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6495,11 +6538,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVector64Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedByte64VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6513,7 +6556,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVector64Tests::LEADING_ZEROS_COUNT); } static byte REVERSE(byte a) { @@ -6521,7 +6564,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSEByte64VectorTests(IntFunction fa) { + static void REVERSEByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6532,11 +6575,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::REVERSE); + assertArraysEquals(r, a, ByteVector64Tests::REVERSE); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSEMaskedByte64VectorTests(IntFunction fa, + static void REVERSEMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6550,7 +6593,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ByteVector64Tests::REVERSE); } static byte REVERSE_BYTES(byte a) { @@ -6558,7 +6601,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSE_BYTESByte64VectorTests(IntFunction fa) { + static void REVERSE_BYTESByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6569,11 +6612,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ByteVector64Tests::REVERSE_BYTES); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedByte64VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedByteVector64Tests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6587,7 +6630,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Byte64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ByteVector64Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6595,7 +6638,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandByteVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6608,7 +6651,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::band); + assertArraysEquals(r, a, b, ByteVector64Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6616,7 +6659,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maskorByteVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6629,7 +6672,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::bor); + assertArraysEquals(r, a, b, ByteVector64Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6637,7 +6680,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorByteVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6650,7 +6693,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::bxor); + assertArraysEquals(r, a, b, ByteVector64Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6658,7 +6701,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotByteVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6671,7 +6714,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::bandNot); + assertArraysEquals(r, a, b, ByteVector64Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6679,7 +6722,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqByteVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6692,7 +6735,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Byte64VectorTests::beq); + assertArraysEquals(r, a, b, ByteVector64Tests::beq); } static boolean unot(boolean a) { @@ -6700,7 +6743,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotByte64VectorTests(IntFunction fa) { + static void masknotByteVector64Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6711,7 +6754,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Byte64VectorTests::unot); + assertArraysEquals(r, a, ByteVector64Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6720,15 +6763,15 @@ public class Byte64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongByte64VectorTests(IntFunction fa) { + static void maskFromToLongByteVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6742,7 +6785,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteCompareOpProvider") - static void ltByte64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltByteVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6752,13 +6795,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByte64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqByteVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6768,13 +6811,13 @@ public class Byte64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteUnaryOpProvider") - static void toIntArrayByte64VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6785,7 +6828,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toLongArrayByte64VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6796,7 +6839,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toDoubleArrayByte64VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6807,7 +6850,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toStringByte64VectorTestsSmokeTest(IntFunction fa) { + static void toStringByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6820,7 +6863,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void hashCodeByte64VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6834,7 +6877,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void reinterpretAsBytesByte64VectorTestsSmokeTest(IntFunction fa) { + static void reinterpretAsBytesByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6864,7 +6907,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceLongByte64VectorTests(IntFunction fa) { + static void ADDReduceLongByteVector64Tests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6880,7 +6923,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Byte64VectorTests::ADDReduceLong, Byte64VectorTests::ADDReduceAllLong); + ByteVector64Tests::ADDReduceLong, ByteVector64Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(byte[] a, int idx, boolean[] mask) { @@ -6903,7 +6946,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceLongByte64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongByteVector64TestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6921,11 +6964,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Byte64VectorTests::ADDReduceLongMasked, Byte64VectorTests::ADDReduceAllLongMasked); + ByteVector64Tests::ADDReduceLongMasked, ByteVector64Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastLongByte64VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongByteVector64TestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6936,7 +6979,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByte64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendByteVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6950,12 +6993,12 @@ public class Byte64VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Byte64VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVector64Tests::blend); } @Test(dataProvider = "byteUnaryOpSelectFromProvider") - static void SelectFromByte64VectorTests(IntFunction fa, + static void SelectFromByteVector64Tests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); byte[] order = fs.apply(a.length, SPECIES.length()); @@ -6971,7 +7014,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorByte64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorByteVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] idx = fc.apply(SPECIES.length()); @@ -6989,7 +7032,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpSelectFromMaskProvider") - static void SelectFromByte64VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromByteVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -7008,7 +7051,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousByte64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousByteVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7019,12 +7062,12 @@ public class Byte64VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringByte64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringByteVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7038,7 +7081,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsByte64VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsByteVector64TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7047,12 +7090,12 @@ public class Byte64VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsByte64VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsByteVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7062,13 +7105,13 @@ public class Byte64VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeByte64VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeByteVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7090,7 +7133,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountByte64VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountByteVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7101,7 +7144,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte64VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ByteVector64Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7115,7 +7158,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueByte64VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueByteVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7126,7 +7169,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte64VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ByteVector64Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7140,7 +7183,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueByte64VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueByteVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7151,11 +7194,11 @@ public class Byte64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Byte64VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ByteVector64Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressByte64VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressByteVector64TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7165,7 +7208,7 @@ public class Byte64VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7183,7 +7226,7 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeByte64VectorTestsSmokeTest(int offset) { + static void indexInRangeByteVector64TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7191,13 +7234,13 @@ public class Byte64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongByte64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongByteVector64TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7205,7 +7248,7 @@ public class Byte64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7224,36 +7267,36 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundByte64VectorTestsSmokeTest(int length) { + static void loopBoundByteVector64TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongByte64VectorTestsSmokeTest(int _length) { + static void loopBoundLongByteVector64TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeByte64VectorTestsSmokeTest() { + static void ElementSizeByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Byte.SIZE); + assertEquals(elsize, Byte.SIZE); } @Test - static void VectorShapeByte64VectorTestsSmokeTest() { + static void VectorShapeByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_64_BIT)); } @Test - static void ShapeWithLanesByte64VectorTestsSmokeTest() { + static void ShapeWithLanesByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(byte.class); @@ -7261,32 +7304,32 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeByte64VectorTestsSmokeTest() { + static void ElementTypeByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementType() == byte.class); } @Test - static void SpeciesElementSizeByte64VectorTestsSmokeTest() { + static void SpeciesElementSizeByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementSize() == Byte.SIZE); } @Test - static void VectorTypeByte64VectorTestsSmokeTest() { + static void VectorTypeByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesByte64VectorTestsSmokeTest() { + static void WithLanesByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(byte.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeByte64VectorTestsSmokeTest() { + static void WithShapeByteVector64TestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7294,9 +7337,9 @@ public class Byte64VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueByte64VectorTestsSmokeTest() { + static void MaskAllTrueByteVector64TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ByteVectorMaxLoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ByteVectorMaxLoadStoreTests.java index bd5afc3f05a..93af9674906 100644 --- a/test/jdk/jdk/incubator/vector/ByteMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVectorMaxLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED - * -XX:-TieredCompilation ByteMaxVectorLoadStoreTests + * -XX:-TieredCompilation ByteVectorMaxLoadStoreTests * */ @@ -52,7 +52,7 @@ import java.util.List; import java.util.function.*; @Test -public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ByteVectorMaxLoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_MAX; @@ -68,14 +68,29 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / Max); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(byte[] r, byte[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (byte) 0, "at index #" + i); } } @@ -329,7 +344,7 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "byteProviderForIOOBE") @@ -964,11 +979,11 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -979,11 +994,11 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (byte) 0, "at index #" + j); } } @@ -999,7 +1014,7 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(byte[] r, byte[] a, int[] indexMap) { @@ -1012,7 +1027,7 @@ public class ByteMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java b/test/jdk/jdk/incubator/vector/ByteVectorMaxTests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java rename to test/jdk/jdk/incubator/vector/ByteVectorMaxTests.java index b6932785b55..c2d8188c090 100644 --- a/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/ByteVectorMaxTests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ByteVectorMaxTests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class ByteMaxVectorTests extends AbstractVectorTest { +public class ByteVectorMaxTests extends AbstractVectorTest { static final VectorSpecies SPECIES = ByteVector.SPECIES_MAX; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(byte actual, byte expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte actual, byte expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(byte actual, byte expected, byte delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(byte actual, byte expected, byte delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(byte [] actual, byte [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(byte [] actual, byte [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static VectorShape getMaxBit() { return VectorShape.S_Max_BIT; @@ -102,10 +145,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -117,13 +160,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { byte[] ref = f.apply(a[i]); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -133,10 +176,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -152,13 +195,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -174,13 +217,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -196,13 +239,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -218,13 +261,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -236,10 +279,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -251,10 +294,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -263,12 +306,12 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -279,20 +322,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (byte)0); + assertEquals(r[i + k], (byte)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -304,19 +347,19 @@ public class ByteMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (byte)0); + assertEquals(r[i + j], (byte)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (byte)0, "at index #" + idx); + assertEquals(r[idx], (byte)0, "at index #" + idx); } } } @@ -332,11 +375,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -345,12 +388,12 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -360,17 +403,17 @@ public class ByteMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -380,17 +423,17 @@ public class ByteMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (byte)0); + assertEquals(r[i+j], (byte)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (byte)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -404,10 +447,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -419,10 +462,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -434,10 +477,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -458,18 +501,18 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -484,18 +527,18 @@ public class ByteMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -503,10 +546,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -514,10 +557,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -525,10 +568,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -537,10 +580,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -553,10 +596,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -568,10 +611,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -583,10 +626,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -601,10 +644,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (byte)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -617,11 +660,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -635,11 +678,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -661,11 +704,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -679,11 +722,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -703,10 +746,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -718,10 +761,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -730,10 +773,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -743,10 +786,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -762,11 +805,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -783,11 +826,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -798,11 +841,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -819,11 +862,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -841,13 +884,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -868,13 +911,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -889,13 +932,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { byte[] ref = f.apply(r, a, i, mask, b, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -916,13 +959,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -936,13 +979,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -957,13 +1000,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -978,13 +1021,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1000,13 +1043,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { byte[] ref = f.apply(a, b, origin, part, mask, i); byte[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1019,10 +1062,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1031,10 +1074,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1042,10 +1085,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1053,10 +1096,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1335,7 +1378,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { static final List> BYTE_SHUFFLE_GENERATORS = List.of( withToStringBi("shuffle[random]", (Integer l, Integer m) -> { byte[] a = new byte[l]; - int upper = Math.min(Byte.MAX_VALUE + 1, m); + int upper = m; for (int i = 0; i < 1; i++) { a[i] = (byte)RAND.nextInt(upper); } @@ -1592,7 +1635,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ByteVector a = io.add((byte)1); //[1,2] ByteVector b = a.neg(); //[-1,-2] byte[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1607,19 +1650,19 @@ public class ByteMaxVectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ByteVector uab0 = zab0.rearrange(unz0,zab1); ByteVector uab1 = zab0.rearrange(unz1,zab1); byte[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ByteVector io = (ByteVector) SPECIES.broadcast(0).addIndex(1); ByteVector io2 = (ByteVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1634,7 +1677,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1668,7 +1711,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ADDByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1681,7 +1724,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::ADD); + assertArraysEquals(r, a, b, ByteVectorMaxTests::ADD); } static byte add(byte a, byte b) { @@ -1689,7 +1732,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void addByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void addByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1700,11 +1743,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::add); + assertArraysEquals(r, a, b, ByteVectorMaxTests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1720,11 +1763,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ADD); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void addByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1738,7 +1781,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::add); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::add); } static byte SUB(byte a, byte b) { @@ -1746,7 +1789,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void SUBByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUBByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1759,7 +1802,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::SUB); + assertArraysEquals(r, a, b, ByteVectorMaxTests::SUB); } static byte sub(byte a, byte b) { @@ -1767,7 +1810,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void subByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void subByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1778,11 +1821,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::sub); + assertArraysEquals(r, a, b, ByteVectorMaxTests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void SUBByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1798,11 +1841,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::SUB); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::SUB); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void subByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1816,7 +1859,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::sub); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::sub); } static byte MUL(byte a, byte b) { @@ -1824,7 +1867,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MULByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MULByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1837,7 +1880,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::MUL); + assertArraysEquals(r, a, b, ByteVectorMaxTests::MUL); } static byte mul(byte a, byte b) { @@ -1845,7 +1888,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void mulByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1856,11 +1899,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::mul); + assertArraysEquals(r, a, b, ByteVectorMaxTests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void MULByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1876,11 +1919,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::MUL); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::MUL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1894,7 +1937,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::mul); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::mul); } static byte DIV(byte a, byte b) { @@ -1902,7 +1945,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void DIVByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void DIVByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1917,7 +1960,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::DIV); + assertArraysEquals(r, a, b, ByteVectorMaxTests::DIV); } static byte div(byte a, byte b) { @@ -1925,7 +1968,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void divByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void divByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -1940,11 +1983,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::div); + assertArraysEquals(r, a, b, ByteVectorMaxTests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void DIVByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1962,11 +2005,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::DIV); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::DIV); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void divByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -1984,7 +2027,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::div); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::div); } static byte FIRST_NONZERO(byte a, byte b) { @@ -1992,7 +2035,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void FIRST_NONZEROByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2005,11 +2048,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ByteVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void FIRST_NONZEROByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2025,7 +2068,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::FIRST_NONZERO); } static byte AND(byte a, byte b) { @@ -2033,7 +2076,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ANDByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2046,7 +2089,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::AND); + assertArraysEquals(r, a, b, ByteVectorMaxTests::AND); } static byte and(byte a, byte b) { @@ -2054,7 +2097,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void andByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void andByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2065,11 +2108,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::and); + assertArraysEquals(r, a, b, ByteVectorMaxTests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2085,7 +2128,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::AND); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::AND); } static byte AND_NOT(byte a, byte b) { @@ -2093,7 +2136,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void AND_NOTByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2106,11 +2149,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, ByteVectorMaxTests::AND_NOT); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void AND_NOTByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2126,7 +2169,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::AND_NOT); } static byte OR(byte a, byte b) { @@ -2134,7 +2177,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ORByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2147,7 +2190,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::OR); + assertArraysEquals(r, a, b, ByteVectorMaxTests::OR); } static byte or(byte a, byte b) { @@ -2155,7 +2198,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void orByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void orByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2166,11 +2209,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::or); + assertArraysEquals(r, a, b, ByteVectorMaxTests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2186,7 +2229,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::OR); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::OR); } static byte XOR(byte a, byte b) { @@ -2194,7 +2237,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void XORByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void XORByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2207,11 +2250,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::XOR); + assertArraysEquals(r, a, b, ByteVectorMaxTests::XOR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void XORByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2227,11 +2270,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::XOR); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::XOR); } @Test(dataProvider = "byteBinaryOpProvider") - static void addByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2241,11 +2284,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::add); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void addByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2258,11 +2301,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ByteVectorMaxTests::add); } @Test(dataProvider = "byteBinaryOpProvider") - static void subByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2272,11 +2315,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::sub); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void subByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2289,11 +2332,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ByteVectorMaxTests::sub); } @Test(dataProvider = "byteBinaryOpProvider") - static void mulByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2303,11 +2346,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::mul); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void mulByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2320,11 +2363,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ByteVectorMaxTests::mul); } @Test(dataProvider = "byteBinaryOpProvider") - static void divByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2336,11 +2379,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::div); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void divByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2355,11 +2398,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ByteVectorMaxTests::div); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2369,11 +2412,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void orByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2383,11 +2426,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::or); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::or); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2400,11 +2443,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ByteVectorMaxTests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ANDByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2414,11 +2457,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void andByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2428,11 +2471,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::and); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::and); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ANDByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2445,11 +2488,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ByteVectorMaxTests::AND); } @Test(dataProvider = "byteBinaryOpProvider") - static void ORByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORByteVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2459,11 +2502,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, ByteMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ByteVectorMaxTests::OR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ORByteMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORByteVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2476,11 +2519,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, ByteMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVectorMaxTests::OR); } @Test(dataProvider = "byteBinaryOpProvider") - static void ADDByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDByteVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2490,11 +2533,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, ByteMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ByteVectorMaxTests::ADD); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ADDByteMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDByteVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2507,7 +2550,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, ByteMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVectorMaxTests::ADD); } static byte LSHL(byte a, byte b) { @@ -2515,7 +2558,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHLByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2528,11 +2571,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, ByteVectorMaxTests::LSHL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2548,7 +2591,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::LSHL); } static byte ASHR(byte a, byte b) { @@ -2556,7 +2599,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ASHRByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2569,11 +2612,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, ByteVectorMaxTests::ASHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2589,7 +2632,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::ASHR); } static byte LSHR(byte a, byte b) { @@ -2597,7 +2640,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHRByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2610,11 +2653,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, ByteVectorMaxTests::LSHR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2630,7 +2673,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::LSHR); } static byte LSHL_unary(byte a, byte b) { @@ -2638,7 +2681,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHLByteMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLByteVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2650,11 +2693,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ByteVectorMaxTests::LSHL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHLByteMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLByteVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2669,7 +2712,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVectorMaxTests::LSHL_unary); } static byte LSHR_unary(byte a, byte b) { @@ -2677,7 +2720,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void LSHRByteMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRByteVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2689,11 +2732,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ByteVectorMaxTests::LSHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void LSHRByteMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRByteVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2708,7 +2751,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVectorMaxTests::LSHR_unary); } static byte ASHR_unary(byte a, byte b) { @@ -2716,7 +2759,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ASHRByteMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRByteVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2728,11 +2771,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ByteVectorMaxTests::ASHR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ASHRByteMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRByteVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2747,7 +2790,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVectorMaxTests::ASHR_unary); } static byte ROR(byte a, byte b) { @@ -2755,7 +2798,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void RORByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2768,11 +2811,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::ROR); + assertArraysEquals(r, a, b, ByteVectorMaxTests::ROR); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2788,7 +2831,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROR); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::ROR); } static byte ROL(byte a, byte b) { @@ -2796,7 +2839,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ROLByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2809,11 +2852,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::ROL); + assertArraysEquals(r, a, b, ByteVectorMaxTests::ROL); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2829,7 +2872,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROL); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::ROL); } static byte ROR_unary(byte a, byte b) { @@ -2837,7 +2880,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void RORByteMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORByteVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2849,11 +2892,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ByteVectorMaxTests::ROR_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void RORByteMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORByteVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2868,7 +2911,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVectorMaxTests::ROR_unary); } static byte ROL_unary(byte a, byte b) { @@ -2876,7 +2919,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void ROLByteMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLByteVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2888,11 +2931,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ByteVectorMaxTests::ROL_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void ROLByteMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLByteVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -2907,14 +2950,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ByteVectorMaxTests::ROL_unary); } static byte LSHR_binary_const(byte a) { return (byte)(((a & 0xFF) >>> CONST_SHIFT)); } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHRByteMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRByteVectorMaxTestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2925,11 +2968,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ByteMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ByteVectorMaxTests::LSHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHRByteMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRByteVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2943,7 +2986,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVectorMaxTests::LSHR_binary_const); } static byte LSHL_binary_const(byte a) { @@ -2951,7 +2994,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LSHLByteMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLByteVectorMaxTestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2962,11 +3005,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ByteMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ByteVectorMaxTests::LSHL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LSHLByteMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLByteVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2980,7 +3023,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVectorMaxTests::LSHL_binary_const); } static byte ASHR_binary_const(byte a) { @@ -2988,7 +3031,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ASHRByteMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRByteVectorMaxTestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -2999,11 +3042,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ByteMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ByteVectorMaxTests::ASHR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ASHRByteMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRByteVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3017,7 +3060,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVectorMaxTests::ASHR_binary_const); } static byte ROR_binary_const(byte a) { @@ -3025,7 +3068,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void RORByteMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void RORByteVectorMaxTestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3036,11 +3079,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ByteMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ByteVectorMaxTests::ROR_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void RORByteMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORByteVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3054,7 +3097,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ByteVectorMaxTests::ROR_binary_const); } static byte ROL_binary_const(byte a) { @@ -3062,7 +3105,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ROLByteMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ROLByteVectorMaxTestsScalarShiftConst(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3073,11 +3116,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ByteMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ByteVectorMaxTests::ROL_binary_const); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ROLByteMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLByteVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3091,14 +3134,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ByteVectorMaxTests::ROL_binary_const); } static ByteVector bv_MIN = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MINByteMaxVectorTestsWithMemOp(IntFunction fa) { + static void MINByteVectorMaxTestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3109,13 +3152,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, ByteMaxVectorTests::MIN); + assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::MIN); } static ByteVector bv_min = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void minByteMaxVectorTestsWithMemOp(IntFunction fa) { + static void minByteVectorMaxTestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3126,13 +3169,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, ByteMaxVectorTests::min); + assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::min); } static ByteVector bv_MIN_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINByteMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINByteVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3145,13 +3188,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, ByteMaxVectorTests::MIN); + assertArraysEquals(r, a, (byte)10, mask, ByteVectorMaxTests::MIN); } static ByteVector bv_MAX = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void MAXByteMaxVectorTestsWithMemOp(IntFunction fa) { + static void MAXByteVectorMaxTestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3162,13 +3205,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, ByteMaxVectorTests::MAX); + assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::MAX); } static ByteVector bv_max = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpProvider") - static void maxByteMaxVectorTestsWithMemOp(IntFunction fa) { + static void maxByteVectorMaxTestsWithMemOp(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3179,13 +3222,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, ByteMaxVectorTests::max); + assertArraysEquals(r, a, (byte)10, ByteVectorMaxTests::max); } static ByteVector bv_MAX_M = ByteVector.broadcast(SPECIES, (byte)10); @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXByteMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXByteVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3198,7 +3241,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (byte)10, mask, ByteMaxVectorTests::MAX); + assertArraysEquals(r, a, (byte)10, mask, ByteVectorMaxTests::MAX); } static byte MIN(byte a, byte b) { @@ -3206,7 +3249,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MINByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3219,7 +3262,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::MIN); + assertArraysEquals(r, a, b, ByteVectorMaxTests::MIN); } static byte min(byte a, byte b) { @@ -3227,7 +3270,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void minByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void minByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3238,7 +3281,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::min); + assertArraysEquals(r, a, b, ByteVectorMaxTests::min); } static byte MAX(byte a, byte b) { @@ -3246,7 +3289,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MAXByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3259,7 +3302,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::MAX); + assertArraysEquals(r, a, b, ByteVectorMaxTests::MAX); } static byte max(byte a, byte b) { @@ -3267,7 +3310,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maxByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3278,7 +3321,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ByteMaxVectorTests::max); + assertArraysEquals(r, a, b, ByteVectorMaxTests::max); } static byte UMIN(byte a, byte b) { @@ -3286,7 +3329,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMINByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMINByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3299,11 +3342,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, ByteVectorMaxTests::UMIN); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMINByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3319,7 +3362,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::UMIN); } static byte UMAX(byte a, byte b) { @@ -3327,7 +3370,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void UMAXByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMAXByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3340,11 +3383,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, ByteVectorMaxTests::UMAX); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void UMAXByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3360,7 +3403,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::UMAX); } static byte SADD(byte a, byte b) { @@ -3368,7 +3411,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SADDByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SADDByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3381,11 +3424,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::SADD); + assertArraysEquals(r, a, b, ByteVectorMaxTests::SADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SADDByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3401,7 +3444,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::SADD); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::SADD); } static byte SSUB(byte a, byte b) { @@ -3409,7 +3452,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SSUBByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SSUBByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3422,11 +3465,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, ByteVectorMaxTests::SSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SSUBByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3442,7 +3485,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::SSUB); } static byte SUADD(byte a, byte b) { @@ -3450,7 +3493,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUADDByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUADDByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3463,11 +3506,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, ByteVectorMaxTests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUADDByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3483,7 +3526,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::SUADD); } static byte SUSUB(byte a, byte b) { @@ -3491,7 +3534,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingBinaryOpProvider") - static void SUSUBByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3504,11 +3547,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, ByteVectorMaxTests::SUSUB); } @Test(dataProvider = "byteSaturatingBinaryOpMaskProvider") - static void SUSUBByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3524,11 +3567,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::SUSUB); } @Test(dataProvider = "byteBinaryOpProvider") - static void MINByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3538,11 +3581,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::MIN); } @Test(dataProvider = "byteBinaryOpProvider") - static void minByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3552,11 +3595,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::min); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::min); } @Test(dataProvider = "byteBinaryOpProvider") - static void MAXByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3566,11 +3609,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::MAX); } @Test(dataProvider = "byteBinaryOpProvider") - static void maxByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -3580,10 +3623,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::max); + assertBroadcastArraysEquals(r, a, b, ByteVectorMaxTests::max); } @Test(dataProvider = "byteSaturatingBinaryOpAssocProvider") - static void SUADDAssocByteMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocByteVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -3600,11 +3643,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, ByteMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ByteVectorMaxTests::SUADD); } @Test(dataProvider = "byteSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -3625,7 +3668,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ByteMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ByteVectorMaxTests::SUADD); } static byte ANDReduce(byte[] a, int idx) { @@ -3647,7 +3690,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ANDReduceByteMaxVectorTests(IntFunction fa) { + static void ANDReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3663,7 +3706,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::ANDReduce, ByteMaxVectorTests::ANDReduceAll); + ByteVectorMaxTests::ANDReduce, ByteVectorMaxTests::ANDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3671,20 +3714,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = AND_IDENTITY; - Assert.assertEquals((byte) (id & id), id, + assertEquals((byte) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id & x), x); - Assert.assertEquals((byte) (x & id), x); + assertEquals((byte) (id & x), x); + assertEquals((byte) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id & x), x, + assertEquals((byte) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x & id), x, + assertEquals((byte) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3709,7 +3752,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ANDReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3727,7 +3770,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::ANDReduceMasked, ByteMaxVectorTests::ANDReduceAllMasked); + ByteVectorMaxTests::ANDReduceMasked, ByteVectorMaxTests::ANDReduceAllMasked); } static byte ORReduce(byte[] a, int idx) { @@ -3749,7 +3792,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ORReduceByteMaxVectorTests(IntFunction fa) { + static void ORReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3765,7 +3808,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::ORReduce, ByteMaxVectorTests::ORReduceAll); + ByteVectorMaxTests::ORReduce, ByteVectorMaxTests::ORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3773,20 +3816,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = OR_IDENTITY; - Assert.assertEquals((byte) (id | id), id, + assertEquals((byte) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id | x), x); - Assert.assertEquals((byte) (x | id), x); + assertEquals((byte) (id | x), x); + assertEquals((byte) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id | x), x, + assertEquals((byte) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x | id), x, + assertEquals((byte) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3811,7 +3854,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ORReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3829,7 +3872,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::ORReduceMasked, ByteMaxVectorTests::ORReduceAllMasked); + ByteVectorMaxTests::ORReduceMasked, ByteVectorMaxTests::ORReduceAllMasked); } static byte XORReduce(byte[] a, int idx) { @@ -3851,7 +3894,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void XORReduceByteMaxVectorTests(IntFunction fa) { + static void XORReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3867,7 +3910,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::XORReduce, ByteMaxVectorTests::XORReduceAll); + ByteVectorMaxTests::XORReduce, ByteVectorMaxTests::XORReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3875,20 +3918,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = XOR_IDENTITY; - Assert.assertEquals((byte) (id ^ id), id, + assertEquals((byte) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id ^ x), x); - Assert.assertEquals((byte) (x ^ id), x); + assertEquals((byte) (id ^ x), x); + assertEquals((byte) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id ^ x), x, + assertEquals((byte) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x ^ id), x, + assertEquals((byte) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3913,7 +3956,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void XORReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3931,7 +3974,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::XORReduceMasked, ByteMaxVectorTests::XORReduceAllMasked); + ByteVectorMaxTests::XORReduceMasked, ByteVectorMaxTests::XORReduceAllMasked); } static byte ADDReduce(byte[] a, int idx) { @@ -3953,7 +3996,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceByteMaxVectorTests(IntFunction fa) { + static void ADDReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -3969,7 +4012,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::ADDReduce, ByteMaxVectorTests::ADDReduceAll); + ByteVectorMaxTests::ADDReduce, ByteVectorMaxTests::ADDReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -3977,20 +4020,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = ADD_IDENTITY; - Assert.assertEquals((byte) (id + id), id, + assertEquals((byte) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id + x), x); - Assert.assertEquals((byte) (x + id), x); + assertEquals((byte) (id + x), x); + assertEquals((byte) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id + x), x, + assertEquals((byte) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x + id), x, + assertEquals((byte) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4015,7 +4058,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4033,7 +4076,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::ADDReduceMasked, ByteMaxVectorTests::ADDReduceAllMasked); + ByteVectorMaxTests::ADDReduceMasked, ByteVectorMaxTests::ADDReduceAllMasked); } static byte MULReduce(byte[] a, int idx) { @@ -4055,7 +4098,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MULReduceByteMaxVectorTests(IntFunction fa) { + static void MULReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4071,7 +4114,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::MULReduce, ByteMaxVectorTests::MULReduceAll); + ByteVectorMaxTests::MULReduce, ByteVectorMaxTests::MULReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4079,20 +4122,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MUL_IDENTITY; - Assert.assertEquals((byte) (id * id), id, + assertEquals((byte) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) (id * x), x); - Assert.assertEquals((byte) (x * id), x); + assertEquals((byte) (id * x), x); + assertEquals((byte) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) (id * x), x, + assertEquals((byte) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) (x * id), x, + assertEquals((byte) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4117,7 +4160,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MULReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4135,7 +4178,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::MULReduceMasked, ByteMaxVectorTests::MULReduceAllMasked); + ByteVectorMaxTests::MULReduceMasked, ByteVectorMaxTests::MULReduceAllMasked); } static byte MINReduce(byte[] a, int idx) { @@ -4157,7 +4200,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MINReduceByteMaxVectorTests(IntFunction fa) { + static void MINReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4173,7 +4216,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::MINReduce, ByteMaxVectorTests::MINReduceAll); + ByteVectorMaxTests::MINReduce, ByteVectorMaxTests::MINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4181,20 +4224,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MIN_IDENTITY; - Assert.assertEquals((byte) Math.min(id, id), id, + assertEquals((byte) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.min(id, x), x); - Assert.assertEquals((byte) Math.min(x, id), x); + assertEquals((byte) Math.min(id, x), x); + assertEquals((byte) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.min(id, x), x, + assertEquals((byte) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.min(x, id), x, + assertEquals((byte) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4219,7 +4262,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MINReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4237,7 +4280,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::MINReduceMasked, ByteMaxVectorTests::MINReduceAllMasked); + ByteVectorMaxTests::MINReduceMasked, ByteVectorMaxTests::MINReduceAllMasked); } static byte MAXReduce(byte[] a, int idx) { @@ -4259,7 +4302,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void MAXReduceByteMaxVectorTests(IntFunction fa) { + static void MAXReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4275,7 +4318,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::MAXReduce, ByteMaxVectorTests::MAXReduceAll); + ByteVectorMaxTests::MAXReduce, ByteVectorMaxTests::MAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4283,20 +4326,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = MAX_IDENTITY; - Assert.assertEquals((byte) Math.max(id, id), id, + assertEquals((byte) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) Math.max(id, x), x); - Assert.assertEquals((byte) Math.max(x, id), x); + assertEquals((byte) Math.max(id, x), x); + assertEquals((byte) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) Math.max(id, x), x, + assertEquals((byte) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) Math.max(x, id), x, + assertEquals((byte) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4321,7 +4364,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void MAXReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4339,7 +4382,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::MAXReduceMasked, ByteMaxVectorTests::MAXReduceAllMasked); + ByteVectorMaxTests::MAXReduceMasked, ByteVectorMaxTests::MAXReduceAllMasked); } static byte UMINReduce(byte[] a, int idx) { @@ -4361,7 +4404,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMINReduceByteMaxVectorTests(IntFunction fa) { + static void UMINReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4377,7 +4420,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::UMINReduce, ByteMaxVectorTests::UMINReduceAll); + ByteVectorMaxTests::UMINReduce, ByteVectorMaxTests::UMINReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4385,20 +4428,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMIN_IDENTITY; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, id), id, + assertEquals((byte) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x); + assertEquals((byte) VectorMath.minUnsigned(id, x), x); + assertEquals((byte) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.minUnsigned(id, x), x, + assertEquals((byte) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.minUnsigned(x, id), x, + assertEquals((byte) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4423,7 +4466,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMINReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4441,7 +4484,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::UMINReduceMasked, ByteMaxVectorTests::UMINReduceAllMasked); + ByteVectorMaxTests::UMINReduceMasked, ByteVectorMaxTests::UMINReduceAllMasked); } static byte UMAXReduce(byte[] a, int idx) { @@ -4463,7 +4506,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void UMAXReduceByteMaxVectorTests(IntFunction fa) { + static void UMAXReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4479,7 +4522,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::UMAXReduce, ByteMaxVectorTests::UMAXReduceAll); + ByteVectorMaxTests::UMAXReduce, ByteVectorMaxTests::UMAXReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4487,20 +4530,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = UMAX_IDENTITY; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, id), id, + assertEquals((byte) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x); + assertEquals((byte) VectorMath.maxUnsigned(id, x), x); + assertEquals((byte) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.maxUnsigned(id, x), x, + assertEquals((byte) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.maxUnsigned(x, id), x, + assertEquals((byte) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4525,7 +4568,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void UMAXReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4543,7 +4586,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::UMAXReduceMasked, ByteMaxVectorTests::UMAXReduceAllMasked); + ByteVectorMaxTests::UMAXReduceMasked, ByteVectorMaxTests::UMAXReduceAllMasked); } static byte FIRST_NONZEROReduce(byte[] a, int idx) { @@ -4565,7 +4608,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void FIRST_NONZEROReduceByteMaxVectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4581,7 +4624,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::FIRST_NONZEROReduce, ByteMaxVectorTests::FIRST_NONZEROReduceAll); + ByteVectorMaxTests::FIRST_NONZEROReduce, ByteVectorMaxTests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "byteUnaryOpProvider") @@ -4589,20 +4632,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4627,7 +4670,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void FIRST_NONZEROReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4645,7 +4688,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::FIRST_NONZEROReduceMasked, ByteMaxVectorTests::FIRST_NONZEROReduceAllMasked); + ByteVectorMaxTests::FIRST_NONZEROReduceMasked, ByteVectorMaxTests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4658,7 +4701,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueByteMaxVectorTests(IntFunction fm) { + static void anyTrueByteVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4669,7 +4712,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, ByteMaxVectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ByteVectorMaxTests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4682,7 +4725,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueByteMaxVectorTests(IntFunction fm) { + static void allTrueByteVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4693,7 +4736,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, ByteMaxVectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ByteVectorMaxTests::allTrue); } static byte SUADDReduce(byte[] a, int idx) { @@ -4715,7 +4758,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSaturatingUnaryOpProvider") - static void SUADDReduceByteMaxVectorTests(IntFunction fa) { + static void SUADDReduceByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -4731,7 +4774,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ByteMaxVectorTests::SUADDReduce, ByteMaxVectorTests::SUADDReduceAll); + ByteVectorMaxTests::SUADDReduce, ByteVectorMaxTests::SUADDReduceAll); } @Test(dataProvider = "byteSaturatingUnaryOpProvider") @@ -4739,20 +4782,20 @@ public class ByteMaxVectorTests extends AbstractVectorTest { byte[] a = fa.apply(SPECIES.length()); byte id = SUADD_IDENTITY; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); byte x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((byte) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4776,7 +4819,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "byteSaturatingUnaryOpMaskProvider") - static void SUADDReduceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4794,11 +4837,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::SUADDReduceMasked, ByteMaxVectorTests::SUADDReduceAllMasked); + ByteVectorMaxTests::SUADDReduceMasked, ByteVectorMaxTests::SUADDReduceAllMasked); } @Test(dataProvider = "byteBinaryOpProvider") - static void withByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void withByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -4821,7 +4864,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_DEFAULTByteMaxVectorTests(IntFunction fa) { + static void IS_DEFAULTByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4831,14 +4874,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_DEFAULTMaskedByteMaxVectorTests(IntFunction fa, + static void IS_DEFAULTMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4851,7 +4894,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4862,7 +4905,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTestOpProvider") - static void IS_NEGATIVEByteMaxVectorTests(IntFunction fa) { + static void IS_NEGATIVEByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4872,14 +4915,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteTestOpMaskProvider") - static void IS_NEGATIVEMaskedByteMaxVectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4892,14 +4935,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LTByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4911,14 +4954,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ltByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ltByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4930,14 +4973,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4953,14 +4996,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GTByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GTByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4972,14 +5015,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GTByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -4995,14 +5038,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EQByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5014,14 +5057,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void eqByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5033,14 +5076,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5056,14 +5099,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void NEByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void NEByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5075,14 +5118,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void NEByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5098,14 +5141,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LEByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LEByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5117,14 +5160,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LEByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5140,14 +5183,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void GEByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GEByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5159,14 +5202,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void GEByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5182,14 +5225,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULTByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULTByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5201,14 +5244,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULTByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5224,14 +5267,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGTByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGTByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5243,14 +5286,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGTByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5266,14 +5309,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void ULEByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULEByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5285,14 +5328,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void ULEByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5308,14 +5351,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void UGEByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGEByteVectorMaxTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5327,14 +5370,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void UGEByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5350,14 +5393,14 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5367,13 +5410,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5387,13 +5430,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void LTByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTByteVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5403,13 +5446,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void LTByteMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTByteVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5423,13 +5466,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (byte)((long)b[i]))); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5439,13 +5482,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5459,13 +5502,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "byteCompareOpProvider") - static void EQByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQByteVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5475,13 +5518,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (byte)((long)b[i])); } } } @Test(dataProvider = "byteCompareOpMaskProvider") - static void EQByteMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQByteVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5495,7 +5538,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (byte)((long)b[i]))); } } } @@ -5505,7 +5548,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByteMaxVectorTests(IntFunction fa, IntFunction fb, + static void blendByteVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5521,11 +5564,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::blend); + assertArraysEquals(r, a, b, mask, ByteVectorMaxTests::blend); } @Test(dataProvider = "byteUnaryOpShuffleProvider") - static void RearrangeByteMaxVectorTests(IntFunction fa, + static void RearrangeByteVectorMaxTests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5542,7 +5585,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpShuffleMaskProvider") - static void RearrangeByteMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeByteVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -5560,7 +5603,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void compressByteMaxVectorTests(IntFunction fa, + static void compressByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5578,7 +5621,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void expandByteMaxVectorTests(IntFunction fa, + static void expandByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5596,7 +5639,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void getByteMaxVectorTests(IntFunction fa) { + static void getByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -5752,7 +5795,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastByteMaxVectorTests(IntFunction fa) { + static void BroadcastByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5766,7 +5809,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZeroByteMaxVectorTests(IntFunction fa) { + static void ZeroByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5776,7 +5819,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static byte[] sliceUnary(byte[] a, int origin, int idx) { @@ -5791,7 +5834,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void sliceUnaryByteMaxVectorTests(IntFunction fa) { + static void sliceUnaryByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5802,7 +5845,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, ByteMaxVectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ByteVectorMaxTests::sliceUnary); } static byte[] sliceBinary(byte[] a, byte[] b, int origin, int idx) { @@ -5819,7 +5862,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void sliceBinaryByteMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryByteVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5832,7 +5875,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, ByteMaxVectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ByteVectorMaxTests::sliceBinary); } static byte[] slice(byte[] a, byte[] b, int origin, boolean[] mask, int idx) { @@ -5849,7 +5892,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void sliceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5866,7 +5909,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, ByteMaxVectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ByteVectorMaxTests::slice); } static byte[] unsliceUnary(byte[] a, int origin, int idx) { @@ -5883,7 +5926,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void unsliceUnaryByteMaxVectorTests(IntFunction fa) { + static void unsliceUnaryByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5894,7 +5937,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, ByteMaxVectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ByteVectorMaxTests::unsliceUnary); } static byte[] unsliceBinary(byte[] a, byte[] b, int origin, int part, int idx) { @@ -5920,7 +5963,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpProvider") - static void unsliceBinaryByteMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryByteVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -5934,7 +5977,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, ByteMaxVectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ByteVectorMaxTests::unsliceBinary); } static byte[] unslice(byte[] a, byte[] b, int origin, int part, boolean[] mask, int idx) { @@ -5974,7 +6017,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void unsliceByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -5991,7 +6034,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, ByteMaxVectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ByteVectorMaxTests::unslice); } static byte BITWISE_BLEND(byte a, byte b, byte c) { @@ -6003,7 +6046,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByteMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6018,11 +6061,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByteMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6035,11 +6078,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ByteVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByteMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6057,11 +6100,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6072,11 +6115,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByteMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6087,11 +6130,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6102,11 +6145,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { ByteVector bv = ByteVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ByteVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByteMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6117,11 +6160,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { ByteVector cv = ByteVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ByteVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6136,11 +6179,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByteMaxVectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVectorMaxTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void BITWISE_BLENDByteMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDByteVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6170,11 +6213,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "byteTernaryOpProvider") - static void bitwiseBlendByteMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendByteVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] c = fc.apply(SPECIES.length()); @@ -6185,11 +6228,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ByteVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "byteTernaryOpMaskProvider") - static void BITWISE_BLENDByteMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDByteVectorMaxTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6203,7 +6246,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteVectorMaxTests::BITWISE_BLEND); } static byte NEG(byte a) { @@ -6215,7 +6258,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NEGByteMaxVectorTests(IntFunction fa) { + static void NEGByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6226,11 +6269,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::NEG); + assertArraysEquals(r, a, ByteVectorMaxTests::NEG); } @Test(dataProvider = "byteUnaryOpProvider") - static void negByteMaxVectorTests(IntFunction fa) { + static void negByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6241,11 +6284,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::neg); + assertArraysEquals(r, a, ByteVectorMaxTests::neg); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NEGMaskedByteMaxVectorTests(IntFunction fa, + static void NEGMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6259,7 +6302,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::NEG); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::NEG); } static byte ABS(byte a) { @@ -6271,7 +6314,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ABSByteMaxVectorTests(IntFunction fa) { + static void ABSByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6282,11 +6325,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::ABS); + assertArraysEquals(r, a, ByteVectorMaxTests::ABS); } @Test(dataProvider = "byteUnaryOpProvider") - static void absByteMaxVectorTests(IntFunction fa) { + static void absByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6297,11 +6340,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::abs); + assertArraysEquals(r, a, ByteVectorMaxTests::abs); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ABSMaskedByteMaxVectorTests(IntFunction fa, + static void ABSMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6315,7 +6358,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::ABS); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::ABS); } static byte NOT(byte a) { @@ -6327,7 +6370,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void NOTByteMaxVectorTests(IntFunction fa) { + static void NOTByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6338,11 +6381,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::NOT); + assertArraysEquals(r, a, ByteVectorMaxTests::NOT); } @Test(dataProvider = "byteUnaryOpProvider") - static void notByteMaxVectorTests(IntFunction fa) { + static void notByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6353,11 +6396,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::not); + assertArraysEquals(r, a, ByteVectorMaxTests::not); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void NOTMaskedByteMaxVectorTests(IntFunction fa, + static void NOTMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6371,7 +6414,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::NOT); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::NOT); } static byte ZOMO(byte a) { @@ -6379,7 +6422,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ZOMOByteMaxVectorTests(IntFunction fa) { + static void ZOMOByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6390,11 +6433,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::ZOMO); + assertArraysEquals(r, a, ByteVectorMaxTests::ZOMO); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ZOMOMaskedByteMaxVectorTests(IntFunction fa, + static void ZOMOMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6408,7 +6451,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::ZOMO); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::ZOMO); } static byte BIT_COUNT(byte a) { @@ -6416,7 +6459,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void BIT_COUNTByteMaxVectorTests(IntFunction fa) { + static void BIT_COUNTByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6427,11 +6470,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, ByteVectorMaxTests::BIT_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void BIT_COUNTMaskedByteMaxVectorTests(IntFunction fa, + static void BIT_COUNTMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6445,7 +6488,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::BIT_COUNT); } static byte TRAILING_ZEROS_COUNT(byte a) { @@ -6453,7 +6496,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void TRAILING_ZEROS_COUNTByteMaxVectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6464,11 +6507,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVectorMaxTests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedByteMaxVectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6482,7 +6525,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::TRAILING_ZEROS_COUNT); } static byte LEADING_ZEROS_COUNT(byte a) { @@ -6490,7 +6533,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void LEADING_ZEROS_COUNTByteMaxVectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6501,11 +6544,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ByteVectorMaxTests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedByteMaxVectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6519,7 +6562,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::LEADING_ZEROS_COUNT); } static byte REVERSE(byte a) { @@ -6527,7 +6570,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSEByteMaxVectorTests(IntFunction fa) { + static void REVERSEByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6538,11 +6581,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::REVERSE); + assertArraysEquals(r, a, ByteVectorMaxTests::REVERSE); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSEMaskedByteMaxVectorTests(IntFunction fa, + static void REVERSEMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6556,7 +6599,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::REVERSE); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::REVERSE); } static byte REVERSE_BYTES(byte a) { @@ -6564,7 +6607,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void REVERSE_BYTESByteMaxVectorTests(IntFunction fa) { + static void REVERSE_BYTESByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6575,11 +6618,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ByteVectorMaxTests::REVERSE_BYTES); } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedByteMaxVectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedByteVectorMaxTests(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -6593,7 +6636,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ByteMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ByteVectorMaxTests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6601,7 +6644,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandByteVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6614,7 +6657,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::band); + assertArraysEquals(r, a, b, ByteVectorMaxTests::band); } static boolean bor(boolean a, boolean b) { @@ -6622,7 +6665,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskorByteVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6635,7 +6678,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::bor); + assertArraysEquals(r, a, b, ByteVectorMaxTests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6643,7 +6686,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskxorByteVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6656,7 +6699,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::bxor); + assertArraysEquals(r, a, b, ByteVectorMaxTests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6664,7 +6707,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotByteVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6677,7 +6720,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::bandNot); + assertArraysEquals(r, a, b, ByteVectorMaxTests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6685,7 +6728,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskeqByteVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6698,7 +6741,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ByteMaxVectorTests::beq); + assertArraysEquals(r, a, b, ByteVectorMaxTests::beq); } static boolean unot(boolean a) { @@ -6706,7 +6749,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotByteMaxVectorTests(IntFunction fa) { + static void masknotByteVectorMaxTests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6717,7 +6760,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ByteMaxVectorTests::unot); + assertArraysEquals(r, a, ByteVectorMaxTests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6726,15 +6769,15 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongByteMaxVectorTests(IntFunction fa) { + static void maskFromToLongByteVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6748,7 +6791,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteCompareOpProvider") - static void ltByteMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltByteVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6758,13 +6801,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "byteCompareOpProvider") - static void eqByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqByteVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6774,13 +6817,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "byteUnaryOpProvider") - static void toIntArrayByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6791,7 +6834,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toLongArrayByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6802,7 +6845,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toDoubleArrayByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6813,7 +6856,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void toStringByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void toStringByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6826,7 +6869,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void hashCodeByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void hashCodeByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6840,7 +6883,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void reinterpretAsBytesByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void reinterpretAsBytesByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6870,7 +6913,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpProvider") - static void ADDReduceLongByteMaxVectorTests(IntFunction fa) { + static void ADDReduceLongByteVectorMaxTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6886,7 +6929,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - ByteMaxVectorTests::ADDReduceLong, ByteMaxVectorTests::ADDReduceAllLong); + ByteVectorMaxTests::ADDReduceLong, ByteVectorMaxTests::ADDReduceAllLong); } static long ADDReduceLongMasked(byte[] a, int idx, boolean[] mask) { @@ -6909,7 +6952,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpMaskProvider") - static void ADDReduceLongByteMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongByteVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6927,11 +6970,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - ByteMaxVectorTests::ADDReduceLongMasked, ByteMaxVectorTests::ADDReduceAllLongMasked); + ByteVectorMaxTests::ADDReduceLongMasked, ByteVectorMaxTests::ADDReduceAllLongMasked); } @Test(dataProvider = "byteUnaryOpProvider") - static void BroadcastLongByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongByteVectorMaxTestsSmokeTest(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = new byte[a.length]; @@ -6942,7 +6985,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void blendByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendByteVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -6956,12 +6999,12 @@ public class ByteMaxVectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, ByteMaxVectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ByteVectorMaxTests::blend); } @Test(dataProvider = "byteUnaryOpSelectFromProvider") - static void SelectFromByteMaxVectorTests(IntFunction fa, + static void SelectFromByteVectorMaxTests(IntFunction fa, BiFunction fs) { byte[] a = fa.apply(SPECIES.length()); byte[] order = fs.apply(a.length, SPECIES.length()); @@ -6977,7 +7020,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorByteMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorByteVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] idx = fc.apply(SPECIES.length()); @@ -6995,7 +7038,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "byteUnaryOpSelectFromMaskProvider") - static void SelectFromByteMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromByteVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); @@ -7014,7 +7057,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousByteMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousByteVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7025,12 +7068,12 @@ public class ByteMaxVectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringByteMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringByteVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7044,7 +7087,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsByteMaxVectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsByteVectorMaxTestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7053,12 +7096,12 @@ public class ByteMaxVectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsByteMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsByteVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7068,13 +7111,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeByteVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7096,7 +7139,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountByteVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7107,7 +7150,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, ByteMaxVectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ByteVectorMaxTests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7121,7 +7164,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueByteVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7132,7 +7175,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, ByteMaxVectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ByteVectorMaxTests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7146,7 +7189,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueByteVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7157,11 +7200,11 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, ByteMaxVectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ByteVectorMaxTests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressByteMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskCompressByteVectorMaxTestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7171,7 +7214,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7189,7 +7232,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeByteMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeByteVectorMaxTestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7197,13 +7240,13 @@ public class ByteMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongByteMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongByteVectorMaxTestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7211,7 +7254,7 @@ public class ByteMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7230,36 +7273,36 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundByteMaxVectorTestsSmokeTest(int length) { + static void loopBoundByteVectorMaxTestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongByteMaxVectorTestsSmokeTest(int _length) { + static void loopBoundLongByteVectorMaxTestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeByteMaxVectorTestsSmokeTest() { + static void ElementSizeByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Byte.SIZE); + assertEquals(elsize, Byte.SIZE); } @Test - static void VectorShapeByteMaxVectorTestsSmokeTest() { + static void VectorShapeByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_Max_BIT)); } @Test - static void ShapeWithLanesByteMaxVectorTestsSmokeTest() { + static void ShapeWithLanesByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(byte.class); @@ -7267,32 +7310,32 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test - static void ElementTypeByteMaxVectorTestsSmokeTest() { + static void ElementTypeByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementType() == byte.class); } @Test - static void SpeciesElementSizeByteMaxVectorTestsSmokeTest() { + static void SpeciesElementSizeByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().elementSize() == Byte.SIZE); } @Test - static void VectorTypeByteMaxVectorTestsSmokeTest() { + static void VectorTypeByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesByteMaxVectorTestsSmokeTest() { + static void WithLanesByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(byte.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeByteMaxVectorTestsSmokeTest() { + static void WithShapeByteVectorMaxTestsSmokeTest() { ByteVector av = ByteVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7300,9 +7343,9 @@ public class ByteMaxVectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueByteMaxVectorTestsSmokeTest() { + static void MaskAllTrueByteVectorMaxTestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleVector128LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector128LoadStoreTests.java index fed75349f68..68349a6afd9 100644 --- a/test/jdk/jdk/incubator/vector/Double128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector128LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Double128VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation DoubleVector128LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class DoubleVector128LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_128; @@ -61,14 +61,29 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(double[] r, double[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "doubleProviderForIOOBE") @@ -870,11 +885,11 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(double[] r, double[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Double128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Double128VectorTests.java b/test/jdk/jdk/incubator/vector/DoubleVector128Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Double128VectorTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector128Tests.java index 1d4cadd2158..7b4b587b142 100644 --- a/test/jdk/jdk/incubator/vector/Double128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector128Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleVector128Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Double128VectorTests extends AbstractVectorTest { +public class DoubleVector128Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_128; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(double actual, double expected, double delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(double actual, double expected, double delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final double ADD_IDENTITY = (double)0; @@ -95,10 +132,10 @@ public class Double128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +147,13 @@ public class Double128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { double[] ref = f.apply(a[i]); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +163,10 @@ public class Double128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +188,13 @@ public class Double128VectorTests extends AbstractVectorTest { double relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +216,14 @@ public class Double128VectorTests extends AbstractVectorTest { double relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +239,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +261,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +279,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +294,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +306,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +322,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (double)0); + assertEquals(r[i + k], (double)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -310,19 +347,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (double)0); + assertEquals(r[i + j], (double)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -338,11 +375,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +388,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +403,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +423,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +447,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +462,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +477,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +501,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +527,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +546,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +557,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +568,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +580,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +596,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +611,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +626,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +644,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +660,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +678,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +704,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +722,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +746,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +761,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +773,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +786,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +805,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +826,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +841,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +862,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +958,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +985,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1006,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(r, a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1033,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1053,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1074,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1095,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1117,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1169,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1215,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1584,7 +1621,7 @@ relativeError)); // Do some zipping and shuffling. DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); DoubleVector a = io.add((double)1); //[1,2] DoubleVector b = a.neg(); //[-1,-2] double[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1599,19 +1636,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); DoubleVector uab0 = zab0.rearrange(unz0,zab1); DoubleVector uab1 = zab0.rearrange(unz1,zab1); double[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,15 +1665,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static double ADD(double a, double b) { @@ -1644,7 +1681,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1657,7 +1694,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::ADD); + assertArraysEquals(r, a, b, DoubleVector128Tests::ADD); } static double add(double a, double b) { @@ -1665,7 +1702,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void addDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1676,11 +1713,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double128VectorTests::add); + assertArraysEquals(r, a, b, DoubleVector128Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1696,11 +1733,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double128VectorTests::ADD); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1714,7 +1751,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double128VectorTests::add); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::add); } static double SUB(double a, double b) { @@ -1722,7 +1759,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void SUBDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void SUBDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1735,7 +1772,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::SUB); + assertArraysEquals(r, a, b, DoubleVector128Tests::SUB); } static double sub(double a, double b) { @@ -1743,7 +1780,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void subDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1754,11 +1791,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double128VectorTests::sub); + assertArraysEquals(r, a, b, DoubleVector128Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void SUBDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1774,11 +1811,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double128VectorTests::SUB); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::SUB); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1792,7 +1829,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double128VectorTests::sub); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::sub); } static double MUL(double a, double b) { @@ -1800,7 +1837,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MULDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void MULDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1813,7 +1850,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::MUL); + assertArraysEquals(r, a, b, DoubleVector128Tests::MUL); } static double mul(double a, double b) { @@ -1821,7 +1858,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void mulDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1832,11 +1869,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double128VectorTests::mul); + assertArraysEquals(r, a, b, DoubleVector128Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void MULDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1852,11 +1889,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double128VectorTests::MUL); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::MUL); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1870,7 +1907,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double128VectorTests::mul); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::mul); } static double DIV(double a, double b) { @@ -1878,7 +1915,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void DIVDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void DIVDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1891,7 +1928,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::DIV); + assertArraysEquals(r, a, b, DoubleVector128Tests::DIV); } static double div(double a, double b) { @@ -1899,7 +1936,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void divDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1910,11 +1947,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double128VectorTests::div); + assertArraysEquals(r, a, b, DoubleVector128Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void DIVDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1930,11 +1967,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double128VectorTests::DIV); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::DIV); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1948,7 +1985,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double128VectorTests::div); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::div); } static double FIRST_NONZERO(double a, double b) { @@ -1956,7 +1993,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void FIRST_NONZERODouble128VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZERODoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1969,11 +2006,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, DoubleVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void FIRST_NONZERODouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZERODoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1989,11 +2026,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2003,11 +2040,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2020,11 +2057,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector128Tests::add); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2034,11 +2071,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2051,11 +2088,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector128Tests::sub); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2065,11 +2102,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2082,11 +2119,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector128Tests::mul); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2096,11 +2133,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2113,11 +2150,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector128Tests::div); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2127,11 +2164,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Double128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, DoubleVector128Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDDoubleVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2144,13 +2181,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Double128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector128Tests::ADD); } static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MINDouble128VectorTestsWithMemOp(IntFunction fa) { + static void MINDoubleVector128TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2161,13 +2198,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double128VectorTests::MIN); + assertArraysEquals(r, a, (double)10, DoubleVector128Tests::MIN); } static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void minDouble128VectorTestsWithMemOp(IntFunction fa) { + static void minDoubleVector128TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2178,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double128VectorTests::min); + assertArraysEquals(r, a, (double)10, DoubleVector128Tests::min); } static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINDouble128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINDoubleVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2197,13 +2234,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double128VectorTests::MIN); + assertArraysEquals(r, a, (double)10, mask, DoubleVector128Tests::MIN); } static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXDouble128VectorTestsWithMemOp(IntFunction fa) { + static void MAXDoubleVector128TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2214,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double128VectorTests::MAX); + assertArraysEquals(r, a, (double)10, DoubleVector128Tests::MAX); } static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void maxDouble128VectorTestsWithMemOp(IntFunction fa) { + static void maxDoubleVector128TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2231,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double128VectorTests::max); + assertArraysEquals(r, a, (double)10, DoubleVector128Tests::max); } static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXDouble128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXDoubleVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2250,7 +2287,7 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double128VectorTests::MAX); + assertArraysEquals(r, a, (double)10, mask, DoubleVector128Tests::MAX); } static double MIN(double a, double b) { @@ -2258,7 +2295,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void MINDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2271,7 +2308,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::MIN); + assertArraysEquals(r, a, b, DoubleVector128Tests::MIN); } static double min(double a, double b) { @@ -2279,7 +2316,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void minDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2290,7 +2327,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double128VectorTests::min); + assertArraysEquals(r, a, b, DoubleVector128Tests::min); } static double MAX(double a, double b) { @@ -2298,7 +2335,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2311,7 +2348,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::MAX); + assertArraysEquals(r, a, b, DoubleVector128Tests::MAX); } static double max(double a, double b) { @@ -2319,7 +2356,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maxDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2367,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double128VectorTests::max); + assertArraysEquals(r, a, b, DoubleVector128Tests::max); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2344,11 +2381,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::MIN); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2358,11 +2395,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::min); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::min); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2372,11 +2409,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::MAX); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2386,7 +2423,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double128VectorTests::max); + assertBroadcastArraysEquals(r, a, b, DoubleVector128Tests::max); } static double ADDReduce(double[] a, int idx) { @@ -2408,7 +2445,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceDouble128VectorTests(IntFunction fa) { + static void ADDReduceDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2424,7 +2461,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double128VectorTests::ADDReduce, Double128VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector128Tests::ADDReduce, DoubleVector128Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2432,20 +2469,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = ADD_IDENTITY; - Assert.assertEquals((double) (id + id), id, + assertEquals((double) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id + x), x); - Assert.assertEquals((double) (x + id), x); + assertEquals((double) (id + x), x); + assertEquals((double) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id + x), x, + assertEquals((double) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x + id), x, + assertEquals((double) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2470,7 +2507,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceDouble128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceDoubleVector128TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2488,7 +2525,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double128VectorTests::ADDReduceMasked, Double128VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector128Tests::ADDReduceMasked, DoubleVector128Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static double MULReduce(double[] a, int idx) { @@ -2510,7 +2547,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MULReduceDouble128VectorTests(IntFunction fa) { + static void MULReduceDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2526,7 +2563,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double128VectorTests::MULReduce, Double128VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector128Tests::MULReduce, DoubleVector128Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2534,20 +2571,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MUL_IDENTITY; - Assert.assertEquals((double) (id * id), id, + assertEquals((double) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id * x), x); - Assert.assertEquals((double) (x * id), x); + assertEquals((double) (id * x), x); + assertEquals((double) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id * x), x, + assertEquals((double) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x * id), x, + assertEquals((double) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2572,7 +2609,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MULReduceDouble128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceDoubleVector128TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2590,7 +2627,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double128VectorTests::MULReduceMasked, Double128VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector128Tests::MULReduceMasked, DoubleVector128Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static double MINReduce(double[] a, int idx) { @@ -2612,7 +2649,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MINReduceDouble128VectorTests(IntFunction fa) { + static void MINReduceDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2628,7 +2665,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double128VectorTests::MINReduce, Double128VectorTests::MINReduceAll); + DoubleVector128Tests::MINReduce, DoubleVector128Tests::MINReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2636,20 +2673,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MIN_IDENTITY; - Assert.assertEquals((double) Math.min(id, id), id, + assertEquals((double) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.min(id, x), x); - Assert.assertEquals((double) Math.min(x, id), x); + assertEquals((double) Math.min(id, x), x); + assertEquals((double) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.min(id, x), x, + assertEquals((double) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.min(x, id), x, + assertEquals((double) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2674,7 +2711,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINReduceDouble128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceDoubleVector128TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2692,7 +2729,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double128VectorTests::MINReduceMasked, Double128VectorTests::MINReduceAllMasked); + DoubleVector128Tests::MINReduceMasked, DoubleVector128Tests::MINReduceAllMasked); } static double MAXReduce(double[] a, int idx) { @@ -2714,7 +2751,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXReduceDouble128VectorTests(IntFunction fa) { + static void MAXReduceDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2730,7 +2767,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double128VectorTests::MAXReduce, Double128VectorTests::MAXReduceAll); + DoubleVector128Tests::MAXReduce, DoubleVector128Tests::MAXReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2738,20 +2775,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MAX_IDENTITY; - Assert.assertEquals((double) Math.max(id, id), id, + assertEquals((double) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.max(id, x), x); - Assert.assertEquals((double) Math.max(x, id), x); + assertEquals((double) Math.max(id, x), x); + assertEquals((double) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.max(id, x), x, + assertEquals((double) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.max(x, id), x, + assertEquals((double) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2776,7 +2813,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXReduceDouble128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceDoubleVector128TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2794,7 +2831,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double128VectorTests::MAXReduceMasked, Double128VectorTests::MAXReduceAllMasked); + DoubleVector128Tests::MAXReduceMasked, DoubleVector128Tests::MAXReduceAllMasked); } static double FIRST_NONZEROReduce(double[] a, int idx) { @@ -2816,7 +2853,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void FIRST_NONZEROReduceDouble128VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2832,7 +2869,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double128VectorTests::FIRST_NONZEROReduce, Double128VectorTests::FIRST_NONZEROReduceAll); + DoubleVector128Tests::FIRST_NONZEROReduce, DoubleVector128Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2840,20 +2877,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2878,7 +2915,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void FIRST_NONZEROReduceDouble128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceDoubleVector128TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2896,11 +2933,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double128VectorTests::FIRST_NONZEROReduceMasked, Double128VectorTests::FIRST_NONZEROReduceAllMasked); + DoubleVector128Tests::FIRST_NONZEROReduceMasked, DoubleVector128Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "doubleBinaryOpProvider") - static void withDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void withDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2923,7 +2960,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_DEFAULTDouble128VectorTests(IntFunction fa) { + static void IS_DEFAULTDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2933,14 +2970,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_DEFAULTMaskedDouble128VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2953,7 +2990,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2964,7 +3001,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NEGATIVEDouble128VectorTests(IntFunction fa) { + static void IS_NEGATIVEDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2974,14 +3011,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NEGATIVEMaskedDouble128VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2994,7 +3031,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3005,7 +3042,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_FINITEDouble128VectorTests(IntFunction fa) { + static void IS_FINITEDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3015,14 +3052,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_FINITEMaskedDouble128VectorTests(IntFunction fa, + static void IS_FINITEMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3035,7 +3072,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3046,7 +3083,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NANDouble128VectorTests(IntFunction fa) { + static void IS_NANDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3056,14 +3093,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NANMaskedDouble128VectorTests(IntFunction fa, + static void IS_NANMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3076,7 +3113,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3087,7 +3124,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_INFINITEDouble128VectorTests(IntFunction fa) { + static void IS_INFINITEDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3097,14 +3134,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_INFINITEMaskedDouble128VectorTests(IntFunction fa, + static void IS_INFINITEMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3117,14 +3154,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void LTDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3136,14 +3173,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void ltDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3155,14 +3192,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3178,14 +3215,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GTDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void GTDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3197,14 +3234,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GTDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3220,14 +3257,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void EQDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3239,14 +3276,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void eqDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3258,14 +3295,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3281,14 +3318,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void NEDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void NEDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3300,14 +3337,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void NEDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3323,14 +3360,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LEDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void LEDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3342,14 +3379,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LEDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3365,14 +3402,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GEDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void GEDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3384,14 +3421,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GEDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3407,14 +3444,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3424,13 +3461,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3444,13 +3481,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3460,13 +3497,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3480,13 +3517,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3496,13 +3533,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3516,13 +3553,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3532,13 +3569,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3552,7 +3589,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); } } } @@ -3562,7 +3599,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble128VectorTests(IntFunction fa, IntFunction fb, + static void blendDoubleVector128Tests(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3578,11 +3615,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double128VectorTests::blend); + assertArraysEquals(r, a, b, mask, DoubleVector128Tests::blend); } @Test(dataProvider = "doubleUnaryOpShuffleProvider") - static void RearrangeDouble128VectorTests(IntFunction fa, + static void RearrangeDoubleVector128Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3599,7 +3636,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpShuffleMaskProvider") - static void RearrangeDouble128VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeDoubleVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -3617,7 +3654,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void compressDouble128VectorTests(IntFunction fa, + static void compressDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3635,7 +3672,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void expandDouble128VectorTests(IntFunction fa, + static void expandDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3653,7 +3690,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void getDouble128VectorTests(IntFunction fa) { + static void getDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3809,7 +3846,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void BroadcastDouble128VectorTests(IntFunction fa) { + static void BroadcastDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3823,7 +3860,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ZeroDouble128VectorTests(IntFunction fa) { + static void ZeroDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3833,7 +3870,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static double[] sliceUnary(double[] a, int origin, int idx) { @@ -3848,7 +3885,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sliceUnaryDouble128VectorTests(IntFunction fa) { + static void sliceUnaryDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3859,7 +3896,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double128VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, DoubleVector128Tests::sliceUnary); } static double[] sliceBinary(double[] a, double[] b, int origin, int idx) { @@ -3876,7 +3913,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void sliceBinaryDouble128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryDoubleVector128TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3889,7 +3926,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Double128VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, DoubleVector128Tests::sliceBinary); } static double[] slice(double[] a, double[] b, int origin, boolean[] mask, int idx) { @@ -3906,7 +3943,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void sliceDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3923,7 +3960,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Double128VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, DoubleVector128Tests::slice); } static double[] unsliceUnary(double[] a, int origin, int idx) { @@ -3940,7 +3977,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void unsliceUnaryDouble128VectorTests(IntFunction fa) { + static void unsliceUnaryDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3951,7 +3988,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double128VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, DoubleVector128Tests::unsliceUnary); } static double[] unsliceBinary(double[] a, double[] b, int origin, int part, int idx) { @@ -3977,7 +4014,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void unsliceBinaryDouble128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryDoubleVector128TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3991,7 +4028,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Double128VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, DoubleVector128Tests::unsliceBinary); } static double[] unslice(double[] a, double[] b, int origin, int part, boolean[] mask, int idx) { @@ -4031,7 +4068,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void unsliceDouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceDoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4048,7 +4085,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Double128VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, DoubleVector128Tests::unslice); } static double SIN(double a) { @@ -4060,7 +4097,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINDouble128VectorTests(IntFunction fa) { + static void SINDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4071,7 +4108,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::SIN, Double128VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::SIN, DoubleVector128Tests::strictSIN); } static double EXP(double a) { @@ -4083,7 +4120,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPDouble128VectorTests(IntFunction fa) { + static void EXPDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4094,7 +4131,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::EXP, Double128VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::EXP, DoubleVector128Tests::strictEXP); } static double LOG1P(double a) { @@ -4106,7 +4143,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG1PDouble128VectorTests(IntFunction fa) { + static void LOG1PDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4117,7 +4154,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::LOG1P, Double128VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::LOG1P, DoubleVector128Tests::strictLOG1P); } static double LOG(double a) { @@ -4129,7 +4166,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOGDouble128VectorTests(IntFunction fa) { + static void LOGDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4140,7 +4177,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::LOG, Double128VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::LOG, DoubleVector128Tests::strictLOG); } static double LOG10(double a) { @@ -4152,7 +4189,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG10Double128VectorTests(IntFunction fa) { + static void LOG10DoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4163,7 +4200,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::LOG10, Double128VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::LOG10, DoubleVector128Tests::strictLOG10); } static double EXPM1(double a) { @@ -4175,7 +4212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPM1Double128VectorTests(IntFunction fa) { + static void EXPM1DoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4186,7 +4223,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::EXPM1, Double128VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::EXPM1, DoubleVector128Tests::strictEXPM1); } static double COS(double a) { @@ -4198,7 +4235,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSDouble128VectorTests(IntFunction fa) { + static void COSDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4209,7 +4246,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::COS, Double128VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::COS, DoubleVector128Tests::strictCOS); } static double TAN(double a) { @@ -4221,7 +4258,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANDouble128VectorTests(IntFunction fa) { + static void TANDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4232,7 +4269,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::TAN, Double128VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::TAN, DoubleVector128Tests::strictTAN); } static double SINH(double a) { @@ -4244,7 +4281,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINHDouble128VectorTests(IntFunction fa) { + static void SINHDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4255,7 +4292,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::SINH, Double128VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::SINH, DoubleVector128Tests::strictSINH); } static double COSH(double a) { @@ -4267,7 +4304,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSHDouble128VectorTests(IntFunction fa) { + static void COSHDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4278,7 +4315,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::COSH, Double128VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::COSH, DoubleVector128Tests::strictCOSH); } static double TANH(double a) { @@ -4290,7 +4327,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANHDouble128VectorTests(IntFunction fa) { + static void TANHDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4301,7 +4338,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::TANH, Double128VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::TANH, DoubleVector128Tests::strictTANH); } static double ASIN(double a) { @@ -4313,7 +4350,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ASINDouble128VectorTests(IntFunction fa) { + static void ASINDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4324,7 +4361,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::ASIN, Double128VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::ASIN, DoubleVector128Tests::strictASIN); } static double ACOS(double a) { @@ -4336,7 +4373,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ACOSDouble128VectorTests(IntFunction fa) { + static void ACOSDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4347,7 +4384,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::ACOS, Double128VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::ACOS, DoubleVector128Tests::strictACOS); } static double ATAN(double a) { @@ -4359,7 +4396,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ATANDouble128VectorTests(IntFunction fa) { + static void ATANDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4370,7 +4407,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::ATAN, Double128VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::ATAN, DoubleVector128Tests::strictATAN); } static double CBRT(double a) { @@ -4382,7 +4419,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void CBRTDouble128VectorTests(IntFunction fa) { + static void CBRTDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4393,7 +4430,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::CBRT, Double128VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector128Tests::CBRT, DoubleVector128Tests::strictCBRT); } static double HYPOT(double a, double b) { @@ -4405,7 +4442,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void HYPOTDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4418,7 +4455,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::HYPOT, Double128VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector128Tests::HYPOT, DoubleVector128Tests::strictHYPOT); } @@ -4431,7 +4468,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void POWDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4444,7 +4481,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::POW, Double128VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector128Tests::POW, DoubleVector128Tests::strictPOW); } @@ -4457,7 +4494,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void powDoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4470,7 +4507,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::pow, Double128VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector128Tests::pow, DoubleVector128Tests::strictpow); } @@ -4483,7 +4520,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ATAN2Double128VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2DoubleVector128Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4496,12 +4533,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::ATAN2, Double128VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector128Tests::ATAN2, DoubleVector128Tests::strictATAN2); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4511,12 +4548,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::POW, Double128VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector128Tests::POW, DoubleVector128Tests::strictPOW); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4526,7 +4563,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::pow, Double128VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector128Tests::pow, DoubleVector128Tests::strictpow); } @@ -4539,7 +4576,7 @@ relativeError)); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4561,11 +4598,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Double128VectorTests::FMA); + assertArraysEquals(r, a, b, c, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4585,11 +4622,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Double128VectorTests::fma); + assertArraysEquals(r, a, b, c, DoubleVector128Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMADoubleVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4614,11 +4651,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4629,11 +4666,11 @@ relativeError)); DoubleVector bv = DoubleVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Double128VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4644,11 +4681,11 @@ relativeError)); DoubleVector cv = DoubleVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Double128VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4663,11 +4700,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble128VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector128TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4682,11 +4719,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4704,11 +4741,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double128VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector128Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4726,11 +4763,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double128VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector128Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector128TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4751,7 +4788,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, DoubleVector128Tests::FMA); } static double NEG(double a) { @@ -4763,7 +4800,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void NEGDouble128VectorTests(IntFunction fa) { + static void NEGDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4774,11 +4811,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::NEG); + assertArraysEquals(r, a, DoubleVector128Tests::NEG); } @Test(dataProvider = "doubleUnaryOpProvider") - static void negDouble128VectorTests(IntFunction fa) { + static void negDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4789,11 +4826,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::neg); + assertArraysEquals(r, a, DoubleVector128Tests::neg); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void NEGMaskedDouble128VectorTests(IntFunction fa, + static void NEGMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4807,7 +4844,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double128VectorTests::NEG); + assertArraysEquals(r, a, mask, DoubleVector128Tests::NEG); } static double ABS(double a) { @@ -4819,7 +4856,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ABSDouble128VectorTests(IntFunction fa) { + static void ABSDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4830,11 +4867,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::ABS); + assertArraysEquals(r, a, DoubleVector128Tests::ABS); } @Test(dataProvider = "doubleUnaryOpProvider") - static void absDouble128VectorTests(IntFunction fa) { + static void absDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4845,11 +4882,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::abs); + assertArraysEquals(r, a, DoubleVector128Tests::abs); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ABSMaskedDouble128VectorTests(IntFunction fa, + static void ABSMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4863,7 +4900,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double128VectorTests::ABS); + assertArraysEquals(r, a, mask, DoubleVector128Tests::ABS); } static double SQRT(double a) { @@ -4875,7 +4912,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SQRTDouble128VectorTests(IntFunction fa) { + static void SQRTDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4886,11 +4923,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::SQRT); + assertArraysEquals(r, a, DoubleVector128Tests::SQRT); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sqrtDouble128VectorTests(IntFunction fa) { + static void sqrtDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4901,11 +4938,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::sqrt); + assertArraysEquals(r, a, DoubleVector128Tests::sqrt); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void SQRTMaskedDouble128VectorTests(IntFunction fa, + static void SQRTMaskedDoubleVector128Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4919,7 +4956,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double128VectorTests::SQRT); + assertArraysEquals(r, a, mask, DoubleVector128Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4927,7 +4964,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandDoubleVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4940,7 +4977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::band); + assertArraysEquals(r, a, b, DoubleVector128Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4948,7 +4985,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maskorDoubleVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4961,7 +4998,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::bor); + assertArraysEquals(r, a, b, DoubleVector128Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4969,7 +5006,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorDoubleVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4982,7 +5019,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::bxor); + assertArraysEquals(r, a, b, DoubleVector128Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4990,7 +5027,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotDoubleVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5003,7 +5040,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::bandNot); + assertArraysEquals(r, a, b, DoubleVector128Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -5011,7 +5048,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqDoubleVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5024,7 +5061,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double128VectorTests::beq); + assertArraysEquals(r, a, b, DoubleVector128Tests::beq); } static boolean unot(boolean a) { @@ -5032,7 +5069,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotDouble128VectorTests(IntFunction fa) { + static void masknotDoubleVector128Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5043,7 +5080,7 @@ relativeError)); } } - assertArraysEquals(r, a, Double128VectorTests::unot); + assertArraysEquals(r, a, DoubleVector128Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5052,15 +5089,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongDouble128VectorTests(IntFunction fa) { + static void maskFromToLongDoubleVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5074,7 +5111,7 @@ relativeError)); } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltDoubleVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5084,13 +5121,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqDoubleVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5100,13 +5137,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubletoIntUnaryOpProvider") - static void toIntArrayDouble128VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayDoubleVector128TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5117,7 +5154,7 @@ relativeError)); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void toLongArrayDouble128VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayDoubleVector128TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5129,7 +5166,7 @@ relativeError)); @Test(dataProvider = "doubleUnaryOpProvider") - static void toStringDouble128VectorTestsSmokeTest(IntFunction fa) { + static void toStringDoubleVector128TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5142,7 +5179,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void hashCodeDouble128VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeDoubleVector128TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5175,7 +5212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceLongDouble128VectorTests(IntFunction fa) { + static void ADDReduceLongDoubleVector128Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5191,7 +5228,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Double128VectorTests::ADDReduceLong, Double128VectorTests::ADDReduceAllLong); + DoubleVector128Tests::ADDReduceLong, DoubleVector128Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(double[] a, int idx, boolean[] mask) { @@ -5214,7 +5251,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceLongDouble128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongDoubleVector128TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5232,11 +5269,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Double128VectorTests::ADDReduceLongMasked, Double128VectorTests::ADDReduceAllLongMasked); + DoubleVector128Tests::ADDReduceLongMasked, DoubleVector128Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void BroadcastLongDouble128VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongDoubleVector128TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -5247,7 +5284,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendDoubleVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5261,12 +5298,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Double128VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector128Tests::blend); } @Test(dataProvider = "doubleUnaryOpSelectFromProvider") - static void SelectFromDouble128VectorTests(IntFunction fa, + static void SelectFromDoubleVector128Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); double[] order = fs.apply(a.length, SPECIES.length()); @@ -5282,7 +5319,7 @@ relativeError)); } @Test(dataProvider = "doubleSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorDouble128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorDoubleVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] idx = fc.apply(SPECIES.length()); @@ -5300,7 +5337,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpSelectFromMaskProvider") - static void SelectFromDouble128VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromDoubleVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -5319,7 +5356,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousDouble128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousDoubleVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5330,12 +5367,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringDouble128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringDoubleVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5349,7 +5386,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsDouble128VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsDoubleVector128TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5358,12 +5395,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsDouble128VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsDoubleVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5373,13 +5410,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeDouble128VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeDoubleVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5401,7 +5438,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountDouble128VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountDoubleVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5412,7 +5449,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double128VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, DoubleVector128Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5426,7 +5463,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueDouble128VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueDoubleVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5437,7 +5474,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double128VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector128Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5451,7 +5488,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueDouble128VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueDoubleVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5462,11 +5499,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double128VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector128Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressDouble128VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressDoubleVector128TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5476,7 +5513,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5494,7 +5531,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeDouble128VectorTestsSmokeTest(int offset) { + static void indexInRangeDoubleVector128TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5502,13 +5539,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongDouble128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongDoubleVector128TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5516,7 +5553,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5535,36 +5572,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundDouble128VectorTestsSmokeTest(int length) { + static void loopBoundDoubleVector128TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongDouble128VectorTestsSmokeTest(int _length) { + static void loopBoundLongDoubleVector128TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeDouble128VectorTestsSmokeTest() { + static void ElementSizeDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Double.SIZE); + assertEquals(elsize, Double.SIZE); } @Test - static void VectorShapeDouble128VectorTestsSmokeTest() { + static void VectorShapeDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_128_BIT)); } @Test - static void ShapeWithLanesDouble128VectorTestsSmokeTest() { + static void ShapeWithLanesDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(double.class); @@ -5572,32 +5609,32 @@ relativeError)); } @Test - static void ElementTypeDouble128VectorTestsSmokeTest() { + static void ElementTypeDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementType() == double.class); } @Test - static void SpeciesElementSizeDouble128VectorTestsSmokeTest() { + static void SpeciesElementSizeDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementSize() == Double.SIZE); } @Test - static void VectorTypeDouble128VectorTestsSmokeTest() { + static void VectorTypeDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesDouble128VectorTestsSmokeTest() { + static void WithLanesDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(double.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeDouble128VectorTestsSmokeTest() { + static void WithShapeDoubleVector128TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5605,9 +5642,9 @@ relativeError)); } @Test - static void MaskAllTrueDouble128VectorTestsSmokeTest() { + static void MaskAllTrueDoubleVector128TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleVector256LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector256LoadStoreTests.java index d8a7eca2bda..b966bafb299 100644 --- a/test/jdk/jdk/incubator/vector/Double256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector256LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Double256VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation DoubleVector256LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class DoubleVector256LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_256; @@ -61,14 +61,29 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(double[] r, double[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "doubleProviderForIOOBE") @@ -870,11 +885,11 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(double[] r, double[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Double256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Double256VectorTests.java b/test/jdk/jdk/incubator/vector/DoubleVector256Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Double256VectorTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector256Tests.java index b5acfe0ef34..4d650d7b407 100644 --- a/test/jdk/jdk/incubator/vector/Double256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector256Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleVector256Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Double256VectorTests extends AbstractVectorTest { +public class DoubleVector256Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_256; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(double actual, double expected, double delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(double actual, double expected, double delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final double ADD_IDENTITY = (double)0; @@ -95,10 +132,10 @@ public class Double256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +147,13 @@ public class Double256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { double[] ref = f.apply(a[i]); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +163,10 @@ public class Double256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +188,13 @@ public class Double256VectorTests extends AbstractVectorTest { double relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +216,14 @@ public class Double256VectorTests extends AbstractVectorTest { double relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +239,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +261,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +279,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +294,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +306,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +322,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (double)0); + assertEquals(r[i + k], (double)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -310,19 +347,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (double)0); + assertEquals(r[i + j], (double)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -338,11 +375,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +388,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +403,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +423,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +447,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +462,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +477,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +501,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +527,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +546,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +557,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +568,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +580,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +596,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +611,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +626,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +644,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +660,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +678,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +704,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +722,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +746,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +761,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +773,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +786,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +805,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +826,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +841,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +862,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +958,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +985,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1006,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(r, a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1033,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1053,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1074,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1095,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1117,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1169,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1215,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1584,7 +1621,7 @@ relativeError)); // Do some zipping and shuffling. DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); DoubleVector a = io.add((double)1); //[1,2] DoubleVector b = a.neg(); //[-1,-2] double[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1599,19 +1636,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); DoubleVector uab0 = zab0.rearrange(unz0,zab1); DoubleVector uab1 = zab0.rearrange(unz1,zab1); double[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,15 +1665,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static double ADD(double a, double b) { @@ -1644,7 +1681,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1657,7 +1694,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::ADD); + assertArraysEquals(r, a, b, DoubleVector256Tests::ADD); } static double add(double a, double b) { @@ -1665,7 +1702,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void addDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1676,11 +1713,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double256VectorTests::add); + assertArraysEquals(r, a, b, DoubleVector256Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1696,11 +1733,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double256VectorTests::ADD); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1714,7 +1751,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double256VectorTests::add); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::add); } static double SUB(double a, double b) { @@ -1722,7 +1759,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void SUBDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void SUBDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1735,7 +1772,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::SUB); + assertArraysEquals(r, a, b, DoubleVector256Tests::SUB); } static double sub(double a, double b) { @@ -1743,7 +1780,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void subDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1754,11 +1791,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double256VectorTests::sub); + assertArraysEquals(r, a, b, DoubleVector256Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void SUBDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1774,11 +1811,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double256VectorTests::SUB); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::SUB); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1792,7 +1829,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double256VectorTests::sub); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::sub); } static double MUL(double a, double b) { @@ -1800,7 +1837,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MULDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void MULDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1813,7 +1850,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::MUL); + assertArraysEquals(r, a, b, DoubleVector256Tests::MUL); } static double mul(double a, double b) { @@ -1821,7 +1858,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void mulDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1832,11 +1869,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double256VectorTests::mul); + assertArraysEquals(r, a, b, DoubleVector256Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void MULDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1852,11 +1889,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double256VectorTests::MUL); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::MUL); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1870,7 +1907,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double256VectorTests::mul); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::mul); } static double DIV(double a, double b) { @@ -1878,7 +1915,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void DIVDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void DIVDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1891,7 +1928,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::DIV); + assertArraysEquals(r, a, b, DoubleVector256Tests::DIV); } static double div(double a, double b) { @@ -1899,7 +1936,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void divDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1910,11 +1947,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double256VectorTests::div); + assertArraysEquals(r, a, b, DoubleVector256Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void DIVDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1930,11 +1967,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double256VectorTests::DIV); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::DIV); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1948,7 +1985,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double256VectorTests::div); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::div); } static double FIRST_NONZERO(double a, double b) { @@ -1956,7 +1993,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void FIRST_NONZERODouble256VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZERODoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1969,11 +2006,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, DoubleVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void FIRST_NONZERODouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZERODoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1989,11 +2026,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2003,11 +2040,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2020,11 +2057,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector256Tests::add); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2034,11 +2071,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2051,11 +2088,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector256Tests::sub); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2065,11 +2102,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2082,11 +2119,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector256Tests::mul); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2096,11 +2133,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2113,11 +2150,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector256Tests::div); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2127,11 +2164,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Double256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, DoubleVector256Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDDoubleVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2144,13 +2181,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Double256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector256Tests::ADD); } static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MINDouble256VectorTestsWithMemOp(IntFunction fa) { + static void MINDoubleVector256TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2161,13 +2198,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double256VectorTests::MIN); + assertArraysEquals(r, a, (double)10, DoubleVector256Tests::MIN); } static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void minDouble256VectorTestsWithMemOp(IntFunction fa) { + static void minDoubleVector256TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2178,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double256VectorTests::min); + assertArraysEquals(r, a, (double)10, DoubleVector256Tests::min); } static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINDouble256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINDoubleVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2197,13 +2234,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double256VectorTests::MIN); + assertArraysEquals(r, a, (double)10, mask, DoubleVector256Tests::MIN); } static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXDouble256VectorTestsWithMemOp(IntFunction fa) { + static void MAXDoubleVector256TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2214,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double256VectorTests::MAX); + assertArraysEquals(r, a, (double)10, DoubleVector256Tests::MAX); } static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void maxDouble256VectorTestsWithMemOp(IntFunction fa) { + static void maxDoubleVector256TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2231,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double256VectorTests::max); + assertArraysEquals(r, a, (double)10, DoubleVector256Tests::max); } static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXDouble256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXDoubleVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2250,7 +2287,7 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double256VectorTests::MAX); + assertArraysEquals(r, a, (double)10, mask, DoubleVector256Tests::MAX); } static double MIN(double a, double b) { @@ -2258,7 +2295,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void MINDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2271,7 +2308,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::MIN); + assertArraysEquals(r, a, b, DoubleVector256Tests::MIN); } static double min(double a, double b) { @@ -2279,7 +2316,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void minDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2290,7 +2327,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double256VectorTests::min); + assertArraysEquals(r, a, b, DoubleVector256Tests::min); } static double MAX(double a, double b) { @@ -2298,7 +2335,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2311,7 +2348,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::MAX); + assertArraysEquals(r, a, b, DoubleVector256Tests::MAX); } static double max(double a, double b) { @@ -2319,7 +2356,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maxDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2367,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double256VectorTests::max); + assertArraysEquals(r, a, b, DoubleVector256Tests::max); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2344,11 +2381,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::MIN); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2358,11 +2395,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::min); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::min); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2372,11 +2409,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::MAX); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2386,7 +2423,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double256VectorTests::max); + assertBroadcastArraysEquals(r, a, b, DoubleVector256Tests::max); } static double ADDReduce(double[] a, int idx) { @@ -2408,7 +2445,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceDouble256VectorTests(IntFunction fa) { + static void ADDReduceDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2424,7 +2461,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double256VectorTests::ADDReduce, Double256VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector256Tests::ADDReduce, DoubleVector256Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2432,20 +2469,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = ADD_IDENTITY; - Assert.assertEquals((double) (id + id), id, + assertEquals((double) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id + x), x); - Assert.assertEquals((double) (x + id), x); + assertEquals((double) (id + x), x); + assertEquals((double) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id + x), x, + assertEquals((double) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x + id), x, + assertEquals((double) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2470,7 +2507,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceDouble256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceDoubleVector256TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2488,7 +2525,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double256VectorTests::ADDReduceMasked, Double256VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector256Tests::ADDReduceMasked, DoubleVector256Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static double MULReduce(double[] a, int idx) { @@ -2510,7 +2547,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MULReduceDouble256VectorTests(IntFunction fa) { + static void MULReduceDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2526,7 +2563,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double256VectorTests::MULReduce, Double256VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector256Tests::MULReduce, DoubleVector256Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2534,20 +2571,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MUL_IDENTITY; - Assert.assertEquals((double) (id * id), id, + assertEquals((double) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id * x), x); - Assert.assertEquals((double) (x * id), x); + assertEquals((double) (id * x), x); + assertEquals((double) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id * x), x, + assertEquals((double) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x * id), x, + assertEquals((double) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2572,7 +2609,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MULReduceDouble256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceDoubleVector256TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2590,7 +2627,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double256VectorTests::MULReduceMasked, Double256VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector256Tests::MULReduceMasked, DoubleVector256Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static double MINReduce(double[] a, int idx) { @@ -2612,7 +2649,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MINReduceDouble256VectorTests(IntFunction fa) { + static void MINReduceDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2628,7 +2665,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double256VectorTests::MINReduce, Double256VectorTests::MINReduceAll); + DoubleVector256Tests::MINReduce, DoubleVector256Tests::MINReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2636,20 +2673,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MIN_IDENTITY; - Assert.assertEquals((double) Math.min(id, id), id, + assertEquals((double) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.min(id, x), x); - Assert.assertEquals((double) Math.min(x, id), x); + assertEquals((double) Math.min(id, x), x); + assertEquals((double) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.min(id, x), x, + assertEquals((double) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.min(x, id), x, + assertEquals((double) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2674,7 +2711,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINReduceDouble256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceDoubleVector256TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2692,7 +2729,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double256VectorTests::MINReduceMasked, Double256VectorTests::MINReduceAllMasked); + DoubleVector256Tests::MINReduceMasked, DoubleVector256Tests::MINReduceAllMasked); } static double MAXReduce(double[] a, int idx) { @@ -2714,7 +2751,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXReduceDouble256VectorTests(IntFunction fa) { + static void MAXReduceDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2730,7 +2767,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double256VectorTests::MAXReduce, Double256VectorTests::MAXReduceAll); + DoubleVector256Tests::MAXReduce, DoubleVector256Tests::MAXReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2738,20 +2775,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MAX_IDENTITY; - Assert.assertEquals((double) Math.max(id, id), id, + assertEquals((double) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.max(id, x), x); - Assert.assertEquals((double) Math.max(x, id), x); + assertEquals((double) Math.max(id, x), x); + assertEquals((double) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.max(id, x), x, + assertEquals((double) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.max(x, id), x, + assertEquals((double) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2776,7 +2813,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXReduceDouble256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceDoubleVector256TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2794,7 +2831,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double256VectorTests::MAXReduceMasked, Double256VectorTests::MAXReduceAllMasked); + DoubleVector256Tests::MAXReduceMasked, DoubleVector256Tests::MAXReduceAllMasked); } static double FIRST_NONZEROReduce(double[] a, int idx) { @@ -2816,7 +2853,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void FIRST_NONZEROReduceDouble256VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2832,7 +2869,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double256VectorTests::FIRST_NONZEROReduce, Double256VectorTests::FIRST_NONZEROReduceAll); + DoubleVector256Tests::FIRST_NONZEROReduce, DoubleVector256Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2840,20 +2877,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2878,7 +2915,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void FIRST_NONZEROReduceDouble256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceDoubleVector256TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2896,11 +2933,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double256VectorTests::FIRST_NONZEROReduceMasked, Double256VectorTests::FIRST_NONZEROReduceAllMasked); + DoubleVector256Tests::FIRST_NONZEROReduceMasked, DoubleVector256Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "doubleBinaryOpProvider") - static void withDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void withDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2923,7 +2960,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_DEFAULTDouble256VectorTests(IntFunction fa) { + static void IS_DEFAULTDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2933,14 +2970,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_DEFAULTMaskedDouble256VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2953,7 +2990,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2964,7 +3001,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NEGATIVEDouble256VectorTests(IntFunction fa) { + static void IS_NEGATIVEDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2974,14 +3011,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NEGATIVEMaskedDouble256VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2994,7 +3031,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3005,7 +3042,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_FINITEDouble256VectorTests(IntFunction fa) { + static void IS_FINITEDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3015,14 +3052,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_FINITEMaskedDouble256VectorTests(IntFunction fa, + static void IS_FINITEMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3035,7 +3072,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3046,7 +3083,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NANDouble256VectorTests(IntFunction fa) { + static void IS_NANDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3056,14 +3093,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NANMaskedDouble256VectorTests(IntFunction fa, + static void IS_NANMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3076,7 +3113,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3087,7 +3124,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_INFINITEDouble256VectorTests(IntFunction fa) { + static void IS_INFINITEDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3097,14 +3134,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_INFINITEMaskedDouble256VectorTests(IntFunction fa, + static void IS_INFINITEMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3117,14 +3154,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void LTDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3136,14 +3173,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void ltDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3155,14 +3192,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3178,14 +3215,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GTDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void GTDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3197,14 +3234,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GTDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3220,14 +3257,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void EQDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3239,14 +3276,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void eqDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3258,14 +3295,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3281,14 +3318,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void NEDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void NEDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3300,14 +3337,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void NEDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3323,14 +3360,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LEDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void LEDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3342,14 +3379,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LEDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3365,14 +3402,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GEDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void GEDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3384,14 +3421,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GEDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3407,14 +3444,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3424,13 +3461,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3444,13 +3481,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3460,13 +3497,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3480,13 +3517,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3496,13 +3533,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3516,13 +3553,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3532,13 +3569,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3552,7 +3589,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); } } } @@ -3562,7 +3599,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble256VectorTests(IntFunction fa, IntFunction fb, + static void blendDoubleVector256Tests(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3578,11 +3615,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double256VectorTests::blend); + assertArraysEquals(r, a, b, mask, DoubleVector256Tests::blend); } @Test(dataProvider = "doubleUnaryOpShuffleProvider") - static void RearrangeDouble256VectorTests(IntFunction fa, + static void RearrangeDoubleVector256Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3599,7 +3636,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpShuffleMaskProvider") - static void RearrangeDouble256VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeDoubleVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -3617,7 +3654,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void compressDouble256VectorTests(IntFunction fa, + static void compressDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3635,7 +3672,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void expandDouble256VectorTests(IntFunction fa, + static void expandDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3653,7 +3690,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void getDouble256VectorTests(IntFunction fa) { + static void getDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3809,7 +3846,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void BroadcastDouble256VectorTests(IntFunction fa) { + static void BroadcastDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3823,7 +3860,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ZeroDouble256VectorTests(IntFunction fa) { + static void ZeroDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3833,7 +3870,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static double[] sliceUnary(double[] a, int origin, int idx) { @@ -3848,7 +3885,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sliceUnaryDouble256VectorTests(IntFunction fa) { + static void sliceUnaryDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3859,7 +3896,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double256VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, DoubleVector256Tests::sliceUnary); } static double[] sliceBinary(double[] a, double[] b, int origin, int idx) { @@ -3876,7 +3913,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void sliceBinaryDouble256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryDoubleVector256TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3889,7 +3926,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Double256VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, DoubleVector256Tests::sliceBinary); } static double[] slice(double[] a, double[] b, int origin, boolean[] mask, int idx) { @@ -3906,7 +3943,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void sliceDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3923,7 +3960,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Double256VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, DoubleVector256Tests::slice); } static double[] unsliceUnary(double[] a, int origin, int idx) { @@ -3940,7 +3977,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void unsliceUnaryDouble256VectorTests(IntFunction fa) { + static void unsliceUnaryDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3951,7 +3988,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double256VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, DoubleVector256Tests::unsliceUnary); } static double[] unsliceBinary(double[] a, double[] b, int origin, int part, int idx) { @@ -3977,7 +4014,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void unsliceBinaryDouble256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryDoubleVector256TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3991,7 +4028,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Double256VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, DoubleVector256Tests::unsliceBinary); } static double[] unslice(double[] a, double[] b, int origin, int part, boolean[] mask, int idx) { @@ -4031,7 +4068,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void unsliceDouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceDoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4048,7 +4085,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Double256VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, DoubleVector256Tests::unslice); } static double SIN(double a) { @@ -4060,7 +4097,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINDouble256VectorTests(IntFunction fa) { + static void SINDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4071,7 +4108,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::SIN, Double256VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::SIN, DoubleVector256Tests::strictSIN); } static double EXP(double a) { @@ -4083,7 +4120,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPDouble256VectorTests(IntFunction fa) { + static void EXPDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4094,7 +4131,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::EXP, Double256VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::EXP, DoubleVector256Tests::strictEXP); } static double LOG1P(double a) { @@ -4106,7 +4143,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG1PDouble256VectorTests(IntFunction fa) { + static void LOG1PDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4117,7 +4154,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::LOG1P, Double256VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::LOG1P, DoubleVector256Tests::strictLOG1P); } static double LOG(double a) { @@ -4129,7 +4166,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOGDouble256VectorTests(IntFunction fa) { + static void LOGDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4140,7 +4177,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::LOG, Double256VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::LOG, DoubleVector256Tests::strictLOG); } static double LOG10(double a) { @@ -4152,7 +4189,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG10Double256VectorTests(IntFunction fa) { + static void LOG10DoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4163,7 +4200,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::LOG10, Double256VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::LOG10, DoubleVector256Tests::strictLOG10); } static double EXPM1(double a) { @@ -4175,7 +4212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPM1Double256VectorTests(IntFunction fa) { + static void EXPM1DoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4186,7 +4223,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::EXPM1, Double256VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::EXPM1, DoubleVector256Tests::strictEXPM1); } static double COS(double a) { @@ -4198,7 +4235,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSDouble256VectorTests(IntFunction fa) { + static void COSDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4209,7 +4246,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::COS, Double256VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::COS, DoubleVector256Tests::strictCOS); } static double TAN(double a) { @@ -4221,7 +4258,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANDouble256VectorTests(IntFunction fa) { + static void TANDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4232,7 +4269,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::TAN, Double256VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::TAN, DoubleVector256Tests::strictTAN); } static double SINH(double a) { @@ -4244,7 +4281,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINHDouble256VectorTests(IntFunction fa) { + static void SINHDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4255,7 +4292,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::SINH, Double256VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::SINH, DoubleVector256Tests::strictSINH); } static double COSH(double a) { @@ -4267,7 +4304,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSHDouble256VectorTests(IntFunction fa) { + static void COSHDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4278,7 +4315,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::COSH, Double256VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::COSH, DoubleVector256Tests::strictCOSH); } static double TANH(double a) { @@ -4290,7 +4327,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANHDouble256VectorTests(IntFunction fa) { + static void TANHDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4301,7 +4338,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::TANH, Double256VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::TANH, DoubleVector256Tests::strictTANH); } static double ASIN(double a) { @@ -4313,7 +4350,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ASINDouble256VectorTests(IntFunction fa) { + static void ASINDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4324,7 +4361,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::ASIN, Double256VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::ASIN, DoubleVector256Tests::strictASIN); } static double ACOS(double a) { @@ -4336,7 +4373,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ACOSDouble256VectorTests(IntFunction fa) { + static void ACOSDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4347,7 +4384,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::ACOS, Double256VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::ACOS, DoubleVector256Tests::strictACOS); } static double ATAN(double a) { @@ -4359,7 +4396,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ATANDouble256VectorTests(IntFunction fa) { + static void ATANDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4370,7 +4407,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::ATAN, Double256VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::ATAN, DoubleVector256Tests::strictATAN); } static double CBRT(double a) { @@ -4382,7 +4419,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void CBRTDouble256VectorTests(IntFunction fa) { + static void CBRTDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4393,7 +4430,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double256VectorTests::CBRT, Double256VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector256Tests::CBRT, DoubleVector256Tests::strictCBRT); } static double HYPOT(double a, double b) { @@ -4405,7 +4442,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void HYPOTDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4418,7 +4455,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double256VectorTests::HYPOT, Double256VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector256Tests::HYPOT, DoubleVector256Tests::strictHYPOT); } @@ -4431,7 +4468,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void POWDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4444,7 +4481,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double256VectorTests::POW, Double256VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector256Tests::POW, DoubleVector256Tests::strictPOW); } @@ -4457,7 +4494,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void powDoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4470,7 +4507,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double256VectorTests::pow, Double256VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector256Tests::pow, DoubleVector256Tests::strictpow); } @@ -4483,7 +4520,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ATAN2Double256VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2DoubleVector256Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4496,12 +4533,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double256VectorTests::ATAN2, Double256VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector256Tests::ATAN2, DoubleVector256Tests::strictATAN2); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4511,12 +4548,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double256VectorTests::POW, Double256VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector256Tests::POW, DoubleVector256Tests::strictPOW); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4526,7 +4563,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double256VectorTests::pow, Double256VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector256Tests::pow, DoubleVector256Tests::strictpow); } @@ -4539,7 +4576,7 @@ relativeError)); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4561,11 +4598,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Double256VectorTests::FMA); + assertArraysEquals(r, a, b, c, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4585,11 +4622,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Double256VectorTests::fma); + assertArraysEquals(r, a, b, c, DoubleVector256Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMADoubleVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4614,11 +4651,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Double256VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4629,11 +4666,11 @@ relativeError)); DoubleVector bv = DoubleVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Double256VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4644,11 +4681,11 @@ relativeError)); DoubleVector cv = DoubleVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Double256VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4663,11 +4700,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Double256VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble256VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector256TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4682,11 +4719,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Double256VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4704,11 +4741,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double256VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector256Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4726,11 +4763,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double256VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector256Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble256VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector256TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4751,7 +4788,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Double256VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, DoubleVector256Tests::FMA); } static double NEG(double a) { @@ -4763,7 +4800,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void NEGDouble256VectorTests(IntFunction fa) { + static void NEGDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4774,11 +4811,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::NEG); + assertArraysEquals(r, a, DoubleVector256Tests::NEG); } @Test(dataProvider = "doubleUnaryOpProvider") - static void negDouble256VectorTests(IntFunction fa) { + static void negDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4789,11 +4826,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::neg); + assertArraysEquals(r, a, DoubleVector256Tests::neg); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void NEGMaskedDouble256VectorTests(IntFunction fa, + static void NEGMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4807,7 +4844,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double256VectorTests::NEG); + assertArraysEquals(r, a, mask, DoubleVector256Tests::NEG); } static double ABS(double a) { @@ -4819,7 +4856,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ABSDouble256VectorTests(IntFunction fa) { + static void ABSDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4830,11 +4867,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::ABS); + assertArraysEquals(r, a, DoubleVector256Tests::ABS); } @Test(dataProvider = "doubleUnaryOpProvider") - static void absDouble256VectorTests(IntFunction fa) { + static void absDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4845,11 +4882,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::abs); + assertArraysEquals(r, a, DoubleVector256Tests::abs); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ABSMaskedDouble256VectorTests(IntFunction fa, + static void ABSMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4863,7 +4900,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double256VectorTests::ABS); + assertArraysEquals(r, a, mask, DoubleVector256Tests::ABS); } static double SQRT(double a) { @@ -4875,7 +4912,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SQRTDouble256VectorTests(IntFunction fa) { + static void SQRTDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4886,11 +4923,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::SQRT); + assertArraysEquals(r, a, DoubleVector256Tests::SQRT); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sqrtDouble256VectorTests(IntFunction fa) { + static void sqrtDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4901,11 +4938,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::sqrt); + assertArraysEquals(r, a, DoubleVector256Tests::sqrt); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void SQRTMaskedDouble256VectorTests(IntFunction fa, + static void SQRTMaskedDoubleVector256Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4919,7 +4956,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double256VectorTests::SQRT); + assertArraysEquals(r, a, mask, DoubleVector256Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4927,7 +4964,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandDoubleVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4940,7 +4977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::band); + assertArraysEquals(r, a, b, DoubleVector256Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4948,7 +4985,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maskorDoubleVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4961,7 +4998,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::bor); + assertArraysEquals(r, a, b, DoubleVector256Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4969,7 +5006,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorDoubleVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4982,7 +5019,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::bxor); + assertArraysEquals(r, a, b, DoubleVector256Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4990,7 +5027,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotDoubleVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5003,7 +5040,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::bandNot); + assertArraysEquals(r, a, b, DoubleVector256Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -5011,7 +5048,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqDoubleVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5024,7 +5061,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double256VectorTests::beq); + assertArraysEquals(r, a, b, DoubleVector256Tests::beq); } static boolean unot(boolean a) { @@ -5032,7 +5069,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotDouble256VectorTests(IntFunction fa) { + static void masknotDoubleVector256Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5043,7 +5080,7 @@ relativeError)); } } - assertArraysEquals(r, a, Double256VectorTests::unot); + assertArraysEquals(r, a, DoubleVector256Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5052,15 +5089,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongDouble256VectorTests(IntFunction fa) { + static void maskFromToLongDoubleVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5074,7 +5111,7 @@ relativeError)); } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltDoubleVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5084,13 +5121,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqDoubleVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5100,13 +5137,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubletoIntUnaryOpProvider") - static void toIntArrayDouble256VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayDoubleVector256TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5117,7 +5154,7 @@ relativeError)); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void toLongArrayDouble256VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayDoubleVector256TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5129,7 +5166,7 @@ relativeError)); @Test(dataProvider = "doubleUnaryOpProvider") - static void toStringDouble256VectorTestsSmokeTest(IntFunction fa) { + static void toStringDoubleVector256TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5142,7 +5179,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void hashCodeDouble256VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeDoubleVector256TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5175,7 +5212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceLongDouble256VectorTests(IntFunction fa) { + static void ADDReduceLongDoubleVector256Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5191,7 +5228,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Double256VectorTests::ADDReduceLong, Double256VectorTests::ADDReduceAllLong); + DoubleVector256Tests::ADDReduceLong, DoubleVector256Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(double[] a, int idx, boolean[] mask) { @@ -5214,7 +5251,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceLongDouble256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongDoubleVector256TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5232,11 +5269,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Double256VectorTests::ADDReduceLongMasked, Double256VectorTests::ADDReduceAllLongMasked); + DoubleVector256Tests::ADDReduceLongMasked, DoubleVector256Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void BroadcastLongDouble256VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongDoubleVector256TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -5247,7 +5284,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendDoubleVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5261,12 +5298,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Double256VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector256Tests::blend); } @Test(dataProvider = "doubleUnaryOpSelectFromProvider") - static void SelectFromDouble256VectorTests(IntFunction fa, + static void SelectFromDoubleVector256Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); double[] order = fs.apply(a.length, SPECIES.length()); @@ -5282,7 +5319,7 @@ relativeError)); } @Test(dataProvider = "doubleSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorDouble256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorDoubleVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] idx = fc.apply(SPECIES.length()); @@ -5300,7 +5337,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpSelectFromMaskProvider") - static void SelectFromDouble256VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromDoubleVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -5319,7 +5356,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousDouble256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousDoubleVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5330,12 +5367,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringDouble256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringDoubleVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5349,7 +5386,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsDouble256VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsDoubleVector256TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5358,12 +5395,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsDouble256VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsDoubleVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5373,13 +5410,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeDouble256VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeDoubleVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5401,7 +5438,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountDouble256VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountDoubleVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5412,7 +5449,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double256VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, DoubleVector256Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5426,7 +5463,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueDouble256VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueDoubleVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5437,7 +5474,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double256VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector256Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5451,7 +5488,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueDouble256VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueDoubleVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5462,11 +5499,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double256VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector256Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressDouble256VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressDoubleVector256TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5476,7 +5513,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5494,7 +5531,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeDouble256VectorTestsSmokeTest(int offset) { + static void indexInRangeDoubleVector256TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5502,13 +5539,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongDouble256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongDoubleVector256TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5516,7 +5553,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5535,36 +5572,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundDouble256VectorTestsSmokeTest(int length) { + static void loopBoundDoubleVector256TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongDouble256VectorTestsSmokeTest(int _length) { + static void loopBoundLongDoubleVector256TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeDouble256VectorTestsSmokeTest() { + static void ElementSizeDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Double.SIZE); + assertEquals(elsize, Double.SIZE); } @Test - static void VectorShapeDouble256VectorTestsSmokeTest() { + static void VectorShapeDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_256_BIT)); } @Test - static void ShapeWithLanesDouble256VectorTestsSmokeTest() { + static void ShapeWithLanesDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(double.class); @@ -5572,32 +5609,32 @@ relativeError)); } @Test - static void ElementTypeDouble256VectorTestsSmokeTest() { + static void ElementTypeDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementType() == double.class); } @Test - static void SpeciesElementSizeDouble256VectorTestsSmokeTest() { + static void SpeciesElementSizeDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementSize() == Double.SIZE); } @Test - static void VectorTypeDouble256VectorTestsSmokeTest() { + static void VectorTypeDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesDouble256VectorTestsSmokeTest() { + static void WithLanesDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(double.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeDouble256VectorTestsSmokeTest() { + static void WithShapeDoubleVector256TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5605,9 +5642,9 @@ relativeError)); } @Test - static void MaskAllTrueDouble256VectorTestsSmokeTest() { + static void MaskAllTrueDoubleVector256TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleVector512LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector512LoadStoreTests.java index ddf76df1f3a..cb60f7363af 100644 --- a/test/jdk/jdk/incubator/vector/Double512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector512LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Double512VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation DoubleVector512LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class DoubleVector512LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_512; @@ -61,14 +61,29 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(double[] r, double[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "doubleProviderForIOOBE") @@ -870,11 +885,11 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(double[] r, double[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Double512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Double512VectorTests.java b/test/jdk/jdk/incubator/vector/DoubleVector512Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Double512VectorTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector512Tests.java index 3f85d0e52a6..534470e194c 100644 --- a/test/jdk/jdk/incubator/vector/Double512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector512Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleVector512Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Double512VectorTests extends AbstractVectorTest { +public class DoubleVector512Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_512; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(double actual, double expected, double delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(double actual, double expected, double delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final double ADD_IDENTITY = (double)0; @@ -95,10 +132,10 @@ public class Double512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +147,13 @@ public class Double512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { double[] ref = f.apply(a[i]); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +163,10 @@ public class Double512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +188,13 @@ public class Double512VectorTests extends AbstractVectorTest { double relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +216,14 @@ public class Double512VectorTests extends AbstractVectorTest { double relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +239,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +261,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +279,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +294,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +306,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +322,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (double)0); + assertEquals(r[i + k], (double)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -310,19 +347,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (double)0); + assertEquals(r[i + j], (double)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -338,11 +375,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +388,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +403,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +423,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +447,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +462,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +477,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +501,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +527,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +546,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +557,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +568,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +580,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +596,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +611,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +626,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +644,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +660,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +678,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +704,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +722,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +746,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +761,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +773,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +786,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +805,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +826,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +841,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +862,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +958,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +985,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1006,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(r, a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1033,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1053,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1074,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1095,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1117,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1169,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1215,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1584,7 +1621,7 @@ relativeError)); // Do some zipping and shuffling. DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); DoubleVector a = io.add((double)1); //[1,2] DoubleVector b = a.neg(); //[-1,-2] double[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1599,19 +1636,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); DoubleVector uab0 = zab0.rearrange(unz0,zab1); DoubleVector uab1 = zab0.rearrange(unz1,zab1); double[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,15 +1665,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static double ADD(double a, double b) { @@ -1644,7 +1681,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1657,7 +1694,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::ADD); + assertArraysEquals(r, a, b, DoubleVector512Tests::ADD); } static double add(double a, double b) { @@ -1665,7 +1702,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void addDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1676,11 +1713,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double512VectorTests::add); + assertArraysEquals(r, a, b, DoubleVector512Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1696,11 +1733,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double512VectorTests::ADD); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1714,7 +1751,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double512VectorTests::add); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::add); } static double SUB(double a, double b) { @@ -1722,7 +1759,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void SUBDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void SUBDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1735,7 +1772,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::SUB); + assertArraysEquals(r, a, b, DoubleVector512Tests::SUB); } static double sub(double a, double b) { @@ -1743,7 +1780,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void subDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1754,11 +1791,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double512VectorTests::sub); + assertArraysEquals(r, a, b, DoubleVector512Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void SUBDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1774,11 +1811,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double512VectorTests::SUB); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::SUB); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1792,7 +1829,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double512VectorTests::sub); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::sub); } static double MUL(double a, double b) { @@ -1800,7 +1837,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MULDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void MULDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1813,7 +1850,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::MUL); + assertArraysEquals(r, a, b, DoubleVector512Tests::MUL); } static double mul(double a, double b) { @@ -1821,7 +1858,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void mulDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1832,11 +1869,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double512VectorTests::mul); + assertArraysEquals(r, a, b, DoubleVector512Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void MULDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1852,11 +1889,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double512VectorTests::MUL); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::MUL); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1870,7 +1907,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double512VectorTests::mul); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::mul); } static double DIV(double a, double b) { @@ -1878,7 +1915,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void DIVDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void DIVDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1891,7 +1928,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::DIV); + assertArraysEquals(r, a, b, DoubleVector512Tests::DIV); } static double div(double a, double b) { @@ -1899,7 +1936,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void divDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1910,11 +1947,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double512VectorTests::div); + assertArraysEquals(r, a, b, DoubleVector512Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void DIVDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1930,11 +1967,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double512VectorTests::DIV); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::DIV); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1948,7 +1985,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double512VectorTests::div); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::div); } static double FIRST_NONZERO(double a, double b) { @@ -1956,7 +1993,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void FIRST_NONZERODouble512VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZERODoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1969,11 +2006,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, DoubleVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void FIRST_NONZERODouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZERODoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1989,11 +2026,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2003,11 +2040,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2020,11 +2057,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector512Tests::add); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2034,11 +2071,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2051,11 +2088,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector512Tests::sub); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2065,11 +2102,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2082,11 +2119,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector512Tests::mul); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2096,11 +2133,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2113,11 +2150,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector512Tests::div); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2127,11 +2164,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Double512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, DoubleVector512Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDDoubleVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2144,13 +2181,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Double512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector512Tests::ADD); } static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MINDouble512VectorTestsWithMemOp(IntFunction fa) { + static void MINDoubleVector512TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2161,13 +2198,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double512VectorTests::MIN); + assertArraysEquals(r, a, (double)10, DoubleVector512Tests::MIN); } static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void minDouble512VectorTestsWithMemOp(IntFunction fa) { + static void minDoubleVector512TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2178,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double512VectorTests::min); + assertArraysEquals(r, a, (double)10, DoubleVector512Tests::min); } static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINDouble512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINDoubleVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2197,13 +2234,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double512VectorTests::MIN); + assertArraysEquals(r, a, (double)10, mask, DoubleVector512Tests::MIN); } static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXDouble512VectorTestsWithMemOp(IntFunction fa) { + static void MAXDoubleVector512TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2214,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double512VectorTests::MAX); + assertArraysEquals(r, a, (double)10, DoubleVector512Tests::MAX); } static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void maxDouble512VectorTestsWithMemOp(IntFunction fa) { + static void maxDoubleVector512TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2231,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double512VectorTests::max); + assertArraysEquals(r, a, (double)10, DoubleVector512Tests::max); } static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXDouble512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXDoubleVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2250,7 +2287,7 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double512VectorTests::MAX); + assertArraysEquals(r, a, (double)10, mask, DoubleVector512Tests::MAX); } static double MIN(double a, double b) { @@ -2258,7 +2295,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void MINDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2271,7 +2308,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::MIN); + assertArraysEquals(r, a, b, DoubleVector512Tests::MIN); } static double min(double a, double b) { @@ -2279,7 +2316,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void minDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2290,7 +2327,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double512VectorTests::min); + assertArraysEquals(r, a, b, DoubleVector512Tests::min); } static double MAX(double a, double b) { @@ -2298,7 +2335,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2311,7 +2348,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::MAX); + assertArraysEquals(r, a, b, DoubleVector512Tests::MAX); } static double max(double a, double b) { @@ -2319,7 +2356,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maxDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2367,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double512VectorTests::max); + assertArraysEquals(r, a, b, DoubleVector512Tests::max); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2344,11 +2381,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::MIN); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2358,11 +2395,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::min); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::min); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2372,11 +2409,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::MAX); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2386,7 +2423,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double512VectorTests::max); + assertBroadcastArraysEquals(r, a, b, DoubleVector512Tests::max); } static double ADDReduce(double[] a, int idx) { @@ -2408,7 +2445,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceDouble512VectorTests(IntFunction fa) { + static void ADDReduceDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2424,7 +2461,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double512VectorTests::ADDReduce, Double512VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector512Tests::ADDReduce, DoubleVector512Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2432,20 +2469,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = ADD_IDENTITY; - Assert.assertEquals((double) (id + id), id, + assertEquals((double) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id + x), x); - Assert.assertEquals((double) (x + id), x); + assertEquals((double) (id + x), x); + assertEquals((double) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id + x), x, + assertEquals((double) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x + id), x, + assertEquals((double) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2470,7 +2507,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceDouble512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceDoubleVector512TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2488,7 +2525,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double512VectorTests::ADDReduceMasked, Double512VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector512Tests::ADDReduceMasked, DoubleVector512Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static double MULReduce(double[] a, int idx) { @@ -2510,7 +2547,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MULReduceDouble512VectorTests(IntFunction fa) { + static void MULReduceDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2526,7 +2563,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double512VectorTests::MULReduce, Double512VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector512Tests::MULReduce, DoubleVector512Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2534,20 +2571,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MUL_IDENTITY; - Assert.assertEquals((double) (id * id), id, + assertEquals((double) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id * x), x); - Assert.assertEquals((double) (x * id), x); + assertEquals((double) (id * x), x); + assertEquals((double) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id * x), x, + assertEquals((double) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x * id), x, + assertEquals((double) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2572,7 +2609,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MULReduceDouble512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceDoubleVector512TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2590,7 +2627,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double512VectorTests::MULReduceMasked, Double512VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector512Tests::MULReduceMasked, DoubleVector512Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static double MINReduce(double[] a, int idx) { @@ -2612,7 +2649,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MINReduceDouble512VectorTests(IntFunction fa) { + static void MINReduceDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2628,7 +2665,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double512VectorTests::MINReduce, Double512VectorTests::MINReduceAll); + DoubleVector512Tests::MINReduce, DoubleVector512Tests::MINReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2636,20 +2673,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MIN_IDENTITY; - Assert.assertEquals((double) Math.min(id, id), id, + assertEquals((double) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.min(id, x), x); - Assert.assertEquals((double) Math.min(x, id), x); + assertEquals((double) Math.min(id, x), x); + assertEquals((double) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.min(id, x), x, + assertEquals((double) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.min(x, id), x, + assertEquals((double) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2674,7 +2711,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINReduceDouble512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceDoubleVector512TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2692,7 +2729,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double512VectorTests::MINReduceMasked, Double512VectorTests::MINReduceAllMasked); + DoubleVector512Tests::MINReduceMasked, DoubleVector512Tests::MINReduceAllMasked); } static double MAXReduce(double[] a, int idx) { @@ -2714,7 +2751,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXReduceDouble512VectorTests(IntFunction fa) { + static void MAXReduceDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2730,7 +2767,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double512VectorTests::MAXReduce, Double512VectorTests::MAXReduceAll); + DoubleVector512Tests::MAXReduce, DoubleVector512Tests::MAXReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2738,20 +2775,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MAX_IDENTITY; - Assert.assertEquals((double) Math.max(id, id), id, + assertEquals((double) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.max(id, x), x); - Assert.assertEquals((double) Math.max(x, id), x); + assertEquals((double) Math.max(id, x), x); + assertEquals((double) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.max(id, x), x, + assertEquals((double) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.max(x, id), x, + assertEquals((double) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2776,7 +2813,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXReduceDouble512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceDoubleVector512TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2794,7 +2831,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double512VectorTests::MAXReduceMasked, Double512VectorTests::MAXReduceAllMasked); + DoubleVector512Tests::MAXReduceMasked, DoubleVector512Tests::MAXReduceAllMasked); } static double FIRST_NONZEROReduce(double[] a, int idx) { @@ -2816,7 +2853,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void FIRST_NONZEROReduceDouble512VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2832,7 +2869,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double512VectorTests::FIRST_NONZEROReduce, Double512VectorTests::FIRST_NONZEROReduceAll); + DoubleVector512Tests::FIRST_NONZEROReduce, DoubleVector512Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2840,20 +2877,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2878,7 +2915,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void FIRST_NONZEROReduceDouble512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceDoubleVector512TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2896,11 +2933,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double512VectorTests::FIRST_NONZEROReduceMasked, Double512VectorTests::FIRST_NONZEROReduceAllMasked); + DoubleVector512Tests::FIRST_NONZEROReduceMasked, DoubleVector512Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "doubleBinaryOpProvider") - static void withDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void withDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2923,7 +2960,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_DEFAULTDouble512VectorTests(IntFunction fa) { + static void IS_DEFAULTDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2933,14 +2970,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_DEFAULTMaskedDouble512VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2953,7 +2990,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2964,7 +3001,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NEGATIVEDouble512VectorTests(IntFunction fa) { + static void IS_NEGATIVEDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2974,14 +3011,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NEGATIVEMaskedDouble512VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2994,7 +3031,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3005,7 +3042,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_FINITEDouble512VectorTests(IntFunction fa) { + static void IS_FINITEDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3015,14 +3052,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_FINITEMaskedDouble512VectorTests(IntFunction fa, + static void IS_FINITEMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3035,7 +3072,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3046,7 +3083,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NANDouble512VectorTests(IntFunction fa) { + static void IS_NANDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3056,14 +3093,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NANMaskedDouble512VectorTests(IntFunction fa, + static void IS_NANMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3076,7 +3113,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3087,7 +3124,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_INFINITEDouble512VectorTests(IntFunction fa) { + static void IS_INFINITEDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3097,14 +3134,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_INFINITEMaskedDouble512VectorTests(IntFunction fa, + static void IS_INFINITEMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3117,14 +3154,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void LTDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3136,14 +3173,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void ltDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3155,14 +3192,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3178,14 +3215,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GTDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void GTDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3197,14 +3234,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GTDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3220,14 +3257,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void EQDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3239,14 +3276,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void eqDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3258,14 +3295,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3281,14 +3318,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void NEDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void NEDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3300,14 +3337,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void NEDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3323,14 +3360,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LEDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void LEDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3342,14 +3379,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LEDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3365,14 +3402,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GEDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void GEDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3384,14 +3421,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GEDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3407,14 +3444,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3424,13 +3461,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3444,13 +3481,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3460,13 +3497,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3480,13 +3517,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3496,13 +3533,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3516,13 +3553,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3532,13 +3569,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3552,7 +3589,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); } } } @@ -3562,7 +3599,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble512VectorTests(IntFunction fa, IntFunction fb, + static void blendDoubleVector512Tests(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3578,11 +3615,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double512VectorTests::blend); + assertArraysEquals(r, a, b, mask, DoubleVector512Tests::blend); } @Test(dataProvider = "doubleUnaryOpShuffleProvider") - static void RearrangeDouble512VectorTests(IntFunction fa, + static void RearrangeDoubleVector512Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3599,7 +3636,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpShuffleMaskProvider") - static void RearrangeDouble512VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeDoubleVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -3617,7 +3654,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void compressDouble512VectorTests(IntFunction fa, + static void compressDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3635,7 +3672,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void expandDouble512VectorTests(IntFunction fa, + static void expandDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3653,7 +3690,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void getDouble512VectorTests(IntFunction fa) { + static void getDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3809,7 +3846,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void BroadcastDouble512VectorTests(IntFunction fa) { + static void BroadcastDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3823,7 +3860,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ZeroDouble512VectorTests(IntFunction fa) { + static void ZeroDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3833,7 +3870,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static double[] sliceUnary(double[] a, int origin, int idx) { @@ -3848,7 +3885,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sliceUnaryDouble512VectorTests(IntFunction fa) { + static void sliceUnaryDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3859,7 +3896,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double512VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, DoubleVector512Tests::sliceUnary); } static double[] sliceBinary(double[] a, double[] b, int origin, int idx) { @@ -3876,7 +3913,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void sliceBinaryDouble512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryDoubleVector512TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3889,7 +3926,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Double512VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, DoubleVector512Tests::sliceBinary); } static double[] slice(double[] a, double[] b, int origin, boolean[] mask, int idx) { @@ -3906,7 +3943,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void sliceDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3923,7 +3960,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Double512VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, DoubleVector512Tests::slice); } static double[] unsliceUnary(double[] a, int origin, int idx) { @@ -3940,7 +3977,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void unsliceUnaryDouble512VectorTests(IntFunction fa) { + static void unsliceUnaryDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3951,7 +3988,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double512VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, DoubleVector512Tests::unsliceUnary); } static double[] unsliceBinary(double[] a, double[] b, int origin, int part, int idx) { @@ -3977,7 +4014,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void unsliceBinaryDouble512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryDoubleVector512TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3991,7 +4028,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Double512VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, DoubleVector512Tests::unsliceBinary); } static double[] unslice(double[] a, double[] b, int origin, int part, boolean[] mask, int idx) { @@ -4031,7 +4068,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void unsliceDouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceDoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4048,7 +4085,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Double512VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, DoubleVector512Tests::unslice); } static double SIN(double a) { @@ -4060,7 +4097,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINDouble512VectorTests(IntFunction fa) { + static void SINDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4071,7 +4108,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::SIN, Double512VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::SIN, DoubleVector512Tests::strictSIN); } static double EXP(double a) { @@ -4083,7 +4120,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPDouble512VectorTests(IntFunction fa) { + static void EXPDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4094,7 +4131,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::EXP, Double512VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::EXP, DoubleVector512Tests::strictEXP); } static double LOG1P(double a) { @@ -4106,7 +4143,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG1PDouble512VectorTests(IntFunction fa) { + static void LOG1PDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4117,7 +4154,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::LOG1P, Double512VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::LOG1P, DoubleVector512Tests::strictLOG1P); } static double LOG(double a) { @@ -4129,7 +4166,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOGDouble512VectorTests(IntFunction fa) { + static void LOGDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4140,7 +4177,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::LOG, Double512VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::LOG, DoubleVector512Tests::strictLOG); } static double LOG10(double a) { @@ -4152,7 +4189,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG10Double512VectorTests(IntFunction fa) { + static void LOG10DoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4163,7 +4200,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::LOG10, Double512VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::LOG10, DoubleVector512Tests::strictLOG10); } static double EXPM1(double a) { @@ -4175,7 +4212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPM1Double512VectorTests(IntFunction fa) { + static void EXPM1DoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4186,7 +4223,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::EXPM1, Double512VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::EXPM1, DoubleVector512Tests::strictEXPM1); } static double COS(double a) { @@ -4198,7 +4235,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSDouble512VectorTests(IntFunction fa) { + static void COSDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4209,7 +4246,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::COS, Double512VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::COS, DoubleVector512Tests::strictCOS); } static double TAN(double a) { @@ -4221,7 +4258,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANDouble512VectorTests(IntFunction fa) { + static void TANDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4232,7 +4269,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::TAN, Double512VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::TAN, DoubleVector512Tests::strictTAN); } static double SINH(double a) { @@ -4244,7 +4281,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINHDouble512VectorTests(IntFunction fa) { + static void SINHDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4255,7 +4292,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::SINH, Double512VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::SINH, DoubleVector512Tests::strictSINH); } static double COSH(double a) { @@ -4267,7 +4304,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSHDouble512VectorTests(IntFunction fa) { + static void COSHDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4278,7 +4315,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::COSH, Double512VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::COSH, DoubleVector512Tests::strictCOSH); } static double TANH(double a) { @@ -4290,7 +4327,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANHDouble512VectorTests(IntFunction fa) { + static void TANHDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4301,7 +4338,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::TANH, Double512VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::TANH, DoubleVector512Tests::strictTANH); } static double ASIN(double a) { @@ -4313,7 +4350,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ASINDouble512VectorTests(IntFunction fa) { + static void ASINDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4324,7 +4361,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::ASIN, Double512VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::ASIN, DoubleVector512Tests::strictASIN); } static double ACOS(double a) { @@ -4336,7 +4373,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ACOSDouble512VectorTests(IntFunction fa) { + static void ACOSDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4347,7 +4384,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::ACOS, Double512VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::ACOS, DoubleVector512Tests::strictACOS); } static double ATAN(double a) { @@ -4359,7 +4396,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ATANDouble512VectorTests(IntFunction fa) { + static void ATANDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4370,7 +4407,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::ATAN, Double512VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::ATAN, DoubleVector512Tests::strictATAN); } static double CBRT(double a) { @@ -4382,7 +4419,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void CBRTDouble512VectorTests(IntFunction fa) { + static void CBRTDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4393,7 +4430,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double512VectorTests::CBRT, Double512VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector512Tests::CBRT, DoubleVector512Tests::strictCBRT); } static double HYPOT(double a, double b) { @@ -4405,7 +4442,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void HYPOTDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4418,7 +4455,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double512VectorTests::HYPOT, Double512VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector512Tests::HYPOT, DoubleVector512Tests::strictHYPOT); } @@ -4431,7 +4468,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void POWDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4444,7 +4481,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double512VectorTests::POW, Double512VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector512Tests::POW, DoubleVector512Tests::strictPOW); } @@ -4457,7 +4494,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void powDoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4470,7 +4507,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double512VectorTests::pow, Double512VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector512Tests::pow, DoubleVector512Tests::strictpow); } @@ -4483,7 +4520,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ATAN2Double512VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2DoubleVector512Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4496,12 +4533,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double512VectorTests::ATAN2, Double512VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector512Tests::ATAN2, DoubleVector512Tests::strictATAN2); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4511,12 +4548,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double512VectorTests::POW, Double512VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector512Tests::POW, DoubleVector512Tests::strictPOW); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4526,7 +4563,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double512VectorTests::pow, Double512VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector512Tests::pow, DoubleVector512Tests::strictpow); } @@ -4539,7 +4576,7 @@ relativeError)); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4561,11 +4598,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Double512VectorTests::FMA); + assertArraysEquals(r, a, b, c, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4585,11 +4622,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Double512VectorTests::fma); + assertArraysEquals(r, a, b, c, DoubleVector512Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMADoubleVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4614,11 +4651,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Double512VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4629,11 +4666,11 @@ relativeError)); DoubleVector bv = DoubleVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Double512VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4644,11 +4681,11 @@ relativeError)); DoubleVector cv = DoubleVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Double512VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4663,11 +4700,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Double512VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble512VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector512TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4682,11 +4719,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Double512VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4704,11 +4741,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double512VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector512Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4726,11 +4763,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double512VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector512Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector512TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4751,7 +4788,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Double512VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, DoubleVector512Tests::FMA); } static double NEG(double a) { @@ -4763,7 +4800,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void NEGDouble512VectorTests(IntFunction fa) { + static void NEGDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4774,11 +4811,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::NEG); + assertArraysEquals(r, a, DoubleVector512Tests::NEG); } @Test(dataProvider = "doubleUnaryOpProvider") - static void negDouble512VectorTests(IntFunction fa) { + static void negDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4789,11 +4826,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::neg); + assertArraysEquals(r, a, DoubleVector512Tests::neg); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void NEGMaskedDouble512VectorTests(IntFunction fa, + static void NEGMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4807,7 +4844,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double512VectorTests::NEG); + assertArraysEquals(r, a, mask, DoubleVector512Tests::NEG); } static double ABS(double a) { @@ -4819,7 +4856,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ABSDouble512VectorTests(IntFunction fa) { + static void ABSDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4830,11 +4867,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::ABS); + assertArraysEquals(r, a, DoubleVector512Tests::ABS); } @Test(dataProvider = "doubleUnaryOpProvider") - static void absDouble512VectorTests(IntFunction fa) { + static void absDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4845,11 +4882,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::abs); + assertArraysEquals(r, a, DoubleVector512Tests::abs); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ABSMaskedDouble512VectorTests(IntFunction fa, + static void ABSMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4863,7 +4900,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double512VectorTests::ABS); + assertArraysEquals(r, a, mask, DoubleVector512Tests::ABS); } static double SQRT(double a) { @@ -4875,7 +4912,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SQRTDouble512VectorTests(IntFunction fa) { + static void SQRTDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4886,11 +4923,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::SQRT); + assertArraysEquals(r, a, DoubleVector512Tests::SQRT); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sqrtDouble512VectorTests(IntFunction fa) { + static void sqrtDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4901,11 +4938,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::sqrt); + assertArraysEquals(r, a, DoubleVector512Tests::sqrt); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void SQRTMaskedDouble512VectorTests(IntFunction fa, + static void SQRTMaskedDoubleVector512Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4919,7 +4956,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double512VectorTests::SQRT); + assertArraysEquals(r, a, mask, DoubleVector512Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4927,7 +4964,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandDoubleVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4940,7 +4977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::band); + assertArraysEquals(r, a, b, DoubleVector512Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4948,7 +4985,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maskorDoubleVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4961,7 +4998,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::bor); + assertArraysEquals(r, a, b, DoubleVector512Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4969,7 +5006,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorDoubleVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4982,7 +5019,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::bxor); + assertArraysEquals(r, a, b, DoubleVector512Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4990,7 +5027,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotDoubleVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5003,7 +5040,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::bandNot); + assertArraysEquals(r, a, b, DoubleVector512Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -5011,7 +5048,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqDoubleVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5024,7 +5061,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double512VectorTests::beq); + assertArraysEquals(r, a, b, DoubleVector512Tests::beq); } static boolean unot(boolean a) { @@ -5032,7 +5069,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotDouble512VectorTests(IntFunction fa) { + static void masknotDoubleVector512Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5043,7 +5080,7 @@ relativeError)); } } - assertArraysEquals(r, a, Double512VectorTests::unot); + assertArraysEquals(r, a, DoubleVector512Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5052,15 +5089,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongDouble512VectorTests(IntFunction fa) { + static void maskFromToLongDoubleVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5074,7 +5111,7 @@ relativeError)); } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltDoubleVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5084,13 +5121,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqDoubleVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5100,13 +5137,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubletoIntUnaryOpProvider") - static void toIntArrayDouble512VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayDoubleVector512TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5117,7 +5154,7 @@ relativeError)); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void toLongArrayDouble512VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayDoubleVector512TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5129,7 +5166,7 @@ relativeError)); @Test(dataProvider = "doubleUnaryOpProvider") - static void toStringDouble512VectorTestsSmokeTest(IntFunction fa) { + static void toStringDoubleVector512TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5142,7 +5179,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void hashCodeDouble512VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeDoubleVector512TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5175,7 +5212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceLongDouble512VectorTests(IntFunction fa) { + static void ADDReduceLongDoubleVector512Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5191,7 +5228,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Double512VectorTests::ADDReduceLong, Double512VectorTests::ADDReduceAllLong); + DoubleVector512Tests::ADDReduceLong, DoubleVector512Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(double[] a, int idx, boolean[] mask) { @@ -5214,7 +5251,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceLongDouble512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongDoubleVector512TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5232,11 +5269,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Double512VectorTests::ADDReduceLongMasked, Double512VectorTests::ADDReduceAllLongMasked); + DoubleVector512Tests::ADDReduceLongMasked, DoubleVector512Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void BroadcastLongDouble512VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongDoubleVector512TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -5247,7 +5284,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendDoubleVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5261,12 +5298,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Double512VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector512Tests::blend); } @Test(dataProvider = "doubleUnaryOpSelectFromProvider") - static void SelectFromDouble512VectorTests(IntFunction fa, + static void SelectFromDoubleVector512Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); double[] order = fs.apply(a.length, SPECIES.length()); @@ -5282,7 +5319,7 @@ relativeError)); } @Test(dataProvider = "doubleSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorDouble512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorDoubleVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] idx = fc.apply(SPECIES.length()); @@ -5300,7 +5337,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpSelectFromMaskProvider") - static void SelectFromDouble512VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromDoubleVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -5319,7 +5356,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousDouble512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousDoubleVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5330,12 +5367,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringDouble512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringDoubleVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5349,7 +5386,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsDouble512VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsDoubleVector512TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5358,12 +5395,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsDouble512VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsDoubleVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5373,13 +5410,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeDouble512VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeDoubleVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5401,7 +5438,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountDouble512VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountDoubleVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5412,7 +5449,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double512VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, DoubleVector512Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5426,7 +5463,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueDouble512VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueDoubleVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5437,7 +5474,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double512VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector512Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5451,7 +5488,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueDouble512VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueDoubleVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5462,11 +5499,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double512VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector512Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressDouble512VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressDoubleVector512TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5476,7 +5513,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5494,7 +5531,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeDouble512VectorTestsSmokeTest(int offset) { + static void indexInRangeDoubleVector512TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5502,13 +5539,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongDouble512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongDoubleVector512TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5516,7 +5553,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5535,36 +5572,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundDouble512VectorTestsSmokeTest(int length) { + static void loopBoundDoubleVector512TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongDouble512VectorTestsSmokeTest(int _length) { + static void loopBoundLongDoubleVector512TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeDouble512VectorTestsSmokeTest() { + static void ElementSizeDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Double.SIZE); + assertEquals(elsize, Double.SIZE); } @Test - static void VectorShapeDouble512VectorTestsSmokeTest() { + static void VectorShapeDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_512_BIT)); } @Test - static void ShapeWithLanesDouble512VectorTestsSmokeTest() { + static void ShapeWithLanesDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(double.class); @@ -5572,32 +5609,32 @@ relativeError)); } @Test - static void ElementTypeDouble512VectorTestsSmokeTest() { + static void ElementTypeDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementType() == double.class); } @Test - static void SpeciesElementSizeDouble512VectorTestsSmokeTest() { + static void SpeciesElementSizeDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementSize() == Double.SIZE); } @Test - static void VectorTypeDouble512VectorTestsSmokeTest() { + static void VectorTypeDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesDouble512VectorTestsSmokeTest() { + static void WithLanesDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(double.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeDouble512VectorTestsSmokeTest() { + static void WithShapeDoubleVector512TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5605,9 +5642,9 @@ relativeError)); } @Test - static void MaskAllTrueDouble512VectorTestsSmokeTest() { + static void MaskAllTrueDoubleVector512TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleVector64LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector64LoadStoreTests.java index e2c48d84529..f07f5be00db 100644 --- a/test/jdk/jdk/incubator/vector/Double64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector64LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Double64VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation DoubleVector64LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class DoubleVector64LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_64; @@ -61,14 +61,29 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 64); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(double[] r, double[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "doubleProviderForIOOBE") @@ -870,11 +885,11 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(double[] r, double[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Double64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Double64VectorTests.java b/test/jdk/jdk/incubator/vector/DoubleVector64Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Double64VectorTests.java rename to test/jdk/jdk/incubator/vector/DoubleVector64Tests.java index ab3586fb424..7f9f8986f1f 100644 --- a/test/jdk/jdk/incubator/vector/Double64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVector64Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Double64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleVector64Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Double64VectorTests extends AbstractVectorTest { +public class DoubleVector64Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_64; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(double actual, double expected, double delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(double actual, double expected, double delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final double ADD_IDENTITY = (double)0; @@ -95,10 +132,10 @@ public class Double64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +147,13 @@ public class Double64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { double[] ref = f.apply(a[i]); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +163,10 @@ public class Double64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +188,13 @@ public class Double64VectorTests extends AbstractVectorTest { double relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +216,14 @@ public class Double64VectorTests extends AbstractVectorTest { double relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +239,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +261,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +279,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +294,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +306,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +322,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (double)0); + assertEquals(r[i + k], (double)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -310,19 +347,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (double)0); + assertEquals(r[i + j], (double)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -338,11 +375,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +388,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +403,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +423,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +447,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +462,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +477,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +501,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +527,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +546,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +557,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +568,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +580,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +596,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +611,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +626,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +644,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +660,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +678,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +704,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +722,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +746,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +761,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +773,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +786,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +805,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +826,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +841,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +862,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +958,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +985,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1006,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(r, a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1033,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1053,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1074,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1095,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1117,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1169,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1215,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1584,7 +1621,7 @@ relativeError)); // Do some zipping and shuffling. DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); DoubleVector a = io.add((double)1); //[1,2] DoubleVector b = a.neg(); //[-1,-2] double[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1599,19 +1636,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); DoubleVector uab0 = zab0.rearrange(unz0,zab1); DoubleVector uab1 = zab0.rearrange(unz1,zab1); double[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1628,15 +1665,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static double ADD(double a, double b) { @@ -1644,7 +1681,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1657,7 +1694,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::ADD); + assertArraysEquals(r, a, b, DoubleVector64Tests::ADD); } static double add(double a, double b) { @@ -1665,7 +1702,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void addDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1676,11 +1713,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double64VectorTests::add); + assertArraysEquals(r, a, b, DoubleVector64Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1696,11 +1733,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double64VectorTests::ADD); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1714,7 +1751,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double64VectorTests::add); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::add); } static double SUB(double a, double b) { @@ -1722,7 +1759,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void SUBDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void SUBDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1735,7 +1772,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::SUB); + assertArraysEquals(r, a, b, DoubleVector64Tests::SUB); } static double sub(double a, double b) { @@ -1743,7 +1780,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void subDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1754,11 +1791,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double64VectorTests::sub); + assertArraysEquals(r, a, b, DoubleVector64Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void SUBDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1774,11 +1811,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double64VectorTests::SUB); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::SUB); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1792,7 +1829,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double64VectorTests::sub); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::sub); } static double MUL(double a, double b) { @@ -1800,7 +1837,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MULDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void MULDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1813,7 +1850,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::MUL); + assertArraysEquals(r, a, b, DoubleVector64Tests::MUL); } static double mul(double a, double b) { @@ -1821,7 +1858,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void mulDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1832,11 +1869,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double64VectorTests::mul); + assertArraysEquals(r, a, b, DoubleVector64Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void MULDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1852,11 +1889,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double64VectorTests::MUL); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::MUL); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1870,7 +1907,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double64VectorTests::mul); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::mul); } static double DIV(double a, double b) { @@ -1878,7 +1915,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void DIVDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void DIVDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1891,7 +1928,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::DIV); + assertArraysEquals(r, a, b, DoubleVector64Tests::DIV); } static double div(double a, double b) { @@ -1899,7 +1936,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void divDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1910,11 +1947,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double64VectorTests::div); + assertArraysEquals(r, a, b, DoubleVector64Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void DIVDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1930,11 +1967,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double64VectorTests::DIV); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::DIV); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1948,7 +1985,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Double64VectorTests::div); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::div); } static double FIRST_NONZERO(double a, double b) { @@ -1956,7 +1993,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void FIRST_NONZERODouble64VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZERODoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1969,11 +2006,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, DoubleVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void FIRST_NONZERODouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZERODoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1989,11 +2026,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2003,11 +2040,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2020,11 +2057,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector64Tests::add); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2034,11 +2071,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2051,11 +2088,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector64Tests::sub); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2065,11 +2102,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2082,11 +2119,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector64Tests::mul); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2096,11 +2133,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2113,11 +2150,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Double64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVector64Tests::div); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDouble64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDDoubleVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2127,11 +2164,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Double64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, DoubleVector64Tests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDouble64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDDoubleVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2144,13 +2181,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Double64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector64Tests::ADD); } static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MINDouble64VectorTestsWithMemOp(IntFunction fa) { + static void MINDoubleVector64TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2161,13 +2198,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double64VectorTests::MIN); + assertArraysEquals(r, a, (double)10, DoubleVector64Tests::MIN); } static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void minDouble64VectorTestsWithMemOp(IntFunction fa) { + static void minDoubleVector64TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2178,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double64VectorTests::min); + assertArraysEquals(r, a, (double)10, DoubleVector64Tests::min); } static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINDouble64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINDoubleVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2197,13 +2234,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double64VectorTests::MIN); + assertArraysEquals(r, a, (double)10, mask, DoubleVector64Tests::MIN); } static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXDouble64VectorTestsWithMemOp(IntFunction fa) { + static void MAXDoubleVector64TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2214,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double64VectorTests::MAX); + assertArraysEquals(r, a, (double)10, DoubleVector64Tests::MAX); } static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void maxDouble64VectorTestsWithMemOp(IntFunction fa) { + static void maxDoubleVector64TestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2231,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, Double64VectorTests::max); + assertArraysEquals(r, a, (double)10, DoubleVector64Tests::max); } static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXDouble64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXDoubleVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2250,7 +2287,7 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, Double64VectorTests::MAX); + assertArraysEquals(r, a, (double)10, mask, DoubleVector64Tests::MAX); } static double MIN(double a, double b) { @@ -2258,7 +2295,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void MINDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2271,7 +2308,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::MIN); + assertArraysEquals(r, a, b, DoubleVector64Tests::MIN); } static double min(double a, double b) { @@ -2279,7 +2316,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void minDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2290,7 +2327,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double64VectorTests::min); + assertArraysEquals(r, a, b, DoubleVector64Tests::min); } static double MAX(double a, double b) { @@ -2298,7 +2335,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2311,7 +2348,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::MAX); + assertArraysEquals(r, a, b, DoubleVector64Tests::MAX); } static double max(double a, double b) { @@ -2319,7 +2356,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maxDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2330,11 +2367,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Double64VectorTests::max); + assertArraysEquals(r, a, b, DoubleVector64Tests::max); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2344,11 +2381,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::MIN); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2358,11 +2395,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::min); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::min); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2372,11 +2409,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::MAX); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2386,7 +2423,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Double64VectorTests::max); + assertBroadcastArraysEquals(r, a, b, DoubleVector64Tests::max); } static double ADDReduce(double[] a, int idx) { @@ -2408,7 +2445,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceDouble64VectorTests(IntFunction fa) { + static void ADDReduceDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2424,7 +2461,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double64VectorTests::ADDReduce, Double64VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector64Tests::ADDReduce, DoubleVector64Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2432,20 +2469,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = ADD_IDENTITY; - Assert.assertEquals((double) (id + id), id, + assertEquals((double) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id + x), x); - Assert.assertEquals((double) (x + id), x); + assertEquals((double) (id + x), x); + assertEquals((double) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id + x), x, + assertEquals((double) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x + id), x, + assertEquals((double) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2470,7 +2507,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceDouble64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceDoubleVector64TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2488,7 +2525,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double64VectorTests::ADDReduceMasked, Double64VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVector64Tests::ADDReduceMasked, DoubleVector64Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static double MULReduce(double[] a, int idx) { @@ -2510,7 +2547,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MULReduceDouble64VectorTests(IntFunction fa) { + static void MULReduceDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2526,7 +2563,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double64VectorTests::MULReduce, Double64VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector64Tests::MULReduce, DoubleVector64Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2534,20 +2571,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MUL_IDENTITY; - Assert.assertEquals((double) (id * id), id, + assertEquals((double) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id * x), x); - Assert.assertEquals((double) (x * id), x); + assertEquals((double) (id * x), x); + assertEquals((double) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id * x), x, + assertEquals((double) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x * id), x, + assertEquals((double) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2572,7 +2609,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MULReduceDouble64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceDoubleVector64TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2590,7 +2627,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double64VectorTests::MULReduceMasked, Double64VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVector64Tests::MULReduceMasked, DoubleVector64Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static double MINReduce(double[] a, int idx) { @@ -2612,7 +2649,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MINReduceDouble64VectorTests(IntFunction fa) { + static void MINReduceDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2628,7 +2665,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double64VectorTests::MINReduce, Double64VectorTests::MINReduceAll); + DoubleVector64Tests::MINReduce, DoubleVector64Tests::MINReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2636,20 +2673,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MIN_IDENTITY; - Assert.assertEquals((double) Math.min(id, id), id, + assertEquals((double) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.min(id, x), x); - Assert.assertEquals((double) Math.min(x, id), x); + assertEquals((double) Math.min(id, x), x); + assertEquals((double) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.min(id, x), x, + assertEquals((double) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.min(x, id), x, + assertEquals((double) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2674,7 +2711,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINReduceDouble64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceDoubleVector64TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2692,7 +2729,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double64VectorTests::MINReduceMasked, Double64VectorTests::MINReduceAllMasked); + DoubleVector64Tests::MINReduceMasked, DoubleVector64Tests::MINReduceAllMasked); } static double MAXReduce(double[] a, int idx) { @@ -2714,7 +2751,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXReduceDouble64VectorTests(IntFunction fa) { + static void MAXReduceDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2730,7 +2767,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double64VectorTests::MAXReduce, Double64VectorTests::MAXReduceAll); + DoubleVector64Tests::MAXReduce, DoubleVector64Tests::MAXReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2738,20 +2775,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MAX_IDENTITY; - Assert.assertEquals((double) Math.max(id, id), id, + assertEquals((double) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.max(id, x), x); - Assert.assertEquals((double) Math.max(x, id), x); + assertEquals((double) Math.max(id, x), x); + assertEquals((double) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.max(id, x), x, + assertEquals((double) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.max(x, id), x, + assertEquals((double) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2776,7 +2813,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXReduceDouble64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceDoubleVector64TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2794,7 +2831,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double64VectorTests::MAXReduceMasked, Double64VectorTests::MAXReduceAllMasked); + DoubleVector64Tests::MAXReduceMasked, DoubleVector64Tests::MAXReduceAllMasked); } static double FIRST_NONZEROReduce(double[] a, int idx) { @@ -2816,7 +2853,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void FIRST_NONZEROReduceDouble64VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2832,7 +2869,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Double64VectorTests::FIRST_NONZEROReduce, Double64VectorTests::FIRST_NONZEROReduceAll); + DoubleVector64Tests::FIRST_NONZEROReduce, DoubleVector64Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2840,20 +2877,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2878,7 +2915,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void FIRST_NONZEROReduceDouble64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceDoubleVector64TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2896,11 +2933,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Double64VectorTests::FIRST_NONZEROReduceMasked, Double64VectorTests::FIRST_NONZEROReduceAllMasked); + DoubleVector64Tests::FIRST_NONZEROReduceMasked, DoubleVector64Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "doubleBinaryOpProvider") - static void withDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void withDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2923,7 +2960,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_DEFAULTDouble64VectorTests(IntFunction fa) { + static void IS_DEFAULTDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2933,14 +2970,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_DEFAULTMaskedDouble64VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2953,7 +2990,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2964,7 +3001,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NEGATIVEDouble64VectorTests(IntFunction fa) { + static void IS_NEGATIVEDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2974,14 +3011,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NEGATIVEMaskedDouble64VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2994,7 +3031,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3005,7 +3042,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_FINITEDouble64VectorTests(IntFunction fa) { + static void IS_FINITEDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3015,14 +3052,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_FINITEMaskedDouble64VectorTests(IntFunction fa, + static void IS_FINITEMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3035,7 +3072,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3046,7 +3083,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NANDouble64VectorTests(IntFunction fa) { + static void IS_NANDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3056,14 +3093,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NANMaskedDouble64VectorTests(IntFunction fa, + static void IS_NANMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3076,7 +3113,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3087,7 +3124,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_INFINITEDouble64VectorTests(IntFunction fa) { + static void IS_INFINITEDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3097,14 +3134,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_INFINITEMaskedDouble64VectorTests(IntFunction fa, + static void IS_INFINITEMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3117,14 +3154,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void LTDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3136,14 +3173,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void ltDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3155,14 +3192,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3178,14 +3215,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GTDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void GTDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3197,14 +3234,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GTDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3220,14 +3257,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void EQDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3239,14 +3276,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void eqDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3258,14 +3295,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3281,14 +3318,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void NEDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void NEDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3300,14 +3337,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void NEDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3323,14 +3360,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LEDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void LEDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3342,14 +3379,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LEDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3365,14 +3402,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GEDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void GEDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3384,14 +3421,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GEDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3407,14 +3444,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3424,13 +3461,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3444,13 +3481,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDouble64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3460,13 +3497,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDouble64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTDoubleVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3480,13 +3517,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3496,13 +3533,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3516,13 +3553,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDouble64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3532,13 +3569,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDouble64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQDoubleVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3552,7 +3589,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); } } } @@ -3562,7 +3599,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble64VectorTests(IntFunction fa, IntFunction fb, + static void blendDoubleVector64Tests(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3578,11 +3615,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Double64VectorTests::blend); + assertArraysEquals(r, a, b, mask, DoubleVector64Tests::blend); } @Test(dataProvider = "doubleUnaryOpShuffleProvider") - static void RearrangeDouble64VectorTests(IntFunction fa, + static void RearrangeDoubleVector64Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3599,7 +3636,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpShuffleMaskProvider") - static void RearrangeDouble64VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeDoubleVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -3617,7 +3654,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void compressDouble64VectorTests(IntFunction fa, + static void compressDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3635,7 +3672,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void expandDouble64VectorTests(IntFunction fa, + static void expandDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3653,7 +3690,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void getDouble64VectorTests(IntFunction fa) { + static void getDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3809,7 +3846,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void BroadcastDouble64VectorTests(IntFunction fa) { + static void BroadcastDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3823,7 +3860,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ZeroDouble64VectorTests(IntFunction fa) { + static void ZeroDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3833,7 +3870,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static double[] sliceUnary(double[] a, int origin, int idx) { @@ -3848,7 +3885,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sliceUnaryDouble64VectorTests(IntFunction fa) { + static void sliceUnaryDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3859,7 +3896,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double64VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, DoubleVector64Tests::sliceUnary); } static double[] sliceBinary(double[] a, double[] b, int origin, int idx) { @@ -3876,7 +3913,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void sliceBinaryDouble64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryDoubleVector64TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3889,7 +3926,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Double64VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, DoubleVector64Tests::sliceBinary); } static double[] slice(double[] a, double[] b, int origin, boolean[] mask, int idx) { @@ -3906,7 +3943,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void sliceDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3923,7 +3960,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Double64VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, DoubleVector64Tests::slice); } static double[] unsliceUnary(double[] a, int origin, int idx) { @@ -3940,7 +3977,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void unsliceUnaryDouble64VectorTests(IntFunction fa) { + static void unsliceUnaryDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3951,7 +3988,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Double64VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, DoubleVector64Tests::unsliceUnary); } static double[] unsliceBinary(double[] a, double[] b, int origin, int part, int idx) { @@ -3977,7 +4014,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void unsliceBinaryDouble64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryDoubleVector64TestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3991,7 +4028,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Double64VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, DoubleVector64Tests::unsliceBinary); } static double[] unslice(double[] a, double[] b, int origin, int part, boolean[] mask, int idx) { @@ -4031,7 +4068,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void unsliceDouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceDoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4048,7 +4085,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Double64VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, DoubleVector64Tests::unslice); } static double SIN(double a) { @@ -4060,7 +4097,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINDouble64VectorTests(IntFunction fa) { + static void SINDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4071,7 +4108,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::SIN, Double64VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::SIN, DoubleVector64Tests::strictSIN); } static double EXP(double a) { @@ -4083,7 +4120,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPDouble64VectorTests(IntFunction fa) { + static void EXPDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4094,7 +4131,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::EXP, Double64VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::EXP, DoubleVector64Tests::strictEXP); } static double LOG1P(double a) { @@ -4106,7 +4143,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG1PDouble64VectorTests(IntFunction fa) { + static void LOG1PDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4117,7 +4154,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::LOG1P, Double64VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::LOG1P, DoubleVector64Tests::strictLOG1P); } static double LOG(double a) { @@ -4129,7 +4166,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOGDouble64VectorTests(IntFunction fa) { + static void LOGDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4140,7 +4177,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::LOG, Double64VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::LOG, DoubleVector64Tests::strictLOG); } static double LOG10(double a) { @@ -4152,7 +4189,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG10Double64VectorTests(IntFunction fa) { + static void LOG10DoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4163,7 +4200,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::LOG10, Double64VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::LOG10, DoubleVector64Tests::strictLOG10); } static double EXPM1(double a) { @@ -4175,7 +4212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPM1Double64VectorTests(IntFunction fa) { + static void EXPM1DoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4186,7 +4223,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::EXPM1, Double64VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::EXPM1, DoubleVector64Tests::strictEXPM1); } static double COS(double a) { @@ -4198,7 +4235,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSDouble64VectorTests(IntFunction fa) { + static void COSDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4209,7 +4246,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::COS, Double64VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::COS, DoubleVector64Tests::strictCOS); } static double TAN(double a) { @@ -4221,7 +4258,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANDouble64VectorTests(IntFunction fa) { + static void TANDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4232,7 +4269,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::TAN, Double64VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::TAN, DoubleVector64Tests::strictTAN); } static double SINH(double a) { @@ -4244,7 +4281,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINHDouble64VectorTests(IntFunction fa) { + static void SINHDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4255,7 +4292,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::SINH, Double64VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::SINH, DoubleVector64Tests::strictSINH); } static double COSH(double a) { @@ -4267,7 +4304,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSHDouble64VectorTests(IntFunction fa) { + static void COSHDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4278,7 +4315,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::COSH, Double64VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::COSH, DoubleVector64Tests::strictCOSH); } static double TANH(double a) { @@ -4290,7 +4327,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANHDouble64VectorTests(IntFunction fa) { + static void TANHDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4301,7 +4338,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::TANH, Double64VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::TANH, DoubleVector64Tests::strictTANH); } static double ASIN(double a) { @@ -4313,7 +4350,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ASINDouble64VectorTests(IntFunction fa) { + static void ASINDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4324,7 +4361,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::ASIN, Double64VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::ASIN, DoubleVector64Tests::strictASIN); } static double ACOS(double a) { @@ -4336,7 +4373,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ACOSDouble64VectorTests(IntFunction fa) { + static void ACOSDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4347,7 +4384,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::ACOS, Double64VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::ACOS, DoubleVector64Tests::strictACOS); } static double ATAN(double a) { @@ -4359,7 +4396,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ATANDouble64VectorTests(IntFunction fa) { + static void ATANDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4370,7 +4407,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::ATAN, Double64VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::ATAN, DoubleVector64Tests::strictATAN); } static double CBRT(double a) { @@ -4382,7 +4419,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void CBRTDouble64VectorTests(IntFunction fa) { + static void CBRTDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4393,7 +4430,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::CBRT, Double64VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, DoubleVector64Tests::CBRT, DoubleVector64Tests::strictCBRT); } static double HYPOT(double a, double b) { @@ -4405,7 +4442,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void HYPOTDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4418,7 +4455,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double64VectorTests::HYPOT, Double64VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector64Tests::HYPOT, DoubleVector64Tests::strictHYPOT); } @@ -4431,7 +4468,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void POWDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4444,7 +4481,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double64VectorTests::POW, Double64VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector64Tests::POW, DoubleVector64Tests::strictPOW); } @@ -4457,7 +4494,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void powDoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4470,7 +4507,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double64VectorTests::pow, Double64VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector64Tests::pow, DoubleVector64Tests::strictpow); } @@ -4483,7 +4520,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ATAN2Double64VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2DoubleVector64Tests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4496,12 +4533,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Double64VectorTests::ATAN2, Double64VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVector64Tests::ATAN2, DoubleVector64Tests::strictATAN2); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4511,12 +4548,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double64VectorTests::POW, Double64VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector64Tests::POW, DoubleVector64Tests::strictPOW); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4526,7 +4563,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double64VectorTests::pow, Double64VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVector64Tests::pow, DoubleVector64Tests::strictpow); } @@ -4539,7 +4576,7 @@ relativeError)); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4561,11 +4598,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Double64VectorTests::FMA); + assertArraysEquals(r, a, b, c, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4585,11 +4622,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Double64VectorTests::fma); + assertArraysEquals(r, a, b, c, DoubleVector64Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMADoubleVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4614,11 +4651,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Double64VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4629,11 +4666,11 @@ relativeError)); DoubleVector bv = DoubleVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Double64VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4644,11 +4681,11 @@ relativeError)); DoubleVector cv = DoubleVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Double64VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4663,11 +4700,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Double64VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble64VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector64TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4682,11 +4719,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Double64VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADouble64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4704,11 +4741,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double64VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector64Tests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDouble64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4726,11 +4763,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Double64VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVector64Tests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADouble64VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVector64TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4751,7 +4788,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Double64VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, DoubleVector64Tests::FMA); } static double NEG(double a) { @@ -4763,7 +4800,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void NEGDouble64VectorTests(IntFunction fa) { + static void NEGDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4774,11 +4811,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::NEG); + assertArraysEquals(r, a, DoubleVector64Tests::NEG); } @Test(dataProvider = "doubleUnaryOpProvider") - static void negDouble64VectorTests(IntFunction fa) { + static void negDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4789,11 +4826,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::neg); + assertArraysEquals(r, a, DoubleVector64Tests::neg); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void NEGMaskedDouble64VectorTests(IntFunction fa, + static void NEGMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4807,7 +4844,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double64VectorTests::NEG); + assertArraysEquals(r, a, mask, DoubleVector64Tests::NEG); } static double ABS(double a) { @@ -4819,7 +4856,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ABSDouble64VectorTests(IntFunction fa) { + static void ABSDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4830,11 +4867,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::ABS); + assertArraysEquals(r, a, DoubleVector64Tests::ABS); } @Test(dataProvider = "doubleUnaryOpProvider") - static void absDouble64VectorTests(IntFunction fa) { + static void absDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4845,11 +4882,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::abs); + assertArraysEquals(r, a, DoubleVector64Tests::abs); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ABSMaskedDouble64VectorTests(IntFunction fa, + static void ABSMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4863,7 +4900,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double64VectorTests::ABS); + assertArraysEquals(r, a, mask, DoubleVector64Tests::ABS); } static double SQRT(double a) { @@ -4875,7 +4912,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SQRTDouble64VectorTests(IntFunction fa) { + static void SQRTDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4886,11 +4923,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::SQRT); + assertArraysEquals(r, a, DoubleVector64Tests::SQRT); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sqrtDouble64VectorTests(IntFunction fa) { + static void sqrtDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4901,11 +4938,11 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::sqrt); + assertArraysEquals(r, a, DoubleVector64Tests::sqrt); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void SQRTMaskedDouble64VectorTests(IntFunction fa, + static void SQRTMaskedDoubleVector64Tests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4919,7 +4956,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Double64VectorTests::SQRT); + assertArraysEquals(r, a, mask, DoubleVector64Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4927,7 +4964,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandDoubleVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4940,7 +4977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::band); + assertArraysEquals(r, a, b, DoubleVector64Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4948,7 +4985,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maskorDoubleVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4961,7 +4998,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::bor); + assertArraysEquals(r, a, b, DoubleVector64Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4969,7 +5006,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorDoubleVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4982,7 +5019,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::bxor); + assertArraysEquals(r, a, b, DoubleVector64Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4990,7 +5027,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotDoubleVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5003,7 +5040,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::bandNot); + assertArraysEquals(r, a, b, DoubleVector64Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -5011,7 +5048,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqDoubleVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5024,7 +5061,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Double64VectorTests::beq); + assertArraysEquals(r, a, b, DoubleVector64Tests::beq); } static boolean unot(boolean a) { @@ -5032,7 +5069,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotDouble64VectorTests(IntFunction fa) { + static void masknotDoubleVector64Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5043,7 +5080,7 @@ relativeError)); } } - assertArraysEquals(r, a, Double64VectorTests::unot); + assertArraysEquals(r, a, DoubleVector64Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5052,15 +5089,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongDouble64VectorTests(IntFunction fa) { + static void maskFromToLongDoubleVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5074,7 +5111,7 @@ relativeError)); } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDouble64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltDoubleVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5084,13 +5121,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDouble64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqDoubleVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5100,13 +5137,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubletoIntUnaryOpProvider") - static void toIntArrayDouble64VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayDoubleVector64TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5117,7 +5154,7 @@ relativeError)); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void toLongArrayDouble64VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayDoubleVector64TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5129,7 +5166,7 @@ relativeError)); @Test(dataProvider = "doubleUnaryOpProvider") - static void toStringDouble64VectorTestsSmokeTest(IntFunction fa) { + static void toStringDoubleVector64TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5142,7 +5179,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void hashCodeDouble64VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeDoubleVector64TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5175,7 +5212,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceLongDouble64VectorTests(IntFunction fa) { + static void ADDReduceLongDoubleVector64Tests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5191,7 +5228,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Double64VectorTests::ADDReduceLong, Double64VectorTests::ADDReduceAllLong); + DoubleVector64Tests::ADDReduceLong, DoubleVector64Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(double[] a, int idx, boolean[] mask) { @@ -5214,7 +5251,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceLongDouble64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongDoubleVector64TestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5232,11 +5269,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Double64VectorTests::ADDReduceLongMasked, Double64VectorTests::ADDReduceAllLongMasked); + DoubleVector64Tests::ADDReduceLongMasked, DoubleVector64Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void BroadcastLongDouble64VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongDoubleVector64TestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -5247,7 +5284,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDouble64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendDoubleVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5261,12 +5298,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Double64VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVector64Tests::blend); } @Test(dataProvider = "doubleUnaryOpSelectFromProvider") - static void SelectFromDouble64VectorTests(IntFunction fa, + static void SelectFromDoubleVector64Tests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); double[] order = fs.apply(a.length, SPECIES.length()); @@ -5282,7 +5319,7 @@ relativeError)); } @Test(dataProvider = "doubleSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorDouble64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorDoubleVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] idx = fc.apply(SPECIES.length()); @@ -5300,7 +5337,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpSelectFromMaskProvider") - static void SelectFromDouble64VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromDoubleVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -5319,7 +5356,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousDouble64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousDoubleVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5330,12 +5367,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringDouble64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringDoubleVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5349,7 +5386,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsDouble64VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsDoubleVector64TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5358,12 +5395,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsDouble64VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsDoubleVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5373,13 +5410,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeDouble64VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeDoubleVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5401,7 +5438,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountDouble64VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountDoubleVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5412,7 +5449,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double64VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, DoubleVector64Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5426,7 +5463,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueDouble64VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueDoubleVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5437,7 +5474,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double64VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector64Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5451,7 +5488,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueDouble64VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueDoubleVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5462,11 +5499,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Double64VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, DoubleVector64Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressDouble64VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressDoubleVector64TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5476,7 +5513,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5494,7 +5531,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeDouble64VectorTestsSmokeTest(int offset) { + static void indexInRangeDoubleVector64TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5502,13 +5539,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongDouble64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongDoubleVector64TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5516,7 +5553,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5535,36 +5572,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundDouble64VectorTestsSmokeTest(int length) { + static void loopBoundDoubleVector64TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongDouble64VectorTestsSmokeTest(int _length) { + static void loopBoundLongDoubleVector64TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeDouble64VectorTestsSmokeTest() { + static void ElementSizeDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Double.SIZE); + assertEquals(elsize, Double.SIZE); } @Test - static void VectorShapeDouble64VectorTestsSmokeTest() { + static void VectorShapeDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_64_BIT)); } @Test - static void ShapeWithLanesDouble64VectorTestsSmokeTest() { + static void ShapeWithLanesDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(double.class); @@ -5572,32 +5609,32 @@ relativeError)); } @Test - static void ElementTypeDouble64VectorTestsSmokeTest() { + static void ElementTypeDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementType() == double.class); } @Test - static void SpeciesElementSizeDouble64VectorTestsSmokeTest() { + static void SpeciesElementSizeDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementSize() == Double.SIZE); } @Test - static void VectorTypeDouble64VectorTestsSmokeTest() { + static void VectorTypeDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesDouble64VectorTestsSmokeTest() { + static void WithLanesDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(double.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeDouble64VectorTestsSmokeTest() { + static void WithShapeDoubleVector64TestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5605,9 +5642,9 @@ relativeError)); } @Test - static void MaskAllTrueDouble64VectorTestsSmokeTest() { + static void MaskAllTrueDoubleVector64TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/DoubleVectorMaxLoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/DoubleVectorMaxLoadStoreTests.java index f8ea6d7c4a2..e52ce2aa0d4 100644 --- a/test/jdk/jdk/incubator/vector/DoubleMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVectorMaxLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED - * -XX:-TieredCompilation DoubleMaxVectorLoadStoreTests + * -XX:-TieredCompilation DoubleVectorMaxLoadStoreTests * */ @@ -52,7 +52,7 @@ import java.util.List; import java.util.function.*; @Test -public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class DoubleVectorMaxLoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_MAX; @@ -68,14 +68,29 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / Max); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(double[] r, double[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (double) 0, "at index #" + i); } } @@ -329,7 +344,7 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "doubleProviderForIOOBE") @@ -877,11 +892,11 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -892,11 +907,11 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (double) 0, "at index #" + j); } } @@ -912,7 +927,7 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(double[] r, double[] a, int[] indexMap) { @@ -925,7 +940,7 @@ public class DoubleMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java b/test/jdk/jdk/incubator/vector/DoubleVectorMaxTests.java similarity index 82% rename from test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java rename to test/jdk/jdk/incubator/vector/DoubleVectorMaxTests.java index 8f135cd221a..c4dda942e83 100644 --- a/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/DoubleVectorMaxTests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation DoubleVectorMaxTests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class DoubleMaxVectorTests extends AbstractVectorTest { +public class DoubleVectorMaxTests extends AbstractVectorTest { static final VectorSpecies SPECIES = DoubleVector.SPECIES_MAX; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(double actual, double expected, double delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(double actual, double expected, double delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(double [] actual, double [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double [] actual, double [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static VectorShape getMaxBit() { return VectorShape.S_Max_BIT; @@ -101,10 +138,10 @@ public class DoubleMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -116,13 +153,13 @@ public class DoubleMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { double[] ref = f.apply(a[i]); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -132,10 +169,10 @@ public class DoubleMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -157,13 +194,13 @@ public class DoubleMaxVectorTests extends AbstractVectorTest { double relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -185,14 +222,14 @@ public class DoubleMaxVectorTests extends AbstractVectorTest { double relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -208,13 +245,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -230,13 +267,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -248,10 +285,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -263,10 +300,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -275,12 +312,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -291,20 +328,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (double)0); + assertEquals(r[i + k], (double)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -316,19 +353,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (double)0); + assertEquals(r[i + j], (double)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (double)0, "at index #" + idx); + assertEquals(r[idx], (double)0, "at index #" + idx); } } } @@ -344,11 +381,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -357,12 +394,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -372,17 +409,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -392,17 +429,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (double)0); + assertEquals(r[i+j], (double)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (double)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -416,10 +453,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -431,10 +468,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -446,10 +483,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -470,18 +507,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -496,18 +533,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -515,10 +552,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -526,10 +563,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -537,10 +574,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -549,10 +586,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -565,10 +602,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -580,10 +617,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -595,10 +632,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -613,10 +650,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (double)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -629,11 +666,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -647,11 +684,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -673,11 +710,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -691,11 +728,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -715,10 +752,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -730,10 +767,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -742,10 +779,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -755,10 +792,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -774,11 +811,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -795,11 +832,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -810,11 +847,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -831,11 +868,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -927,13 +964,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -954,13 +991,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -975,13 +1012,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { double[] ref = f.apply(r, a, i, mask, b, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -1002,13 +1039,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1022,13 +1059,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1043,13 +1080,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1064,13 +1101,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1086,13 +1123,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { double[] ref = f.apply(a, b, origin, part, mask, i); double[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1138,10 +1175,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1184,10 +1221,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1590,7 +1627,7 @@ relativeError)); // Do some zipping and shuffling. DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); DoubleVector a = io.add((double)1); //[1,2] DoubleVector b = a.neg(); //[-1,-2] double[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1605,19 +1642,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); DoubleVector uab0 = zab0.rearrange(unz0,zab1); DoubleVector uab1 = zab0.rearrange(unz1,zab1); double[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { DoubleVector io = (DoubleVector) SPECIES.broadcast(0).addIndex(1); DoubleVector io2 = (DoubleVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1634,15 +1671,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static double ADD(double a, double b) { @@ -1650,7 +1687,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ADDDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1663,7 +1700,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::ADD); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::ADD); } static double add(double a, double b) { @@ -1671,7 +1708,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void addDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1682,11 +1719,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::add); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1702,11 +1739,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::ADD); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void addDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1720,7 +1757,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::add); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::add); } static double SUB(double a, double b) { @@ -1728,7 +1765,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void SUBDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUBDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1741,7 +1778,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::SUB); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::SUB); } static double sub(double a, double b) { @@ -1749,7 +1786,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void subDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1760,11 +1797,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::sub); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void SUBDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1780,11 +1817,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::SUB); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::SUB); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void subDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1798,7 +1835,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::sub); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::sub); } static double MUL(double a, double b) { @@ -1806,7 +1843,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MULDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MULDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1819,7 +1856,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::MUL); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::MUL); } static double mul(double a, double b) { @@ -1827,7 +1864,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void mulDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1838,11 +1875,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::mul); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void MULDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1858,11 +1895,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::MUL); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::MUL); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1876,7 +1913,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::mul); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::mul); } static double DIV(double a, double b) { @@ -1884,7 +1921,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void DIVDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void DIVDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1897,7 +1934,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::DIV); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::DIV); } static double div(double a, double b) { @@ -1905,7 +1942,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void divDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1916,11 +1953,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::div); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void DIVDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1936,11 +1973,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::DIV); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::DIV); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void divDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1954,7 +1991,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::div); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::div); } static double FIRST_NONZERO(double a, double b) { @@ -1962,7 +1999,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void FIRST_NONZERODoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZERODoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -1975,11 +2012,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void FIRST_NONZERODoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZERODoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -1995,11 +2032,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "doubleBinaryOpProvider") - static void addDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2009,11 +2046,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::add); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void addDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2026,11 +2063,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, DoubleMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVectorMaxTests::add); } @Test(dataProvider = "doubleBinaryOpProvider") - static void subDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2040,11 +2077,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::sub); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void subDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2057,11 +2094,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, DoubleMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVectorMaxTests::sub); } @Test(dataProvider = "doubleBinaryOpProvider") - static void mulDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2071,11 +2108,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::mul); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void mulDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2088,11 +2125,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, DoubleMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVectorMaxTests::mul); } @Test(dataProvider = "doubleBinaryOpProvider") - static void divDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2102,11 +2139,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::div); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void divDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2119,11 +2156,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, DoubleMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, DoubleVectorMaxTests::div); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ADDDoubleMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDDoubleVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2133,11 +2170,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, DoubleMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, DoubleVectorMaxTests::ADD); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void ADDDoubleMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDDoubleVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -2150,13 +2187,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, DoubleMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVectorMaxTests::ADD); } static DoubleVector bv_MIN = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MINDoubleMaxVectorTestsWithMemOp(IntFunction fa) { + static void MINDoubleVectorMaxTestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2167,13 +2204,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, DoubleMaxVectorTests::MIN); + assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::MIN); } static DoubleVector bv_min = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void minDoubleMaxVectorTestsWithMemOp(IntFunction fa) { + static void minDoubleVectorMaxTestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2184,13 +2221,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, DoubleMaxVectorTests::min); + assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::min); } static DoubleVector bv_MIN_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINDoubleMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINDoubleVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2203,13 +2240,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, DoubleMaxVectorTests::MIN); + assertArraysEquals(r, a, (double)10, mask, DoubleVectorMaxTests::MIN); } static DoubleVector bv_MAX = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXDoubleMaxVectorTestsWithMemOp(IntFunction fa) { + static void MAXDoubleVectorMaxTestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2220,13 +2257,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, DoubleMaxVectorTests::MAX); + assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::MAX); } static DoubleVector bv_max = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpProvider") - static void maxDoubleMaxVectorTestsWithMemOp(IntFunction fa) { + static void maxDoubleVectorMaxTestsWithMemOp(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2237,13 +2274,13 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, DoubleMaxVectorTests::max); + assertArraysEquals(r, a, (double)10, DoubleVectorMaxTests::max); } static DoubleVector bv_MAX_M = DoubleVector.broadcast(SPECIES, (double)10); @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXDoubleMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXDoubleVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2256,7 +2293,7 @@ relativeError)); } } - assertArraysEquals(r, a, (double)10, mask, DoubleMaxVectorTests::MAX); + assertArraysEquals(r, a, (double)10, mask, DoubleVectorMaxTests::MAX); } static double MIN(double a, double b) { @@ -2264,7 +2301,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MINDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2277,7 +2314,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::MIN); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::MIN); } static double min(double a, double b) { @@ -2285,7 +2322,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void minDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2296,7 +2333,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::min); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::min); } static double MAX(double a, double b) { @@ -2304,7 +2341,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MAXDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2317,7 +2354,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::MAX); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::MAX); } static double max(double a, double b) { @@ -2325,7 +2362,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maxDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2336,11 +2373,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::max); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::max); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MINDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2350,11 +2387,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::MIN); } @Test(dataProvider = "doubleBinaryOpProvider") - static void minDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2364,11 +2401,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::min); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::min); } @Test(dataProvider = "doubleBinaryOpProvider") - static void MAXDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2378,11 +2415,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::MAX); } @Test(dataProvider = "doubleBinaryOpProvider") - static void maxDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2392,7 +2429,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, DoubleMaxVectorTests::max); + assertBroadcastArraysEquals(r, a, b, DoubleVectorMaxTests::max); } static double ADDReduce(double[] a, int idx) { @@ -2414,7 +2451,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceDoubleMaxVectorTests(IntFunction fa) { + static void ADDReduceDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2430,7 +2467,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - DoubleMaxVectorTests::ADDReduce, DoubleMaxVectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVectorMaxTests::ADDReduce, DoubleVectorMaxTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2438,20 +2475,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = ADD_IDENTITY; - Assert.assertEquals((double) (id + id), id, + assertEquals((double) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id + x), x); - Assert.assertEquals((double) (x + id), x); + assertEquals((double) (id + x), x); + assertEquals((double) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id + x), x, + assertEquals((double) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x + id), x, + assertEquals((double) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2476,7 +2513,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2494,7 +2531,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - DoubleMaxVectorTests::ADDReduceMasked, DoubleMaxVectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + DoubleVectorMaxTests::ADDReduceMasked, DoubleVectorMaxTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static double MULReduce(double[] a, int idx) { @@ -2516,7 +2553,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MULReduceDoubleMaxVectorTests(IntFunction fa) { + static void MULReduceDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2532,7 +2569,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - DoubleMaxVectorTests::MULReduce, DoubleMaxVectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVectorMaxTests::MULReduce, DoubleVectorMaxTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2540,20 +2577,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MUL_IDENTITY; - Assert.assertEquals((double) (id * id), id, + assertEquals((double) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) (id * x), x); - Assert.assertEquals((double) (x * id), x); + assertEquals((double) (id * x), x); + assertEquals((double) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) (id * x), x, + assertEquals((double) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) (x * id), x, + assertEquals((double) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2578,7 +2615,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MULReduceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2596,7 +2633,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - DoubleMaxVectorTests::MULReduceMasked, DoubleMaxVectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + DoubleVectorMaxTests::MULReduceMasked, DoubleVectorMaxTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static double MINReduce(double[] a, int idx) { @@ -2618,7 +2655,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MINReduceDoubleMaxVectorTests(IntFunction fa) { + static void MINReduceDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2634,7 +2671,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - DoubleMaxVectorTests::MINReduce, DoubleMaxVectorTests::MINReduceAll); + DoubleVectorMaxTests::MINReduce, DoubleVectorMaxTests::MINReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2642,20 +2679,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MIN_IDENTITY; - Assert.assertEquals((double) Math.min(id, id), id, + assertEquals((double) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.min(id, x), x); - Assert.assertEquals((double) Math.min(x, id), x); + assertEquals((double) Math.min(id, x), x); + assertEquals((double) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.min(id, x), x, + assertEquals((double) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.min(x, id), x, + assertEquals((double) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2680,7 +2717,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MINReduceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2698,7 +2735,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - DoubleMaxVectorTests::MINReduceMasked, DoubleMaxVectorTests::MINReduceAllMasked); + DoubleVectorMaxTests::MINReduceMasked, DoubleVectorMaxTests::MINReduceAllMasked); } static double MAXReduce(double[] a, int idx) { @@ -2720,7 +2757,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void MAXReduceDoubleMaxVectorTests(IntFunction fa) { + static void MAXReduceDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2736,7 +2773,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - DoubleMaxVectorTests::MAXReduce, DoubleMaxVectorTests::MAXReduceAll); + DoubleVectorMaxTests::MAXReduce, DoubleVectorMaxTests::MAXReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2744,20 +2781,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = MAX_IDENTITY; - Assert.assertEquals((double) Math.max(id, id), id, + assertEquals((double) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((double) Math.max(id, x), x); - Assert.assertEquals((double) Math.max(x, id), x); + assertEquals((double) Math.max(id, x), x); + assertEquals((double) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((double) Math.max(id, x), x, + assertEquals((double) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((double) Math.max(x, id), x, + assertEquals((double) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2782,7 +2819,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void MAXReduceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2800,7 +2837,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - DoubleMaxVectorTests::MAXReduceMasked, DoubleMaxVectorTests::MAXReduceAllMasked); + DoubleVectorMaxTests::MAXReduceMasked, DoubleVectorMaxTests::MAXReduceAllMasked); } static double FIRST_NONZEROReduce(double[] a, int idx) { @@ -2822,7 +2859,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void FIRST_NONZEROReduceDoubleMaxVectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -2838,7 +2875,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - DoubleMaxVectorTests::FIRST_NONZEROReduce, DoubleMaxVectorTests::FIRST_NONZEROReduceAll); + DoubleVectorMaxTests::FIRST_NONZEROReduce, DoubleVectorMaxTests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "doubleUnaryOpProvider") @@ -2846,20 +2883,20 @@ relativeError)); double[] a = fa.apply(SPECIES.length()); double id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); double x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2884,7 +2921,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void FIRST_NONZEROReduceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2902,11 +2939,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - DoubleMaxVectorTests::FIRST_NONZEROReduceMasked, DoubleMaxVectorTests::FIRST_NONZEROReduceAllMasked); + DoubleVectorMaxTests::FIRST_NONZEROReduceMasked, DoubleVectorMaxTests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "doubleBinaryOpProvider") - static void withDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void withDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -2929,7 +2966,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_DEFAULTDoubleMaxVectorTests(IntFunction fa) { + static void IS_DEFAULTDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2939,14 +2976,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_DEFAULTMaskedDoubleMaxVectorTests(IntFunction fa, + static void IS_DEFAULTMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2959,7 +2996,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2970,7 +3007,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NEGATIVEDoubleMaxVectorTests(IntFunction fa) { + static void IS_NEGATIVEDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2980,14 +3017,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NEGATIVEMaskedDoubleMaxVectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3000,7 +3037,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3011,7 +3048,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_FINITEDoubleMaxVectorTests(IntFunction fa) { + static void IS_FINITEDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3021,14 +3058,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_FINITEMaskedDoubleMaxVectorTests(IntFunction fa, + static void IS_FINITEMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3041,7 +3078,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3052,7 +3089,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_NANDoubleMaxVectorTests(IntFunction fa) { + static void IS_NANDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3062,14 +3099,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_NANMaskedDoubleMaxVectorTests(IntFunction fa, + static void IS_NANMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3082,7 +3119,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3093,7 +3130,7 @@ relativeError)); } @Test(dataProvider = "doubleTestOpProvider") - static void IS_INFINITEDoubleMaxVectorTests(IntFunction fa) { + static void IS_INFINITEDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3103,14 +3140,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleTestOpMaskProvider") - static void IS_INFINITEMaskedDoubleMaxVectorTests(IntFunction fa, + static void IS_INFINITEMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3123,14 +3160,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LTDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3142,14 +3179,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ltDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3161,14 +3198,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3184,14 +3221,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GTDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GTDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3203,14 +3240,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GTDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3226,14 +3263,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EQDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3245,14 +3282,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void eqDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3264,14 +3301,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3287,14 +3324,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void NEDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void NEDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3306,14 +3343,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void NEDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3329,14 +3366,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LEDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LEDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3348,14 +3385,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LEDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3371,14 +3408,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void GEDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GEDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3390,14 +3427,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void GEDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3413,14 +3450,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3430,13 +3467,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3450,13 +3487,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void LTDoubleMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTDoubleVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3466,13 +3503,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void LTDoubleMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTDoubleVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3486,13 +3523,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (double)((long)b[i]))); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3502,13 +3539,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3522,13 +3559,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void EQDoubleMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQDoubleVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3538,13 +3575,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i])); } } } @Test(dataProvider = "doubleCompareOpMaskProvider") - static void EQDoubleMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQDoubleVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3558,7 +3595,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (double)((long)b[i]))); } } } @@ -3568,7 +3605,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDoubleMaxVectorTests(IntFunction fa, IntFunction fb, + static void blendDoubleVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3584,11 +3621,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, DoubleMaxVectorTests::blend); + assertArraysEquals(r, a, b, mask, DoubleVectorMaxTests::blend); } @Test(dataProvider = "doubleUnaryOpShuffleProvider") - static void RearrangeDoubleMaxVectorTests(IntFunction fa, + static void RearrangeDoubleVectorMaxTests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3605,7 +3642,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpShuffleMaskProvider") - static void RearrangeDoubleMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeDoubleVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -3623,7 +3660,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void compressDoubleMaxVectorTests(IntFunction fa, + static void compressDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3641,7 +3678,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void expandDoubleMaxVectorTests(IntFunction fa, + static void expandDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3659,7 +3696,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void getDoubleMaxVectorTests(IntFunction fa) { + static void getDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -3815,7 +3852,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void BroadcastDoubleMaxVectorTests(IntFunction fa) { + static void BroadcastDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3829,7 +3866,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ZeroDoubleMaxVectorTests(IntFunction fa) { + static void ZeroDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3839,7 +3876,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static double[] sliceUnary(double[] a, int origin, int idx) { @@ -3854,7 +3891,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sliceUnaryDoubleMaxVectorTests(IntFunction fa) { + static void sliceUnaryDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3865,7 +3902,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, DoubleMaxVectorTests::sliceUnary); + assertArraysEquals(r, a, origin, DoubleVectorMaxTests::sliceUnary); } static double[] sliceBinary(double[] a, double[] b, int origin, int idx) { @@ -3882,7 +3919,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void sliceBinaryDoubleMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryDoubleVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3895,7 +3932,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, DoubleMaxVectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, DoubleVectorMaxTests::sliceBinary); } static double[] slice(double[] a, double[] b, int origin, boolean[] mask, int idx) { @@ -3912,7 +3949,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void sliceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -3929,7 +3966,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, DoubleMaxVectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, DoubleVectorMaxTests::slice); } static double[] unsliceUnary(double[] a, int origin, int idx) { @@ -3946,7 +3983,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void unsliceUnaryDoubleMaxVectorTests(IntFunction fa) { + static void unsliceUnaryDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3957,7 +3994,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, DoubleMaxVectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, DoubleVectorMaxTests::unsliceUnary); } static double[] unsliceBinary(double[] a, double[] b, int origin, int part, int idx) { @@ -3983,7 +4020,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void unsliceBinaryDoubleMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryDoubleVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -3997,7 +4034,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, DoubleMaxVectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, DoubleVectorMaxTests::unsliceBinary); } static double[] unslice(double[] a, double[] b, int origin, int part, boolean[] mask, int idx) { @@ -4037,7 +4074,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void unsliceDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4054,7 +4091,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, DoubleMaxVectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, DoubleVectorMaxTests::unslice); } static double SIN(double a) { @@ -4066,7 +4103,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINDoubleMaxVectorTests(IntFunction fa) { + static void SINDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4077,7 +4114,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::SIN, DoubleMaxVectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::SIN, DoubleVectorMaxTests::strictSIN); } static double EXP(double a) { @@ -4089,7 +4126,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPDoubleMaxVectorTests(IntFunction fa) { + static void EXPDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4100,7 +4137,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::EXP, DoubleMaxVectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::EXP, DoubleVectorMaxTests::strictEXP); } static double LOG1P(double a) { @@ -4112,7 +4149,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG1PDoubleMaxVectorTests(IntFunction fa) { + static void LOG1PDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4123,7 +4160,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::LOG1P, DoubleMaxVectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::LOG1P, DoubleVectorMaxTests::strictLOG1P); } static double LOG(double a) { @@ -4135,7 +4172,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOGDoubleMaxVectorTests(IntFunction fa) { + static void LOGDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4146,7 +4183,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::LOG, DoubleMaxVectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::LOG, DoubleVectorMaxTests::strictLOG); } static double LOG10(double a) { @@ -4158,7 +4195,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void LOG10DoubleMaxVectorTests(IntFunction fa) { + static void LOG10DoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4169,7 +4206,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::LOG10, DoubleMaxVectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::LOG10, DoubleVectorMaxTests::strictLOG10); } static double EXPM1(double a) { @@ -4181,7 +4218,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void EXPM1DoubleMaxVectorTests(IntFunction fa) { + static void EXPM1DoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4192,7 +4229,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::EXPM1, DoubleMaxVectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::EXPM1, DoubleVectorMaxTests::strictEXPM1); } static double COS(double a) { @@ -4204,7 +4241,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSDoubleMaxVectorTests(IntFunction fa) { + static void COSDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4215,7 +4252,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::COS, DoubleMaxVectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::COS, DoubleVectorMaxTests::strictCOS); } static double TAN(double a) { @@ -4227,7 +4264,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANDoubleMaxVectorTests(IntFunction fa) { + static void TANDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4238,7 +4275,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::TAN, DoubleMaxVectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::TAN, DoubleVectorMaxTests::strictTAN); } static double SINH(double a) { @@ -4250,7 +4287,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SINHDoubleMaxVectorTests(IntFunction fa) { + static void SINHDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4261,7 +4298,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::SINH, DoubleMaxVectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::SINH, DoubleVectorMaxTests::strictSINH); } static double COSH(double a) { @@ -4273,7 +4310,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void COSHDoubleMaxVectorTests(IntFunction fa) { + static void COSHDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4284,7 +4321,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::COSH, DoubleMaxVectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::COSH, DoubleVectorMaxTests::strictCOSH); } static double TANH(double a) { @@ -4296,7 +4333,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void TANHDoubleMaxVectorTests(IntFunction fa) { + static void TANHDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4307,7 +4344,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::TANH, DoubleMaxVectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::TANH, DoubleVectorMaxTests::strictTANH); } static double ASIN(double a) { @@ -4319,7 +4356,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ASINDoubleMaxVectorTests(IntFunction fa) { + static void ASINDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4330,7 +4367,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::ASIN, DoubleMaxVectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::ASIN, DoubleVectorMaxTests::strictASIN); } static double ACOS(double a) { @@ -4342,7 +4379,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ACOSDoubleMaxVectorTests(IntFunction fa) { + static void ACOSDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4353,7 +4390,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::ACOS, DoubleMaxVectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::ACOS, DoubleVectorMaxTests::strictACOS); } static double ATAN(double a) { @@ -4365,7 +4402,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ATANDoubleMaxVectorTests(IntFunction fa) { + static void ATANDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4376,7 +4413,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::ATAN, DoubleMaxVectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::ATAN, DoubleVectorMaxTests::strictATAN); } static double CBRT(double a) { @@ -4388,7 +4425,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void CBRTDoubleMaxVectorTests(IntFunction fa) { + static void CBRTDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4399,7 +4436,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, DoubleMaxVectorTests::CBRT, DoubleMaxVectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, DoubleVectorMaxTests::CBRT, DoubleVectorMaxTests::strictCBRT); } static double HYPOT(double a, double b) { @@ -4411,7 +4448,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void HYPOTDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4424,7 +4461,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, DoubleMaxVectorTests::HYPOT, DoubleMaxVectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVectorMaxTests::HYPOT, DoubleVectorMaxTests::strictHYPOT); } @@ -4437,7 +4474,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void POWDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4450,7 +4487,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, DoubleMaxVectorTests::POW, DoubleMaxVectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVectorMaxTests::POW, DoubleVectorMaxTests::strictPOW); } @@ -4463,7 +4500,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void powDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4476,7 +4513,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, DoubleMaxVectorTests::pow, DoubleMaxVectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVectorMaxTests::pow, DoubleVectorMaxTests::strictpow); } @@ -4489,7 +4526,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpProvider") - static void ATAN2DoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2DoubleVectorMaxTests(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4502,12 +4539,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, DoubleMaxVectorTests::ATAN2, DoubleMaxVectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, DoubleVectorMaxTests::ATAN2, DoubleVectorMaxTests::strictATAN2); } @Test(dataProvider = "doubleBinaryOpProvider") - static void POWDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4517,12 +4554,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleMaxVectorTests::POW, DoubleMaxVectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVectorMaxTests::POW, DoubleVectorMaxTests::strictPOW); } @Test(dataProvider = "doubleBinaryOpProvider") - static void powDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4532,7 +4569,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleMaxVectorTests::pow, DoubleMaxVectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, DoubleVectorMaxTests::pow, DoubleVectorMaxTests::strictpow); } @@ -4545,7 +4582,7 @@ relativeError)); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADoubleMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4567,11 +4604,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, DoubleMaxVectorTests::FMA); + assertArraysEquals(r, a, b, c, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDoubleMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4591,11 +4628,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, DoubleMaxVectorTests::fma); + assertArraysEquals(r, a, b, c, DoubleVectorMaxTests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMADoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4620,11 +4657,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, DoubleMaxVectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4635,11 +4672,11 @@ relativeError)); DoubleVector bv = DoubleVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, DoubleMaxVectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADoubleMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] c = fc.apply(SPECIES.length()); @@ -4650,11 +4687,11 @@ relativeError)); DoubleVector cv = DoubleVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, DoubleMaxVectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4669,11 +4706,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, DoubleMaxVectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADoubleMaxVectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVectorMaxTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -4688,11 +4725,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, DoubleMaxVectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void FMADoubleMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMADoubleVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("FMA") { case "fma": case "lanewise_FMA": @@ -4710,11 +4747,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleMaxVectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVectorMaxTests::FMA); } @Test(dataProvider = "doubleTernaryOpProvider") - static void fmaDoubleMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaDoubleVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int count = INVOC_COUNT; switch ("fma") { case "fma": case "lanewise_FMA": @@ -4732,11 +4769,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleMaxVectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, DoubleVectorMaxTests::fma); } @Test(dataProvider = "doubleTernaryOpMaskProvider") - static void FMADoubleMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMADoubleVectorMaxTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int count = INVOC_COUNT; switch ("FMA") { @@ -4757,7 +4794,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, DoubleMaxVectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, DoubleVectorMaxTests::FMA); } static double NEG(double a) { @@ -4769,7 +4806,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void NEGDoubleMaxVectorTests(IntFunction fa) { + static void NEGDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4780,11 +4817,11 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::NEG); + assertArraysEquals(r, a, DoubleVectorMaxTests::NEG); } @Test(dataProvider = "doubleUnaryOpProvider") - static void negDoubleMaxVectorTests(IntFunction fa) { + static void negDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4795,11 +4832,11 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::neg); + assertArraysEquals(r, a, DoubleVectorMaxTests::neg); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void NEGMaskedDoubleMaxVectorTests(IntFunction fa, + static void NEGMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4813,7 +4850,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, DoubleMaxVectorTests::NEG); + assertArraysEquals(r, a, mask, DoubleVectorMaxTests::NEG); } static double ABS(double a) { @@ -4825,7 +4862,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ABSDoubleMaxVectorTests(IntFunction fa) { + static void ABSDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4836,11 +4873,11 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::ABS); + assertArraysEquals(r, a, DoubleVectorMaxTests::ABS); } @Test(dataProvider = "doubleUnaryOpProvider") - static void absDoubleMaxVectorTests(IntFunction fa) { + static void absDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4851,11 +4888,11 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::abs); + assertArraysEquals(r, a, DoubleVectorMaxTests::abs); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ABSMaskedDoubleMaxVectorTests(IntFunction fa, + static void ABSMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4869,7 +4906,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, DoubleMaxVectorTests::ABS); + assertArraysEquals(r, a, mask, DoubleVectorMaxTests::ABS); } static double SQRT(double a) { @@ -4881,7 +4918,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void SQRTDoubleMaxVectorTests(IntFunction fa) { + static void SQRTDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4892,11 +4929,11 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::SQRT); + assertArraysEquals(r, a, DoubleVectorMaxTests::SQRT); } @Test(dataProvider = "doubleUnaryOpProvider") - static void sqrtDoubleMaxVectorTests(IntFunction fa) { + static void sqrtDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4907,11 +4944,11 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::sqrt); + assertArraysEquals(r, a, DoubleVectorMaxTests::sqrt); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void SQRTMaskedDoubleMaxVectorTests(IntFunction fa, + static void SQRTMaskedDoubleVectorMaxTests(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); @@ -4925,7 +4962,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, DoubleMaxVectorTests::SQRT); + assertArraysEquals(r, a, mask, DoubleVectorMaxTests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4933,7 +4970,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4946,7 +4983,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::band); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::band); } static boolean bor(boolean a, boolean b) { @@ -4954,7 +4991,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskorDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4967,7 +5004,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::bor); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4975,7 +5012,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskxorDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4988,7 +5025,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::bxor); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4996,7 +5033,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5009,7 +5046,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::bandNot); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -5017,7 +5054,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskeqDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5030,7 +5067,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, DoubleMaxVectorTests::beq); + assertArraysEquals(r, a, b, DoubleVectorMaxTests::beq); } static boolean unot(boolean a) { @@ -5038,7 +5075,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotDoubleMaxVectorTests(IntFunction fa) { + static void masknotDoubleVectorMaxTests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5049,7 +5086,7 @@ relativeError)); } } - assertArraysEquals(r, a, DoubleMaxVectorTests::unot); + assertArraysEquals(r, a, DoubleVectorMaxTests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5058,15 +5095,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongDoubleMaxVectorTests(IntFunction fa) { + static void maskFromToLongDoubleVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5080,7 +5117,7 @@ relativeError)); } @Test(dataProvider = "doubleCompareOpProvider") - static void ltDoubleMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltDoubleVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5090,13 +5127,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "doubleCompareOpProvider") - static void eqDoubleMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqDoubleVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5106,13 +5143,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "doubletoIntUnaryOpProvider") - static void toIntArrayDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayDoubleVectorMaxTestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5123,7 +5160,7 @@ relativeError)); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void toLongArrayDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayDoubleVectorMaxTestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5135,7 +5172,7 @@ relativeError)); @Test(dataProvider = "doubleUnaryOpProvider") - static void toStringDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void toStringDoubleVectorMaxTestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5148,7 +5185,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void hashCodeDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void hashCodeDoubleVectorMaxTestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5181,7 +5218,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpProvider") - static void ADDReduceLongDoubleMaxVectorTests(IntFunction fa) { + static void ADDReduceLongDoubleVectorMaxTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5197,7 +5234,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - DoubleMaxVectorTests::ADDReduceLong, DoubleMaxVectorTests::ADDReduceAllLong); + DoubleVectorMaxTests::ADDReduceLong, DoubleVectorMaxTests::ADDReduceAllLong); } static long ADDReduceLongMasked(double[] a, int idx, boolean[] mask) { @@ -5220,7 +5257,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpMaskProvider") - static void ADDReduceLongDoubleMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongDoubleVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5238,11 +5275,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - DoubleMaxVectorTests::ADDReduceLongMasked, DoubleMaxVectorTests::ADDReduceAllLongMasked); + DoubleVectorMaxTests::ADDReduceLongMasked, DoubleVectorMaxTests::ADDReduceAllLongMasked); } @Test(dataProvider = "doubletoLongUnaryOpProvider") - static void BroadcastLongDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongDoubleVectorMaxTestsSmokeTest(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = new double[a.length]; @@ -5253,7 +5290,7 @@ relativeError)); } @Test(dataProvider = "doubleBinaryOpMaskProvider") - static void blendDoubleMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendDoubleVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); @@ -5267,12 +5304,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, DoubleMaxVectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, DoubleVectorMaxTests::blend); } @Test(dataProvider = "doubleUnaryOpSelectFromProvider") - static void SelectFromDoubleMaxVectorTests(IntFunction fa, + static void SelectFromDoubleVectorMaxTests(IntFunction fa, BiFunction fs) { double[] a = fa.apply(SPECIES.length()); double[] order = fs.apply(a.length, SPECIES.length()); @@ -5288,7 +5325,7 @@ relativeError)); } @Test(dataProvider = "doubleSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorDoubleMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorDoubleVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { double[] a = fa.apply(SPECIES.length()); double[] b = fb.apply(SPECIES.length()); double[] idx = fc.apply(SPECIES.length()); @@ -5306,7 +5343,7 @@ relativeError)); } @Test(dataProvider = "doubleUnaryOpSelectFromMaskProvider") - static void SelectFromDoubleMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromDoubleVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { double[] a = fa.apply(SPECIES.length()); @@ -5325,7 +5362,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousDoubleMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousDoubleVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5336,12 +5373,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringDoubleMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringDoubleVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5355,7 +5392,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsDoubleMaxVectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsDoubleVectorMaxTestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5364,12 +5401,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsDoubleMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsDoubleVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5379,13 +5416,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeDoubleVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5407,7 +5444,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountDoubleVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5418,7 +5455,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, DoubleMaxVectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, DoubleVectorMaxTests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5432,7 +5469,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueDoubleVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5443,7 +5480,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, DoubleMaxVectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, DoubleVectorMaxTests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5457,7 +5494,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueDoubleVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5468,11 +5505,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, DoubleMaxVectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, DoubleVectorMaxTests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressDoubleMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskCompressDoubleVectorMaxTestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5482,7 +5519,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5500,7 +5537,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeDoubleMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeDoubleVectorMaxTestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5508,13 +5545,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongDoubleMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongDoubleVectorMaxTestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5522,7 +5559,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5541,36 +5578,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundDoubleMaxVectorTestsSmokeTest(int length) { + static void loopBoundDoubleVectorMaxTestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongDoubleMaxVectorTestsSmokeTest(int _length) { + static void loopBoundLongDoubleVectorMaxTestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeDoubleMaxVectorTestsSmokeTest() { + static void ElementSizeDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Double.SIZE); + assertEquals(elsize, Double.SIZE); } @Test - static void VectorShapeDoubleMaxVectorTestsSmokeTest() { + static void VectorShapeDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_Max_BIT)); } @Test - static void ShapeWithLanesDoubleMaxVectorTestsSmokeTest() { + static void ShapeWithLanesDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(double.class); @@ -5578,32 +5615,32 @@ relativeError)); } @Test - static void ElementTypeDoubleMaxVectorTestsSmokeTest() { + static void ElementTypeDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementType() == double.class); } @Test - static void SpeciesElementSizeDoubleMaxVectorTestsSmokeTest() { + static void SpeciesElementSizeDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().elementSize() == Double.SIZE); } @Test - static void VectorTypeDoubleMaxVectorTestsSmokeTest() { + static void VectorTypeDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesDoubleMaxVectorTestsSmokeTest() { + static void WithLanesDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(double.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeDoubleMaxVectorTestsSmokeTest() { + static void WithShapeDoubleVectorMaxTestsSmokeTest() { DoubleVector av = DoubleVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5611,9 +5648,9 @@ relativeError)); } @Test - static void MaskAllTrueDoubleMaxVectorTestsSmokeTest() { + static void MaskAllTrueDoubleVectorMaxTestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatVector128LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/FloatVector128LoadStoreTests.java index 4421c355c14..5ef419f940d 100644 --- a/test/jdk/jdk/incubator/vector/Float128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector128LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Float128VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation FloatVector128LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class FloatVector128LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_128; @@ -61,14 +61,29 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(float[] r, float[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "floatProviderForIOOBE") @@ -870,11 +885,11 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(float[] r, float[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Float128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Float128VectorTests.java b/test/jdk/jdk/incubator/vector/FloatVector128Tests.java similarity index 82% rename from test/jdk/jdk/incubator/vector/Float128VectorTests.java rename to test/jdk/jdk/incubator/vector/FloatVector128Tests.java index f97c5b0064c..51e6365b01b 100644 --- a/test/jdk/jdk/incubator/vector/Float128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector128Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatVector128Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Float128VectorTests extends AbstractVectorTest { +public class FloatVector128Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_128; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(float actual, float expected, float delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(float actual, float expected, float delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final float ADD_IDENTITY = (float)0; @@ -95,10 +138,10 @@ public class Float128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +153,13 @@ public class Float128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { float[] ref = f.apply(a[i]); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +169,10 @@ public class Float128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +194,13 @@ public class Float128VectorTests extends AbstractVectorTest { float relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +222,14 @@ public class Float128VectorTests extends AbstractVectorTest { float relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +245,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +267,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +285,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +300,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +312,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +328,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (float)0); + assertEquals(r[i + k], (float)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -310,19 +353,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (float)0); + assertEquals(r[i + j], (float)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -338,11 +381,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +394,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +409,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +429,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +453,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +468,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +483,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +507,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +533,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +552,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +563,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +574,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +586,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +602,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +617,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +632,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +650,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +666,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +684,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +710,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +728,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +752,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +767,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +779,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +792,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +811,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +832,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +847,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +868,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +964,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +991,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1012,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(r, a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1039,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1059,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1080,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1101,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1123,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1175,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1221,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1189,10 +1232,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1595,7 +1638,7 @@ relativeError)); // Do some zipping and shuffling. FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); FloatVector a = io.add((float)1); //[1,2] FloatVector b = a.neg(); //[-1,-2] float[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1610,19 +1653,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); FloatVector uab0 = zab0.rearrange(unz0,zab1); FloatVector uab1 = zab0.rearrange(unz1,zab1); float[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1639,15 +1682,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static float ADD(float a, float b) { @@ -1655,7 +1698,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void ADDFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1668,7 +1711,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::ADD); + assertArraysEquals(r, a, b, FloatVector128Tests::ADD); } static float add(float a, float b) { @@ -1676,7 +1719,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void addFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1687,11 +1730,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float128VectorTests::add); + assertArraysEquals(r, a, b, FloatVector128Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1707,11 +1750,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float128VectorTests::ADD); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1725,7 +1768,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float128VectorTests::add); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::add); } static float SUB(float a, float b) { @@ -1733,7 +1776,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void SUBFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void SUBFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1746,7 +1789,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::SUB); + assertArraysEquals(r, a, b, FloatVector128Tests::SUB); } static float sub(float a, float b) { @@ -1754,7 +1797,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void subFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1765,11 +1808,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float128VectorTests::sub); + assertArraysEquals(r, a, b, FloatVector128Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void SUBFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1785,11 +1828,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float128VectorTests::SUB); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::SUB); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1803,7 +1846,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float128VectorTests::sub); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::sub); } static float MUL(float a, float b) { @@ -1811,7 +1854,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MULFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void MULFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1824,7 +1867,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::MUL); + assertArraysEquals(r, a, b, FloatVector128Tests::MUL); } static float mul(float a, float b) { @@ -1832,7 +1875,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void mulFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1843,11 +1886,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float128VectorTests::mul); + assertArraysEquals(r, a, b, FloatVector128Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void MULFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1863,11 +1906,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float128VectorTests::MUL); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::MUL); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1881,7 +1924,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float128VectorTests::mul); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::mul); } static float DIV(float a, float b) { @@ -1889,7 +1932,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void DIVFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void DIVFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::DIV); + assertArraysEquals(r, a, b, FloatVector128Tests::DIV); } static float div(float a, float b) { @@ -1910,7 +1953,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void divFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1921,11 +1964,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float128VectorTests::div); + assertArraysEquals(r, a, b, FloatVector128Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void DIVFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1941,11 +1984,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float128VectorTests::DIV); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::DIV); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1959,7 +2002,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float128VectorTests::div); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::div); } static float FIRST_NONZERO(float a, float b) { @@ -1967,7 +2010,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void FIRST_NONZEROFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1980,11 +2023,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, FloatVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void FIRST_NONZEROFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2000,11 +2043,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2014,11 +2057,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2031,11 +2074,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector128Tests::add); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2045,11 +2088,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector128Tests::sub); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2076,11 +2119,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2093,11 +2136,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector128Tests::mul); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2107,11 +2150,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2124,11 +2167,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector128Tests::div); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDFloatVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2138,11 +2181,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Float128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, FloatVector128Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDFloatVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2155,13 +2198,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Float128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector128Tests::ADD); } static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MINFloat128VectorTestsWithMemOp(IntFunction fa) { + static void MINFloatVector128TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2172,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float128VectorTests::MIN); + assertArraysEquals(r, a, (float)10, FloatVector128Tests::MIN); } static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void minFloat128VectorTestsWithMemOp(IntFunction fa) { + static void minFloatVector128TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2189,13 +2232,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float128VectorTests::min); + assertArraysEquals(r, a, (float)10, FloatVector128Tests::min); } static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINFloat128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINFloatVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2208,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float128VectorTests::MIN); + assertArraysEquals(r, a, (float)10, mask, FloatVector128Tests::MIN); } static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MAXFloat128VectorTestsWithMemOp(IntFunction fa) { + static void MAXFloatVector128TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2225,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float128VectorTests::MAX); + assertArraysEquals(r, a, (float)10, FloatVector128Tests::MAX); } static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void maxFloat128VectorTestsWithMemOp(IntFunction fa) { + static void maxFloatVector128TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2242,13 +2285,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float128VectorTests::max); + assertArraysEquals(r, a, (float)10, FloatVector128Tests::max); } static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXFloat128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXFloatVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2261,7 +2304,7 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float128VectorTests::MAX); + assertArraysEquals(r, a, (float)10, mask, FloatVector128Tests::MAX); } static float MIN(float a, float b) { @@ -2269,7 +2312,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void MINFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2282,7 +2325,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::MIN); + assertArraysEquals(r, a, b, FloatVector128Tests::MIN); } static float min(float a, float b) { @@ -2290,7 +2333,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void minFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2301,7 +2344,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float128VectorTests::min); + assertArraysEquals(r, a, b, FloatVector128Tests::min); } static float MAX(float a, float b) { @@ -2309,7 +2352,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void MAXFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2322,7 +2365,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::MAX); + assertArraysEquals(r, a, b, FloatVector128Tests::MAX); } static float max(float a, float b) { @@ -2330,7 +2373,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maxFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float128VectorTests::max); + assertArraysEquals(r, a, b, FloatVector128Tests::max); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2355,11 +2398,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::MIN); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2369,11 +2412,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::min); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::min); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2383,11 +2426,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::MAX); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2397,7 +2440,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float128VectorTests::max); + assertBroadcastArraysEquals(r, a, b, FloatVector128Tests::max); } static float ADDReduce(float[] a, int idx) { @@ -2419,7 +2462,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceFloat128VectorTests(IntFunction fa) { + static void ADDReduceFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2435,7 +2478,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float128VectorTests::ADDReduce, Float128VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector128Tests::ADDReduce, FloatVector128Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2443,20 +2486,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = ADD_IDENTITY; - Assert.assertEquals((float) (id + id), id, + assertEquals((float) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id + x), x); - Assert.assertEquals((float) (x + id), x); + assertEquals((float) (id + x), x); + assertEquals((float) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id + x), x, + assertEquals((float) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x + id), x, + assertEquals((float) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2481,7 +2524,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceFloat128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceFloatVector128TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2499,7 +2542,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float128VectorTests::ADDReduceMasked, Float128VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector128Tests::ADDReduceMasked, FloatVector128Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static float MULReduce(float[] a, int idx) { @@ -2521,7 +2564,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MULReduceFloat128VectorTests(IntFunction fa) { + static void MULReduceFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2537,7 +2580,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float128VectorTests::MULReduce, Float128VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector128Tests::MULReduce, FloatVector128Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2545,20 +2588,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MUL_IDENTITY; - Assert.assertEquals((float) (id * id), id, + assertEquals((float) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id * x), x); - Assert.assertEquals((float) (x * id), x); + assertEquals((float) (id * x), x); + assertEquals((float) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id * x), x, + assertEquals((float) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x * id), x, + assertEquals((float) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2583,7 +2626,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MULReduceFloat128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceFloatVector128TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2601,7 +2644,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float128VectorTests::MULReduceMasked, Float128VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector128Tests::MULReduceMasked, FloatVector128Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static float MINReduce(float[] a, int idx) { @@ -2623,7 +2666,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MINReduceFloat128VectorTests(IntFunction fa) { + static void MINReduceFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2639,7 +2682,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float128VectorTests::MINReduce, Float128VectorTests::MINReduceAll); + FloatVector128Tests::MINReduce, FloatVector128Tests::MINReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2647,20 +2690,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MIN_IDENTITY; - Assert.assertEquals((float) Math.min(id, id), id, + assertEquals((float) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.min(id, x), x); - Assert.assertEquals((float) Math.min(x, id), x); + assertEquals((float) Math.min(id, x), x); + assertEquals((float) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.min(id, x), x, + assertEquals((float) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.min(x, id), x, + assertEquals((float) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2685,7 +2728,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINReduceFloat128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceFloatVector128TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2703,7 +2746,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float128VectorTests::MINReduceMasked, Float128VectorTests::MINReduceAllMasked); + FloatVector128Tests::MINReduceMasked, FloatVector128Tests::MINReduceAllMasked); } static float MAXReduce(float[] a, int idx) { @@ -2725,7 +2768,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MAXReduceFloat128VectorTests(IntFunction fa) { + static void MAXReduceFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2741,7 +2784,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float128VectorTests::MAXReduce, Float128VectorTests::MAXReduceAll); + FloatVector128Tests::MAXReduce, FloatVector128Tests::MAXReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2749,20 +2792,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MAX_IDENTITY; - Assert.assertEquals((float) Math.max(id, id), id, + assertEquals((float) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.max(id, x), x); - Assert.assertEquals((float) Math.max(x, id), x); + assertEquals((float) Math.max(id, x), x); + assertEquals((float) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.max(id, x), x, + assertEquals((float) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.max(x, id), x, + assertEquals((float) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2787,7 +2830,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXReduceFloat128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceFloatVector128TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2805,7 +2848,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float128VectorTests::MAXReduceMasked, Float128VectorTests::MAXReduceAllMasked); + FloatVector128Tests::MAXReduceMasked, FloatVector128Tests::MAXReduceAllMasked); } static float FIRST_NONZEROReduce(float[] a, int idx) { @@ -2827,7 +2870,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void FIRST_NONZEROReduceFloat128VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2843,7 +2886,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float128VectorTests::FIRST_NONZEROReduce, Float128VectorTests::FIRST_NONZEROReduceAll); + FloatVector128Tests::FIRST_NONZEROReduce, FloatVector128Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2851,20 +2894,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2889,7 +2932,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void FIRST_NONZEROReduceFloat128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceFloatVector128TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2907,11 +2950,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float128VectorTests::FIRST_NONZEROReduceMasked, Float128VectorTests::FIRST_NONZEROReduceAllMasked); + FloatVector128Tests::FIRST_NONZEROReduceMasked, FloatVector128Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "floatBinaryOpProvider") - static void withFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void withFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2934,7 +2977,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_DEFAULTFloat128VectorTests(IntFunction fa) { + static void IS_DEFAULTFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2944,14 +2987,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_DEFAULTMaskedFloat128VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2964,7 +3007,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2975,7 +3018,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NEGATIVEFloat128VectorTests(IntFunction fa) { + static void IS_NEGATIVEFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2985,14 +3028,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NEGATIVEMaskedFloat128VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3005,7 +3048,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3016,7 +3059,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_FINITEFloat128VectorTests(IntFunction fa) { + static void IS_FINITEFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3026,14 +3069,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_FINITEMaskedFloat128VectorTests(IntFunction fa, + static void IS_FINITEMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3046,7 +3089,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3057,7 +3100,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NANFloat128VectorTests(IntFunction fa) { + static void IS_NANFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3067,14 +3110,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NANMaskedFloat128VectorTests(IntFunction fa, + static void IS_NANMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3087,7 +3130,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3098,7 +3141,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_INFINITEFloat128VectorTests(IntFunction fa) { + static void IS_INFINITEFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3108,14 +3151,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_INFINITEMaskedFloat128VectorTests(IntFunction fa, + static void IS_INFINITEMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3128,14 +3171,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void LTFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3147,14 +3190,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void ltFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3166,14 +3209,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3189,14 +3232,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GTFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void GTFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3208,14 +3251,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GTFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3231,14 +3274,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void EQFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3250,14 +3293,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void eqFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3269,14 +3312,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3292,14 +3335,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void NEFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void NEFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3311,14 +3354,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void NEFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3334,14 +3377,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LEFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void LEFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3353,14 +3396,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LEFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3376,14 +3419,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GEFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void GEFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3395,14 +3438,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GEFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3418,14 +3461,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3435,13 +3478,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3455,13 +3498,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3471,13 +3514,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTFloatVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3491,13 +3534,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3507,13 +3550,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3527,13 +3570,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3543,13 +3586,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQFloatVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3563,7 +3606,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); } } } @@ -3573,7 +3616,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat128VectorTests(IntFunction fa, IntFunction fb, + static void blendFloatVector128Tests(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3589,11 +3632,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float128VectorTests::blend); + assertArraysEquals(r, a, b, mask, FloatVector128Tests::blend); } @Test(dataProvider = "floatUnaryOpShuffleProvider") - static void RearrangeFloat128VectorTests(IntFunction fa, + static void RearrangeFloatVector128Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3610,7 +3653,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpShuffleMaskProvider") - static void RearrangeFloat128VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeFloatVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -3628,7 +3671,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void compressFloat128VectorTests(IntFunction fa, + static void compressFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3646,7 +3689,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void expandFloat128VectorTests(IntFunction fa, + static void expandFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3664,7 +3707,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void getFloat128VectorTests(IntFunction fa) { + static void getFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3820,7 +3863,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void BroadcastFloat128VectorTests(IntFunction fa) { + static void BroadcastFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3834,7 +3877,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ZeroFloat128VectorTests(IntFunction fa) { + static void ZeroFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3844,7 +3887,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static float[] sliceUnary(float[] a, int origin, int idx) { @@ -3859,7 +3902,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void sliceUnaryFloat128VectorTests(IntFunction fa) { + static void sliceUnaryFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3870,7 +3913,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float128VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, FloatVector128Tests::sliceUnary); } static float[] sliceBinary(float[] a, float[] b, int origin, int idx) { @@ -3887,7 +3930,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void sliceBinaryFloat128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryFloatVector128TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3900,7 +3943,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Float128VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, FloatVector128Tests::sliceBinary); } static float[] slice(float[] a, float[] b, int origin, boolean[] mask, int idx) { @@ -3917,7 +3960,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void sliceFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3934,7 +3977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Float128VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, FloatVector128Tests::slice); } static float[] unsliceUnary(float[] a, int origin, int idx) { @@ -3951,7 +3994,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void unsliceUnaryFloat128VectorTests(IntFunction fa) { + static void unsliceUnaryFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3962,7 +4005,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float128VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, FloatVector128Tests::unsliceUnary); } static float[] unsliceBinary(float[] a, float[] b, int origin, int part, int idx) { @@ -3988,7 +4031,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void unsliceBinaryFloat128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryFloatVector128TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -4002,7 +4045,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Float128VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, FloatVector128Tests::unsliceBinary); } static float[] unslice(float[] a, float[] b, int origin, int part, boolean[] mask, int idx) { @@ -4042,7 +4085,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void unsliceFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4059,7 +4102,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Float128VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, FloatVector128Tests::unslice); } static float SIN(float a) { @@ -4071,7 +4114,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINFloat128VectorTests(IntFunction fa) { + static void SINFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4082,7 +4125,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::SIN, Float128VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::SIN, FloatVector128Tests::strictSIN); } static float EXP(float a) { @@ -4094,7 +4137,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPFloat128VectorTests(IntFunction fa) { + static void EXPFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4105,7 +4148,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::EXP, Float128VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::EXP, FloatVector128Tests::strictEXP); } static float LOG1P(float a) { @@ -4117,7 +4160,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG1PFloat128VectorTests(IntFunction fa) { + static void LOG1PFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4128,7 +4171,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::LOG1P, Float128VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::LOG1P, FloatVector128Tests::strictLOG1P); } static float LOG(float a) { @@ -4140,7 +4183,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOGFloat128VectorTests(IntFunction fa) { + static void LOGFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4151,7 +4194,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::LOG, Float128VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::LOG, FloatVector128Tests::strictLOG); } static float LOG10(float a) { @@ -4163,7 +4206,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG10Float128VectorTests(IntFunction fa) { + static void LOG10FloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4174,7 +4217,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::LOG10, Float128VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::LOG10, FloatVector128Tests::strictLOG10); } static float EXPM1(float a) { @@ -4186,7 +4229,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPM1Float128VectorTests(IntFunction fa) { + static void EXPM1FloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4197,7 +4240,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::EXPM1, Float128VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::EXPM1, FloatVector128Tests::strictEXPM1); } static float COS(float a) { @@ -4209,7 +4252,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSFloat128VectorTests(IntFunction fa) { + static void COSFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4220,7 +4263,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::COS, Float128VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::COS, FloatVector128Tests::strictCOS); } static float TAN(float a) { @@ -4232,7 +4275,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANFloat128VectorTests(IntFunction fa) { + static void TANFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4243,7 +4286,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::TAN, Float128VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::TAN, FloatVector128Tests::strictTAN); } static float SINH(float a) { @@ -4255,7 +4298,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINHFloat128VectorTests(IntFunction fa) { + static void SINHFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4266,7 +4309,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::SINH, Float128VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::SINH, FloatVector128Tests::strictSINH); } static float COSH(float a) { @@ -4278,7 +4321,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSHFloat128VectorTests(IntFunction fa) { + static void COSHFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4289,7 +4332,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::COSH, Float128VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::COSH, FloatVector128Tests::strictCOSH); } static float TANH(float a) { @@ -4301,7 +4344,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANHFloat128VectorTests(IntFunction fa) { + static void TANHFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4312,7 +4355,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::TANH, Float128VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::TANH, FloatVector128Tests::strictTANH); } static float ASIN(float a) { @@ -4324,7 +4367,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ASINFloat128VectorTests(IntFunction fa) { + static void ASINFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4335,7 +4378,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::ASIN, Float128VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::ASIN, FloatVector128Tests::strictASIN); } static float ACOS(float a) { @@ -4347,7 +4390,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ACOSFloat128VectorTests(IntFunction fa) { + static void ACOSFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4358,7 +4401,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::ACOS, Float128VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::ACOS, FloatVector128Tests::strictACOS); } static float ATAN(float a) { @@ -4370,7 +4413,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ATANFloat128VectorTests(IntFunction fa) { + static void ATANFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4381,7 +4424,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::ATAN, Float128VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::ATAN, FloatVector128Tests::strictATAN); } static float CBRT(float a) { @@ -4393,7 +4436,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void CBRTFloat128VectorTests(IntFunction fa) { + static void CBRTFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4404,7 +4447,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float128VectorTests::CBRT, Float128VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, FloatVector128Tests::CBRT, FloatVector128Tests::strictCBRT); } static float HYPOT(float a, float b) { @@ -4416,7 +4459,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void HYPOTFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4429,7 +4472,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float128VectorTests::HYPOT, Float128VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector128Tests::HYPOT, FloatVector128Tests::strictHYPOT); } @@ -4442,7 +4485,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void POWFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4455,7 +4498,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float128VectorTests::POW, Float128VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector128Tests::POW, FloatVector128Tests::strictPOW); } @@ -4468,7 +4511,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void powFloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4481,7 +4524,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float128VectorTests::pow, Float128VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector128Tests::pow, FloatVector128Tests::strictpow); } @@ -4494,7 +4537,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ATAN2Float128VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2FloatVector128Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4507,12 +4550,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float128VectorTests::ATAN2, Float128VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector128Tests::ATAN2, FloatVector128Tests::strictATAN2); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4522,12 +4565,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float128VectorTests::POW, Float128VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector128Tests::POW, FloatVector128Tests::strictPOW); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float128VectorTests::pow, Float128VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector128Tests::pow, FloatVector128Tests::strictpow); } @@ -4550,7 +4593,7 @@ relativeError)); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4565,11 +4608,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Float128VectorTests::FMA); + assertArraysEquals(r, a, b, c, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4582,11 +4625,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Float128VectorTests::fma); + assertArraysEquals(r, a, b, c, FloatVector128Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMAFloatVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4604,11 +4647,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Float128VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4619,11 +4662,11 @@ relativeError)); FloatVector bv = FloatVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Float128VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4634,11 +4677,11 @@ relativeError)); FloatVector cv = FloatVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Float128VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4653,11 +4696,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Float128VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat128VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector128TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4672,11 +4715,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Float128VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4687,11 +4730,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float128VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector128Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4702,11 +4745,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float128VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector128Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector128TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4720,7 +4763,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Float128VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, FloatVector128Tests::FMA); } static float NEG(float a) { @@ -4732,7 +4775,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void NEGFloat128VectorTests(IntFunction fa) { + static void NEGFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4743,11 +4786,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::NEG); + assertArraysEquals(r, a, FloatVector128Tests::NEG); } @Test(dataProvider = "floatUnaryOpProvider") - static void negFloat128VectorTests(IntFunction fa) { + static void negFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4758,11 +4801,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::neg); + assertArraysEquals(r, a, FloatVector128Tests::neg); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void NEGMaskedFloat128VectorTests(IntFunction fa, + static void NEGMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4776,7 +4819,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float128VectorTests::NEG); + assertArraysEquals(r, a, mask, FloatVector128Tests::NEG); } static float ABS(float a) { @@ -4788,7 +4831,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ABSFloat128VectorTests(IntFunction fa) { + static void ABSFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4799,11 +4842,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::ABS); + assertArraysEquals(r, a, FloatVector128Tests::ABS); } @Test(dataProvider = "floatUnaryOpProvider") - static void absFloat128VectorTests(IntFunction fa) { + static void absFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4814,11 +4857,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::abs); + assertArraysEquals(r, a, FloatVector128Tests::abs); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ABSMaskedFloat128VectorTests(IntFunction fa, + static void ABSMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4832,7 +4875,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float128VectorTests::ABS); + assertArraysEquals(r, a, mask, FloatVector128Tests::ABS); } static float SQRT(float a) { @@ -4844,7 +4887,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SQRTFloat128VectorTests(IntFunction fa) { + static void SQRTFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4855,11 +4898,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::SQRT); + assertArraysEquals(r, a, FloatVector128Tests::SQRT); } @Test(dataProvider = "floatUnaryOpProvider") - static void sqrtFloat128VectorTests(IntFunction fa) { + static void sqrtFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4870,11 +4913,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::sqrt); + assertArraysEquals(r, a, FloatVector128Tests::sqrt); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void SQRTMaskedFloat128VectorTests(IntFunction fa, + static void SQRTMaskedFloatVector128Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4888,7 +4931,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float128VectorTests::SQRT); + assertArraysEquals(r, a, mask, FloatVector128Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4896,7 +4939,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandFloatVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4909,7 +4952,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::band); + assertArraysEquals(r, a, b, FloatVector128Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4917,7 +4960,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maskorFloatVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4930,7 +4973,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::bor); + assertArraysEquals(r, a, b, FloatVector128Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4938,7 +4981,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorFloatVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4951,7 +4994,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::bxor); + assertArraysEquals(r, a, b, FloatVector128Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4959,7 +5002,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotFloatVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4972,7 +5015,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::bandNot); + assertArraysEquals(r, a, b, FloatVector128Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -4980,7 +5023,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqFloatVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4993,7 +5036,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float128VectorTests::beq); + assertArraysEquals(r, a, b, FloatVector128Tests::beq); } static boolean unot(boolean a) { @@ -5001,7 +5044,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotFloat128VectorTests(IntFunction fa) { + static void masknotFloatVector128Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5012,7 +5055,7 @@ relativeError)); } } - assertArraysEquals(r, a, Float128VectorTests::unot); + assertArraysEquals(r, a, FloatVector128Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5021,15 +5064,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongFloat128VectorTests(IntFunction fa) { + static void maskFromToLongFloatVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5043,7 +5086,7 @@ relativeError)); } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltFloatVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5053,13 +5096,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqFloatVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5069,13 +5112,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floattoIntUnaryOpProvider") - static void toIntArrayFloat128VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayFloatVector128TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5086,7 +5129,7 @@ relativeError)); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void toLongArrayFloat128VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayFloatVector128TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5097,7 +5140,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toDoubleArrayFloat128VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayFloatVector128TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5108,7 +5151,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toStringFloat128VectorTestsSmokeTest(IntFunction fa) { + static void toStringFloatVector128TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5121,7 +5164,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void hashCodeFloat128VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeFloatVector128TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5154,7 +5197,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceLongFloat128VectorTests(IntFunction fa) { + static void ADDReduceLongFloatVector128Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5170,7 +5213,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Float128VectorTests::ADDReduceLong, Float128VectorTests::ADDReduceAllLong); + FloatVector128Tests::ADDReduceLong, FloatVector128Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(float[] a, int idx, boolean[] mask) { @@ -5193,7 +5236,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceLongFloat128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongFloatVector128TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5211,11 +5254,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Float128VectorTests::ADDReduceLongMasked, Float128VectorTests::ADDReduceAllLongMasked); + FloatVector128Tests::ADDReduceLongMasked, FloatVector128Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void BroadcastLongFloat128VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongFloatVector128TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -5226,7 +5269,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendFloatVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5240,12 +5283,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Float128VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector128Tests::blend); } @Test(dataProvider = "floatUnaryOpSelectFromProvider") - static void SelectFromFloat128VectorTests(IntFunction fa, + static void SelectFromFloatVector128Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); float[] order = fs.apply(a.length, SPECIES.length()); @@ -5261,7 +5304,7 @@ relativeError)); } @Test(dataProvider = "floatSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorFloat128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorFloatVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] idx = fc.apply(SPECIES.length()); @@ -5279,7 +5322,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpSelectFromMaskProvider") - static void SelectFromFloat128VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromFloatVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -5298,7 +5341,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousFloat128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousFloatVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5309,12 +5352,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringFloat128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringFloatVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5328,7 +5371,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsFloat128VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsFloatVector128TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5337,12 +5380,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsFloat128VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsFloatVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeFloat128VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeFloatVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5380,7 +5423,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountFloat128VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountFloatVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5391,7 +5434,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float128VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, FloatVector128Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5405,7 +5448,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueFloat128VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueFloatVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5416,7 +5459,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float128VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, FloatVector128Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5430,7 +5473,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueFloat128VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueFloatVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5441,11 +5484,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float128VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, FloatVector128Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressFloat128VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressFloatVector128TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5455,7 +5498,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5473,7 +5516,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeFloat128VectorTestsSmokeTest(int offset) { + static void indexInRangeFloatVector128TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5481,13 +5524,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongFloat128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongFloatVector128TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5495,7 +5538,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5514,36 +5557,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundFloat128VectorTestsSmokeTest(int length) { + static void loopBoundFloatVector128TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongFloat128VectorTestsSmokeTest(int _length) { + static void loopBoundLongFloatVector128TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeFloat128VectorTestsSmokeTest() { + static void ElementSizeFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Float.SIZE); + assertEquals(elsize, Float.SIZE); } @Test - static void VectorShapeFloat128VectorTestsSmokeTest() { + static void VectorShapeFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_128_BIT)); } @Test - static void ShapeWithLanesFloat128VectorTestsSmokeTest() { + static void ShapeWithLanesFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(float.class); @@ -5551,32 +5594,32 @@ relativeError)); } @Test - static void ElementTypeFloat128VectorTestsSmokeTest() { + static void ElementTypeFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementType() == float.class); } @Test - static void SpeciesElementSizeFloat128VectorTestsSmokeTest() { + static void SpeciesElementSizeFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementSize() == Float.SIZE); } @Test - static void VectorTypeFloat128VectorTestsSmokeTest() { + static void VectorTypeFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesFloat128VectorTestsSmokeTest() { + static void WithLanesFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(float.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeFloat128VectorTestsSmokeTest() { + static void WithShapeFloatVector128TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5584,9 +5627,9 @@ relativeError)); } @Test - static void MaskAllTrueFloat128VectorTestsSmokeTest() { + static void MaskAllTrueFloatVector128TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatVector256LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/FloatVector256LoadStoreTests.java index 0ad426d9954..a889bb5e8c8 100644 --- a/test/jdk/jdk/incubator/vector/Float256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector256LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Float256VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation FloatVector256LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class FloatVector256LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_256; @@ -61,14 +61,29 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(float[] r, float[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "floatProviderForIOOBE") @@ -870,11 +885,11 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(float[] r, float[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Float256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Float256VectorTests.java b/test/jdk/jdk/incubator/vector/FloatVector256Tests.java similarity index 82% rename from test/jdk/jdk/incubator/vector/Float256VectorTests.java rename to test/jdk/jdk/incubator/vector/FloatVector256Tests.java index d9746d3291c..b7d16ecc7f7 100644 --- a/test/jdk/jdk/incubator/vector/Float256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector256Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatVector256Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Float256VectorTests extends AbstractVectorTest { +public class FloatVector256Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_256; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(float actual, float expected, float delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(float actual, float expected, float delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final float ADD_IDENTITY = (float)0; @@ -95,10 +138,10 @@ public class Float256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +153,13 @@ public class Float256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { float[] ref = f.apply(a[i]); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +169,10 @@ public class Float256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +194,13 @@ public class Float256VectorTests extends AbstractVectorTest { float relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +222,14 @@ public class Float256VectorTests extends AbstractVectorTest { float relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +245,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +267,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +285,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +300,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +312,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +328,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (float)0); + assertEquals(r[i + k], (float)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -310,19 +353,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (float)0); + assertEquals(r[i + j], (float)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -338,11 +381,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +394,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +409,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +429,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +453,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +468,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +483,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +507,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +533,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +552,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +563,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +574,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +586,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +602,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +617,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +632,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +650,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +666,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +684,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +710,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +728,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +752,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +767,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +779,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +792,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +811,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +832,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +847,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +868,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +964,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +991,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1012,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(r, a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1039,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1059,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1080,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1101,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1123,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1175,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1221,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1189,10 +1232,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1595,7 +1638,7 @@ relativeError)); // Do some zipping and shuffling. FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); FloatVector a = io.add((float)1); //[1,2] FloatVector b = a.neg(); //[-1,-2] float[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1610,19 +1653,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); FloatVector uab0 = zab0.rearrange(unz0,zab1); FloatVector uab1 = zab0.rearrange(unz1,zab1); float[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1639,15 +1682,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static float ADD(float a, float b) { @@ -1655,7 +1698,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void ADDFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1668,7 +1711,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::ADD); + assertArraysEquals(r, a, b, FloatVector256Tests::ADD); } static float add(float a, float b) { @@ -1676,7 +1719,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void addFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1687,11 +1730,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float256VectorTests::add); + assertArraysEquals(r, a, b, FloatVector256Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1707,11 +1750,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float256VectorTests::ADD); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1725,7 +1768,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float256VectorTests::add); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::add); } static float SUB(float a, float b) { @@ -1733,7 +1776,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void SUBFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void SUBFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1746,7 +1789,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::SUB); + assertArraysEquals(r, a, b, FloatVector256Tests::SUB); } static float sub(float a, float b) { @@ -1754,7 +1797,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void subFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1765,11 +1808,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float256VectorTests::sub); + assertArraysEquals(r, a, b, FloatVector256Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void SUBFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1785,11 +1828,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float256VectorTests::SUB); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::SUB); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1803,7 +1846,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float256VectorTests::sub); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::sub); } static float MUL(float a, float b) { @@ -1811,7 +1854,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MULFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void MULFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1824,7 +1867,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::MUL); + assertArraysEquals(r, a, b, FloatVector256Tests::MUL); } static float mul(float a, float b) { @@ -1832,7 +1875,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void mulFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1843,11 +1886,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float256VectorTests::mul); + assertArraysEquals(r, a, b, FloatVector256Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void MULFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1863,11 +1906,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float256VectorTests::MUL); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::MUL); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1881,7 +1924,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float256VectorTests::mul); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::mul); } static float DIV(float a, float b) { @@ -1889,7 +1932,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void DIVFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void DIVFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::DIV); + assertArraysEquals(r, a, b, FloatVector256Tests::DIV); } static float div(float a, float b) { @@ -1910,7 +1953,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void divFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1921,11 +1964,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float256VectorTests::div); + assertArraysEquals(r, a, b, FloatVector256Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void DIVFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1941,11 +1984,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float256VectorTests::DIV); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::DIV); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1959,7 +2002,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float256VectorTests::div); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::div); } static float FIRST_NONZERO(float a, float b) { @@ -1967,7 +2010,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void FIRST_NONZEROFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1980,11 +2023,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, FloatVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void FIRST_NONZEROFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2000,11 +2043,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2014,11 +2057,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2031,11 +2074,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector256Tests::add); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2045,11 +2088,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector256Tests::sub); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2076,11 +2119,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2093,11 +2136,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector256Tests::mul); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2107,11 +2150,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2124,11 +2167,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector256Tests::div); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDFloatVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2138,11 +2181,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Float256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, FloatVector256Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDFloatVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2155,13 +2198,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Float256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector256Tests::ADD); } static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MINFloat256VectorTestsWithMemOp(IntFunction fa) { + static void MINFloatVector256TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2172,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float256VectorTests::MIN); + assertArraysEquals(r, a, (float)10, FloatVector256Tests::MIN); } static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void minFloat256VectorTestsWithMemOp(IntFunction fa) { + static void minFloatVector256TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2189,13 +2232,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float256VectorTests::min); + assertArraysEquals(r, a, (float)10, FloatVector256Tests::min); } static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINFloat256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINFloatVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2208,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float256VectorTests::MIN); + assertArraysEquals(r, a, (float)10, mask, FloatVector256Tests::MIN); } static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MAXFloat256VectorTestsWithMemOp(IntFunction fa) { + static void MAXFloatVector256TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2225,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float256VectorTests::MAX); + assertArraysEquals(r, a, (float)10, FloatVector256Tests::MAX); } static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void maxFloat256VectorTestsWithMemOp(IntFunction fa) { + static void maxFloatVector256TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2242,13 +2285,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float256VectorTests::max); + assertArraysEquals(r, a, (float)10, FloatVector256Tests::max); } static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXFloat256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXFloatVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2261,7 +2304,7 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float256VectorTests::MAX); + assertArraysEquals(r, a, (float)10, mask, FloatVector256Tests::MAX); } static float MIN(float a, float b) { @@ -2269,7 +2312,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void MINFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2282,7 +2325,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::MIN); + assertArraysEquals(r, a, b, FloatVector256Tests::MIN); } static float min(float a, float b) { @@ -2290,7 +2333,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void minFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2301,7 +2344,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float256VectorTests::min); + assertArraysEquals(r, a, b, FloatVector256Tests::min); } static float MAX(float a, float b) { @@ -2309,7 +2352,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void MAXFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2322,7 +2365,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::MAX); + assertArraysEquals(r, a, b, FloatVector256Tests::MAX); } static float max(float a, float b) { @@ -2330,7 +2373,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maxFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float256VectorTests::max); + assertArraysEquals(r, a, b, FloatVector256Tests::max); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2355,11 +2398,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::MIN); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2369,11 +2412,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::min); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::min); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2383,11 +2426,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::MAX); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2397,7 +2440,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float256VectorTests::max); + assertBroadcastArraysEquals(r, a, b, FloatVector256Tests::max); } static float ADDReduce(float[] a, int idx) { @@ -2419,7 +2462,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceFloat256VectorTests(IntFunction fa) { + static void ADDReduceFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2435,7 +2478,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float256VectorTests::ADDReduce, Float256VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector256Tests::ADDReduce, FloatVector256Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2443,20 +2486,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = ADD_IDENTITY; - Assert.assertEquals((float) (id + id), id, + assertEquals((float) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id + x), x); - Assert.assertEquals((float) (x + id), x); + assertEquals((float) (id + x), x); + assertEquals((float) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id + x), x, + assertEquals((float) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x + id), x, + assertEquals((float) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2481,7 +2524,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceFloat256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceFloatVector256TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2499,7 +2542,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float256VectorTests::ADDReduceMasked, Float256VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector256Tests::ADDReduceMasked, FloatVector256Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static float MULReduce(float[] a, int idx) { @@ -2521,7 +2564,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MULReduceFloat256VectorTests(IntFunction fa) { + static void MULReduceFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2537,7 +2580,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float256VectorTests::MULReduce, Float256VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector256Tests::MULReduce, FloatVector256Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2545,20 +2588,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MUL_IDENTITY; - Assert.assertEquals((float) (id * id), id, + assertEquals((float) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id * x), x); - Assert.assertEquals((float) (x * id), x); + assertEquals((float) (id * x), x); + assertEquals((float) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id * x), x, + assertEquals((float) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x * id), x, + assertEquals((float) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2583,7 +2626,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MULReduceFloat256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceFloatVector256TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2601,7 +2644,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float256VectorTests::MULReduceMasked, Float256VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector256Tests::MULReduceMasked, FloatVector256Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static float MINReduce(float[] a, int idx) { @@ -2623,7 +2666,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MINReduceFloat256VectorTests(IntFunction fa) { + static void MINReduceFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2639,7 +2682,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float256VectorTests::MINReduce, Float256VectorTests::MINReduceAll); + FloatVector256Tests::MINReduce, FloatVector256Tests::MINReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2647,20 +2690,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MIN_IDENTITY; - Assert.assertEquals((float) Math.min(id, id), id, + assertEquals((float) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.min(id, x), x); - Assert.assertEquals((float) Math.min(x, id), x); + assertEquals((float) Math.min(id, x), x); + assertEquals((float) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.min(id, x), x, + assertEquals((float) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.min(x, id), x, + assertEquals((float) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2685,7 +2728,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINReduceFloat256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceFloatVector256TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2703,7 +2746,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float256VectorTests::MINReduceMasked, Float256VectorTests::MINReduceAllMasked); + FloatVector256Tests::MINReduceMasked, FloatVector256Tests::MINReduceAllMasked); } static float MAXReduce(float[] a, int idx) { @@ -2725,7 +2768,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MAXReduceFloat256VectorTests(IntFunction fa) { + static void MAXReduceFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2741,7 +2784,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float256VectorTests::MAXReduce, Float256VectorTests::MAXReduceAll); + FloatVector256Tests::MAXReduce, FloatVector256Tests::MAXReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2749,20 +2792,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MAX_IDENTITY; - Assert.assertEquals((float) Math.max(id, id), id, + assertEquals((float) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.max(id, x), x); - Assert.assertEquals((float) Math.max(x, id), x); + assertEquals((float) Math.max(id, x), x); + assertEquals((float) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.max(id, x), x, + assertEquals((float) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.max(x, id), x, + assertEquals((float) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2787,7 +2830,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXReduceFloat256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceFloatVector256TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2805,7 +2848,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float256VectorTests::MAXReduceMasked, Float256VectorTests::MAXReduceAllMasked); + FloatVector256Tests::MAXReduceMasked, FloatVector256Tests::MAXReduceAllMasked); } static float FIRST_NONZEROReduce(float[] a, int idx) { @@ -2827,7 +2870,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void FIRST_NONZEROReduceFloat256VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2843,7 +2886,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float256VectorTests::FIRST_NONZEROReduce, Float256VectorTests::FIRST_NONZEROReduceAll); + FloatVector256Tests::FIRST_NONZEROReduce, FloatVector256Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2851,20 +2894,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2889,7 +2932,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void FIRST_NONZEROReduceFloat256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceFloatVector256TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2907,11 +2950,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float256VectorTests::FIRST_NONZEROReduceMasked, Float256VectorTests::FIRST_NONZEROReduceAllMasked); + FloatVector256Tests::FIRST_NONZEROReduceMasked, FloatVector256Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "floatBinaryOpProvider") - static void withFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void withFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2934,7 +2977,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_DEFAULTFloat256VectorTests(IntFunction fa) { + static void IS_DEFAULTFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2944,14 +2987,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_DEFAULTMaskedFloat256VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2964,7 +3007,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2975,7 +3018,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NEGATIVEFloat256VectorTests(IntFunction fa) { + static void IS_NEGATIVEFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2985,14 +3028,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NEGATIVEMaskedFloat256VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3005,7 +3048,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3016,7 +3059,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_FINITEFloat256VectorTests(IntFunction fa) { + static void IS_FINITEFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3026,14 +3069,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_FINITEMaskedFloat256VectorTests(IntFunction fa, + static void IS_FINITEMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3046,7 +3089,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3057,7 +3100,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NANFloat256VectorTests(IntFunction fa) { + static void IS_NANFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3067,14 +3110,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NANMaskedFloat256VectorTests(IntFunction fa, + static void IS_NANMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3087,7 +3130,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3098,7 +3141,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_INFINITEFloat256VectorTests(IntFunction fa) { + static void IS_INFINITEFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3108,14 +3151,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_INFINITEMaskedFloat256VectorTests(IntFunction fa, + static void IS_INFINITEMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3128,14 +3171,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void LTFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3147,14 +3190,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void ltFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3166,14 +3209,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3189,14 +3232,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GTFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void GTFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3208,14 +3251,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GTFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3231,14 +3274,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void EQFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3250,14 +3293,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void eqFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3269,14 +3312,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3292,14 +3335,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void NEFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void NEFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3311,14 +3354,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void NEFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3334,14 +3377,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LEFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void LEFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3353,14 +3396,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LEFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3376,14 +3419,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GEFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void GEFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3395,14 +3438,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GEFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3418,14 +3461,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3435,13 +3478,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3455,13 +3498,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3471,13 +3514,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTFloatVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3491,13 +3534,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3507,13 +3550,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3527,13 +3570,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3543,13 +3586,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQFloatVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3563,7 +3606,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); } } } @@ -3573,7 +3616,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat256VectorTests(IntFunction fa, IntFunction fb, + static void blendFloatVector256Tests(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3589,11 +3632,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float256VectorTests::blend); + assertArraysEquals(r, a, b, mask, FloatVector256Tests::blend); } @Test(dataProvider = "floatUnaryOpShuffleProvider") - static void RearrangeFloat256VectorTests(IntFunction fa, + static void RearrangeFloatVector256Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3610,7 +3653,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpShuffleMaskProvider") - static void RearrangeFloat256VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeFloatVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -3628,7 +3671,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void compressFloat256VectorTests(IntFunction fa, + static void compressFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3646,7 +3689,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void expandFloat256VectorTests(IntFunction fa, + static void expandFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3664,7 +3707,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void getFloat256VectorTests(IntFunction fa) { + static void getFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3820,7 +3863,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void BroadcastFloat256VectorTests(IntFunction fa) { + static void BroadcastFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3834,7 +3877,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ZeroFloat256VectorTests(IntFunction fa) { + static void ZeroFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3844,7 +3887,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static float[] sliceUnary(float[] a, int origin, int idx) { @@ -3859,7 +3902,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void sliceUnaryFloat256VectorTests(IntFunction fa) { + static void sliceUnaryFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3870,7 +3913,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float256VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, FloatVector256Tests::sliceUnary); } static float[] sliceBinary(float[] a, float[] b, int origin, int idx) { @@ -3887,7 +3930,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void sliceBinaryFloat256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryFloatVector256TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3900,7 +3943,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Float256VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, FloatVector256Tests::sliceBinary); } static float[] slice(float[] a, float[] b, int origin, boolean[] mask, int idx) { @@ -3917,7 +3960,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void sliceFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3934,7 +3977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Float256VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, FloatVector256Tests::slice); } static float[] unsliceUnary(float[] a, int origin, int idx) { @@ -3951,7 +3994,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void unsliceUnaryFloat256VectorTests(IntFunction fa) { + static void unsliceUnaryFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3962,7 +4005,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float256VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, FloatVector256Tests::unsliceUnary); } static float[] unsliceBinary(float[] a, float[] b, int origin, int part, int idx) { @@ -3988,7 +4031,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void unsliceBinaryFloat256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryFloatVector256TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -4002,7 +4045,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Float256VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, FloatVector256Tests::unsliceBinary); } static float[] unslice(float[] a, float[] b, int origin, int part, boolean[] mask, int idx) { @@ -4042,7 +4085,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void unsliceFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4059,7 +4102,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Float256VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, FloatVector256Tests::unslice); } static float SIN(float a) { @@ -4071,7 +4114,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINFloat256VectorTests(IntFunction fa) { + static void SINFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4082,7 +4125,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::SIN, Float256VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::SIN, FloatVector256Tests::strictSIN); } static float EXP(float a) { @@ -4094,7 +4137,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPFloat256VectorTests(IntFunction fa) { + static void EXPFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4105,7 +4148,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::EXP, Float256VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::EXP, FloatVector256Tests::strictEXP); } static float LOG1P(float a) { @@ -4117,7 +4160,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG1PFloat256VectorTests(IntFunction fa) { + static void LOG1PFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4128,7 +4171,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::LOG1P, Float256VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::LOG1P, FloatVector256Tests::strictLOG1P); } static float LOG(float a) { @@ -4140,7 +4183,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOGFloat256VectorTests(IntFunction fa) { + static void LOGFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4151,7 +4194,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::LOG, Float256VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::LOG, FloatVector256Tests::strictLOG); } static float LOG10(float a) { @@ -4163,7 +4206,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG10Float256VectorTests(IntFunction fa) { + static void LOG10FloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4174,7 +4217,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::LOG10, Float256VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::LOG10, FloatVector256Tests::strictLOG10); } static float EXPM1(float a) { @@ -4186,7 +4229,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPM1Float256VectorTests(IntFunction fa) { + static void EXPM1FloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4197,7 +4240,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::EXPM1, Float256VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::EXPM1, FloatVector256Tests::strictEXPM1); } static float COS(float a) { @@ -4209,7 +4252,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSFloat256VectorTests(IntFunction fa) { + static void COSFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4220,7 +4263,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::COS, Float256VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::COS, FloatVector256Tests::strictCOS); } static float TAN(float a) { @@ -4232,7 +4275,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANFloat256VectorTests(IntFunction fa) { + static void TANFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4243,7 +4286,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::TAN, Float256VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::TAN, FloatVector256Tests::strictTAN); } static float SINH(float a) { @@ -4255,7 +4298,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINHFloat256VectorTests(IntFunction fa) { + static void SINHFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4266,7 +4309,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::SINH, Float256VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::SINH, FloatVector256Tests::strictSINH); } static float COSH(float a) { @@ -4278,7 +4321,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSHFloat256VectorTests(IntFunction fa) { + static void COSHFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4289,7 +4332,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::COSH, Float256VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::COSH, FloatVector256Tests::strictCOSH); } static float TANH(float a) { @@ -4301,7 +4344,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANHFloat256VectorTests(IntFunction fa) { + static void TANHFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4312,7 +4355,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::TANH, Float256VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::TANH, FloatVector256Tests::strictTANH); } static float ASIN(float a) { @@ -4324,7 +4367,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ASINFloat256VectorTests(IntFunction fa) { + static void ASINFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4335,7 +4378,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::ASIN, Float256VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::ASIN, FloatVector256Tests::strictASIN); } static float ACOS(float a) { @@ -4347,7 +4390,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ACOSFloat256VectorTests(IntFunction fa) { + static void ACOSFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4358,7 +4401,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::ACOS, Float256VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::ACOS, FloatVector256Tests::strictACOS); } static float ATAN(float a) { @@ -4370,7 +4413,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ATANFloat256VectorTests(IntFunction fa) { + static void ATANFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4381,7 +4424,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::ATAN, Float256VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::ATAN, FloatVector256Tests::strictATAN); } static float CBRT(float a) { @@ -4393,7 +4436,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void CBRTFloat256VectorTests(IntFunction fa) { + static void CBRTFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4404,7 +4447,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float256VectorTests::CBRT, Float256VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, FloatVector256Tests::CBRT, FloatVector256Tests::strictCBRT); } static float HYPOT(float a, float b) { @@ -4416,7 +4459,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void HYPOTFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4429,7 +4472,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float256VectorTests::HYPOT, Float256VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector256Tests::HYPOT, FloatVector256Tests::strictHYPOT); } @@ -4442,7 +4485,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void POWFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4455,7 +4498,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float256VectorTests::POW, Float256VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector256Tests::POW, FloatVector256Tests::strictPOW); } @@ -4468,7 +4511,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void powFloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4481,7 +4524,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float256VectorTests::pow, Float256VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector256Tests::pow, FloatVector256Tests::strictpow); } @@ -4494,7 +4537,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ATAN2Float256VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2FloatVector256Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4507,12 +4550,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float256VectorTests::ATAN2, Float256VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector256Tests::ATAN2, FloatVector256Tests::strictATAN2); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4522,12 +4565,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float256VectorTests::POW, Float256VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector256Tests::POW, FloatVector256Tests::strictPOW); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float256VectorTests::pow, Float256VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector256Tests::pow, FloatVector256Tests::strictpow); } @@ -4550,7 +4593,7 @@ relativeError)); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4565,11 +4608,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Float256VectorTests::FMA); + assertArraysEquals(r, a, b, c, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4582,11 +4625,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Float256VectorTests::fma); + assertArraysEquals(r, a, b, c, FloatVector256Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMAFloatVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4604,11 +4647,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Float256VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4619,11 +4662,11 @@ relativeError)); FloatVector bv = FloatVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Float256VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4634,11 +4677,11 @@ relativeError)); FloatVector cv = FloatVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Float256VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4653,11 +4696,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Float256VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat256VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector256TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4672,11 +4715,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Float256VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4687,11 +4730,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float256VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector256Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4702,11 +4745,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float256VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector256Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat256VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector256TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4720,7 +4763,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Float256VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, FloatVector256Tests::FMA); } static float NEG(float a) { @@ -4732,7 +4775,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void NEGFloat256VectorTests(IntFunction fa) { + static void NEGFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4743,11 +4786,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::NEG); + assertArraysEquals(r, a, FloatVector256Tests::NEG); } @Test(dataProvider = "floatUnaryOpProvider") - static void negFloat256VectorTests(IntFunction fa) { + static void negFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4758,11 +4801,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::neg); + assertArraysEquals(r, a, FloatVector256Tests::neg); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void NEGMaskedFloat256VectorTests(IntFunction fa, + static void NEGMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4776,7 +4819,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float256VectorTests::NEG); + assertArraysEquals(r, a, mask, FloatVector256Tests::NEG); } static float ABS(float a) { @@ -4788,7 +4831,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ABSFloat256VectorTests(IntFunction fa) { + static void ABSFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4799,11 +4842,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::ABS); + assertArraysEquals(r, a, FloatVector256Tests::ABS); } @Test(dataProvider = "floatUnaryOpProvider") - static void absFloat256VectorTests(IntFunction fa) { + static void absFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4814,11 +4857,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::abs); + assertArraysEquals(r, a, FloatVector256Tests::abs); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ABSMaskedFloat256VectorTests(IntFunction fa, + static void ABSMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4832,7 +4875,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float256VectorTests::ABS); + assertArraysEquals(r, a, mask, FloatVector256Tests::ABS); } static float SQRT(float a) { @@ -4844,7 +4887,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SQRTFloat256VectorTests(IntFunction fa) { + static void SQRTFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4855,11 +4898,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::SQRT); + assertArraysEquals(r, a, FloatVector256Tests::SQRT); } @Test(dataProvider = "floatUnaryOpProvider") - static void sqrtFloat256VectorTests(IntFunction fa) { + static void sqrtFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4870,11 +4913,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::sqrt); + assertArraysEquals(r, a, FloatVector256Tests::sqrt); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void SQRTMaskedFloat256VectorTests(IntFunction fa, + static void SQRTMaskedFloatVector256Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4888,7 +4931,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float256VectorTests::SQRT); + assertArraysEquals(r, a, mask, FloatVector256Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4896,7 +4939,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandFloatVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4909,7 +4952,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::band); + assertArraysEquals(r, a, b, FloatVector256Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4917,7 +4960,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maskorFloatVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4930,7 +4973,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::bor); + assertArraysEquals(r, a, b, FloatVector256Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4938,7 +4981,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorFloatVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4951,7 +4994,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::bxor); + assertArraysEquals(r, a, b, FloatVector256Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4959,7 +5002,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotFloatVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4972,7 +5015,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::bandNot); + assertArraysEquals(r, a, b, FloatVector256Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -4980,7 +5023,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqFloatVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4993,7 +5036,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float256VectorTests::beq); + assertArraysEquals(r, a, b, FloatVector256Tests::beq); } static boolean unot(boolean a) { @@ -5001,7 +5044,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotFloat256VectorTests(IntFunction fa) { + static void masknotFloatVector256Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5012,7 +5055,7 @@ relativeError)); } } - assertArraysEquals(r, a, Float256VectorTests::unot); + assertArraysEquals(r, a, FloatVector256Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5021,15 +5064,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongFloat256VectorTests(IntFunction fa) { + static void maskFromToLongFloatVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5043,7 +5086,7 @@ relativeError)); } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltFloatVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5053,13 +5096,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqFloatVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5069,13 +5112,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floattoIntUnaryOpProvider") - static void toIntArrayFloat256VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayFloatVector256TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5086,7 +5129,7 @@ relativeError)); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void toLongArrayFloat256VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayFloatVector256TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5097,7 +5140,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toDoubleArrayFloat256VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayFloatVector256TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5108,7 +5151,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toStringFloat256VectorTestsSmokeTest(IntFunction fa) { + static void toStringFloatVector256TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5121,7 +5164,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void hashCodeFloat256VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeFloatVector256TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5154,7 +5197,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceLongFloat256VectorTests(IntFunction fa) { + static void ADDReduceLongFloatVector256Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5170,7 +5213,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Float256VectorTests::ADDReduceLong, Float256VectorTests::ADDReduceAllLong); + FloatVector256Tests::ADDReduceLong, FloatVector256Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(float[] a, int idx, boolean[] mask) { @@ -5193,7 +5236,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceLongFloat256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongFloatVector256TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5211,11 +5254,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Float256VectorTests::ADDReduceLongMasked, Float256VectorTests::ADDReduceAllLongMasked); + FloatVector256Tests::ADDReduceLongMasked, FloatVector256Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void BroadcastLongFloat256VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongFloatVector256TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -5226,7 +5269,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendFloatVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5240,12 +5283,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Float256VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector256Tests::blend); } @Test(dataProvider = "floatUnaryOpSelectFromProvider") - static void SelectFromFloat256VectorTests(IntFunction fa, + static void SelectFromFloatVector256Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); float[] order = fs.apply(a.length, SPECIES.length()); @@ -5261,7 +5304,7 @@ relativeError)); } @Test(dataProvider = "floatSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorFloat256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorFloatVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] idx = fc.apply(SPECIES.length()); @@ -5279,7 +5322,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpSelectFromMaskProvider") - static void SelectFromFloat256VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromFloatVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -5298,7 +5341,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousFloat256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousFloatVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5309,12 +5352,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringFloat256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringFloatVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5328,7 +5371,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsFloat256VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsFloatVector256TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5337,12 +5380,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsFloat256VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsFloatVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeFloat256VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeFloatVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5380,7 +5423,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountFloat256VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountFloatVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5391,7 +5434,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float256VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, FloatVector256Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5405,7 +5448,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueFloat256VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueFloatVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5416,7 +5459,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float256VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, FloatVector256Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5430,7 +5473,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueFloat256VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueFloatVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5441,11 +5484,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float256VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, FloatVector256Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressFloat256VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressFloatVector256TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5455,7 +5498,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5473,7 +5516,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeFloat256VectorTestsSmokeTest(int offset) { + static void indexInRangeFloatVector256TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5481,13 +5524,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongFloat256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongFloatVector256TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5495,7 +5538,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5514,36 +5557,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundFloat256VectorTestsSmokeTest(int length) { + static void loopBoundFloatVector256TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongFloat256VectorTestsSmokeTest(int _length) { + static void loopBoundLongFloatVector256TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeFloat256VectorTestsSmokeTest() { + static void ElementSizeFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Float.SIZE); + assertEquals(elsize, Float.SIZE); } @Test - static void VectorShapeFloat256VectorTestsSmokeTest() { + static void VectorShapeFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_256_BIT)); } @Test - static void ShapeWithLanesFloat256VectorTestsSmokeTest() { + static void ShapeWithLanesFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(float.class); @@ -5551,32 +5594,32 @@ relativeError)); } @Test - static void ElementTypeFloat256VectorTestsSmokeTest() { + static void ElementTypeFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementType() == float.class); } @Test - static void SpeciesElementSizeFloat256VectorTestsSmokeTest() { + static void SpeciesElementSizeFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementSize() == Float.SIZE); } @Test - static void VectorTypeFloat256VectorTestsSmokeTest() { + static void VectorTypeFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesFloat256VectorTestsSmokeTest() { + static void WithLanesFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(float.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeFloat256VectorTestsSmokeTest() { + static void WithShapeFloatVector256TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5584,9 +5627,9 @@ relativeError)); } @Test - static void MaskAllTrueFloat256VectorTestsSmokeTest() { + static void MaskAllTrueFloatVector256TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatVector512LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/FloatVector512LoadStoreTests.java index 56da27f1149..3a33f0175b4 100644 --- a/test/jdk/jdk/incubator/vector/Float512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector512LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Float512VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation FloatVector512LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class FloatVector512LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_512; @@ -61,14 +61,29 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(float[] r, float[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "floatProviderForIOOBE") @@ -870,11 +885,11 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(float[] r, float[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Float512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Float512VectorTests.java b/test/jdk/jdk/incubator/vector/FloatVector512Tests.java similarity index 82% rename from test/jdk/jdk/incubator/vector/Float512VectorTests.java rename to test/jdk/jdk/incubator/vector/FloatVector512Tests.java index ca395221c6b..17493778826 100644 --- a/test/jdk/jdk/incubator/vector/Float512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector512Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatVector512Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Float512VectorTests extends AbstractVectorTest { +public class FloatVector512Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_512; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(float actual, float expected, float delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(float actual, float expected, float delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final float ADD_IDENTITY = (float)0; @@ -95,10 +138,10 @@ public class Float512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +153,13 @@ public class Float512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { float[] ref = f.apply(a[i]); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +169,10 @@ public class Float512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +194,13 @@ public class Float512VectorTests extends AbstractVectorTest { float relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +222,14 @@ public class Float512VectorTests extends AbstractVectorTest { float relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +245,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +267,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +285,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +300,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +312,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +328,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (float)0); + assertEquals(r[i + k], (float)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -310,19 +353,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (float)0); + assertEquals(r[i + j], (float)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -338,11 +381,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +394,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +409,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +429,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +453,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +468,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +483,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +507,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +533,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +552,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +563,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +574,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +586,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +602,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +617,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +632,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +650,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +666,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +684,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +710,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +728,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +752,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +767,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +779,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +792,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +811,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +832,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +847,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +868,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +964,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +991,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1012,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(r, a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1039,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1059,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1080,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1101,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1123,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1175,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1221,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1189,10 +1232,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1595,7 +1638,7 @@ relativeError)); // Do some zipping and shuffling. FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); FloatVector a = io.add((float)1); //[1,2] FloatVector b = a.neg(); //[-1,-2] float[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1610,19 +1653,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); FloatVector uab0 = zab0.rearrange(unz0,zab1); FloatVector uab1 = zab0.rearrange(unz1,zab1); float[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1639,15 +1682,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static float ADD(float a, float b) { @@ -1655,7 +1698,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void ADDFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1668,7 +1711,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::ADD); + assertArraysEquals(r, a, b, FloatVector512Tests::ADD); } static float add(float a, float b) { @@ -1676,7 +1719,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void addFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1687,11 +1730,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float512VectorTests::add); + assertArraysEquals(r, a, b, FloatVector512Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1707,11 +1750,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float512VectorTests::ADD); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1725,7 +1768,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float512VectorTests::add); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::add); } static float SUB(float a, float b) { @@ -1733,7 +1776,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void SUBFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void SUBFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1746,7 +1789,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::SUB); + assertArraysEquals(r, a, b, FloatVector512Tests::SUB); } static float sub(float a, float b) { @@ -1754,7 +1797,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void subFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1765,11 +1808,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float512VectorTests::sub); + assertArraysEquals(r, a, b, FloatVector512Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void SUBFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1785,11 +1828,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float512VectorTests::SUB); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::SUB); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1803,7 +1846,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float512VectorTests::sub); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::sub); } static float MUL(float a, float b) { @@ -1811,7 +1854,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MULFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void MULFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1824,7 +1867,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::MUL); + assertArraysEquals(r, a, b, FloatVector512Tests::MUL); } static float mul(float a, float b) { @@ -1832,7 +1875,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void mulFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1843,11 +1886,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float512VectorTests::mul); + assertArraysEquals(r, a, b, FloatVector512Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void MULFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1863,11 +1906,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float512VectorTests::MUL); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::MUL); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1881,7 +1924,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float512VectorTests::mul); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::mul); } static float DIV(float a, float b) { @@ -1889,7 +1932,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void DIVFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void DIVFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::DIV); + assertArraysEquals(r, a, b, FloatVector512Tests::DIV); } static float div(float a, float b) { @@ -1910,7 +1953,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void divFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1921,11 +1964,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float512VectorTests::div); + assertArraysEquals(r, a, b, FloatVector512Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void DIVFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1941,11 +1984,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float512VectorTests::DIV); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::DIV); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1959,7 +2002,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float512VectorTests::div); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::div); } static float FIRST_NONZERO(float a, float b) { @@ -1967,7 +2010,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void FIRST_NONZEROFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1980,11 +2023,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, FloatVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void FIRST_NONZEROFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2000,11 +2043,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2014,11 +2057,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2031,11 +2074,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector512Tests::add); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2045,11 +2088,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector512Tests::sub); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2076,11 +2119,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2093,11 +2136,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector512Tests::mul); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2107,11 +2150,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2124,11 +2167,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector512Tests::div); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDFloatVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2138,11 +2181,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Float512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, FloatVector512Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDFloatVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2155,13 +2198,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Float512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector512Tests::ADD); } static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MINFloat512VectorTestsWithMemOp(IntFunction fa) { + static void MINFloatVector512TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2172,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float512VectorTests::MIN); + assertArraysEquals(r, a, (float)10, FloatVector512Tests::MIN); } static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void minFloat512VectorTestsWithMemOp(IntFunction fa) { + static void minFloatVector512TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2189,13 +2232,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float512VectorTests::min); + assertArraysEquals(r, a, (float)10, FloatVector512Tests::min); } static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINFloat512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINFloatVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2208,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float512VectorTests::MIN); + assertArraysEquals(r, a, (float)10, mask, FloatVector512Tests::MIN); } static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MAXFloat512VectorTestsWithMemOp(IntFunction fa) { + static void MAXFloatVector512TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2225,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float512VectorTests::MAX); + assertArraysEquals(r, a, (float)10, FloatVector512Tests::MAX); } static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void maxFloat512VectorTestsWithMemOp(IntFunction fa) { + static void maxFloatVector512TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2242,13 +2285,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float512VectorTests::max); + assertArraysEquals(r, a, (float)10, FloatVector512Tests::max); } static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXFloat512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXFloatVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2261,7 +2304,7 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float512VectorTests::MAX); + assertArraysEquals(r, a, (float)10, mask, FloatVector512Tests::MAX); } static float MIN(float a, float b) { @@ -2269,7 +2312,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void MINFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2282,7 +2325,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::MIN); + assertArraysEquals(r, a, b, FloatVector512Tests::MIN); } static float min(float a, float b) { @@ -2290,7 +2333,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void minFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2301,7 +2344,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float512VectorTests::min); + assertArraysEquals(r, a, b, FloatVector512Tests::min); } static float MAX(float a, float b) { @@ -2309,7 +2352,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void MAXFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2322,7 +2365,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::MAX); + assertArraysEquals(r, a, b, FloatVector512Tests::MAX); } static float max(float a, float b) { @@ -2330,7 +2373,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maxFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float512VectorTests::max); + assertArraysEquals(r, a, b, FloatVector512Tests::max); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2355,11 +2398,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::MIN); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2369,11 +2412,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::min); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::min); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2383,11 +2426,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::MAX); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2397,7 +2440,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float512VectorTests::max); + assertBroadcastArraysEquals(r, a, b, FloatVector512Tests::max); } static float ADDReduce(float[] a, int idx) { @@ -2419,7 +2462,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceFloat512VectorTests(IntFunction fa) { + static void ADDReduceFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2435,7 +2478,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float512VectorTests::ADDReduce, Float512VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector512Tests::ADDReduce, FloatVector512Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2443,20 +2486,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = ADD_IDENTITY; - Assert.assertEquals((float) (id + id), id, + assertEquals((float) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id + x), x); - Assert.assertEquals((float) (x + id), x); + assertEquals((float) (id + x), x); + assertEquals((float) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id + x), x, + assertEquals((float) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x + id), x, + assertEquals((float) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2481,7 +2524,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceFloat512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceFloatVector512TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2499,7 +2542,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float512VectorTests::ADDReduceMasked, Float512VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector512Tests::ADDReduceMasked, FloatVector512Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static float MULReduce(float[] a, int idx) { @@ -2521,7 +2564,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MULReduceFloat512VectorTests(IntFunction fa) { + static void MULReduceFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2537,7 +2580,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float512VectorTests::MULReduce, Float512VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector512Tests::MULReduce, FloatVector512Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2545,20 +2588,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MUL_IDENTITY; - Assert.assertEquals((float) (id * id), id, + assertEquals((float) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id * x), x); - Assert.assertEquals((float) (x * id), x); + assertEquals((float) (id * x), x); + assertEquals((float) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id * x), x, + assertEquals((float) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x * id), x, + assertEquals((float) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2583,7 +2626,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MULReduceFloat512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceFloatVector512TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2601,7 +2644,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float512VectorTests::MULReduceMasked, Float512VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector512Tests::MULReduceMasked, FloatVector512Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static float MINReduce(float[] a, int idx) { @@ -2623,7 +2666,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MINReduceFloat512VectorTests(IntFunction fa) { + static void MINReduceFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2639,7 +2682,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float512VectorTests::MINReduce, Float512VectorTests::MINReduceAll); + FloatVector512Tests::MINReduce, FloatVector512Tests::MINReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2647,20 +2690,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MIN_IDENTITY; - Assert.assertEquals((float) Math.min(id, id), id, + assertEquals((float) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.min(id, x), x); - Assert.assertEquals((float) Math.min(x, id), x); + assertEquals((float) Math.min(id, x), x); + assertEquals((float) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.min(id, x), x, + assertEquals((float) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.min(x, id), x, + assertEquals((float) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2685,7 +2728,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINReduceFloat512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceFloatVector512TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2703,7 +2746,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float512VectorTests::MINReduceMasked, Float512VectorTests::MINReduceAllMasked); + FloatVector512Tests::MINReduceMasked, FloatVector512Tests::MINReduceAllMasked); } static float MAXReduce(float[] a, int idx) { @@ -2725,7 +2768,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MAXReduceFloat512VectorTests(IntFunction fa) { + static void MAXReduceFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2741,7 +2784,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float512VectorTests::MAXReduce, Float512VectorTests::MAXReduceAll); + FloatVector512Tests::MAXReduce, FloatVector512Tests::MAXReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2749,20 +2792,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MAX_IDENTITY; - Assert.assertEquals((float) Math.max(id, id), id, + assertEquals((float) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.max(id, x), x); - Assert.assertEquals((float) Math.max(x, id), x); + assertEquals((float) Math.max(id, x), x); + assertEquals((float) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.max(id, x), x, + assertEquals((float) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.max(x, id), x, + assertEquals((float) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2787,7 +2830,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXReduceFloat512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceFloatVector512TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2805,7 +2848,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float512VectorTests::MAXReduceMasked, Float512VectorTests::MAXReduceAllMasked); + FloatVector512Tests::MAXReduceMasked, FloatVector512Tests::MAXReduceAllMasked); } static float FIRST_NONZEROReduce(float[] a, int idx) { @@ -2827,7 +2870,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void FIRST_NONZEROReduceFloat512VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2843,7 +2886,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float512VectorTests::FIRST_NONZEROReduce, Float512VectorTests::FIRST_NONZEROReduceAll); + FloatVector512Tests::FIRST_NONZEROReduce, FloatVector512Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2851,20 +2894,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2889,7 +2932,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void FIRST_NONZEROReduceFloat512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceFloatVector512TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2907,11 +2950,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float512VectorTests::FIRST_NONZEROReduceMasked, Float512VectorTests::FIRST_NONZEROReduceAllMasked); + FloatVector512Tests::FIRST_NONZEROReduceMasked, FloatVector512Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "floatBinaryOpProvider") - static void withFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void withFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2934,7 +2977,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_DEFAULTFloat512VectorTests(IntFunction fa) { + static void IS_DEFAULTFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2944,14 +2987,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_DEFAULTMaskedFloat512VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2964,7 +3007,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2975,7 +3018,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NEGATIVEFloat512VectorTests(IntFunction fa) { + static void IS_NEGATIVEFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2985,14 +3028,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NEGATIVEMaskedFloat512VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3005,7 +3048,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3016,7 +3059,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_FINITEFloat512VectorTests(IntFunction fa) { + static void IS_FINITEFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3026,14 +3069,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_FINITEMaskedFloat512VectorTests(IntFunction fa, + static void IS_FINITEMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3046,7 +3089,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3057,7 +3100,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NANFloat512VectorTests(IntFunction fa) { + static void IS_NANFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3067,14 +3110,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NANMaskedFloat512VectorTests(IntFunction fa, + static void IS_NANMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3087,7 +3130,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3098,7 +3141,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_INFINITEFloat512VectorTests(IntFunction fa) { + static void IS_INFINITEFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3108,14 +3151,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_INFINITEMaskedFloat512VectorTests(IntFunction fa, + static void IS_INFINITEMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3128,14 +3171,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void LTFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3147,14 +3190,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void ltFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3166,14 +3209,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3189,14 +3232,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GTFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void GTFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3208,14 +3251,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GTFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3231,14 +3274,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void EQFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3250,14 +3293,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void eqFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3269,14 +3312,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3292,14 +3335,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void NEFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void NEFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3311,14 +3354,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void NEFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3334,14 +3377,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LEFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void LEFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3353,14 +3396,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LEFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3376,14 +3419,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GEFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void GEFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3395,14 +3438,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GEFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3418,14 +3461,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3435,13 +3478,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3455,13 +3498,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3471,13 +3514,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTFloatVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3491,13 +3534,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3507,13 +3550,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3527,13 +3570,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3543,13 +3586,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQFloatVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3563,7 +3606,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); } } } @@ -3573,7 +3616,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat512VectorTests(IntFunction fa, IntFunction fb, + static void blendFloatVector512Tests(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3589,11 +3632,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float512VectorTests::blend); + assertArraysEquals(r, a, b, mask, FloatVector512Tests::blend); } @Test(dataProvider = "floatUnaryOpShuffleProvider") - static void RearrangeFloat512VectorTests(IntFunction fa, + static void RearrangeFloatVector512Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3610,7 +3653,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpShuffleMaskProvider") - static void RearrangeFloat512VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeFloatVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -3628,7 +3671,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void compressFloat512VectorTests(IntFunction fa, + static void compressFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3646,7 +3689,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void expandFloat512VectorTests(IntFunction fa, + static void expandFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3664,7 +3707,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void getFloat512VectorTests(IntFunction fa) { + static void getFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3820,7 +3863,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void BroadcastFloat512VectorTests(IntFunction fa) { + static void BroadcastFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3834,7 +3877,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ZeroFloat512VectorTests(IntFunction fa) { + static void ZeroFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3844,7 +3887,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static float[] sliceUnary(float[] a, int origin, int idx) { @@ -3859,7 +3902,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void sliceUnaryFloat512VectorTests(IntFunction fa) { + static void sliceUnaryFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3870,7 +3913,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float512VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, FloatVector512Tests::sliceUnary); } static float[] sliceBinary(float[] a, float[] b, int origin, int idx) { @@ -3887,7 +3930,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void sliceBinaryFloat512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryFloatVector512TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3900,7 +3943,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Float512VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, FloatVector512Tests::sliceBinary); } static float[] slice(float[] a, float[] b, int origin, boolean[] mask, int idx) { @@ -3917,7 +3960,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void sliceFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3934,7 +3977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Float512VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, FloatVector512Tests::slice); } static float[] unsliceUnary(float[] a, int origin, int idx) { @@ -3951,7 +3994,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void unsliceUnaryFloat512VectorTests(IntFunction fa) { + static void unsliceUnaryFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3962,7 +4005,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float512VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, FloatVector512Tests::unsliceUnary); } static float[] unsliceBinary(float[] a, float[] b, int origin, int part, int idx) { @@ -3988,7 +4031,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void unsliceBinaryFloat512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryFloatVector512TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -4002,7 +4045,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Float512VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, FloatVector512Tests::unsliceBinary); } static float[] unslice(float[] a, float[] b, int origin, int part, boolean[] mask, int idx) { @@ -4042,7 +4085,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void unsliceFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4059,7 +4102,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Float512VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, FloatVector512Tests::unslice); } static float SIN(float a) { @@ -4071,7 +4114,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINFloat512VectorTests(IntFunction fa) { + static void SINFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4082,7 +4125,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::SIN, Float512VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::SIN, FloatVector512Tests::strictSIN); } static float EXP(float a) { @@ -4094,7 +4137,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPFloat512VectorTests(IntFunction fa) { + static void EXPFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4105,7 +4148,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::EXP, Float512VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::EXP, FloatVector512Tests::strictEXP); } static float LOG1P(float a) { @@ -4117,7 +4160,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG1PFloat512VectorTests(IntFunction fa) { + static void LOG1PFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4128,7 +4171,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::LOG1P, Float512VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::LOG1P, FloatVector512Tests::strictLOG1P); } static float LOG(float a) { @@ -4140,7 +4183,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOGFloat512VectorTests(IntFunction fa) { + static void LOGFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4151,7 +4194,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::LOG, Float512VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::LOG, FloatVector512Tests::strictLOG); } static float LOG10(float a) { @@ -4163,7 +4206,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG10Float512VectorTests(IntFunction fa) { + static void LOG10FloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4174,7 +4217,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::LOG10, Float512VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::LOG10, FloatVector512Tests::strictLOG10); } static float EXPM1(float a) { @@ -4186,7 +4229,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPM1Float512VectorTests(IntFunction fa) { + static void EXPM1FloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4197,7 +4240,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::EXPM1, Float512VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::EXPM1, FloatVector512Tests::strictEXPM1); } static float COS(float a) { @@ -4209,7 +4252,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSFloat512VectorTests(IntFunction fa) { + static void COSFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4220,7 +4263,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::COS, Float512VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::COS, FloatVector512Tests::strictCOS); } static float TAN(float a) { @@ -4232,7 +4275,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANFloat512VectorTests(IntFunction fa) { + static void TANFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4243,7 +4286,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::TAN, Float512VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::TAN, FloatVector512Tests::strictTAN); } static float SINH(float a) { @@ -4255,7 +4298,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINHFloat512VectorTests(IntFunction fa) { + static void SINHFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4266,7 +4309,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::SINH, Float512VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::SINH, FloatVector512Tests::strictSINH); } static float COSH(float a) { @@ -4278,7 +4321,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSHFloat512VectorTests(IntFunction fa) { + static void COSHFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4289,7 +4332,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::COSH, Float512VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::COSH, FloatVector512Tests::strictCOSH); } static float TANH(float a) { @@ -4301,7 +4344,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANHFloat512VectorTests(IntFunction fa) { + static void TANHFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4312,7 +4355,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::TANH, Float512VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::TANH, FloatVector512Tests::strictTANH); } static float ASIN(float a) { @@ -4324,7 +4367,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ASINFloat512VectorTests(IntFunction fa) { + static void ASINFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4335,7 +4378,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::ASIN, Float512VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::ASIN, FloatVector512Tests::strictASIN); } static float ACOS(float a) { @@ -4347,7 +4390,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ACOSFloat512VectorTests(IntFunction fa) { + static void ACOSFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4358,7 +4401,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::ACOS, Float512VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::ACOS, FloatVector512Tests::strictACOS); } static float ATAN(float a) { @@ -4370,7 +4413,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ATANFloat512VectorTests(IntFunction fa) { + static void ATANFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4381,7 +4424,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::ATAN, Float512VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::ATAN, FloatVector512Tests::strictATAN); } static float CBRT(float a) { @@ -4393,7 +4436,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void CBRTFloat512VectorTests(IntFunction fa) { + static void CBRTFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4404,7 +4447,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::CBRT, Float512VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, FloatVector512Tests::CBRT, FloatVector512Tests::strictCBRT); } static float HYPOT(float a, float b) { @@ -4416,7 +4459,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void HYPOTFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4429,7 +4472,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::HYPOT, Float512VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector512Tests::HYPOT, FloatVector512Tests::strictHYPOT); } @@ -4442,7 +4485,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void POWFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4455,7 +4498,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::POW, Float512VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector512Tests::POW, FloatVector512Tests::strictPOW); } @@ -4468,7 +4511,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void powFloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4481,7 +4524,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::pow, Float512VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector512Tests::pow, FloatVector512Tests::strictpow); } @@ -4494,7 +4537,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ATAN2Float512VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2FloatVector512Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4507,12 +4550,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::ATAN2, Float512VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector512Tests::ATAN2, FloatVector512Tests::strictATAN2); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4522,12 +4565,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::POW, Float512VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector512Tests::POW, FloatVector512Tests::strictPOW); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::pow, Float512VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector512Tests::pow, FloatVector512Tests::strictpow); } @@ -4550,7 +4593,7 @@ relativeError)); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4565,11 +4608,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Float512VectorTests::FMA); + assertArraysEquals(r, a, b, c, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4582,11 +4625,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Float512VectorTests::fma); + assertArraysEquals(r, a, b, c, FloatVector512Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMAFloatVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4604,11 +4647,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4619,11 +4662,11 @@ relativeError)); FloatVector bv = FloatVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Float512VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4634,11 +4677,11 @@ relativeError)); FloatVector cv = FloatVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Float512VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4653,11 +4696,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat512VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector512TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4672,11 +4715,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4687,11 +4730,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float512VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector512Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4702,11 +4745,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float512VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector512Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector512TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4720,7 +4763,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, FloatVector512Tests::FMA); } static float NEG(float a) { @@ -4732,7 +4775,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void NEGFloat512VectorTests(IntFunction fa) { + static void NEGFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4743,11 +4786,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::NEG); + assertArraysEquals(r, a, FloatVector512Tests::NEG); } @Test(dataProvider = "floatUnaryOpProvider") - static void negFloat512VectorTests(IntFunction fa) { + static void negFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4758,11 +4801,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::neg); + assertArraysEquals(r, a, FloatVector512Tests::neg); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void NEGMaskedFloat512VectorTests(IntFunction fa, + static void NEGMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4776,7 +4819,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float512VectorTests::NEG); + assertArraysEquals(r, a, mask, FloatVector512Tests::NEG); } static float ABS(float a) { @@ -4788,7 +4831,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ABSFloat512VectorTests(IntFunction fa) { + static void ABSFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4799,11 +4842,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::ABS); + assertArraysEquals(r, a, FloatVector512Tests::ABS); } @Test(dataProvider = "floatUnaryOpProvider") - static void absFloat512VectorTests(IntFunction fa) { + static void absFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4814,11 +4857,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::abs); + assertArraysEquals(r, a, FloatVector512Tests::abs); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ABSMaskedFloat512VectorTests(IntFunction fa, + static void ABSMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4832,7 +4875,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float512VectorTests::ABS); + assertArraysEquals(r, a, mask, FloatVector512Tests::ABS); } static float SQRT(float a) { @@ -4844,7 +4887,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SQRTFloat512VectorTests(IntFunction fa) { + static void SQRTFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4855,11 +4898,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::SQRT); + assertArraysEquals(r, a, FloatVector512Tests::SQRT); } @Test(dataProvider = "floatUnaryOpProvider") - static void sqrtFloat512VectorTests(IntFunction fa) { + static void sqrtFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4870,11 +4913,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::sqrt); + assertArraysEquals(r, a, FloatVector512Tests::sqrt); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void SQRTMaskedFloat512VectorTests(IntFunction fa, + static void SQRTMaskedFloatVector512Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4888,7 +4931,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float512VectorTests::SQRT); + assertArraysEquals(r, a, mask, FloatVector512Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4896,7 +4939,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandFloatVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4909,7 +4952,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::band); + assertArraysEquals(r, a, b, FloatVector512Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4917,7 +4960,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maskorFloatVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4930,7 +4973,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::bor); + assertArraysEquals(r, a, b, FloatVector512Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4938,7 +4981,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorFloatVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4951,7 +4994,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::bxor); + assertArraysEquals(r, a, b, FloatVector512Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4959,7 +5002,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotFloatVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4972,7 +5015,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::bandNot); + assertArraysEquals(r, a, b, FloatVector512Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -4980,7 +5023,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqFloatVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4993,7 +5036,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float512VectorTests::beq); + assertArraysEquals(r, a, b, FloatVector512Tests::beq); } static boolean unot(boolean a) { @@ -5001,7 +5044,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotFloat512VectorTests(IntFunction fa) { + static void masknotFloatVector512Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5012,7 +5055,7 @@ relativeError)); } } - assertArraysEquals(r, a, Float512VectorTests::unot); + assertArraysEquals(r, a, FloatVector512Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5021,15 +5064,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongFloat512VectorTests(IntFunction fa) { + static void maskFromToLongFloatVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5043,7 +5086,7 @@ relativeError)); } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltFloatVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5053,13 +5096,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqFloatVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5069,13 +5112,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floattoIntUnaryOpProvider") - static void toIntArrayFloat512VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayFloatVector512TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5086,7 +5129,7 @@ relativeError)); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void toLongArrayFloat512VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayFloatVector512TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5097,7 +5140,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toDoubleArrayFloat512VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayFloatVector512TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5108,7 +5151,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toStringFloat512VectorTestsSmokeTest(IntFunction fa) { + static void toStringFloatVector512TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5121,7 +5164,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void hashCodeFloat512VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeFloatVector512TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5154,7 +5197,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceLongFloat512VectorTests(IntFunction fa) { + static void ADDReduceLongFloatVector512Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5170,7 +5213,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Float512VectorTests::ADDReduceLong, Float512VectorTests::ADDReduceAllLong); + FloatVector512Tests::ADDReduceLong, FloatVector512Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(float[] a, int idx, boolean[] mask) { @@ -5193,7 +5236,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceLongFloat512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongFloatVector512TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5211,11 +5254,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Float512VectorTests::ADDReduceLongMasked, Float512VectorTests::ADDReduceAllLongMasked); + FloatVector512Tests::ADDReduceLongMasked, FloatVector512Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void BroadcastLongFloat512VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongFloatVector512TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -5226,7 +5269,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendFloatVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5240,12 +5283,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Float512VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector512Tests::blend); } @Test(dataProvider = "floatUnaryOpSelectFromProvider") - static void SelectFromFloat512VectorTests(IntFunction fa, + static void SelectFromFloatVector512Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); float[] order = fs.apply(a.length, SPECIES.length()); @@ -5261,7 +5304,7 @@ relativeError)); } @Test(dataProvider = "floatSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorFloat512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorFloatVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] idx = fc.apply(SPECIES.length()); @@ -5279,7 +5322,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpSelectFromMaskProvider") - static void SelectFromFloat512VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromFloatVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -5298,7 +5341,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousFloat512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousFloatVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5309,12 +5352,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringFloat512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringFloatVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5328,7 +5371,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsFloat512VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsFloatVector512TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5337,12 +5380,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsFloat512VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsFloatVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeFloat512VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeFloatVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5380,7 +5423,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountFloat512VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountFloatVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5391,7 +5434,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float512VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, FloatVector512Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5405,7 +5448,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueFloat512VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueFloatVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5416,7 +5459,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float512VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, FloatVector512Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5430,7 +5473,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueFloat512VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueFloatVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5441,11 +5484,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float512VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, FloatVector512Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressFloat512VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressFloatVector512TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5455,7 +5498,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5473,7 +5516,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeFloat512VectorTestsSmokeTest(int offset) { + static void indexInRangeFloatVector512TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5481,13 +5524,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongFloat512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongFloatVector512TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5495,7 +5538,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5514,36 +5557,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundFloat512VectorTestsSmokeTest(int length) { + static void loopBoundFloatVector512TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongFloat512VectorTestsSmokeTest(int _length) { + static void loopBoundLongFloatVector512TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeFloat512VectorTestsSmokeTest() { + static void ElementSizeFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Float.SIZE); + assertEquals(elsize, Float.SIZE); } @Test - static void VectorShapeFloat512VectorTestsSmokeTest() { + static void VectorShapeFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_512_BIT)); } @Test - static void ShapeWithLanesFloat512VectorTestsSmokeTest() { + static void ShapeWithLanesFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(float.class); @@ -5551,32 +5594,32 @@ relativeError)); } @Test - static void ElementTypeFloat512VectorTestsSmokeTest() { + static void ElementTypeFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementType() == float.class); } @Test - static void SpeciesElementSizeFloat512VectorTestsSmokeTest() { + static void SpeciesElementSizeFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementSize() == Float.SIZE); } @Test - static void VectorTypeFloat512VectorTestsSmokeTest() { + static void VectorTypeFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesFloat512VectorTestsSmokeTest() { + static void WithLanesFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(float.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeFloat512VectorTestsSmokeTest() { + static void WithShapeFloatVector512TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5584,9 +5627,9 @@ relativeError)); } @Test - static void MaskAllTrueFloat512VectorTestsSmokeTest() { + static void MaskAllTrueFloatVector512TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatVector64LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/FloatVector64LoadStoreTests.java index b3ee68a4aca..359558abbd1 100644 --- a/test/jdk/jdk/incubator/vector/Float64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector64LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Float64VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation FloatVector64LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class FloatVector64LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_64; @@ -61,14 +61,29 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 64); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(float[] r, float[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "floatProviderForIOOBE") @@ -870,11 +885,11 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(float[] r, float[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Float64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Float64VectorTests.java b/test/jdk/jdk/incubator/vector/FloatVector64Tests.java similarity index 82% rename from test/jdk/jdk/incubator/vector/Float64VectorTests.java rename to test/jdk/jdk/incubator/vector/FloatVector64Tests.java index 1b14cdb7791..663a56dfe26 100644 --- a/test/jdk/jdk/incubator/vector/Float64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVector64Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Float64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatVector64Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Float64VectorTests extends AbstractVectorTest { +public class FloatVector64Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_64; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(float actual, float expected, float delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(float actual, float expected, float delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + // Identity values for reduction operations private static final float ADD_IDENTITY = (float)0; @@ -95,10 +138,10 @@ public class Float64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -110,13 +153,13 @@ public class Float64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { float[] ref = f.apply(a[i]); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -126,10 +169,10 @@ public class Float64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -151,13 +194,13 @@ public class Float64VectorTests extends AbstractVectorTest { float relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -179,14 +222,14 @@ public class Float64VectorTests extends AbstractVectorTest { float relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -202,13 +245,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -224,13 +267,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -242,10 +285,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,10 +300,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -269,12 +312,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -285,20 +328,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (float)0); + assertEquals(r[i + k], (float)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -310,19 +353,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (float)0); + assertEquals(r[i + j], (float)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -338,11 +381,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -351,12 +394,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -366,17 +409,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -386,17 +429,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -410,10 +453,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -425,10 +468,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -440,10 +483,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -464,18 +507,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -490,18 +533,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -509,10 +552,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -520,10 +563,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -531,10 +574,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -543,10 +586,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -559,10 +602,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -574,10 +617,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -589,10 +632,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -607,10 +650,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -623,11 +666,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -641,11 +684,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -667,11 +710,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -685,11 +728,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -709,10 +752,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -724,10 +767,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -736,10 +779,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -749,10 +792,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -768,11 +811,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -789,11 +832,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -804,11 +847,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -825,11 +868,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -921,13 +964,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -948,13 +991,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -969,13 +1012,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(r, a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -996,13 +1039,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1016,13 +1059,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1037,13 +1080,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1058,13 +1101,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1080,13 +1123,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1132,10 +1175,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1178,10 +1221,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1189,10 +1232,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1595,7 +1638,7 @@ relativeError)); // Do some zipping and shuffling. FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); FloatVector a = io.add((float)1); //[1,2] FloatVector b = a.neg(); //[-1,-2] float[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1610,19 +1653,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); FloatVector uab0 = zab0.rearrange(unz0,zab1); FloatVector uab1 = zab0.rearrange(unz1,zab1); float[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1639,15 +1682,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static float ADD(float a, float b) { @@ -1655,7 +1698,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void ADDFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1668,7 +1711,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::ADD); + assertArraysEquals(r, a, b, FloatVector64Tests::ADD); } static float add(float a, float b) { @@ -1676,7 +1719,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void addFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1687,11 +1730,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float64VectorTests::add); + assertArraysEquals(r, a, b, FloatVector64Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1707,11 +1750,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float64VectorTests::ADD); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1725,7 +1768,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float64VectorTests::add); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::add); } static float SUB(float a, float b) { @@ -1733,7 +1776,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void SUBFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void SUBFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1746,7 +1789,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::SUB); + assertArraysEquals(r, a, b, FloatVector64Tests::SUB); } static float sub(float a, float b) { @@ -1754,7 +1797,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void subFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1765,11 +1808,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float64VectorTests::sub); + assertArraysEquals(r, a, b, FloatVector64Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void SUBFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1785,11 +1828,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float64VectorTests::SUB); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::SUB); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1803,7 +1846,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float64VectorTests::sub); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::sub); } static float MUL(float a, float b) { @@ -1811,7 +1854,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MULFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void MULFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1824,7 +1867,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::MUL); + assertArraysEquals(r, a, b, FloatVector64Tests::MUL); } static float mul(float a, float b) { @@ -1832,7 +1875,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void mulFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1843,11 +1886,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float64VectorTests::mul); + assertArraysEquals(r, a, b, FloatVector64Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void MULFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1863,11 +1906,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float64VectorTests::MUL); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::MUL); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1881,7 +1924,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float64VectorTests::mul); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::mul); } static float DIV(float a, float b) { @@ -1889,7 +1932,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void DIVFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void DIVFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::DIV); + assertArraysEquals(r, a, b, FloatVector64Tests::DIV); } static float div(float a, float b) { @@ -1910,7 +1953,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void divFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1921,11 +1964,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float64VectorTests::div); + assertArraysEquals(r, a, b, FloatVector64Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void DIVFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1941,11 +1984,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float64VectorTests::DIV); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::DIV); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1959,7 +2002,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Float64VectorTests::div); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::div); } static float FIRST_NONZERO(float a, float b) { @@ -1967,7 +2010,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void FIRST_NONZEROFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1980,11 +2023,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, FloatVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void FIRST_NONZEROFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2000,11 +2043,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2014,11 +2057,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2031,11 +2074,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector64Tests::add); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2045,11 +2088,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector64Tests::sub); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2076,11 +2119,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2093,11 +2136,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector64Tests::mul); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2107,11 +2150,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2124,11 +2167,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Float64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, FloatVector64Tests::div); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloat64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDFloatVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2138,11 +2181,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Float64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, FloatVector64Tests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloat64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDFloatVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2155,13 +2198,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Float64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector64Tests::ADD); } static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MINFloat64VectorTestsWithMemOp(IntFunction fa) { + static void MINFloatVector64TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2172,13 +2215,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float64VectorTests::MIN); + assertArraysEquals(r, a, (float)10, FloatVector64Tests::MIN); } static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void minFloat64VectorTestsWithMemOp(IntFunction fa) { + static void minFloatVector64TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2189,13 +2232,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float64VectorTests::min); + assertArraysEquals(r, a, (float)10, FloatVector64Tests::min); } static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINFloat64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINFloatVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2208,13 +2251,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float64VectorTests::MIN); + assertArraysEquals(r, a, (float)10, mask, FloatVector64Tests::MIN); } static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MAXFloat64VectorTestsWithMemOp(IntFunction fa) { + static void MAXFloatVector64TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2225,13 +2268,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float64VectorTests::MAX); + assertArraysEquals(r, a, (float)10, FloatVector64Tests::MAX); } static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void maxFloat64VectorTestsWithMemOp(IntFunction fa) { + static void maxFloatVector64TestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2242,13 +2285,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, Float64VectorTests::max); + assertArraysEquals(r, a, (float)10, FloatVector64Tests::max); } static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXFloat64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXFloatVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2261,7 +2304,7 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, Float64VectorTests::MAX); + assertArraysEquals(r, a, (float)10, mask, FloatVector64Tests::MAX); } static float MIN(float a, float b) { @@ -2269,7 +2312,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void MINFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2282,7 +2325,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::MIN); + assertArraysEquals(r, a, b, FloatVector64Tests::MIN); } static float min(float a, float b) { @@ -2290,7 +2333,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void minFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2301,7 +2344,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float64VectorTests::min); + assertArraysEquals(r, a, b, FloatVector64Tests::min); } static float MAX(float a, float b) { @@ -2309,7 +2352,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void MAXFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2322,7 +2365,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::MAX); + assertArraysEquals(r, a, b, FloatVector64Tests::MAX); } static float max(float a, float b) { @@ -2330,7 +2373,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maxFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Float64VectorTests::max); + assertArraysEquals(r, a, b, FloatVector64Tests::max); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2355,11 +2398,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::MIN); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2369,11 +2412,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::min); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::min); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2383,11 +2426,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::MAX); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2397,7 +2440,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Float64VectorTests::max); + assertBroadcastArraysEquals(r, a, b, FloatVector64Tests::max); } static float ADDReduce(float[] a, int idx) { @@ -2419,7 +2462,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceFloat64VectorTests(IntFunction fa) { + static void ADDReduceFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2435,7 +2478,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float64VectorTests::ADDReduce, Float64VectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector64Tests::ADDReduce, FloatVector64Tests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2443,20 +2486,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = ADD_IDENTITY; - Assert.assertEquals((float) (id + id), id, + assertEquals((float) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id + x), x); - Assert.assertEquals((float) (x + id), x); + assertEquals((float) (id + x), x); + assertEquals((float) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id + x), x, + assertEquals((float) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x + id), x, + assertEquals((float) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2481,7 +2524,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceFloat64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceFloatVector64TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2499,7 +2542,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float64VectorTests::ADDReduceMasked, Float64VectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVector64Tests::ADDReduceMasked, FloatVector64Tests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static float MULReduce(float[] a, int idx) { @@ -2521,7 +2564,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MULReduceFloat64VectorTests(IntFunction fa) { + static void MULReduceFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2537,7 +2580,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float64VectorTests::MULReduce, Float64VectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector64Tests::MULReduce, FloatVector64Tests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2545,20 +2588,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MUL_IDENTITY; - Assert.assertEquals((float) (id * id), id, + assertEquals((float) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id * x), x); - Assert.assertEquals((float) (x * id), x); + assertEquals((float) (id * x), x); + assertEquals((float) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id * x), x, + assertEquals((float) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x * id), x, + assertEquals((float) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2583,7 +2626,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MULReduceFloat64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceFloatVector64TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2601,7 +2644,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float64VectorTests::MULReduceMasked, Float64VectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVector64Tests::MULReduceMasked, FloatVector64Tests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static float MINReduce(float[] a, int idx) { @@ -2623,7 +2666,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MINReduceFloat64VectorTests(IntFunction fa) { + static void MINReduceFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2639,7 +2682,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float64VectorTests::MINReduce, Float64VectorTests::MINReduceAll); + FloatVector64Tests::MINReduce, FloatVector64Tests::MINReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2647,20 +2690,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MIN_IDENTITY; - Assert.assertEquals((float) Math.min(id, id), id, + assertEquals((float) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.min(id, x), x); - Assert.assertEquals((float) Math.min(x, id), x); + assertEquals((float) Math.min(id, x), x); + assertEquals((float) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.min(id, x), x, + assertEquals((float) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.min(x, id), x, + assertEquals((float) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2685,7 +2728,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINReduceFloat64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceFloatVector64TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2703,7 +2746,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float64VectorTests::MINReduceMasked, Float64VectorTests::MINReduceAllMasked); + FloatVector64Tests::MINReduceMasked, FloatVector64Tests::MINReduceAllMasked); } static float MAXReduce(float[] a, int idx) { @@ -2725,7 +2768,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MAXReduceFloat64VectorTests(IntFunction fa) { + static void MAXReduceFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2741,7 +2784,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float64VectorTests::MAXReduce, Float64VectorTests::MAXReduceAll); + FloatVector64Tests::MAXReduce, FloatVector64Tests::MAXReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2749,20 +2792,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MAX_IDENTITY; - Assert.assertEquals((float) Math.max(id, id), id, + assertEquals((float) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.max(id, x), x); - Assert.assertEquals((float) Math.max(x, id), x); + assertEquals((float) Math.max(id, x), x); + assertEquals((float) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.max(id, x), x, + assertEquals((float) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.max(x, id), x, + assertEquals((float) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2787,7 +2830,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXReduceFloat64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceFloatVector64TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2805,7 +2848,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float64VectorTests::MAXReduceMasked, Float64VectorTests::MAXReduceAllMasked); + FloatVector64Tests::MAXReduceMasked, FloatVector64Tests::MAXReduceAllMasked); } static float FIRST_NONZEROReduce(float[] a, int idx) { @@ -2827,7 +2870,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void FIRST_NONZEROReduceFloat64VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2843,7 +2886,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - Float64VectorTests::FIRST_NONZEROReduce, Float64VectorTests::FIRST_NONZEROReduceAll); + FloatVector64Tests::FIRST_NONZEROReduce, FloatVector64Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2851,20 +2894,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2889,7 +2932,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void FIRST_NONZEROReduceFloat64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceFloatVector64TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2907,11 +2950,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - Float64VectorTests::FIRST_NONZEROReduceMasked, Float64VectorTests::FIRST_NONZEROReduceAllMasked); + FloatVector64Tests::FIRST_NONZEROReduceMasked, FloatVector64Tests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "floatBinaryOpProvider") - static void withFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void withFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2934,7 +2977,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_DEFAULTFloat64VectorTests(IntFunction fa) { + static void IS_DEFAULTFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2944,14 +2987,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_DEFAULTMaskedFloat64VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2964,7 +3007,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2975,7 +3018,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NEGATIVEFloat64VectorTests(IntFunction fa) { + static void IS_NEGATIVEFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2985,14 +3028,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NEGATIVEMaskedFloat64VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3005,7 +3048,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3016,7 +3059,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_FINITEFloat64VectorTests(IntFunction fa) { + static void IS_FINITEFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3026,14 +3069,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_FINITEMaskedFloat64VectorTests(IntFunction fa, + static void IS_FINITEMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3046,7 +3089,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3057,7 +3100,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NANFloat64VectorTests(IntFunction fa) { + static void IS_NANFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3067,14 +3110,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NANMaskedFloat64VectorTests(IntFunction fa, + static void IS_NANMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3087,7 +3130,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3098,7 +3141,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_INFINITEFloat64VectorTests(IntFunction fa) { + static void IS_INFINITEFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3108,14 +3151,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_INFINITEMaskedFloat64VectorTests(IntFunction fa, + static void IS_INFINITEMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3128,14 +3171,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void LTFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3147,14 +3190,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void ltFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3166,14 +3209,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3189,14 +3232,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GTFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void GTFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3208,14 +3251,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GTFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3231,14 +3274,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void EQFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3250,14 +3293,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void eqFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3269,14 +3312,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3292,14 +3335,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void NEFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void NEFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3311,14 +3354,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void NEFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3334,14 +3377,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LEFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void LEFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3353,14 +3396,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LEFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3376,14 +3419,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GEFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void GEFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3395,14 +3438,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GEFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3418,14 +3461,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3435,13 +3478,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3455,13 +3498,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloat64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3471,13 +3514,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloat64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTFloatVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3491,13 +3534,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3507,13 +3550,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3527,13 +3570,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloat64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3543,13 +3586,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloat64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQFloatVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3563,7 +3606,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); } } } @@ -3573,7 +3616,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat64VectorTests(IntFunction fa, IntFunction fb, + static void blendFloatVector64Tests(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3589,11 +3632,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, Float64VectorTests::blend); + assertArraysEquals(r, a, b, mask, FloatVector64Tests::blend); } @Test(dataProvider = "floatUnaryOpShuffleProvider") - static void RearrangeFloat64VectorTests(IntFunction fa, + static void RearrangeFloatVector64Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3610,7 +3653,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpShuffleMaskProvider") - static void RearrangeFloat64VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeFloatVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -3628,7 +3671,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void compressFloat64VectorTests(IntFunction fa, + static void compressFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3646,7 +3689,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void expandFloat64VectorTests(IntFunction fa, + static void expandFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3664,7 +3707,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void getFloat64VectorTests(IntFunction fa) { + static void getFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3820,7 +3863,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void BroadcastFloat64VectorTests(IntFunction fa) { + static void BroadcastFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3834,7 +3877,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ZeroFloat64VectorTests(IntFunction fa) { + static void ZeroFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3844,7 +3887,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static float[] sliceUnary(float[] a, int origin, int idx) { @@ -3859,7 +3902,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void sliceUnaryFloat64VectorTests(IntFunction fa) { + static void sliceUnaryFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3870,7 +3913,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float64VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, FloatVector64Tests::sliceUnary); } static float[] sliceBinary(float[] a, float[] b, int origin, int idx) { @@ -3887,7 +3930,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void sliceBinaryFloat64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryFloatVector64TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3900,7 +3943,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, Float64VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, FloatVector64Tests::sliceBinary); } static float[] slice(float[] a, float[] b, int origin, boolean[] mask, int idx) { @@ -3917,7 +3960,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void sliceFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3934,7 +3977,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, Float64VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, FloatVector64Tests::slice); } static float[] unsliceUnary(float[] a, int origin, int idx) { @@ -3951,7 +3994,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void unsliceUnaryFloat64VectorTests(IntFunction fa) { + static void unsliceUnaryFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3962,7 +4005,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, Float64VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, FloatVector64Tests::unsliceUnary); } static float[] unsliceBinary(float[] a, float[] b, int origin, int part, int idx) { @@ -3988,7 +4031,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void unsliceBinaryFloat64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryFloatVector64TestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -4002,7 +4045,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, Float64VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, FloatVector64Tests::unsliceBinary); } static float[] unslice(float[] a, float[] b, int origin, int part, boolean[] mask, int idx) { @@ -4042,7 +4085,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void unsliceFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4059,7 +4102,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, Float64VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, FloatVector64Tests::unslice); } static float SIN(float a) { @@ -4071,7 +4114,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINFloat64VectorTests(IntFunction fa) { + static void SINFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4082,7 +4125,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::SIN, Float64VectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::SIN, FloatVector64Tests::strictSIN); } static float EXP(float a) { @@ -4094,7 +4137,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPFloat64VectorTests(IntFunction fa) { + static void EXPFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4105,7 +4148,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::EXP, Float64VectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::EXP, FloatVector64Tests::strictEXP); } static float LOG1P(float a) { @@ -4117,7 +4160,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG1PFloat64VectorTests(IntFunction fa) { + static void LOG1PFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4128,7 +4171,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::LOG1P, Float64VectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::LOG1P, FloatVector64Tests::strictLOG1P); } static float LOG(float a) { @@ -4140,7 +4183,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOGFloat64VectorTests(IntFunction fa) { + static void LOGFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4151,7 +4194,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::LOG, Float64VectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::LOG, FloatVector64Tests::strictLOG); } static float LOG10(float a) { @@ -4163,7 +4206,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG10Float64VectorTests(IntFunction fa) { + static void LOG10FloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4174,7 +4217,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::LOG10, Float64VectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::LOG10, FloatVector64Tests::strictLOG10); } static float EXPM1(float a) { @@ -4186,7 +4229,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPM1Float64VectorTests(IntFunction fa) { + static void EXPM1FloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4197,7 +4240,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::EXPM1, Float64VectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::EXPM1, FloatVector64Tests::strictEXPM1); } static float COS(float a) { @@ -4209,7 +4252,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSFloat64VectorTests(IntFunction fa) { + static void COSFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4220,7 +4263,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::COS, Float64VectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::COS, FloatVector64Tests::strictCOS); } static float TAN(float a) { @@ -4232,7 +4275,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANFloat64VectorTests(IntFunction fa) { + static void TANFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4243,7 +4286,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::TAN, Float64VectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::TAN, FloatVector64Tests::strictTAN); } static float SINH(float a) { @@ -4255,7 +4298,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINHFloat64VectorTests(IntFunction fa) { + static void SINHFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4266,7 +4309,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::SINH, Float64VectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::SINH, FloatVector64Tests::strictSINH); } static float COSH(float a) { @@ -4278,7 +4321,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSHFloat64VectorTests(IntFunction fa) { + static void COSHFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4289,7 +4332,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::COSH, Float64VectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::COSH, FloatVector64Tests::strictCOSH); } static float TANH(float a) { @@ -4301,7 +4344,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANHFloat64VectorTests(IntFunction fa) { + static void TANHFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4312,7 +4355,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::TANH, Float64VectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::TANH, FloatVector64Tests::strictTANH); } static float ASIN(float a) { @@ -4324,7 +4367,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ASINFloat64VectorTests(IntFunction fa) { + static void ASINFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4335,7 +4378,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::ASIN, Float64VectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::ASIN, FloatVector64Tests::strictASIN); } static float ACOS(float a) { @@ -4347,7 +4390,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ACOSFloat64VectorTests(IntFunction fa) { + static void ACOSFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4358,7 +4401,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::ACOS, Float64VectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::ACOS, FloatVector64Tests::strictACOS); } static float ATAN(float a) { @@ -4370,7 +4413,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ATANFloat64VectorTests(IntFunction fa) { + static void ATANFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4381,7 +4424,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::ATAN, Float64VectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::ATAN, FloatVector64Tests::strictATAN); } static float CBRT(float a) { @@ -4393,7 +4436,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void CBRTFloat64VectorTests(IntFunction fa) { + static void CBRTFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4404,7 +4447,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, Float64VectorTests::CBRT, Float64VectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, FloatVector64Tests::CBRT, FloatVector64Tests::strictCBRT); } static float HYPOT(float a, float b) { @@ -4416,7 +4459,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void HYPOTFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4429,7 +4472,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float64VectorTests::HYPOT, Float64VectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector64Tests::HYPOT, FloatVector64Tests::strictHYPOT); } @@ -4442,7 +4485,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void POWFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4455,7 +4498,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float64VectorTests::POW, Float64VectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector64Tests::POW, FloatVector64Tests::strictPOW); } @@ -4468,7 +4511,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void powFloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4481,7 +4524,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float64VectorTests::pow, Float64VectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector64Tests::pow, FloatVector64Tests::strictpow); } @@ -4494,7 +4537,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ATAN2Float64VectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2FloatVector64Tests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4507,12 +4550,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, Float64VectorTests::ATAN2, Float64VectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVector64Tests::ATAN2, FloatVector64Tests::strictATAN2); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4522,12 +4565,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float64VectorTests::POW, Float64VectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector64Tests::POW, FloatVector64Tests::strictPOW); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4537,7 +4580,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float64VectorTests::pow, Float64VectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVector64Tests::pow, FloatVector64Tests::strictpow); } @@ -4550,7 +4593,7 @@ relativeError)); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4565,11 +4608,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, Float64VectorTests::FMA); + assertArraysEquals(r, a, b, c, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4582,11 +4625,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Float64VectorTests::fma); + assertArraysEquals(r, a, b, c, FloatVector64Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMAFloatVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4604,11 +4647,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, Float64VectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4619,11 +4662,11 @@ relativeError)); FloatVector bv = FloatVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Float64VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4634,11 +4677,11 @@ relativeError)); FloatVector cv = FloatVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Float64VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4653,11 +4696,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Float64VectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat64VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector64TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4672,11 +4715,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Float64VectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloat64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4687,11 +4730,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float64VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector64Tests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloat64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4702,11 +4745,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Float64VectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVector64Tests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloat64VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVector64TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4720,7 +4763,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Float64VectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, FloatVector64Tests::FMA); } static float NEG(float a) { @@ -4732,7 +4775,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void NEGFloat64VectorTests(IntFunction fa) { + static void NEGFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4743,11 +4786,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::NEG); + assertArraysEquals(r, a, FloatVector64Tests::NEG); } @Test(dataProvider = "floatUnaryOpProvider") - static void negFloat64VectorTests(IntFunction fa) { + static void negFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4758,11 +4801,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::neg); + assertArraysEquals(r, a, FloatVector64Tests::neg); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void NEGMaskedFloat64VectorTests(IntFunction fa, + static void NEGMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4776,7 +4819,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float64VectorTests::NEG); + assertArraysEquals(r, a, mask, FloatVector64Tests::NEG); } static float ABS(float a) { @@ -4788,7 +4831,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ABSFloat64VectorTests(IntFunction fa) { + static void ABSFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4799,11 +4842,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::ABS); + assertArraysEquals(r, a, FloatVector64Tests::ABS); } @Test(dataProvider = "floatUnaryOpProvider") - static void absFloat64VectorTests(IntFunction fa) { + static void absFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4814,11 +4857,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::abs); + assertArraysEquals(r, a, FloatVector64Tests::abs); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ABSMaskedFloat64VectorTests(IntFunction fa, + static void ABSMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4832,7 +4875,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float64VectorTests::ABS); + assertArraysEquals(r, a, mask, FloatVector64Tests::ABS); } static float SQRT(float a) { @@ -4844,7 +4887,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SQRTFloat64VectorTests(IntFunction fa) { + static void SQRTFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4855,11 +4898,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::SQRT); + assertArraysEquals(r, a, FloatVector64Tests::SQRT); } @Test(dataProvider = "floatUnaryOpProvider") - static void sqrtFloat64VectorTests(IntFunction fa) { + static void sqrtFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4870,11 +4913,11 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::sqrt); + assertArraysEquals(r, a, FloatVector64Tests::sqrt); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void SQRTMaskedFloat64VectorTests(IntFunction fa, + static void SQRTMaskedFloatVector64Tests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4888,7 +4931,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, Float64VectorTests::SQRT); + assertArraysEquals(r, a, mask, FloatVector64Tests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4896,7 +4939,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandFloatVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4909,7 +4952,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::band); + assertArraysEquals(r, a, b, FloatVector64Tests::band); } static boolean bor(boolean a, boolean b) { @@ -4917,7 +4960,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maskorFloatVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4930,7 +4973,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::bor); + assertArraysEquals(r, a, b, FloatVector64Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4938,7 +4981,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorFloatVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4951,7 +4994,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::bxor); + assertArraysEquals(r, a, b, FloatVector64Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4959,7 +5002,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotFloatVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4972,7 +5015,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::bandNot); + assertArraysEquals(r, a, b, FloatVector64Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -4980,7 +5023,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqFloatVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4993,7 +5036,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, Float64VectorTests::beq); + assertArraysEquals(r, a, b, FloatVector64Tests::beq); } static boolean unot(boolean a) { @@ -5001,7 +5044,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotFloat64VectorTests(IntFunction fa) { + static void masknotFloatVector64Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5012,7 +5055,7 @@ relativeError)); } } - assertArraysEquals(r, a, Float64VectorTests::unot); + assertArraysEquals(r, a, FloatVector64Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5021,15 +5064,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongFloat64VectorTests(IntFunction fa) { + static void maskFromToLongFloatVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5043,7 +5086,7 @@ relativeError)); } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloat64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltFloatVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5053,13 +5096,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloat64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqFloatVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5069,13 +5112,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floattoIntUnaryOpProvider") - static void toIntArrayFloat64VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayFloatVector64TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5086,7 +5129,7 @@ relativeError)); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void toLongArrayFloat64VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayFloatVector64TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5097,7 +5140,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toDoubleArrayFloat64VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayFloatVector64TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5108,7 +5151,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toStringFloat64VectorTestsSmokeTest(IntFunction fa) { + static void toStringFloatVector64TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5121,7 +5164,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void hashCodeFloat64VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeFloatVector64TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5154,7 +5197,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceLongFloat64VectorTests(IntFunction fa) { + static void ADDReduceLongFloatVector64Tests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5170,7 +5213,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - Float64VectorTests::ADDReduceLong, Float64VectorTests::ADDReduceAllLong); + FloatVector64Tests::ADDReduceLong, FloatVector64Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(float[] a, int idx, boolean[] mask) { @@ -5193,7 +5236,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceLongFloat64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongFloatVector64TestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5211,11 +5254,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Float64VectorTests::ADDReduceLongMasked, Float64VectorTests::ADDReduceAllLongMasked); + FloatVector64Tests::ADDReduceLongMasked, FloatVector64Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void BroadcastLongFloat64VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongFloatVector64TestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -5226,7 +5269,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloat64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendFloatVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5240,12 +5283,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Float64VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVector64Tests::blend); } @Test(dataProvider = "floatUnaryOpSelectFromProvider") - static void SelectFromFloat64VectorTests(IntFunction fa, + static void SelectFromFloatVector64Tests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); float[] order = fs.apply(a.length, SPECIES.length()); @@ -5261,7 +5304,7 @@ relativeError)); } @Test(dataProvider = "floatSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorFloat64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorFloatVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] idx = fc.apply(SPECIES.length()); @@ -5279,7 +5322,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpSelectFromMaskProvider") - static void SelectFromFloat64VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromFloatVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -5298,7 +5341,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousFloat64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousFloatVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5309,12 +5352,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringFloat64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringFloatVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5328,7 +5371,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsFloat64VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsFloatVector64TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5337,12 +5380,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsFloat64VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsFloatVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeFloat64VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeFloatVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5380,7 +5423,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountFloat64VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountFloatVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5391,7 +5434,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float64VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, FloatVector64Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5405,7 +5448,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueFloat64VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueFloatVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5416,7 +5459,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float64VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, FloatVector64Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5430,7 +5473,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueFloat64VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueFloatVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5441,11 +5484,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, Float64VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, FloatVector64Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressFloat64VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressFloatVector64TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5455,7 +5498,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5473,7 +5516,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeFloat64VectorTestsSmokeTest(int offset) { + static void indexInRangeFloatVector64TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5481,13 +5524,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongFloat64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongFloatVector64TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5495,7 +5538,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5514,36 +5557,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundFloat64VectorTestsSmokeTest(int length) { + static void loopBoundFloatVector64TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongFloat64VectorTestsSmokeTest(int _length) { + static void loopBoundLongFloatVector64TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeFloat64VectorTestsSmokeTest() { + static void ElementSizeFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Float.SIZE); + assertEquals(elsize, Float.SIZE); } @Test - static void VectorShapeFloat64VectorTestsSmokeTest() { + static void VectorShapeFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_64_BIT)); } @Test - static void ShapeWithLanesFloat64VectorTestsSmokeTest() { + static void ShapeWithLanesFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(float.class); @@ -5551,32 +5594,32 @@ relativeError)); } @Test - static void ElementTypeFloat64VectorTestsSmokeTest() { + static void ElementTypeFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementType() == float.class); } @Test - static void SpeciesElementSizeFloat64VectorTestsSmokeTest() { + static void SpeciesElementSizeFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementSize() == Float.SIZE); } @Test - static void VectorTypeFloat64VectorTestsSmokeTest() { + static void VectorTypeFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesFloat64VectorTestsSmokeTest() { + static void WithLanesFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(float.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeFloat64VectorTestsSmokeTest() { + static void WithShapeFloatVector64TestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5584,9 +5627,9 @@ relativeError)); } @Test - static void MaskAllTrueFloat64VectorTestsSmokeTest() { + static void MaskAllTrueFloatVector64TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/FloatVectorMaxLoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/FloatVectorMaxLoadStoreTests.java index 5c86ab350d2..d1832ea8e3a 100644 --- a/test/jdk/jdk/incubator/vector/FloatMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVectorMaxLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED - * -XX:-TieredCompilation FloatMaxVectorLoadStoreTests + * -XX:-TieredCompilation FloatVectorMaxLoadStoreTests * */ @@ -52,7 +52,7 @@ import java.util.List; import java.util.function.*; @Test -public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class FloatVectorMaxLoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_MAX; @@ -68,14 +68,29 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / Max); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(float[] r, float[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (float) 0, "at index #" + i); } } @@ -329,7 +344,7 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "floatProviderForIOOBE") @@ -877,11 +892,11 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -892,11 +907,11 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (float) 0, "at index #" + j); } } @@ -912,7 +927,7 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(float[] r, float[] a, int[] indexMap) { @@ -925,7 +940,7 @@ public class FloatMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java b/test/jdk/jdk/incubator/vector/FloatVectorMaxTests.java similarity index 82% rename from test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java rename to test/jdk/jdk/incubator/vector/FloatVectorMaxTests.java index 53edb408035..9d272f43863 100644 --- a/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/FloatVectorMaxTests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation FloatVectorMaxTests */ // -- This file was mechanically generated: Do not edit! -- // @@ -55,12 +55,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class FloatMaxVectorTests extends AbstractVectorTest { +public class FloatVectorMaxTests extends AbstractVectorTest { static final VectorSpecies SPECIES = FloatVector.SPECIES_MAX; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(float actual, float expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float actual, float expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(float actual, float expected, float delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(float actual, float expected, float delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(float [] actual, float [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(float [] actual, float [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static VectorShape getMaxBit() { return VectorShape.S_Max_BIT; @@ -101,10 +144,10 @@ public class FloatMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -116,13 +159,13 @@ public class FloatMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { float[] ref = f.apply(a[i]); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -132,10 +175,10 @@ public class FloatMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -157,13 +200,13 @@ public class FloatMaxVectorTests extends AbstractVectorTest { float relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } @@ -185,14 +228,14 @@ public class FloatMaxVectorTests extends AbstractVectorTest { float relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } @@ -208,13 +251,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -230,13 +273,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -248,10 +291,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -263,10 +306,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -275,12 +318,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -291,20 +334,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (float)0); + assertEquals(r[i + k], (float)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -316,19 +359,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (float)0); + assertEquals(r[i + j], (float)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (float)0, "at index #" + idx); + assertEquals(r[idx], (float)0, "at index #" + idx); } } } @@ -344,11 +387,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -357,12 +400,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -372,17 +415,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -392,17 +435,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (float)0); + assertEquals(r[i+j], (float)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (float)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -416,10 +459,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -431,10 +474,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -446,10 +489,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -470,18 +513,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -496,18 +539,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -515,10 +558,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -526,10 +569,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -537,10 +580,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -549,10 +592,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -565,10 +608,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -580,10 +623,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -595,10 +638,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -613,10 +656,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (float)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -629,11 +672,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -647,11 +690,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -673,11 +716,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -691,11 +734,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -715,10 +758,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -730,10 +773,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -742,10 +785,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -755,10 +798,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -774,11 +817,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -795,11 +838,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -810,11 +853,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -831,11 +874,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -927,13 +970,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -954,13 +997,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -975,13 +1018,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { float[] ref = f.apply(r, a, i, mask, b, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -1002,13 +1045,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1022,13 +1065,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1043,13 +1086,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1064,13 +1107,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1086,13 +1129,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { float[] ref = f.apply(a, b, origin, part, mask, i); float[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1138,10 +1181,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1184,10 +1227,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1195,10 +1238,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1601,7 +1644,7 @@ relativeError)); // Do some zipping and shuffling. FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); FloatVector a = io.add((float)1); //[1,2] FloatVector b = a.neg(); //[-1,-2] float[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1616,19 +1659,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); FloatVector uab0 = zab0.rearrange(unz0,zab1); FloatVector uab1 = zab0.rearrange(unz1,zab1); float[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { FloatVector io = (FloatVector) SPECIES.broadcast(0).addIndex(1); FloatVector io2 = (FloatVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1645,15 +1688,15 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); } @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } static float ADD(float a, float b) { @@ -1661,7 +1704,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ADDFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1674,7 +1717,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::ADD); + assertArraysEquals(r, a, b, FloatVectorMaxTests::ADD); } static float add(float a, float b) { @@ -1682,7 +1725,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void addFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1693,11 +1736,11 @@ relativeError)); av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, FloatMaxVectorTests::add); + assertArraysEquals(r, a, b, FloatVectorMaxTests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1713,11 +1756,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::ADD); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void addFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1731,7 +1774,7 @@ relativeError)); av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::add); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::add); } static float SUB(float a, float b) { @@ -1739,7 +1782,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void SUBFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUBFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1752,7 +1795,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::SUB); + assertArraysEquals(r, a, b, FloatVectorMaxTests::SUB); } static float sub(float a, float b) { @@ -1760,7 +1803,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void subFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1771,11 +1814,11 @@ relativeError)); av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, FloatMaxVectorTests::sub); + assertArraysEquals(r, a, b, FloatVectorMaxTests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void SUBFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1791,11 +1834,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::SUB); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::SUB); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void subFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1809,7 +1852,7 @@ relativeError)); av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::sub); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::sub); } static float MUL(float a, float b) { @@ -1817,7 +1860,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MULFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MULFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1830,7 +1873,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::MUL); + assertArraysEquals(r, a, b, FloatVectorMaxTests::MUL); } static float mul(float a, float b) { @@ -1838,7 +1881,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void mulFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1849,11 +1892,11 @@ relativeError)); av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, FloatMaxVectorTests::mul); + assertArraysEquals(r, a, b, FloatVectorMaxTests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void MULFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1869,11 +1912,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::MUL); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::MUL); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1887,7 +1930,7 @@ relativeError)); av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::mul); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::mul); } static float DIV(float a, float b) { @@ -1895,7 +1938,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void DIVFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void DIVFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1908,7 +1951,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::DIV); + assertArraysEquals(r, a, b, FloatVectorMaxTests::DIV); } static float div(float a, float b) { @@ -1916,7 +1959,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void divFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1927,11 +1970,11 @@ relativeError)); av.div(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, FloatMaxVectorTests::div); + assertArraysEquals(r, a, b, FloatVectorMaxTests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void DIVFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1947,11 +1990,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::DIV); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::DIV); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void divFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -1965,7 +2008,7 @@ relativeError)); av.div(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::div); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::div); } static float FIRST_NONZERO(float a, float b) { @@ -1973,7 +2016,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void FIRST_NONZEROFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -1986,11 +2029,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, FloatVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void FIRST_NONZEROFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2006,11 +2049,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "floatBinaryOpProvider") - static void addFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2020,11 +2063,11 @@ relativeError)); av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::add); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void addFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2037,11 +2080,11 @@ relativeError)); av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, FloatMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, FloatVectorMaxTests::add); } @Test(dataProvider = "floatBinaryOpProvider") - static void subFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2051,11 +2094,11 @@ relativeError)); av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::sub); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void subFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2068,11 +2111,11 @@ relativeError)); av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, FloatMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, FloatVectorMaxTests::sub); } @Test(dataProvider = "floatBinaryOpProvider") - static void mulFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2082,11 +2125,11 @@ relativeError)); av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::mul); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void mulFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2099,11 +2142,11 @@ relativeError)); av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, FloatMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, FloatVectorMaxTests::mul); } @Test(dataProvider = "floatBinaryOpProvider") - static void divFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2113,11 +2156,11 @@ relativeError)); av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::div); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void divFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2130,11 +2173,11 @@ relativeError)); av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, FloatMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, FloatVectorMaxTests::div); } @Test(dataProvider = "floatBinaryOpProvider") - static void ADDFloatMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDFloatVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2144,11 +2187,11 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, FloatMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, FloatVectorMaxTests::ADD); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void ADDFloatMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDFloatVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -2161,13 +2204,13 @@ relativeError)); av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, FloatMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVectorMaxTests::ADD); } static FloatVector bv_MIN = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MINFloatMaxVectorTestsWithMemOp(IntFunction fa) { + static void MINFloatVectorMaxTestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2178,13 +2221,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, FloatMaxVectorTests::MIN); + assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::MIN); } static FloatVector bv_min = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void minFloatMaxVectorTestsWithMemOp(IntFunction fa) { + static void minFloatVectorMaxTestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2195,13 +2238,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, FloatMaxVectorTests::min); + assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::min); } static FloatVector bv_MIN_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINFloatMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINFloatVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2214,13 +2257,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, FloatMaxVectorTests::MIN); + assertArraysEquals(r, a, (float)10, mask, FloatVectorMaxTests::MIN); } static FloatVector bv_MAX = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void MAXFloatMaxVectorTestsWithMemOp(IntFunction fa) { + static void MAXFloatVectorMaxTestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2231,13 +2274,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, FloatMaxVectorTests::MAX); + assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::MAX); } static FloatVector bv_max = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpProvider") - static void maxFloatMaxVectorTestsWithMemOp(IntFunction fa) { + static void maxFloatVectorMaxTestsWithMemOp(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2248,13 +2291,13 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, FloatMaxVectorTests::max); + assertArraysEquals(r, a, (float)10, FloatVectorMaxTests::max); } static FloatVector bv_MAX_M = FloatVector.broadcast(SPECIES, (float)10); @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXFloatMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXFloatVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2267,7 +2310,7 @@ relativeError)); } } - assertArraysEquals(r, a, (float)10, mask, FloatMaxVectorTests::MAX); + assertArraysEquals(r, a, (float)10, mask, FloatVectorMaxTests::MAX); } static float MIN(float a, float b) { @@ -2275,7 +2318,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MINFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2288,7 +2331,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::MIN); + assertArraysEquals(r, a, b, FloatVectorMaxTests::MIN); } static float min(float a, float b) { @@ -2296,7 +2339,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void minFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2307,7 +2350,7 @@ relativeError)); av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, FloatMaxVectorTests::min); + assertArraysEquals(r, a, b, FloatVectorMaxTests::min); } static float MAX(float a, float b) { @@ -2315,7 +2358,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MAXFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2328,7 +2371,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::MAX); + assertArraysEquals(r, a, b, FloatVectorMaxTests::MAX); } static float max(float a, float b) { @@ -2336,7 +2379,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maxFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2347,11 +2390,11 @@ relativeError)); av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, FloatMaxVectorTests::max); + assertArraysEquals(r, a, b, FloatVectorMaxTests::max); } @Test(dataProvider = "floatBinaryOpProvider") - static void MINFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2361,11 +2404,11 @@ relativeError)); av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::MIN); } @Test(dataProvider = "floatBinaryOpProvider") - static void minFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2375,11 +2418,11 @@ relativeError)); av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::min); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::min); } @Test(dataProvider = "floatBinaryOpProvider") - static void MAXFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2389,11 +2432,11 @@ relativeError)); av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::MAX); } @Test(dataProvider = "floatBinaryOpProvider") - static void maxFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2403,7 +2446,7 @@ relativeError)); av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, FloatMaxVectorTests::max); + assertBroadcastArraysEquals(r, a, b, FloatVectorMaxTests::max); } static float ADDReduce(float[] a, int idx) { @@ -2425,7 +2468,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceFloatMaxVectorTests(IntFunction fa) { + static void ADDReduceFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2441,7 +2484,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - FloatMaxVectorTests::ADDReduce, FloatMaxVectorTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVectorMaxTests::ADDReduce, FloatVectorMaxTests::ADDReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2449,20 +2492,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = ADD_IDENTITY; - Assert.assertEquals((float) (id + id), id, + assertEquals((float) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id + x), x); - Assert.assertEquals((float) (x + id), x); + assertEquals((float) (id + x), x); + assertEquals((float) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id + x), x, + assertEquals((float) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x + id), x, + assertEquals((float) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -2487,7 +2530,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2505,7 +2548,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - FloatMaxVectorTests::ADDReduceMasked, FloatMaxVectorTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); + FloatVectorMaxTests::ADDReduceMasked, FloatVectorMaxTests::ADDReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_ADD); } static float MULReduce(float[] a, int idx) { @@ -2527,7 +2570,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MULReduceFloatMaxVectorTests(IntFunction fa) { + static void MULReduceFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2543,7 +2586,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - FloatMaxVectorTests::MULReduce, FloatMaxVectorTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVectorMaxTests::MULReduce, FloatVectorMaxTests::MULReduceAll, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2551,20 +2594,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MUL_IDENTITY; - Assert.assertEquals((float) (id * id), id, + assertEquals((float) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) (id * x), x); - Assert.assertEquals((float) (x * id), x); + assertEquals((float) (id * x), x); + assertEquals((float) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) (id * x), x, + assertEquals((float) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) (x * id), x, + assertEquals((float) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -2589,7 +2632,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MULReduceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2607,7 +2650,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - FloatMaxVectorTests::MULReduceMasked, FloatMaxVectorTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); + FloatVectorMaxTests::MULReduceMasked, FloatVectorMaxTests::MULReduceAllMasked, RELATIVE_ROUNDING_ERROR_FACTOR_MUL); } static float MINReduce(float[] a, int idx) { @@ -2629,7 +2672,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MINReduceFloatMaxVectorTests(IntFunction fa) { + static void MINReduceFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2645,7 +2688,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - FloatMaxVectorTests::MINReduce, FloatMaxVectorTests::MINReduceAll); + FloatVectorMaxTests::MINReduce, FloatVectorMaxTests::MINReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2653,20 +2696,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MIN_IDENTITY; - Assert.assertEquals((float) Math.min(id, id), id, + assertEquals((float) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.min(id, x), x); - Assert.assertEquals((float) Math.min(x, id), x); + assertEquals((float) Math.min(id, x), x); + assertEquals((float) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.min(id, x), x, + assertEquals((float) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.min(x, id), x, + assertEquals((float) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -2691,7 +2734,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MINReduceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2709,7 +2752,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - FloatMaxVectorTests::MINReduceMasked, FloatMaxVectorTests::MINReduceAllMasked); + FloatVectorMaxTests::MINReduceMasked, FloatVectorMaxTests::MINReduceAllMasked); } static float MAXReduce(float[] a, int idx) { @@ -2731,7 +2774,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void MAXReduceFloatMaxVectorTests(IntFunction fa) { + static void MAXReduceFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2747,7 +2790,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - FloatMaxVectorTests::MAXReduce, FloatMaxVectorTests::MAXReduceAll); + FloatVectorMaxTests::MAXReduce, FloatVectorMaxTests::MAXReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2755,20 +2798,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = MAX_IDENTITY; - Assert.assertEquals((float) Math.max(id, id), id, + assertEquals((float) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((float) Math.max(id, x), x); - Assert.assertEquals((float) Math.max(x, id), x); + assertEquals((float) Math.max(id, x), x); + assertEquals((float) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((float) Math.max(id, x), x, + assertEquals((float) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((float) Math.max(x, id), x, + assertEquals((float) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -2793,7 +2836,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void MAXReduceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2811,7 +2854,7 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - FloatMaxVectorTests::MAXReduceMasked, FloatMaxVectorTests::MAXReduceAllMasked); + FloatVectorMaxTests::MAXReduceMasked, FloatVectorMaxTests::MAXReduceAllMasked); } static float FIRST_NONZEROReduce(float[] a, int idx) { @@ -2833,7 +2876,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void FIRST_NONZEROReduceFloatMaxVectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -2849,7 +2892,7 @@ relativeError)); } assertReductionArraysEquals(r, ra, a, - FloatMaxVectorTests::FIRST_NONZEROReduce, FloatMaxVectorTests::FIRST_NONZEROReduceAll); + FloatVectorMaxTests::FIRST_NONZEROReduce, FloatVectorMaxTests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "floatUnaryOpProvider") @@ -2857,20 +2900,20 @@ relativeError)); float[] a = fa.apply(SPECIES.length()); float id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); float x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -2895,7 +2938,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void FIRST_NONZEROReduceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2913,11 +2956,11 @@ relativeError)); } assertReductionArraysEqualsMasked(r, ra, a, mask, - FloatMaxVectorTests::FIRST_NONZEROReduceMasked, FloatMaxVectorTests::FIRST_NONZEROReduceAllMasked); + FloatVectorMaxTests::FIRST_NONZEROReduceMasked, FloatVectorMaxTests::FIRST_NONZEROReduceAllMasked); } @Test(dataProvider = "floatBinaryOpProvider") - static void withFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void withFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -2940,7 +2983,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_DEFAULTFloatMaxVectorTests(IntFunction fa) { + static void IS_DEFAULTFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2950,14 +2993,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_DEFAULTMaskedFloatMaxVectorTests(IntFunction fa, + static void IS_DEFAULTMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -2970,7 +3013,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -2981,7 +3024,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NEGATIVEFloatMaxVectorTests(IntFunction fa) { + static void IS_NEGATIVEFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -2991,14 +3034,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NEGATIVEMaskedFloatMaxVectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3011,7 +3054,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } @@ -3022,7 +3065,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_FINITEFloatMaxVectorTests(IntFunction fa) { + static void IS_FINITEFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3032,14 +3075,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_FINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_FINITEMaskedFloatMaxVectorTests(IntFunction fa, + static void IS_FINITEMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3052,7 +3095,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_FINITE(a[i + j])); } } } @@ -3063,7 +3106,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_NANFloatMaxVectorTests(IntFunction fa) { + static void IS_NANFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3073,14 +3116,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NAN(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_NANMaskedFloatMaxVectorTests(IntFunction fa, + static void IS_NANMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3093,7 +3136,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NAN(a[i + j])); } } } @@ -3104,7 +3147,7 @@ relativeError)); } @Test(dataProvider = "floatTestOpProvider") - static void IS_INFINITEFloatMaxVectorTests(IntFunction fa) { + static void IS_INFINITEFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -3114,14 +3157,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatTestOpMaskProvider") - static void IS_INFINITEMaskedFloatMaxVectorTests(IntFunction fa, + static void IS_INFINITEMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3134,14 +3177,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_INFINITE(a[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LTFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3153,14 +3196,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ltFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3172,14 +3215,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3195,14 +3238,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GTFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GTFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3214,14 +3257,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GTFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3237,14 +3280,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EQFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3256,14 +3299,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void eqFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3275,14 +3318,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3298,14 +3341,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void NEFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void NEFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3317,14 +3360,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void NEFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3340,14 +3383,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LEFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LEFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3359,14 +3402,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LEFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3382,14 +3425,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void GEFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GEFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3401,14 +3444,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void GEFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3424,14 +3467,14 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3441,13 +3484,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3461,13 +3504,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void LTFloatMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTFloatVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3477,13 +3520,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void LTFloatMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTFloatVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3497,13 +3540,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (float)((long)b[i]))); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3513,13 +3556,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3533,13 +3576,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "floatCompareOpProvider") - static void EQFloatMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQFloatVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3549,13 +3592,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i])); } } } @Test(dataProvider = "floatCompareOpMaskProvider") - static void EQFloatMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQFloatVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3569,7 +3612,7 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (float)((long)b[i]))); } } } @@ -3579,7 +3622,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloatMaxVectorTests(IntFunction fa, IntFunction fb, + static void blendFloatVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3595,11 +3638,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, mask, FloatMaxVectorTests::blend); + assertArraysEquals(r, a, b, mask, FloatVectorMaxTests::blend); } @Test(dataProvider = "floatUnaryOpShuffleProvider") - static void RearrangeFloatMaxVectorTests(IntFunction fa, + static void RearrangeFloatVectorMaxTests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -3616,7 +3659,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpShuffleMaskProvider") - static void RearrangeFloatMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeFloatVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -3634,7 +3677,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void compressFloatMaxVectorTests(IntFunction fa, + static void compressFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3652,7 +3695,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void expandFloatMaxVectorTests(IntFunction fa, + static void expandFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3670,7 +3713,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void getFloatMaxVectorTests(IntFunction fa) { + static void getFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -3826,7 +3869,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void BroadcastFloatMaxVectorTests(IntFunction fa) { + static void BroadcastFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3840,7 +3883,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ZeroFloatMaxVectorTests(IntFunction fa) { + static void ZeroFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3850,7 +3893,7 @@ relativeError)); } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static float[] sliceUnary(float[] a, int origin, int idx) { @@ -3865,7 +3908,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void sliceUnaryFloatMaxVectorTests(IntFunction fa) { + static void sliceUnaryFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3876,7 +3919,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, FloatMaxVectorTests::sliceUnary); + assertArraysEquals(r, a, origin, FloatVectorMaxTests::sliceUnary); } static float[] sliceBinary(float[] a, float[] b, int origin, int idx) { @@ -3893,7 +3936,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void sliceBinaryFloatMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryFloatVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -3906,7 +3949,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, FloatMaxVectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, FloatVectorMaxTests::sliceBinary); } static float[] slice(float[] a, float[] b, int origin, boolean[] mask, int idx) { @@ -3923,7 +3966,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void sliceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -3940,7 +3983,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, mask, FloatMaxVectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, FloatVectorMaxTests::slice); } static float[] unsliceUnary(float[] a, int origin, int idx) { @@ -3957,7 +4000,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void unsliceUnaryFloatMaxVectorTests(IntFunction fa) { + static void unsliceUnaryFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -3968,7 +4011,7 @@ relativeError)); } } - assertArraysEquals(r, a, origin, FloatMaxVectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, FloatVectorMaxTests::unsliceUnary); } static float[] unsliceBinary(float[] a, float[] b, int origin, int part, int idx) { @@ -3994,7 +4037,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void unsliceBinaryFloatMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryFloatVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -4008,7 +4051,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, FloatMaxVectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, FloatVectorMaxTests::unsliceBinary); } static float[] unslice(float[] a, float[] b, int origin, int part, boolean[] mask, int idx) { @@ -4048,7 +4091,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void unsliceFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4065,7 +4108,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, origin, part, mask, FloatMaxVectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, FloatVectorMaxTests::unslice); } static float SIN(float a) { @@ -4077,7 +4120,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINFloatMaxVectorTests(IntFunction fa) { + static void SINFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4088,7 +4131,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::SIN, FloatMaxVectorTests::strictSIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::SIN, FloatVectorMaxTests::strictSIN); } static float EXP(float a) { @@ -4100,7 +4143,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPFloatMaxVectorTests(IntFunction fa) { + static void EXPFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4111,7 +4154,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::EXP, FloatMaxVectorTests::strictEXP); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::EXP, FloatVectorMaxTests::strictEXP); } static float LOG1P(float a) { @@ -4123,7 +4166,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG1PFloatMaxVectorTests(IntFunction fa) { + static void LOG1PFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4134,7 +4177,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::LOG1P, FloatMaxVectorTests::strictLOG1P); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::LOG1P, FloatVectorMaxTests::strictLOG1P); } static float LOG(float a) { @@ -4146,7 +4189,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOGFloatMaxVectorTests(IntFunction fa) { + static void LOGFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4157,7 +4200,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::LOG, FloatMaxVectorTests::strictLOG); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::LOG, FloatVectorMaxTests::strictLOG); } static float LOG10(float a) { @@ -4169,7 +4212,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void LOG10FloatMaxVectorTests(IntFunction fa) { + static void LOG10FloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4180,7 +4223,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::LOG10, FloatMaxVectorTests::strictLOG10); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::LOG10, FloatVectorMaxTests::strictLOG10); } static float EXPM1(float a) { @@ -4192,7 +4235,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void EXPM1FloatMaxVectorTests(IntFunction fa) { + static void EXPM1FloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4203,7 +4246,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::EXPM1, FloatMaxVectorTests::strictEXPM1); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::EXPM1, FloatVectorMaxTests::strictEXPM1); } static float COS(float a) { @@ -4215,7 +4258,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSFloatMaxVectorTests(IntFunction fa) { + static void COSFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4226,7 +4269,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::COS, FloatMaxVectorTests::strictCOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::COS, FloatVectorMaxTests::strictCOS); } static float TAN(float a) { @@ -4238,7 +4281,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANFloatMaxVectorTests(IntFunction fa) { + static void TANFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4249,7 +4292,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::TAN, FloatMaxVectorTests::strictTAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::TAN, FloatVectorMaxTests::strictTAN); } static float SINH(float a) { @@ -4261,7 +4304,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SINHFloatMaxVectorTests(IntFunction fa) { + static void SINHFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4272,7 +4315,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::SINH, FloatMaxVectorTests::strictSINH); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::SINH, FloatVectorMaxTests::strictSINH); } static float COSH(float a) { @@ -4284,7 +4327,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void COSHFloatMaxVectorTests(IntFunction fa) { + static void COSHFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4295,7 +4338,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::COSH, FloatMaxVectorTests::strictCOSH); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::COSH, FloatVectorMaxTests::strictCOSH); } static float TANH(float a) { @@ -4307,7 +4350,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void TANHFloatMaxVectorTests(IntFunction fa) { + static void TANHFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4318,7 +4361,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::TANH, FloatMaxVectorTests::strictTANH); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::TANH, FloatVectorMaxTests::strictTANH); } static float ASIN(float a) { @@ -4330,7 +4373,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ASINFloatMaxVectorTests(IntFunction fa) { + static void ASINFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4341,7 +4384,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::ASIN, FloatMaxVectorTests::strictASIN); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::ASIN, FloatVectorMaxTests::strictASIN); } static float ACOS(float a) { @@ -4353,7 +4396,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ACOSFloatMaxVectorTests(IntFunction fa) { + static void ACOSFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4364,7 +4407,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::ACOS, FloatMaxVectorTests::strictACOS); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::ACOS, FloatVectorMaxTests::strictACOS); } static float ATAN(float a) { @@ -4376,7 +4419,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ATANFloatMaxVectorTests(IntFunction fa) { + static void ATANFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4387,7 +4430,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::ATAN, FloatMaxVectorTests::strictATAN); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::ATAN, FloatVectorMaxTests::strictATAN); } static float CBRT(float a) { @@ -4399,7 +4442,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void CBRTFloatMaxVectorTests(IntFunction fa) { + static void CBRTFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4410,7 +4453,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, FloatMaxVectorTests::CBRT, FloatMaxVectorTests::strictCBRT); + assertArraysEqualsWithinOneUlp(r, a, FloatVectorMaxTests::CBRT, FloatVectorMaxTests::strictCBRT); } static float HYPOT(float a, float b) { @@ -4422,7 +4465,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void HYPOTFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void HYPOTFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4435,7 +4478,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, FloatMaxVectorTests::HYPOT, FloatMaxVectorTests::strictHYPOT); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVectorMaxTests::HYPOT, FloatVectorMaxTests::strictHYPOT); } @@ -4448,7 +4491,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void POWFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4461,7 +4504,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, FloatMaxVectorTests::POW, FloatMaxVectorTests::strictPOW); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVectorMaxTests::POW, FloatVectorMaxTests::strictPOW); } @@ -4474,7 +4517,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void powFloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4487,7 +4530,7 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, FloatMaxVectorTests::pow, FloatMaxVectorTests::strictpow); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVectorMaxTests::pow, FloatVectorMaxTests::strictpow); } @@ -4500,7 +4543,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpProvider") - static void ATAN2FloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ATAN2FloatVectorMaxTests(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4513,12 +4556,12 @@ relativeError)); } } - assertArraysEqualsWithinOneUlp(r, a, b, FloatMaxVectorTests::ATAN2, FloatMaxVectorTests::strictATAN2); + assertArraysEqualsWithinOneUlp(r, a, b, FloatVectorMaxTests::ATAN2, FloatVectorMaxTests::strictATAN2); } @Test(dataProvider = "floatBinaryOpProvider") - static void POWFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void POWFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4528,12 +4571,12 @@ relativeError)); av.lanewise(VectorOperators.POW, b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatMaxVectorTests::POW, FloatMaxVectorTests::strictPOW); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVectorMaxTests::POW, FloatVectorMaxTests::strictPOW); } @Test(dataProvider = "floatBinaryOpProvider") - static void powFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void powFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4543,7 +4586,7 @@ relativeError)); av.pow(b[i]).intoArray(r, i); } - assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatMaxVectorTests::pow, FloatMaxVectorTests::strictpow); + assertBroadcastArraysEqualsWithinOneUlp(r, a, b, FloatVectorMaxTests::pow, FloatVectorMaxTests::strictpow); } @@ -4556,7 +4599,7 @@ relativeError)); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloatMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4571,11 +4614,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, FloatMaxVectorTests::FMA); + assertArraysEquals(r, a, b, c, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloatMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4588,11 +4631,11 @@ relativeError)); av.fma(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, FloatMaxVectorTests::fma); + assertArraysEquals(r, a, b, c, FloatVectorMaxTests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FMAFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4610,11 +4653,11 @@ relativeError)); } } - assertArraysEquals(r, a, b, c, mask, FloatMaxVectorTests::FMA); + assertArraysEquals(r, a, b, c, mask, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4625,11 +4668,11 @@ relativeError)); FloatVector bv = FloatVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.FMA, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, FloatMaxVectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloatMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4640,11 +4683,11 @@ relativeError)); FloatVector cv = FloatVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, FloatMaxVectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4659,11 +4702,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, FloatMaxVectorTests::FMA); + assertBroadcastArraysEquals(r, a, b, c, mask, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloatMaxVectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVectorMaxTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4678,11 +4721,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, FloatMaxVectorTests::FMA); + assertAltBroadcastArraysEquals(r, a, b, c, mask, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void FMAFloatMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void FMAFloatVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4693,11 +4736,11 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, FloatMaxVectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVectorMaxTests::FMA); } @Test(dataProvider = "floatTernaryOpProvider") - static void fmaFloatMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void fmaFloatVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] c = fc.apply(SPECIES.length()); @@ -4708,11 +4751,11 @@ relativeError)); av.fma(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, FloatMaxVectorTests::fma); + assertDoubleBroadcastArraysEquals(r, a, b, c, FloatVectorMaxTests::fma); } @Test(dataProvider = "floatTernaryOpMaskProvider") - static void FMAFloatMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void FMAFloatVectorMaxTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -4726,7 +4769,7 @@ relativeError)); av.lanewise(VectorOperators.FMA, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, FloatMaxVectorTests::FMA); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, FloatVectorMaxTests::FMA); } static float NEG(float a) { @@ -4738,7 +4781,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void NEGFloatMaxVectorTests(IntFunction fa) { + static void NEGFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4749,11 +4792,11 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::NEG); + assertArraysEquals(r, a, FloatVectorMaxTests::NEG); } @Test(dataProvider = "floatUnaryOpProvider") - static void negFloatMaxVectorTests(IntFunction fa) { + static void negFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4764,11 +4807,11 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::neg); + assertArraysEquals(r, a, FloatVectorMaxTests::neg); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void NEGMaskedFloatMaxVectorTests(IntFunction fa, + static void NEGMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4782,7 +4825,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, FloatMaxVectorTests::NEG); + assertArraysEquals(r, a, mask, FloatVectorMaxTests::NEG); } static float ABS(float a) { @@ -4794,7 +4837,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ABSFloatMaxVectorTests(IntFunction fa) { + static void ABSFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4805,11 +4848,11 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::ABS); + assertArraysEquals(r, a, FloatVectorMaxTests::ABS); } @Test(dataProvider = "floatUnaryOpProvider") - static void absFloatMaxVectorTests(IntFunction fa) { + static void absFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4820,11 +4863,11 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::abs); + assertArraysEquals(r, a, FloatVectorMaxTests::abs); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ABSMaskedFloatMaxVectorTests(IntFunction fa, + static void ABSMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4838,7 +4881,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, FloatMaxVectorTests::ABS); + assertArraysEquals(r, a, mask, FloatVectorMaxTests::ABS); } static float SQRT(float a) { @@ -4850,7 +4893,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void SQRTFloatMaxVectorTests(IntFunction fa) { + static void SQRTFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4861,11 +4904,11 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::SQRT); + assertArraysEquals(r, a, FloatVectorMaxTests::SQRT); } @Test(dataProvider = "floatUnaryOpProvider") - static void sqrtFloatMaxVectorTests(IntFunction fa) { + static void sqrtFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4876,11 +4919,11 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::sqrt); + assertArraysEquals(r, a, FloatVectorMaxTests::sqrt); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void SQRTMaskedFloatMaxVectorTests(IntFunction fa, + static void SQRTMaskedFloatVectorMaxTests(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); @@ -4894,7 +4937,7 @@ relativeError)); } } - assertArraysEquals(r, a, mask, FloatMaxVectorTests::SQRT); + assertArraysEquals(r, a, mask, FloatVectorMaxTests::SQRT); } static boolean band(boolean a, boolean b) { @@ -4902,7 +4945,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandFloatVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4915,7 +4958,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::band); + assertArraysEquals(r, a, b, FloatVectorMaxTests::band); } static boolean bor(boolean a, boolean b) { @@ -4923,7 +4966,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskorFloatVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4936,7 +4979,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::bor); + assertArraysEquals(r, a, b, FloatVectorMaxTests::bor); } static boolean bxor(boolean a, boolean b) { @@ -4944,7 +4987,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskxorFloatVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4957,7 +5000,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::bxor); + assertArraysEquals(r, a, b, FloatVectorMaxTests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -4965,7 +5008,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotFloatVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4978,7 +5021,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::bandNot); + assertArraysEquals(r, a, b, FloatVectorMaxTests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -4986,7 +5029,7 @@ relativeError)); } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskeqFloatVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -4999,7 +5042,7 @@ relativeError)); } } - assertArraysEquals(r, a, b, FloatMaxVectorTests::beq); + assertArraysEquals(r, a, b, FloatVectorMaxTests::beq); } static boolean unot(boolean a) { @@ -5007,7 +5050,7 @@ relativeError)); } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotFloatMaxVectorTests(IntFunction fa) { + static void masknotFloatVectorMaxTests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -5018,7 +5061,7 @@ relativeError)); } } - assertArraysEquals(r, a, FloatMaxVectorTests::unot); + assertArraysEquals(r, a, FloatVectorMaxTests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -5027,15 +5070,15 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongFloatMaxVectorTests(IntFunction fa) { + static void maskFromToLongFloatVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5049,7 +5092,7 @@ relativeError)); } @Test(dataProvider = "floatCompareOpProvider") - static void ltFloatMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltFloatVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5059,13 +5102,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "floatCompareOpProvider") - static void eqFloatMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqFloatVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5075,13 +5118,13 @@ relativeError)); // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "floattoIntUnaryOpProvider") - static void toIntArrayFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayFloatVectorMaxTestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5092,7 +5135,7 @@ relativeError)); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void toLongArrayFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayFloatVectorMaxTestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5103,7 +5146,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toDoubleArrayFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayFloatVectorMaxTestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5114,7 +5157,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void toStringFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void toStringFloatVectorMaxTestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5127,7 +5170,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void hashCodeFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void hashCodeFloatVectorMaxTestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5160,7 +5203,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpProvider") - static void ADDReduceLongFloatMaxVectorTests(IntFunction fa) { + static void ADDReduceLongFloatVectorMaxTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -5176,7 +5219,7 @@ relativeError)); } assertReductionLongArraysEquals(r, ra, a, - FloatMaxVectorTests::ADDReduceLong, FloatMaxVectorTests::ADDReduceAllLong); + FloatVectorMaxTests::ADDReduceLong, FloatVectorMaxTests::ADDReduceAllLong); } static long ADDReduceLongMasked(float[] a, int idx, boolean[] mask) { @@ -5199,7 +5242,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpMaskProvider") - static void ADDReduceLongFloatMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongFloatVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -5217,11 +5260,11 @@ relativeError)); } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - FloatMaxVectorTests::ADDReduceLongMasked, FloatMaxVectorTests::ADDReduceAllLongMasked); + FloatVectorMaxTests::ADDReduceLongMasked, FloatVectorMaxTests::ADDReduceAllLongMasked); } @Test(dataProvider = "floattoLongUnaryOpProvider") - static void BroadcastLongFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongFloatVectorMaxTestsSmokeTest(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = new float[a.length]; @@ -5232,7 +5275,7 @@ relativeError)); } @Test(dataProvider = "floatBinaryOpMaskProvider") - static void blendFloatMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendFloatVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); @@ -5246,12 +5289,12 @@ relativeError)); av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, FloatMaxVectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, FloatVectorMaxTests::blend); } @Test(dataProvider = "floatUnaryOpSelectFromProvider") - static void SelectFromFloatMaxVectorTests(IntFunction fa, + static void SelectFromFloatVectorMaxTests(IntFunction fa, BiFunction fs) { float[] a = fa.apply(SPECIES.length()); float[] order = fs.apply(a.length, SPECIES.length()); @@ -5267,7 +5310,7 @@ relativeError)); } @Test(dataProvider = "floatSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorFloatMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorFloatVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { float[] a = fa.apply(SPECIES.length()); float[] b = fb.apply(SPECIES.length()); float[] idx = fc.apply(SPECIES.length()); @@ -5285,7 +5328,7 @@ relativeError)); } @Test(dataProvider = "floatUnaryOpSelectFromMaskProvider") - static void SelectFromFloatMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromFloatVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { float[] a = fa.apply(SPECIES.length()); @@ -5304,7 +5347,7 @@ relativeError)); } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousFloatMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousFloatVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5315,12 +5358,12 @@ relativeError)); int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringFloatMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringFloatVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5334,7 +5377,7 @@ relativeError)); } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsFloatMaxVectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsFloatVectorMaxTestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -5343,12 +5386,12 @@ relativeError)); var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsFloatMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsFloatVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -5358,13 +5401,13 @@ relativeError)); var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeFloatVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -5386,7 +5429,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskTrueCountFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountFloatVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5397,7 +5440,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, FloatMaxVectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, FloatVectorMaxTests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -5411,7 +5454,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskLastTrueFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueFloatVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5422,7 +5465,7 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, FloatMaxVectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, FloatVectorMaxTests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -5436,7 +5479,7 @@ relativeError)); } @Test(dataProvider = "maskProvider") - static void maskFirstTrueFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueFloatVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5447,11 +5490,11 @@ relativeError)); } } - assertMaskReductionArraysEquals(r, a, FloatMaxVectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, FloatVectorMaxTests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressFloatMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskCompressFloatVectorMaxTestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -5461,7 +5504,7 @@ relativeError)); trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -5479,7 +5522,7 @@ relativeError)); } @Test(dataProvider = "offsetProvider") - static void indexInRangeFloatMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeFloatVectorMaxTestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5487,13 +5530,13 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongFloatMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongFloatVectorMaxTestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -5501,7 +5544,7 @@ relativeError)); assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -5520,36 +5563,36 @@ relativeError)); } @Test(dataProvider = "lengthProvider") - static void loopBoundFloatMaxVectorTestsSmokeTest(int length) { + static void loopBoundFloatVectorMaxTestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongFloatMaxVectorTestsSmokeTest(int _length) { + static void loopBoundLongFloatVectorMaxTestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeFloatMaxVectorTestsSmokeTest() { + static void ElementSizeFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Float.SIZE); + assertEquals(elsize, Float.SIZE); } @Test - static void VectorShapeFloatMaxVectorTestsSmokeTest() { + static void VectorShapeFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_Max_BIT)); } @Test - static void ShapeWithLanesFloatMaxVectorTestsSmokeTest() { + static void ShapeWithLanesFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(float.class); @@ -5557,32 +5600,32 @@ relativeError)); } @Test - static void ElementTypeFloatMaxVectorTestsSmokeTest() { + static void ElementTypeFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementType() == float.class); } @Test - static void SpeciesElementSizeFloatMaxVectorTestsSmokeTest() { + static void SpeciesElementSizeFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().elementSize() == Float.SIZE); } @Test - static void VectorTypeFloatMaxVectorTestsSmokeTest() { + static void VectorTypeFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesFloatMaxVectorTestsSmokeTest() { + static void WithLanesFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(float.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeFloatMaxVectorTestsSmokeTest() { + static void WithShapeFloatVectorMaxTestsSmokeTest() { FloatVector av = FloatVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -5590,9 +5633,9 @@ relativeError)); } @Test - static void MaskAllTrueFloatMaxVectorTestsSmokeTest() { + static void MaskAllTrueFloatVectorMaxTestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntVector128LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/IntVector128LoadStoreTests.java index f2448365138..dd865141e08 100644 --- a/test/jdk/jdk/incubator/vector/Int128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector128LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Int128VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation IntVector128LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class IntVector128LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = IntVector.SPECIES_128; @@ -61,14 +61,29 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(int[] r, int[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "intProviderForIOOBE") @@ -870,11 +885,11 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(int[] r, int[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Int128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Int128VectorTests.java b/test/jdk/jdk/incubator/vector/IntVector128Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Int128VectorTests.java rename to test/jdk/jdk/incubator/vector/IntVector128Tests.java index 69bb0c84588..ecdb23eb40d 100644 --- a/test/jdk/jdk/incubator/vector/Int128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector128Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntVector128Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Int128VectorTests extends AbstractVectorTest { +public class IntVector128Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = IntVector.SPECIES_128; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(int actual, int expected, int delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(int actual, int expected, int delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final int CONST_SHIFT = Integer.SIZE / 2; @@ -96,10 +139,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { int[] ref = f.apply(a[i]); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Int128VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Int128VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Int128VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Int128VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Int128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (int)0); + assertEquals(r[i + k], (int)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Int128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (int)0); + assertEquals(r[i + j], (int)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Int128VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Int128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Int128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Int128VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Int128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(r, a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1543,7 +1586,7 @@ public class Int128VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); IntVector a = io.add((int)1); //[1,2] IntVector b = a.neg(); //[-1,-2] int[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1558,19 +1601,19 @@ public class Int128VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); IntVector uab0 = zab0.rearrange(unz0,zab1); IntVector uab1 = zab0.rearrange(unz1,zab1); int[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1585,7 +1628,7 @@ public class Int128VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1593,9 +1636,9 @@ public class Int128VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1624,7 +1667,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ADDIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1637,7 +1680,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::ADD); + assertArraysEquals(r, a, b, IntVector128Tests::ADD); } static int add(int a, int b) { @@ -1645,7 +1688,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void addInt128VectorTests(IntFunction fa, IntFunction fb) { + static void addIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1656,11 +1699,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::add); + assertArraysEquals(r, a, b, IntVector128Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1676,11 +1719,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::ADD); + assertArraysEquals(r, a, b, mask, IntVector128Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1694,7 +1737,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int128VectorTests::add); + assertArraysEquals(r, a, b, mask, IntVector128Tests::add); } static int SUB(int a, int b) { @@ -1702,7 +1745,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void SUBInt128VectorTests(IntFunction fa, IntFunction fb) { + static void SUBIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1715,7 +1758,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::SUB); + assertArraysEquals(r, a, b, IntVector128Tests::SUB); } static int sub(int a, int b) { @@ -1723,7 +1766,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void subInt128VectorTests(IntFunction fa, IntFunction fb) { + static void subIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1734,11 +1777,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::sub); + assertArraysEquals(r, a, b, IntVector128Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void SUBInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1754,11 +1797,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::SUB); + assertArraysEquals(r, a, b, mask, IntVector128Tests::SUB); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1772,7 +1815,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int128VectorTests::sub); + assertArraysEquals(r, a, b, mask, IntVector128Tests::sub); } static int MUL(int a, int b) { @@ -1780,7 +1823,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MULInt128VectorTests(IntFunction fa, IntFunction fb) { + static void MULIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1793,7 +1836,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::MUL); + assertArraysEquals(r, a, b, IntVector128Tests::MUL); } static int mul(int a, int b) { @@ -1801,7 +1844,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt128VectorTests(IntFunction fa, IntFunction fb) { + static void mulIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1812,11 +1855,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::mul); + assertArraysEquals(r, a, b, IntVector128Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void MULInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1832,11 +1875,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::MUL); + assertArraysEquals(r, a, b, mask, IntVector128Tests::MUL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1850,7 +1893,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int128VectorTests::mul); + assertArraysEquals(r, a, b, mask, IntVector128Tests::mul); } static int DIV(int a, int b) { @@ -1858,7 +1901,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void DIVInt128VectorTests(IntFunction fa, IntFunction fb) { + static void DIVIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1873,7 +1916,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::DIV); + assertArraysEquals(r, a, b, IntVector128Tests::DIV); } static int div(int a, int b) { @@ -1881,7 +1924,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void divInt128VectorTests(IntFunction fa, IntFunction fb) { + static void divIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1896,11 +1939,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::div); + assertArraysEquals(r, a, b, IntVector128Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void DIVInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1918,11 +1961,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::DIV); + assertArraysEquals(r, a, b, mask, IntVector128Tests::DIV); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1940,7 +1983,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::div); + assertArraysEquals(r, a, b, mask, IntVector128Tests::div); } static int FIRST_NONZERO(int a, int b) { @@ -1948,7 +1991,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void FIRST_NONZEROInt128VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1961,11 +2004,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, IntVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void FIRST_NONZEROInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1981,7 +2024,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, IntVector128Tests::FIRST_NONZERO); } static int AND(int a, int b) { @@ -1989,7 +2032,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ANDIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2002,7 +2045,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::AND); + assertArraysEquals(r, a, b, IntVector128Tests::AND); } static int and(int a, int b) { @@ -2010,7 +2053,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void andInt128VectorTests(IntFunction fa, IntFunction fb) { + static void andIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2021,11 +2064,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::and); + assertArraysEquals(r, a, b, IntVector128Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2041,7 +2084,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::AND); + assertArraysEquals(r, a, b, mask, IntVector128Tests::AND); } static int AND_NOT(int a, int b) { @@ -2049,7 +2092,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void AND_NOTInt128VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, IntVector128Tests::AND_NOT); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void AND_NOTInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2082,7 +2125,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, IntVector128Tests::AND_NOT); } static int OR(int a, int b) { @@ -2090,7 +2133,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ORIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2103,7 +2146,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::OR); + assertArraysEquals(r, a, b, IntVector128Tests::OR); } static int or(int a, int b) { @@ -2111,7 +2154,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void orInt128VectorTests(IntFunction fa, IntFunction fb) { + static void orIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2122,11 +2165,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::or); + assertArraysEquals(r, a, b, IntVector128Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2142,7 +2185,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::OR); + assertArraysEquals(r, a, b, mask, IntVector128Tests::OR); } static int XOR(int a, int b) { @@ -2150,7 +2193,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void XORInt128VectorTests(IntFunction fa, IntFunction fb) { + static void XORIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2163,11 +2206,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::XOR); + assertArraysEquals(r, a, b, IntVector128Tests::XOR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void XORInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2183,7 +2226,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::XOR); + assertArraysEquals(r, a, b, mask, IntVector128Tests::XOR); } static int COMPRESS_BITS(int a, int b) { @@ -2191,7 +2234,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void COMPRESS_BITSInt128VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2204,11 +2247,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, IntVector128Tests::COMPRESS_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void COMPRESS_BITSInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2224,7 +2267,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, IntVector128Tests::COMPRESS_BITS); } static int EXPAND_BITS(int a, int b) { @@ -2232,7 +2275,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void EXPAND_BITSInt128VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2245,11 +2288,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, IntVector128Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void EXPAND_BITSInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2265,11 +2308,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, IntVector128Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpProvider") - static void addInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2279,11 +2322,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2296,11 +2339,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, IntVector128Tests::add); } @Test(dataProvider = "intBinaryOpProvider") - static void subInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2310,11 +2353,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2327,11 +2370,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, IntVector128Tests::sub); } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2358,11 +2401,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, IntVector128Tests::mul); } @Test(dataProvider = "intBinaryOpProvider") - static void divInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2374,11 +2417,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2393,11 +2436,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, IntVector128Tests::div); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2407,11 +2450,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void orInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2421,11 +2464,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::or); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2438,11 +2481,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, IntVector128Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2452,11 +2495,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void andInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2466,11 +2509,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::and); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2483,11 +2526,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, IntVector128Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2497,11 +2540,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, IntVector128Tests::OR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2514,11 +2557,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector128Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDIntVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2528,11 +2571,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, IntVector128Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDIntVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2545,7 +2588,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector128Tests::ADD); } static int LSHL(int a, int b) { @@ -2553,7 +2596,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2566,11 +2609,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::LSHL); + assertArraysEquals(r, a, b, IntVector128Tests::LSHL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2586,7 +2629,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, IntVector128Tests::LSHL); } static int ASHR(int a, int b) { @@ -2594,7 +2637,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2607,11 +2650,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::ASHR); + assertArraysEquals(r, a, b, IntVector128Tests::ASHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2627,7 +2670,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, IntVector128Tests::ASHR); } static int LSHR(int a, int b) { @@ -2635,7 +2678,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2648,11 +2691,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::LSHR); + assertArraysEquals(r, a, b, IntVector128Tests::LSHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2668,7 +2711,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, IntVector128Tests::LSHR); } static int LSHL_unary(int a, int b) { @@ -2676,7 +2719,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLIntVector128TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2688,11 +2731,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, IntVector128Tests::LSHL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2707,7 +2750,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector128Tests::LSHL_unary); } static int LSHR_unary(int a, int b) { @@ -2715,7 +2758,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRIntVector128TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2727,11 +2770,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, IntVector128Tests::LSHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2746,7 +2789,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector128Tests::LSHR_unary); } static int ASHR_unary(int a, int b) { @@ -2754,7 +2797,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRIntVector128TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2766,11 +2809,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, IntVector128Tests::ASHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2785,7 +2828,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector128Tests::ASHR_unary); } static int ROR(int a, int b) { @@ -2793,7 +2836,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt128VectorTests(IntFunction fa, IntFunction fb) { + static void RORIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2806,11 +2849,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::ROR); + assertArraysEquals(r, a, b, IntVector128Tests::ROR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2826,7 +2869,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::ROR); + assertArraysEquals(r, a, b, mask, IntVector128Tests::ROR); } static int ROL(int a, int b) { @@ -2834,7 +2877,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ROLIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2847,11 +2890,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::ROL); + assertArraysEquals(r, a, b, IntVector128Tests::ROL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2867,7 +2910,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::ROL); + assertArraysEquals(r, a, b, mask, IntVector128Tests::ROL); } static int ROR_unary(int a, int b) { @@ -2875,7 +2918,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORIntVector128TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2887,11 +2930,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, IntVector128Tests::ROR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORIntVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2906,7 +2949,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector128Tests::ROR_unary); } static int ROL_unary(int a, int b) { @@ -2914,7 +2957,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLIntVector128TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2926,11 +2969,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, IntVector128Tests::ROL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2945,14 +2988,14 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector128Tests::ROL_unary); } static int LSHR_binary_const(int a) { return (int)((a >>> CONST_SHIFT)); } @Test(dataProvider = "intUnaryOpProvider") - static void LSHRInt128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRIntVector128TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2963,11 +3006,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, IntVector128Tests::LSHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHRInt128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRIntVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2981,7 +3024,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector128Tests::LSHR_binary_const); } static int LSHL_binary_const(int a) { @@ -2989,7 +3032,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LSHLInt128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLIntVector128TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3000,11 +3043,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, IntVector128Tests::LSHL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHLInt128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLIntVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3018,7 +3061,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector128Tests::LSHL_binary_const); } static int ASHR_binary_const(int a) { @@ -3026,7 +3069,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ASHRInt128VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRIntVector128TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3037,11 +3080,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, IntVector128Tests::ASHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ASHRInt128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRIntVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3055,7 +3098,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector128Tests::ASHR_binary_const); } static int ROR_binary_const(int a) { @@ -3063,7 +3106,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void RORInt128VectorTestsScalarShiftConst(IntFunction fa) { + static void RORIntVector128TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3074,11 +3117,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, IntVector128Tests::ROR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void RORInt128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORIntVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3092,7 +3135,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector128Tests::ROR_binary_const); } static int ROL_binary_const(int a) { @@ -3100,7 +3143,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ROLInt128VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLIntVector128TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3111,11 +3154,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, IntVector128Tests::ROL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ROLInt128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLIntVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3129,14 +3172,14 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector128Tests::ROL_binary_const); } static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MINInt128VectorTestsWithMemOp(IntFunction fa) { + static void MINIntVector128TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int128VectorTests::MIN); + assertArraysEquals(r, a, (int)10, IntVector128Tests::MIN); } static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void minInt128VectorTestsWithMemOp(IntFunction fa) { + static void minIntVector128TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int128VectorTests::min); + assertArraysEquals(r, a, (int)10, IntVector128Tests::min); } static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINInt128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINIntVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,13 +3226,13 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int128VectorTests::MIN); + assertArraysEquals(r, a, (int)10, mask, IntVector128Tests::MIN); } static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MAXInt128VectorTestsWithMemOp(IntFunction fa) { + static void MAXIntVector128TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3200,13 +3243,13 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int128VectorTests::MAX); + assertArraysEquals(r, a, (int)10, IntVector128Tests::MAX); } static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void maxInt128VectorTestsWithMemOp(IntFunction fa) { + static void maxIntVector128TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3217,13 +3260,13 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int128VectorTests::max); + assertArraysEquals(r, a, (int)10, IntVector128Tests::max); } static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXInt128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXIntVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3236,7 +3279,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int128VectorTests::MAX); + assertArraysEquals(r, a, (int)10, mask, IntVector128Tests::MAX); } static int MIN(int a, int b) { @@ -3244,7 +3287,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt128VectorTests(IntFunction fa, IntFunction fb) { + static void MINIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3257,7 +3300,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::MIN); + assertArraysEquals(r, a, b, IntVector128Tests::MIN); } static int min(int a, int b) { @@ -3265,7 +3308,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void minInt128VectorTests(IntFunction fa, IntFunction fb) { + static void minIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3276,7 +3319,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::min); + assertArraysEquals(r, a, b, IntVector128Tests::min); } static int MAX(int a, int b) { @@ -3284,7 +3327,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt128VectorTests(IntFunction fa, IntFunction fb) { + static void MAXIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3297,7 +3340,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::MAX); + assertArraysEquals(r, a, b, IntVector128Tests::MAX); } static int max(int a, int b) { @@ -3305,7 +3348,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maxIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3316,7 +3359,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int128VectorTests::max); + assertArraysEquals(r, a, b, IntVector128Tests::max); } static int UMIN(int a, int b) { @@ -3324,7 +3367,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMINInt128VectorTests(IntFunction fa, IntFunction fb) { + static void UMINIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3337,11 +3380,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::UMIN); + assertArraysEquals(r, a, b, IntVector128Tests::UMIN); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMINInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3357,7 +3400,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, IntVector128Tests::UMIN); } static int UMAX(int a, int b) { @@ -3365,7 +3408,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMAXInt128VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3378,11 +3421,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::UMAX); + assertArraysEquals(r, a, b, IntVector128Tests::UMAX); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMAXInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3398,7 +3441,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, IntVector128Tests::UMAX); } static int SADD(int a, int b) { @@ -3406,7 +3449,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SADDInt128VectorTests(IntFunction fa, IntFunction fb) { + static void SADDIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3419,11 +3462,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::SADD); + assertArraysEquals(r, a, b, IntVector128Tests::SADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SADDInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3439,7 +3482,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::SADD); + assertArraysEquals(r, a, b, mask, IntVector128Tests::SADD); } static int SSUB(int a, int b) { @@ -3447,7 +3490,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SSUBInt128VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3460,11 +3503,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::SSUB); + assertArraysEquals(r, a, b, IntVector128Tests::SSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SSUBInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3480,7 +3523,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, IntVector128Tests::SSUB); } static int SUADD(int a, int b) { @@ -3488,7 +3531,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUADDInt128VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3501,11 +3544,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::SUADD); + assertArraysEquals(r, a, b, IntVector128Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUADDInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3521,7 +3564,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, IntVector128Tests::SUADD); } static int SUSUB(int a, int b) { @@ -3529,7 +3572,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUSUBInt128VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3542,11 +3585,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::SUSUB); + assertArraysEquals(r, a, b, IntVector128Tests::SUSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUSUBInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3562,11 +3605,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, IntVector128Tests::SUSUB); } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3576,11 +3619,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::MIN); } @Test(dataProvider = "intBinaryOpProvider") - static void minInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3590,11 +3633,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::min); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::min); } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3604,11 +3647,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::MAX); } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3618,10 +3661,10 @@ public class Int128VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int128VectorTests::max); + assertBroadcastArraysEquals(r, a, b, IntVector128Tests::max); } @Test(dataProvider = "intSaturatingBinaryOpAssocProvider") - static void SUADDAssocInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocIntVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -3638,11 +3681,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Int128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, IntVector128Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3663,7 +3706,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Int128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, IntVector128Tests::SUADD); } static int ANDReduce(int[] a, int idx) { @@ -3685,7 +3728,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ANDReduceInt128VectorTests(IntFunction fa) { + static void ANDReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3701,7 +3744,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::ANDReduce, Int128VectorTests::ANDReduceAll); + IntVector128Tests::ANDReduce, IntVector128Tests::ANDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3709,20 +3752,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = AND_IDENTITY; - Assert.assertEquals((int) (id & id), id, + assertEquals((int) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id & x), x); - Assert.assertEquals((int) (x & id), x); + assertEquals((int) (id & x), x); + assertEquals((int) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id & x), x, + assertEquals((int) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x & id), x, + assertEquals((int) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3747,7 +3790,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ANDReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3765,7 +3808,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::ANDReduceMasked, Int128VectorTests::ANDReduceAllMasked); + IntVector128Tests::ANDReduceMasked, IntVector128Tests::ANDReduceAllMasked); } static int ORReduce(int[] a, int idx) { @@ -3787,7 +3830,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ORReduceInt128VectorTests(IntFunction fa) { + static void ORReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3803,7 +3846,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::ORReduce, Int128VectorTests::ORReduceAll); + IntVector128Tests::ORReduce, IntVector128Tests::ORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3811,20 +3854,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = OR_IDENTITY; - Assert.assertEquals((int) (id | id), id, + assertEquals((int) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id | x), x); - Assert.assertEquals((int) (x | id), x); + assertEquals((int) (id | x), x); + assertEquals((int) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id | x), x, + assertEquals((int) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x | id), x, + assertEquals((int) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3849,7 +3892,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ORReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3867,7 +3910,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::ORReduceMasked, Int128VectorTests::ORReduceAllMasked); + IntVector128Tests::ORReduceMasked, IntVector128Tests::ORReduceAllMasked); } static int XORReduce(int[] a, int idx) { @@ -3889,7 +3932,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void XORReduceInt128VectorTests(IntFunction fa) { + static void XORReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3905,7 +3948,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::XORReduce, Int128VectorTests::XORReduceAll); + IntVector128Tests::XORReduce, IntVector128Tests::XORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3913,20 +3956,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = XOR_IDENTITY; - Assert.assertEquals((int) (id ^ id), id, + assertEquals((int) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id ^ x), x); - Assert.assertEquals((int) (x ^ id), x); + assertEquals((int) (id ^ x), x); + assertEquals((int) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id ^ x), x, + assertEquals((int) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x ^ id), x, + assertEquals((int) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3951,7 +3994,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void XORReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3969,7 +4012,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::XORReduceMasked, Int128VectorTests::XORReduceAllMasked); + IntVector128Tests::XORReduceMasked, IntVector128Tests::XORReduceAllMasked); } static int ADDReduce(int[] a, int idx) { @@ -3991,7 +4034,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceInt128VectorTests(IntFunction fa) { + static void ADDReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4007,7 +4050,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::ADDReduce, Int128VectorTests::ADDReduceAll); + IntVector128Tests::ADDReduce, IntVector128Tests::ADDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4015,20 +4058,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = ADD_IDENTITY; - Assert.assertEquals((int) (id + id), id, + assertEquals((int) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id + x), x); - Assert.assertEquals((int) (x + id), x); + assertEquals((int) (id + x), x); + assertEquals((int) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id + x), x, + assertEquals((int) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x + id), x, + assertEquals((int) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4053,7 +4096,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4071,7 +4114,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::ADDReduceMasked, Int128VectorTests::ADDReduceAllMasked); + IntVector128Tests::ADDReduceMasked, IntVector128Tests::ADDReduceAllMasked); } static int MULReduce(int[] a, int idx) { @@ -4093,7 +4136,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MULReduceInt128VectorTests(IntFunction fa) { + static void MULReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4109,7 +4152,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::MULReduce, Int128VectorTests::MULReduceAll); + IntVector128Tests::MULReduce, IntVector128Tests::MULReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4117,20 +4160,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MUL_IDENTITY; - Assert.assertEquals((int) (id * id), id, + assertEquals((int) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id * x), x); - Assert.assertEquals((int) (x * id), x); + assertEquals((int) (id * x), x); + assertEquals((int) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id * x), x, + assertEquals((int) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x * id), x, + assertEquals((int) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4155,7 +4198,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MULReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4173,7 +4216,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::MULReduceMasked, Int128VectorTests::MULReduceAllMasked); + IntVector128Tests::MULReduceMasked, IntVector128Tests::MULReduceAllMasked); } static int MINReduce(int[] a, int idx) { @@ -4195,7 +4238,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MINReduceInt128VectorTests(IntFunction fa) { + static void MINReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4211,7 +4254,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::MINReduce, Int128VectorTests::MINReduceAll); + IntVector128Tests::MINReduce, IntVector128Tests::MINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4219,20 +4262,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MIN_IDENTITY; - Assert.assertEquals((int) Math.min(id, id), id, + assertEquals((int) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.min(id, x), x); - Assert.assertEquals((int) Math.min(x, id), x); + assertEquals((int) Math.min(id, x), x); + assertEquals((int) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.min(id, x), x, + assertEquals((int) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.min(x, id), x, + assertEquals((int) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4257,7 +4300,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4275,7 +4318,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::MINReduceMasked, Int128VectorTests::MINReduceAllMasked); + IntVector128Tests::MINReduceMasked, IntVector128Tests::MINReduceAllMasked); } static int MAXReduce(int[] a, int idx) { @@ -4297,7 +4340,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MAXReduceInt128VectorTests(IntFunction fa) { + static void MAXReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4313,7 +4356,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::MAXReduce, Int128VectorTests::MAXReduceAll); + IntVector128Tests::MAXReduce, IntVector128Tests::MAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4321,20 +4364,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MAX_IDENTITY; - Assert.assertEquals((int) Math.max(id, id), id, + assertEquals((int) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.max(id, x), x); - Assert.assertEquals((int) Math.max(x, id), x); + assertEquals((int) Math.max(id, x), x); + assertEquals((int) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.max(id, x), x, + assertEquals((int) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.max(x, id), x, + assertEquals((int) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4359,7 +4402,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4377,7 +4420,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::MAXReduceMasked, Int128VectorTests::MAXReduceAllMasked); + IntVector128Tests::MAXReduceMasked, IntVector128Tests::MAXReduceAllMasked); } static int UMINReduce(int[] a, int idx) { @@ -4399,7 +4442,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMINReduceInt128VectorTests(IntFunction fa) { + static void UMINReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4415,7 +4458,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::UMINReduce, Int128VectorTests::UMINReduceAll); + IntVector128Tests::UMINReduce, IntVector128Tests::UMINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4423,20 +4466,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMIN_IDENTITY; - Assert.assertEquals((int) VectorMath.minUnsigned(id, id), id, + assertEquals((int) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x); + assertEquals((int) VectorMath.minUnsigned(id, x), x); + assertEquals((int) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x, + assertEquals((int) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x, + assertEquals((int) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4461,7 +4504,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMINReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4479,7 +4522,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::UMINReduceMasked, Int128VectorTests::UMINReduceAllMasked); + IntVector128Tests::UMINReduceMasked, IntVector128Tests::UMINReduceAllMasked); } static int UMAXReduce(int[] a, int idx) { @@ -4501,7 +4544,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMAXReduceInt128VectorTests(IntFunction fa) { + static void UMAXReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4517,7 +4560,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::UMAXReduce, Int128VectorTests::UMAXReduceAll); + IntVector128Tests::UMAXReduce, IntVector128Tests::UMAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4525,20 +4568,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMAX_IDENTITY; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, id), id, + assertEquals((int) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x); + assertEquals((int) VectorMath.maxUnsigned(id, x), x); + assertEquals((int) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x, + assertEquals((int) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x, + assertEquals((int) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4563,7 +4606,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMAXReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4581,7 +4624,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::UMAXReduceMasked, Int128VectorTests::UMAXReduceAllMasked); + IntVector128Tests::UMAXReduceMasked, IntVector128Tests::UMAXReduceAllMasked); } static int FIRST_NONZEROReduce(int[] a, int idx) { @@ -4603,7 +4646,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void FIRST_NONZEROReduceInt128VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4619,7 +4662,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::FIRST_NONZEROReduce, Int128VectorTests::FIRST_NONZEROReduceAll); + IntVector128Tests::FIRST_NONZEROReduce, IntVector128Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4627,20 +4670,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4665,7 +4708,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void FIRST_NONZEROReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4683,7 +4726,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::FIRST_NONZEROReduceMasked, Int128VectorTests::FIRST_NONZEROReduceAllMasked); + IntVector128Tests::FIRST_NONZEROReduceMasked, IntVector128Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4696,7 +4739,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueInt128VectorTests(IntFunction fm) { + static void anyTrueIntVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4707,7 +4750,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int128VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, IntVector128Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4720,7 +4763,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueInt128VectorTests(IntFunction fm) { + static void allTrueIntVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4731,7 +4774,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int128VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, IntVector128Tests::allTrue); } static int SUADDReduce(int[] a, int idx) { @@ -4753,7 +4796,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingUnaryOpProvider") - static void SUADDReduceInt128VectorTests(IntFunction fa) { + static void SUADDReduceIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4769,7 +4812,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int128VectorTests::SUADDReduce, Int128VectorTests::SUADDReduceAll); + IntVector128Tests::SUADDReduce, IntVector128Tests::SUADDReduceAll); } @Test(dataProvider = "intSaturatingUnaryOpProvider") @@ -4777,20 +4820,20 @@ public class Int128VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = SUADD_IDENTITY; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4814,7 +4857,7 @@ public class Int128VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "intSaturatingUnaryOpMaskProvider") - static void SUADDReduceInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4832,11 +4875,11 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::SUADDReduceMasked, Int128VectorTests::SUADDReduceAllMasked); + IntVector128Tests::SUADDReduceMasked, IntVector128Tests::SUADDReduceAllMasked); } @Test(dataProvider = "intBinaryOpProvider") - static void withInt128VectorTests(IntFunction fa, IntFunction fb) { + static void withIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -4859,7 +4902,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_DEFAULTInt128VectorTests(IntFunction fa) { + static void IS_DEFAULTIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4869,14 +4912,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_DEFAULTMaskedInt128VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4889,7 +4932,7 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4900,7 +4943,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_NEGATIVEInt128VectorTests(IntFunction fa) { + static void IS_NEGATIVEIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4910,14 +4953,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_NEGATIVEMaskedInt128VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4930,14 +4973,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt128VectorTests(IntFunction fa, IntFunction fb) { + static void LTIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4949,14 +4992,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ltInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ltIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4968,14 +5011,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4991,14 +5034,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GTInt128VectorTests(IntFunction fa, IntFunction fb) { + static void GTIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5010,14 +5053,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GTInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5033,14 +5076,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt128VectorTests(IntFunction fa, IntFunction fb) { + static void EQIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5052,14 +5095,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt128VectorTests(IntFunction fa, IntFunction fb) { + static void eqIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5071,14 +5114,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5094,14 +5137,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void NEInt128VectorTests(IntFunction fa, IntFunction fb) { + static void NEIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5113,14 +5156,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void NEInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5136,14 +5179,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LEInt128VectorTests(IntFunction fa, IntFunction fb) { + static void LEIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5155,14 +5198,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LEInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5178,14 +5221,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GEInt128VectorTests(IntFunction fa, IntFunction fb) { + static void GEIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5197,14 +5240,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GEInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5220,14 +5263,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULTInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ULTIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5239,14 +5282,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULTInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5262,14 +5305,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGTInt128VectorTests(IntFunction fa, IntFunction fb) { + static void UGTIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5281,14 +5324,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGTInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5304,14 +5347,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULEInt128VectorTests(IntFunction fa, IntFunction fb) { + static void ULEIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5323,14 +5366,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULEInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5346,14 +5389,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGEInt128VectorTests(IntFunction fa, IntFunction fb) { + static void UGEIntVector128Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5365,14 +5408,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGEInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5388,14 +5431,14 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5405,13 +5448,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5425,13 +5468,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5441,13 +5484,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTIntVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5461,13 +5504,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5477,13 +5520,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5497,13 +5540,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5513,13 +5556,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQIntVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5533,7 +5576,7 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); } } } @@ -5543,7 +5586,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt128VectorTests(IntFunction fa, IntFunction fb, + static void blendIntVector128Tests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5559,11 +5602,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int128VectorTests::blend); + assertArraysEquals(r, a, b, mask, IntVector128Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void RearrangeInt128VectorTests(IntFunction fa, + static void RearrangeIntVector128Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5580,7 +5623,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void RearrangeInt128VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeIntVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -5598,7 +5641,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void compressInt128VectorTests(IntFunction fa, + static void compressIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5616,7 +5659,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void expandInt128VectorTests(IntFunction fa, + static void expandIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5634,7 +5677,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void getInt128VectorTests(IntFunction fa) { + static void getIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5790,7 +5833,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastInt128VectorTests(IntFunction fa) { + static void BroadcastIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5804,7 +5847,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZeroInt128VectorTests(IntFunction fa) { + static void ZeroIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5814,7 +5857,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static int[] sliceUnary(int[] a, int origin, int idx) { @@ -5829,7 +5872,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void sliceUnaryInt128VectorTests(IntFunction fa) { + static void sliceUnaryIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5840,7 +5883,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int128VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, IntVector128Tests::sliceUnary); } static int[] sliceBinary(int[] a, int[] b, int origin, int idx) { @@ -5857,7 +5900,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void sliceBinaryInt128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryIntVector128TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5870,7 +5913,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Int128VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, IntVector128Tests::sliceBinary); } static int[] slice(int[] a, int[] b, int origin, boolean[] mask, int idx) { @@ -5887,7 +5930,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void sliceInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5904,7 +5947,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Int128VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, IntVector128Tests::slice); } static int[] unsliceUnary(int[] a, int origin, int idx) { @@ -5921,7 +5964,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void unsliceUnaryInt128VectorTests(IntFunction fa) { + static void unsliceUnaryIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5932,7 +5975,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int128VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, IntVector128Tests::unsliceUnary); } static int[] unsliceBinary(int[] a, int[] b, int origin, int part, int idx) { @@ -5958,7 +6001,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void unsliceBinaryInt128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryIntVector128TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5972,7 +6015,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Int128VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, IntVector128Tests::unsliceBinary); } static int[] unslice(int[] a, int[] b, int origin, int part, boolean[] mask, int idx) { @@ -6012,7 +6055,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void unsliceInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6029,7 +6072,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Int128VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, IntVector128Tests::unslice); } static int BITWISE_BLEND(int a, int b, int c) { @@ -6041,7 +6084,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6056,11 +6099,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Int128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6073,11 +6116,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Int128VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, IntVector128Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6095,11 +6138,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Int128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6110,11 +6153,11 @@ public class Int128VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6125,11 +6168,11 @@ public class Int128VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Int128VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int128VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, IntVector128Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Int128VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int128VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector128Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6174,11 +6217,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Int128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt128VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector128TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6193,11 +6236,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Int128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6208,11 +6251,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6223,11 +6266,11 @@ public class Int128VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int128VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector128Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector128TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6241,7 +6284,7 @@ public class Int128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Int128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntVector128Tests::BITWISE_BLEND); } static int NEG(int a) { @@ -6253,7 +6296,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NEGInt128VectorTests(IntFunction fa) { + static void NEGIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6264,11 +6307,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::NEG); + assertArraysEquals(r, a, IntVector128Tests::NEG); } @Test(dataProvider = "intUnaryOpProvider") - static void negInt128VectorTests(IntFunction fa) { + static void negIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6279,11 +6322,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::neg); + assertArraysEquals(r, a, IntVector128Tests::neg); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NEGMaskedInt128VectorTests(IntFunction fa, + static void NEGMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6297,7 +6340,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::NEG); + assertArraysEquals(r, a, mask, IntVector128Tests::NEG); } static int ABS(int a) { @@ -6309,7 +6352,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ABSInt128VectorTests(IntFunction fa) { + static void ABSIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6320,11 +6363,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::ABS); + assertArraysEquals(r, a, IntVector128Tests::ABS); } @Test(dataProvider = "intUnaryOpProvider") - static void absInt128VectorTests(IntFunction fa) { + static void absIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6335,11 +6378,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::abs); + assertArraysEquals(r, a, IntVector128Tests::abs); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ABSMaskedInt128VectorTests(IntFunction fa, + static void ABSMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6353,7 +6396,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::ABS); + assertArraysEquals(r, a, mask, IntVector128Tests::ABS); } static int NOT(int a) { @@ -6365,7 +6408,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NOTInt128VectorTests(IntFunction fa) { + static void NOTIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6376,11 +6419,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::NOT); + assertArraysEquals(r, a, IntVector128Tests::NOT); } @Test(dataProvider = "intUnaryOpProvider") - static void notInt128VectorTests(IntFunction fa) { + static void notIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6391,11 +6434,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::not); + assertArraysEquals(r, a, IntVector128Tests::not); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NOTMaskedInt128VectorTests(IntFunction fa, + static void NOTMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6409,7 +6452,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::NOT); + assertArraysEquals(r, a, mask, IntVector128Tests::NOT); } static int ZOMO(int a) { @@ -6417,7 +6460,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZOMOInt128VectorTests(IntFunction fa) { + static void ZOMOIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6428,11 +6471,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::ZOMO); + assertArraysEquals(r, a, IntVector128Tests::ZOMO); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ZOMOMaskedInt128VectorTests(IntFunction fa, + static void ZOMOMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6446,7 +6489,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::ZOMO); + assertArraysEquals(r, a, mask, IntVector128Tests::ZOMO); } static int BIT_COUNT(int a) { @@ -6454,7 +6497,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BIT_COUNTInt128VectorTests(IntFunction fa) { + static void BIT_COUNTIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6465,11 +6508,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, IntVector128Tests::BIT_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void BIT_COUNTMaskedInt128VectorTests(IntFunction fa, + static void BIT_COUNTMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6483,7 +6526,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, IntVector128Tests::BIT_COUNT); } static int TRAILING_ZEROS_COUNT(int a) { @@ -6491,7 +6534,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void TRAILING_ZEROS_COUNTInt128VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6502,11 +6545,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector128Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedInt128VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6520,7 +6563,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector128Tests::TRAILING_ZEROS_COUNT); } static int LEADING_ZEROS_COUNT(int a) { @@ -6528,7 +6571,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LEADING_ZEROS_COUNTInt128VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6539,11 +6582,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector128Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedInt128VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6557,7 +6600,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector128Tests::LEADING_ZEROS_COUNT); } static int REVERSE(int a) { @@ -6565,7 +6608,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSEInt128VectorTests(IntFunction fa) { + static void REVERSEIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6576,11 +6619,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::REVERSE); + assertArraysEquals(r, a, IntVector128Tests::REVERSE); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSEMaskedInt128VectorTests(IntFunction fa, + static void REVERSEMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6594,7 +6637,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::REVERSE); + assertArraysEquals(r, a, mask, IntVector128Tests::REVERSE); } static int REVERSE_BYTES(int a) { @@ -6602,7 +6645,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSE_BYTESInt128VectorTests(IntFunction fa) { + static void REVERSE_BYTESIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6613,11 +6656,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, IntVector128Tests::REVERSE_BYTES); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedInt128VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedIntVector128Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6631,7 +6674,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, IntVector128Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6639,7 +6682,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandIntVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6652,7 +6695,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::band); + assertArraysEquals(r, a, b, IntVector128Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6660,7 +6703,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maskorIntVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6673,7 +6716,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::bor); + assertArraysEquals(r, a, b, IntVector128Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6681,7 +6724,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorIntVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6694,7 +6737,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::bxor); + assertArraysEquals(r, a, b, IntVector128Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6702,7 +6745,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotIntVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6715,7 +6758,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::bandNot); + assertArraysEquals(r, a, b, IntVector128Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6723,7 +6766,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqIntVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6736,7 +6779,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int128VectorTests::beq); + assertArraysEquals(r, a, b, IntVector128Tests::beq); } static boolean unot(boolean a) { @@ -6744,7 +6787,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotInt128VectorTests(IntFunction fa) { + static void masknotIntVector128Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6755,7 +6798,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int128VectorTests::unot); + assertArraysEquals(r, a, IntVector128Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6764,15 +6807,15 @@ public class Int128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongInt128VectorTests(IntFunction fa) { + static void maskFromToLongIntVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6786,7 +6829,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intCompareOpProvider") - static void ltInt128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltIntVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6796,13 +6839,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqIntVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6812,13 +6855,13 @@ public class Int128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intUnaryOpProvider") - static void toIntArrayInt128VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayIntVector128TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6829,7 +6872,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toLongArrayInt128VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayIntVector128TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6840,7 +6883,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toDoubleArrayInt128VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayIntVector128TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6851,7 +6894,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toStringInt128VectorTestsSmokeTest(IntFunction fa) { + static void toStringIntVector128TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6864,7 +6907,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void hashCodeInt128VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeIntVector128TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6897,7 +6940,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceLongInt128VectorTests(IntFunction fa) { + static void ADDReduceLongIntVector128Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6913,7 +6956,7 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Int128VectorTests::ADDReduceLong, Int128VectorTests::ADDReduceAllLong); + IntVector128Tests::ADDReduceLong, IntVector128Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(int[] a, int idx, boolean[] mask) { @@ -6936,7 +6979,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceLongInt128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongIntVector128TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6954,11 +6997,11 @@ public class Int128VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Int128VectorTests::ADDReduceLongMasked, Int128VectorTests::ADDReduceAllLongMasked); + IntVector128Tests::ADDReduceLongMasked, IntVector128Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastLongInt128VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongIntVector128TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -6969,7 +7012,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendIntVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6983,12 +7026,12 @@ public class Int128VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Int128VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector128Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void SelectFromInt128VectorTests(IntFunction fa, + static void SelectFromIntVector128Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -7004,7 +7047,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorIntVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] idx = fc.apply(SPECIES.length()); @@ -7022,7 +7065,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void SelectFromInt128VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromIntVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -7041,7 +7084,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousInt128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousIntVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7052,12 +7095,12 @@ public class Int128VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringInt128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringIntVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7071,7 +7114,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsInt128VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsIntVector128TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7080,12 +7123,12 @@ public class Int128VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsInt128VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsIntVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7095,13 +7138,13 @@ public class Int128VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeInt128VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeIntVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7123,7 +7166,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountInt128VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountIntVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7134,7 +7177,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int128VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, IntVector128Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7148,7 +7191,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueInt128VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueIntVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7159,7 +7202,7 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int128VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, IntVector128Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7173,7 +7216,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueInt128VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueIntVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7184,11 +7227,11 @@ public class Int128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int128VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, IntVector128Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressInt128VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressIntVector128TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7198,7 +7241,7 @@ public class Int128VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7216,7 +7259,7 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeInt128VectorTestsSmokeTest(int offset) { + static void indexInRangeIntVector128TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7224,13 +7267,13 @@ public class Int128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongInt128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongIntVector128TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7238,7 +7281,7 @@ public class Int128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7257,36 +7300,36 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundInt128VectorTestsSmokeTest(int length) { + static void loopBoundIntVector128TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongInt128VectorTestsSmokeTest(int _length) { + static void loopBoundLongIntVector128TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeInt128VectorTestsSmokeTest() { + static void ElementSizeIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Integer.SIZE); + assertEquals(elsize, Integer.SIZE); } @Test - static void VectorShapeInt128VectorTestsSmokeTest() { + static void VectorShapeIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_128_BIT)); } @Test - static void ShapeWithLanesInt128VectorTestsSmokeTest() { + static void ShapeWithLanesIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(int.class); @@ -7294,32 +7337,32 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeInt128VectorTestsSmokeTest() { + static void ElementTypeIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementType() == int.class); } @Test - static void SpeciesElementSizeInt128VectorTestsSmokeTest() { + static void SpeciesElementSizeIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementSize() == Integer.SIZE); } @Test - static void VectorTypeInt128VectorTestsSmokeTest() { + static void VectorTypeIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesInt128VectorTestsSmokeTest() { + static void WithLanesIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(int.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeInt128VectorTestsSmokeTest() { + static void WithShapeIntVector128TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7327,9 +7370,9 @@ public class Int128VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueInt128VectorTestsSmokeTest() { + static void MaskAllTrueIntVector128TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntVector256LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/IntVector256LoadStoreTests.java index 1a8c113d3b9..ea98a287ded 100644 --- a/test/jdk/jdk/incubator/vector/Int256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector256LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Int256VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation IntVector256LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class IntVector256LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = IntVector.SPECIES_256; @@ -61,14 +61,29 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(int[] r, int[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "intProviderForIOOBE") @@ -870,11 +885,11 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(int[] r, int[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Int256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Int256VectorTests.java b/test/jdk/jdk/incubator/vector/IntVector256Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Int256VectorTests.java rename to test/jdk/jdk/incubator/vector/IntVector256Tests.java index 4e63de95b7b..7100ebd1693 100644 --- a/test/jdk/jdk/incubator/vector/Int256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector256Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntVector256Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Int256VectorTests extends AbstractVectorTest { +public class IntVector256Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = IntVector.SPECIES_256; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(int actual, int expected, int delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(int actual, int expected, int delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final int CONST_SHIFT = Integer.SIZE / 2; @@ -96,10 +139,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { int[] ref = f.apply(a[i]); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Int256VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Int256VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Int256VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Int256VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Int256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (int)0); + assertEquals(r[i + k], (int)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Int256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (int)0); + assertEquals(r[i + j], (int)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Int256VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Int256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Int256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Int256VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Int256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(r, a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1543,7 +1586,7 @@ public class Int256VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); IntVector a = io.add((int)1); //[1,2] IntVector b = a.neg(); //[-1,-2] int[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1558,19 +1601,19 @@ public class Int256VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); IntVector uab0 = zab0.rearrange(unz0,zab1); IntVector uab1 = zab0.rearrange(unz1,zab1); int[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1585,7 +1628,7 @@ public class Int256VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1593,9 +1636,9 @@ public class Int256VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1624,7 +1667,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ADDIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1637,7 +1680,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::ADD); + assertArraysEquals(r, a, b, IntVector256Tests::ADD); } static int add(int a, int b) { @@ -1645,7 +1688,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void addInt256VectorTests(IntFunction fa, IntFunction fb) { + static void addIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1656,11 +1699,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::add); + assertArraysEquals(r, a, b, IntVector256Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1676,11 +1719,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::ADD); + assertArraysEquals(r, a, b, mask, IntVector256Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1694,7 +1737,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int256VectorTests::add); + assertArraysEquals(r, a, b, mask, IntVector256Tests::add); } static int SUB(int a, int b) { @@ -1702,7 +1745,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void SUBInt256VectorTests(IntFunction fa, IntFunction fb) { + static void SUBIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1715,7 +1758,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::SUB); + assertArraysEquals(r, a, b, IntVector256Tests::SUB); } static int sub(int a, int b) { @@ -1723,7 +1766,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void subInt256VectorTests(IntFunction fa, IntFunction fb) { + static void subIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1734,11 +1777,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::sub); + assertArraysEquals(r, a, b, IntVector256Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void SUBInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1754,11 +1797,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::SUB); + assertArraysEquals(r, a, b, mask, IntVector256Tests::SUB); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1772,7 +1815,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int256VectorTests::sub); + assertArraysEquals(r, a, b, mask, IntVector256Tests::sub); } static int MUL(int a, int b) { @@ -1780,7 +1823,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MULInt256VectorTests(IntFunction fa, IntFunction fb) { + static void MULIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1793,7 +1836,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::MUL); + assertArraysEquals(r, a, b, IntVector256Tests::MUL); } static int mul(int a, int b) { @@ -1801,7 +1844,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt256VectorTests(IntFunction fa, IntFunction fb) { + static void mulIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1812,11 +1855,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::mul); + assertArraysEquals(r, a, b, IntVector256Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void MULInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1832,11 +1875,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::MUL); + assertArraysEquals(r, a, b, mask, IntVector256Tests::MUL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1850,7 +1893,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int256VectorTests::mul); + assertArraysEquals(r, a, b, mask, IntVector256Tests::mul); } static int DIV(int a, int b) { @@ -1858,7 +1901,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void DIVInt256VectorTests(IntFunction fa, IntFunction fb) { + static void DIVIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1873,7 +1916,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::DIV); + assertArraysEquals(r, a, b, IntVector256Tests::DIV); } static int div(int a, int b) { @@ -1881,7 +1924,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void divInt256VectorTests(IntFunction fa, IntFunction fb) { + static void divIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1896,11 +1939,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::div); + assertArraysEquals(r, a, b, IntVector256Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void DIVInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1918,11 +1961,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::DIV); + assertArraysEquals(r, a, b, mask, IntVector256Tests::DIV); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1940,7 +1983,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::div); + assertArraysEquals(r, a, b, mask, IntVector256Tests::div); } static int FIRST_NONZERO(int a, int b) { @@ -1948,7 +1991,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void FIRST_NONZEROInt256VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1961,11 +2004,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, IntVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void FIRST_NONZEROInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1981,7 +2024,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, IntVector256Tests::FIRST_NONZERO); } static int AND(int a, int b) { @@ -1989,7 +2032,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ANDIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2002,7 +2045,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::AND); + assertArraysEquals(r, a, b, IntVector256Tests::AND); } static int and(int a, int b) { @@ -2010,7 +2053,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void andInt256VectorTests(IntFunction fa, IntFunction fb) { + static void andIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2021,11 +2064,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::and); + assertArraysEquals(r, a, b, IntVector256Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2041,7 +2084,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::AND); + assertArraysEquals(r, a, b, mask, IntVector256Tests::AND); } static int AND_NOT(int a, int b) { @@ -2049,7 +2092,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void AND_NOTInt256VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, IntVector256Tests::AND_NOT); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void AND_NOTInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2082,7 +2125,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, IntVector256Tests::AND_NOT); } static int OR(int a, int b) { @@ -2090,7 +2133,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ORIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2103,7 +2146,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::OR); + assertArraysEquals(r, a, b, IntVector256Tests::OR); } static int or(int a, int b) { @@ -2111,7 +2154,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void orInt256VectorTests(IntFunction fa, IntFunction fb) { + static void orIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2122,11 +2165,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::or); + assertArraysEquals(r, a, b, IntVector256Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2142,7 +2185,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::OR); + assertArraysEquals(r, a, b, mask, IntVector256Tests::OR); } static int XOR(int a, int b) { @@ -2150,7 +2193,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void XORInt256VectorTests(IntFunction fa, IntFunction fb) { + static void XORIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2163,11 +2206,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::XOR); + assertArraysEquals(r, a, b, IntVector256Tests::XOR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void XORInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2183,7 +2226,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::XOR); + assertArraysEquals(r, a, b, mask, IntVector256Tests::XOR); } static int COMPRESS_BITS(int a, int b) { @@ -2191,7 +2234,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void COMPRESS_BITSInt256VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2204,11 +2247,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, IntVector256Tests::COMPRESS_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void COMPRESS_BITSInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2224,7 +2267,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, IntVector256Tests::COMPRESS_BITS); } static int EXPAND_BITS(int a, int b) { @@ -2232,7 +2275,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void EXPAND_BITSInt256VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2245,11 +2288,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, IntVector256Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void EXPAND_BITSInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2265,11 +2308,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, IntVector256Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpProvider") - static void addInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2279,11 +2322,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2296,11 +2339,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, IntVector256Tests::add); } @Test(dataProvider = "intBinaryOpProvider") - static void subInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2310,11 +2353,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2327,11 +2370,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, IntVector256Tests::sub); } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2358,11 +2401,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, IntVector256Tests::mul); } @Test(dataProvider = "intBinaryOpProvider") - static void divInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2374,11 +2417,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2393,11 +2436,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, IntVector256Tests::div); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2407,11 +2450,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void orInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2421,11 +2464,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::or); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2438,11 +2481,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, IntVector256Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2452,11 +2495,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void andInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2466,11 +2509,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::and); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2483,11 +2526,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, IntVector256Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2497,11 +2540,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, IntVector256Tests::OR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2514,11 +2557,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector256Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDIntVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2528,11 +2571,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, IntVector256Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDIntVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2545,7 +2588,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector256Tests::ADD); } static int LSHL(int a, int b) { @@ -2553,7 +2596,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2566,11 +2609,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::LSHL); + assertArraysEquals(r, a, b, IntVector256Tests::LSHL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2586,7 +2629,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, IntVector256Tests::LSHL); } static int ASHR(int a, int b) { @@ -2594,7 +2637,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2607,11 +2650,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::ASHR); + assertArraysEquals(r, a, b, IntVector256Tests::ASHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2627,7 +2670,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, IntVector256Tests::ASHR); } static int LSHR(int a, int b) { @@ -2635,7 +2678,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2648,11 +2691,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::LSHR); + assertArraysEquals(r, a, b, IntVector256Tests::LSHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2668,7 +2711,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, IntVector256Tests::LSHR); } static int LSHL_unary(int a, int b) { @@ -2676,7 +2719,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLIntVector256TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2688,11 +2731,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, IntVector256Tests::LSHL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2707,7 +2750,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector256Tests::LSHL_unary); } static int LSHR_unary(int a, int b) { @@ -2715,7 +2758,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRIntVector256TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2727,11 +2770,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, IntVector256Tests::LSHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2746,7 +2789,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector256Tests::LSHR_unary); } static int ASHR_unary(int a, int b) { @@ -2754,7 +2797,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRIntVector256TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2766,11 +2809,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, IntVector256Tests::ASHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2785,7 +2828,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector256Tests::ASHR_unary); } static int ROR(int a, int b) { @@ -2793,7 +2836,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt256VectorTests(IntFunction fa, IntFunction fb) { + static void RORIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2806,11 +2849,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::ROR); + assertArraysEquals(r, a, b, IntVector256Tests::ROR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2826,7 +2869,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::ROR); + assertArraysEquals(r, a, b, mask, IntVector256Tests::ROR); } static int ROL(int a, int b) { @@ -2834,7 +2877,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ROLIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2847,11 +2890,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::ROL); + assertArraysEquals(r, a, b, IntVector256Tests::ROL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2867,7 +2910,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::ROL); + assertArraysEquals(r, a, b, mask, IntVector256Tests::ROL); } static int ROR_unary(int a, int b) { @@ -2875,7 +2918,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORIntVector256TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2887,11 +2930,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, IntVector256Tests::ROR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORIntVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2906,7 +2949,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector256Tests::ROR_unary); } static int ROL_unary(int a, int b) { @@ -2914,7 +2957,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLIntVector256TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2926,11 +2969,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, IntVector256Tests::ROL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2945,14 +2988,14 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector256Tests::ROL_unary); } static int LSHR_binary_const(int a) { return (int)((a >>> CONST_SHIFT)); } @Test(dataProvider = "intUnaryOpProvider") - static void LSHRInt256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRIntVector256TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2963,11 +3006,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, IntVector256Tests::LSHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHRInt256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRIntVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2981,7 +3024,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector256Tests::LSHR_binary_const); } static int LSHL_binary_const(int a) { @@ -2989,7 +3032,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LSHLInt256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLIntVector256TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3000,11 +3043,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, IntVector256Tests::LSHL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHLInt256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLIntVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3018,7 +3061,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector256Tests::LSHL_binary_const); } static int ASHR_binary_const(int a) { @@ -3026,7 +3069,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ASHRInt256VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRIntVector256TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3037,11 +3080,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, IntVector256Tests::ASHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ASHRInt256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRIntVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3055,7 +3098,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector256Tests::ASHR_binary_const); } static int ROR_binary_const(int a) { @@ -3063,7 +3106,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void RORInt256VectorTestsScalarShiftConst(IntFunction fa) { + static void RORIntVector256TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3074,11 +3117,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, IntVector256Tests::ROR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void RORInt256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORIntVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3092,7 +3135,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector256Tests::ROR_binary_const); } static int ROL_binary_const(int a) { @@ -3100,7 +3143,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ROLInt256VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLIntVector256TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3111,11 +3154,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, IntVector256Tests::ROL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ROLInt256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLIntVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3129,14 +3172,14 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector256Tests::ROL_binary_const); } static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MINInt256VectorTestsWithMemOp(IntFunction fa) { + static void MINIntVector256TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int256VectorTests::MIN); + assertArraysEquals(r, a, (int)10, IntVector256Tests::MIN); } static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void minInt256VectorTestsWithMemOp(IntFunction fa) { + static void minIntVector256TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int256VectorTests::min); + assertArraysEquals(r, a, (int)10, IntVector256Tests::min); } static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINInt256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINIntVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,13 +3226,13 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int256VectorTests::MIN); + assertArraysEquals(r, a, (int)10, mask, IntVector256Tests::MIN); } static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MAXInt256VectorTestsWithMemOp(IntFunction fa) { + static void MAXIntVector256TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3200,13 +3243,13 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int256VectorTests::MAX); + assertArraysEquals(r, a, (int)10, IntVector256Tests::MAX); } static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void maxInt256VectorTestsWithMemOp(IntFunction fa) { + static void maxIntVector256TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3217,13 +3260,13 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int256VectorTests::max); + assertArraysEquals(r, a, (int)10, IntVector256Tests::max); } static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXInt256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXIntVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3236,7 +3279,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int256VectorTests::MAX); + assertArraysEquals(r, a, (int)10, mask, IntVector256Tests::MAX); } static int MIN(int a, int b) { @@ -3244,7 +3287,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt256VectorTests(IntFunction fa, IntFunction fb) { + static void MINIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3257,7 +3300,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::MIN); + assertArraysEquals(r, a, b, IntVector256Tests::MIN); } static int min(int a, int b) { @@ -3265,7 +3308,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void minInt256VectorTests(IntFunction fa, IntFunction fb) { + static void minIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3276,7 +3319,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::min); + assertArraysEquals(r, a, b, IntVector256Tests::min); } static int MAX(int a, int b) { @@ -3284,7 +3327,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt256VectorTests(IntFunction fa, IntFunction fb) { + static void MAXIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3297,7 +3340,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::MAX); + assertArraysEquals(r, a, b, IntVector256Tests::MAX); } static int max(int a, int b) { @@ -3305,7 +3348,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maxIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3316,7 +3359,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int256VectorTests::max); + assertArraysEquals(r, a, b, IntVector256Tests::max); } static int UMIN(int a, int b) { @@ -3324,7 +3367,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMINInt256VectorTests(IntFunction fa, IntFunction fb) { + static void UMINIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3337,11 +3380,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::UMIN); + assertArraysEquals(r, a, b, IntVector256Tests::UMIN); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMINInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3357,7 +3400,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, IntVector256Tests::UMIN); } static int UMAX(int a, int b) { @@ -3365,7 +3408,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMAXInt256VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3378,11 +3421,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::UMAX); + assertArraysEquals(r, a, b, IntVector256Tests::UMAX); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMAXInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3398,7 +3441,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, IntVector256Tests::UMAX); } static int SADD(int a, int b) { @@ -3406,7 +3449,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SADDInt256VectorTests(IntFunction fa, IntFunction fb) { + static void SADDIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3419,11 +3462,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::SADD); + assertArraysEquals(r, a, b, IntVector256Tests::SADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SADDInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3439,7 +3482,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::SADD); + assertArraysEquals(r, a, b, mask, IntVector256Tests::SADD); } static int SSUB(int a, int b) { @@ -3447,7 +3490,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SSUBInt256VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3460,11 +3503,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::SSUB); + assertArraysEquals(r, a, b, IntVector256Tests::SSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SSUBInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3480,7 +3523,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, IntVector256Tests::SSUB); } static int SUADD(int a, int b) { @@ -3488,7 +3531,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUADDInt256VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3501,11 +3544,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::SUADD); + assertArraysEquals(r, a, b, IntVector256Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUADDInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3521,7 +3564,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, IntVector256Tests::SUADD); } static int SUSUB(int a, int b) { @@ -3529,7 +3572,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUSUBInt256VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3542,11 +3585,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::SUSUB); + assertArraysEquals(r, a, b, IntVector256Tests::SUSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUSUBInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3562,11 +3605,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, IntVector256Tests::SUSUB); } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3576,11 +3619,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::MIN); } @Test(dataProvider = "intBinaryOpProvider") - static void minInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3590,11 +3633,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::min); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::min); } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3604,11 +3647,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::MAX); } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3618,10 +3661,10 @@ public class Int256VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int256VectorTests::max); + assertBroadcastArraysEquals(r, a, b, IntVector256Tests::max); } @Test(dataProvider = "intSaturatingBinaryOpAssocProvider") - static void SUADDAssocInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocIntVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -3638,11 +3681,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Int256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, IntVector256Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3663,7 +3706,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Int256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, IntVector256Tests::SUADD); } static int ANDReduce(int[] a, int idx) { @@ -3685,7 +3728,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ANDReduceInt256VectorTests(IntFunction fa) { + static void ANDReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3701,7 +3744,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::ANDReduce, Int256VectorTests::ANDReduceAll); + IntVector256Tests::ANDReduce, IntVector256Tests::ANDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3709,20 +3752,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = AND_IDENTITY; - Assert.assertEquals((int) (id & id), id, + assertEquals((int) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id & x), x); - Assert.assertEquals((int) (x & id), x); + assertEquals((int) (id & x), x); + assertEquals((int) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id & x), x, + assertEquals((int) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x & id), x, + assertEquals((int) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3747,7 +3790,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ANDReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3765,7 +3808,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::ANDReduceMasked, Int256VectorTests::ANDReduceAllMasked); + IntVector256Tests::ANDReduceMasked, IntVector256Tests::ANDReduceAllMasked); } static int ORReduce(int[] a, int idx) { @@ -3787,7 +3830,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ORReduceInt256VectorTests(IntFunction fa) { + static void ORReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3803,7 +3846,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::ORReduce, Int256VectorTests::ORReduceAll); + IntVector256Tests::ORReduce, IntVector256Tests::ORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3811,20 +3854,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = OR_IDENTITY; - Assert.assertEquals((int) (id | id), id, + assertEquals((int) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id | x), x); - Assert.assertEquals((int) (x | id), x); + assertEquals((int) (id | x), x); + assertEquals((int) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id | x), x, + assertEquals((int) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x | id), x, + assertEquals((int) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3849,7 +3892,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ORReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3867,7 +3910,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::ORReduceMasked, Int256VectorTests::ORReduceAllMasked); + IntVector256Tests::ORReduceMasked, IntVector256Tests::ORReduceAllMasked); } static int XORReduce(int[] a, int idx) { @@ -3889,7 +3932,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void XORReduceInt256VectorTests(IntFunction fa) { + static void XORReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3905,7 +3948,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::XORReduce, Int256VectorTests::XORReduceAll); + IntVector256Tests::XORReduce, IntVector256Tests::XORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3913,20 +3956,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = XOR_IDENTITY; - Assert.assertEquals((int) (id ^ id), id, + assertEquals((int) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id ^ x), x); - Assert.assertEquals((int) (x ^ id), x); + assertEquals((int) (id ^ x), x); + assertEquals((int) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id ^ x), x, + assertEquals((int) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x ^ id), x, + assertEquals((int) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3951,7 +3994,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void XORReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3969,7 +4012,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::XORReduceMasked, Int256VectorTests::XORReduceAllMasked); + IntVector256Tests::XORReduceMasked, IntVector256Tests::XORReduceAllMasked); } static int ADDReduce(int[] a, int idx) { @@ -3991,7 +4034,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceInt256VectorTests(IntFunction fa) { + static void ADDReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4007,7 +4050,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::ADDReduce, Int256VectorTests::ADDReduceAll); + IntVector256Tests::ADDReduce, IntVector256Tests::ADDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4015,20 +4058,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = ADD_IDENTITY; - Assert.assertEquals((int) (id + id), id, + assertEquals((int) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id + x), x); - Assert.assertEquals((int) (x + id), x); + assertEquals((int) (id + x), x); + assertEquals((int) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id + x), x, + assertEquals((int) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x + id), x, + assertEquals((int) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4053,7 +4096,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4071,7 +4114,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::ADDReduceMasked, Int256VectorTests::ADDReduceAllMasked); + IntVector256Tests::ADDReduceMasked, IntVector256Tests::ADDReduceAllMasked); } static int MULReduce(int[] a, int idx) { @@ -4093,7 +4136,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MULReduceInt256VectorTests(IntFunction fa) { + static void MULReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4109,7 +4152,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::MULReduce, Int256VectorTests::MULReduceAll); + IntVector256Tests::MULReduce, IntVector256Tests::MULReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4117,20 +4160,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MUL_IDENTITY; - Assert.assertEquals((int) (id * id), id, + assertEquals((int) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id * x), x); - Assert.assertEquals((int) (x * id), x); + assertEquals((int) (id * x), x); + assertEquals((int) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id * x), x, + assertEquals((int) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x * id), x, + assertEquals((int) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4155,7 +4198,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MULReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4173,7 +4216,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::MULReduceMasked, Int256VectorTests::MULReduceAllMasked); + IntVector256Tests::MULReduceMasked, IntVector256Tests::MULReduceAllMasked); } static int MINReduce(int[] a, int idx) { @@ -4195,7 +4238,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MINReduceInt256VectorTests(IntFunction fa) { + static void MINReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4211,7 +4254,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::MINReduce, Int256VectorTests::MINReduceAll); + IntVector256Tests::MINReduce, IntVector256Tests::MINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4219,20 +4262,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MIN_IDENTITY; - Assert.assertEquals((int) Math.min(id, id), id, + assertEquals((int) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.min(id, x), x); - Assert.assertEquals((int) Math.min(x, id), x); + assertEquals((int) Math.min(id, x), x); + assertEquals((int) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.min(id, x), x, + assertEquals((int) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.min(x, id), x, + assertEquals((int) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4257,7 +4300,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4275,7 +4318,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::MINReduceMasked, Int256VectorTests::MINReduceAllMasked); + IntVector256Tests::MINReduceMasked, IntVector256Tests::MINReduceAllMasked); } static int MAXReduce(int[] a, int idx) { @@ -4297,7 +4340,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MAXReduceInt256VectorTests(IntFunction fa) { + static void MAXReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4313,7 +4356,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::MAXReduce, Int256VectorTests::MAXReduceAll); + IntVector256Tests::MAXReduce, IntVector256Tests::MAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4321,20 +4364,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MAX_IDENTITY; - Assert.assertEquals((int) Math.max(id, id), id, + assertEquals((int) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.max(id, x), x); - Assert.assertEquals((int) Math.max(x, id), x); + assertEquals((int) Math.max(id, x), x); + assertEquals((int) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.max(id, x), x, + assertEquals((int) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.max(x, id), x, + assertEquals((int) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4359,7 +4402,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4377,7 +4420,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::MAXReduceMasked, Int256VectorTests::MAXReduceAllMasked); + IntVector256Tests::MAXReduceMasked, IntVector256Tests::MAXReduceAllMasked); } static int UMINReduce(int[] a, int idx) { @@ -4399,7 +4442,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMINReduceInt256VectorTests(IntFunction fa) { + static void UMINReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4415,7 +4458,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::UMINReduce, Int256VectorTests::UMINReduceAll); + IntVector256Tests::UMINReduce, IntVector256Tests::UMINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4423,20 +4466,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMIN_IDENTITY; - Assert.assertEquals((int) VectorMath.minUnsigned(id, id), id, + assertEquals((int) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x); + assertEquals((int) VectorMath.minUnsigned(id, x), x); + assertEquals((int) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x, + assertEquals((int) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x, + assertEquals((int) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4461,7 +4504,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMINReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4479,7 +4522,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::UMINReduceMasked, Int256VectorTests::UMINReduceAllMasked); + IntVector256Tests::UMINReduceMasked, IntVector256Tests::UMINReduceAllMasked); } static int UMAXReduce(int[] a, int idx) { @@ -4501,7 +4544,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMAXReduceInt256VectorTests(IntFunction fa) { + static void UMAXReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4517,7 +4560,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::UMAXReduce, Int256VectorTests::UMAXReduceAll); + IntVector256Tests::UMAXReduce, IntVector256Tests::UMAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4525,20 +4568,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMAX_IDENTITY; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, id), id, + assertEquals((int) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x); + assertEquals((int) VectorMath.maxUnsigned(id, x), x); + assertEquals((int) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x, + assertEquals((int) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x, + assertEquals((int) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4563,7 +4606,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMAXReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4581,7 +4624,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::UMAXReduceMasked, Int256VectorTests::UMAXReduceAllMasked); + IntVector256Tests::UMAXReduceMasked, IntVector256Tests::UMAXReduceAllMasked); } static int FIRST_NONZEROReduce(int[] a, int idx) { @@ -4603,7 +4646,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void FIRST_NONZEROReduceInt256VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4619,7 +4662,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::FIRST_NONZEROReduce, Int256VectorTests::FIRST_NONZEROReduceAll); + IntVector256Tests::FIRST_NONZEROReduce, IntVector256Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4627,20 +4670,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4665,7 +4708,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void FIRST_NONZEROReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4683,7 +4726,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::FIRST_NONZEROReduceMasked, Int256VectorTests::FIRST_NONZEROReduceAllMasked); + IntVector256Tests::FIRST_NONZEROReduceMasked, IntVector256Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4696,7 +4739,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueInt256VectorTests(IntFunction fm) { + static void anyTrueIntVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4707,7 +4750,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int256VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, IntVector256Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4720,7 +4763,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueInt256VectorTests(IntFunction fm) { + static void allTrueIntVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4731,7 +4774,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int256VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, IntVector256Tests::allTrue); } static int SUADDReduce(int[] a, int idx) { @@ -4753,7 +4796,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingUnaryOpProvider") - static void SUADDReduceInt256VectorTests(IntFunction fa) { + static void SUADDReduceIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4769,7 +4812,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int256VectorTests::SUADDReduce, Int256VectorTests::SUADDReduceAll); + IntVector256Tests::SUADDReduce, IntVector256Tests::SUADDReduceAll); } @Test(dataProvider = "intSaturatingUnaryOpProvider") @@ -4777,20 +4820,20 @@ public class Int256VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = SUADD_IDENTITY; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4814,7 +4857,7 @@ public class Int256VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "intSaturatingUnaryOpMaskProvider") - static void SUADDReduceInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4832,11 +4875,11 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::SUADDReduceMasked, Int256VectorTests::SUADDReduceAllMasked); + IntVector256Tests::SUADDReduceMasked, IntVector256Tests::SUADDReduceAllMasked); } @Test(dataProvider = "intBinaryOpProvider") - static void withInt256VectorTests(IntFunction fa, IntFunction fb) { + static void withIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -4859,7 +4902,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_DEFAULTInt256VectorTests(IntFunction fa) { + static void IS_DEFAULTIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4869,14 +4912,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_DEFAULTMaskedInt256VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4889,7 +4932,7 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4900,7 +4943,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_NEGATIVEInt256VectorTests(IntFunction fa) { + static void IS_NEGATIVEIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4910,14 +4953,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_NEGATIVEMaskedInt256VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4930,14 +4973,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt256VectorTests(IntFunction fa, IntFunction fb) { + static void LTIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4949,14 +4992,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ltInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ltIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4968,14 +5011,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4991,14 +5034,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GTInt256VectorTests(IntFunction fa, IntFunction fb) { + static void GTIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5010,14 +5053,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GTInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5033,14 +5076,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt256VectorTests(IntFunction fa, IntFunction fb) { + static void EQIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5052,14 +5095,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt256VectorTests(IntFunction fa, IntFunction fb) { + static void eqIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5071,14 +5114,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5094,14 +5137,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void NEInt256VectorTests(IntFunction fa, IntFunction fb) { + static void NEIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5113,14 +5156,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void NEInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5136,14 +5179,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LEInt256VectorTests(IntFunction fa, IntFunction fb) { + static void LEIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5155,14 +5198,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LEInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5178,14 +5221,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GEInt256VectorTests(IntFunction fa, IntFunction fb) { + static void GEIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5197,14 +5240,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GEInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5220,14 +5263,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULTInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ULTIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5239,14 +5282,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULTInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5262,14 +5305,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGTInt256VectorTests(IntFunction fa, IntFunction fb) { + static void UGTIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5281,14 +5324,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGTInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5304,14 +5347,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULEInt256VectorTests(IntFunction fa, IntFunction fb) { + static void ULEIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5323,14 +5366,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULEInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5346,14 +5389,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGEInt256VectorTests(IntFunction fa, IntFunction fb) { + static void UGEIntVector256Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5365,14 +5408,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGEInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5388,14 +5431,14 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5405,13 +5448,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5425,13 +5468,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5441,13 +5484,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTIntVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5461,13 +5504,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5477,13 +5520,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5497,13 +5540,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5513,13 +5556,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQIntVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5533,7 +5576,7 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); } } } @@ -5543,7 +5586,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt256VectorTests(IntFunction fa, IntFunction fb, + static void blendIntVector256Tests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5559,11 +5602,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int256VectorTests::blend); + assertArraysEquals(r, a, b, mask, IntVector256Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void RearrangeInt256VectorTests(IntFunction fa, + static void RearrangeIntVector256Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5580,7 +5623,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void RearrangeInt256VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeIntVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -5598,7 +5641,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void compressInt256VectorTests(IntFunction fa, + static void compressIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5616,7 +5659,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void expandInt256VectorTests(IntFunction fa, + static void expandIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5634,7 +5677,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void getInt256VectorTests(IntFunction fa) { + static void getIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5790,7 +5833,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastInt256VectorTests(IntFunction fa) { + static void BroadcastIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5804,7 +5847,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZeroInt256VectorTests(IntFunction fa) { + static void ZeroIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5814,7 +5857,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static int[] sliceUnary(int[] a, int origin, int idx) { @@ -5829,7 +5872,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void sliceUnaryInt256VectorTests(IntFunction fa) { + static void sliceUnaryIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5840,7 +5883,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int256VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, IntVector256Tests::sliceUnary); } static int[] sliceBinary(int[] a, int[] b, int origin, int idx) { @@ -5857,7 +5900,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void sliceBinaryInt256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryIntVector256TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5870,7 +5913,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Int256VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, IntVector256Tests::sliceBinary); } static int[] slice(int[] a, int[] b, int origin, boolean[] mask, int idx) { @@ -5887,7 +5930,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void sliceInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5904,7 +5947,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Int256VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, IntVector256Tests::slice); } static int[] unsliceUnary(int[] a, int origin, int idx) { @@ -5921,7 +5964,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void unsliceUnaryInt256VectorTests(IntFunction fa) { + static void unsliceUnaryIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5932,7 +5975,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int256VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, IntVector256Tests::unsliceUnary); } static int[] unsliceBinary(int[] a, int[] b, int origin, int part, int idx) { @@ -5958,7 +6001,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void unsliceBinaryInt256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryIntVector256TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5972,7 +6015,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Int256VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, IntVector256Tests::unsliceBinary); } static int[] unslice(int[] a, int[] b, int origin, int part, boolean[] mask, int idx) { @@ -6012,7 +6055,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void unsliceInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6029,7 +6072,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Int256VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, IntVector256Tests::unslice); } static int BITWISE_BLEND(int a, int b, int c) { @@ -6041,7 +6084,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6056,11 +6099,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Int256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6073,11 +6116,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Int256VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, IntVector256Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6095,11 +6138,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Int256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6110,11 +6153,11 @@ public class Int256VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6125,11 +6168,11 @@ public class Int256VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Int256VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int256VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, IntVector256Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Int256VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int256VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector256Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6174,11 +6217,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Int256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt256VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector256TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6193,11 +6236,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Int256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6208,11 +6251,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6223,11 +6266,11 @@ public class Int256VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int256VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector256Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt256VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector256TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6241,7 +6284,7 @@ public class Int256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Int256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntVector256Tests::BITWISE_BLEND); } static int NEG(int a) { @@ -6253,7 +6296,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NEGInt256VectorTests(IntFunction fa) { + static void NEGIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6264,11 +6307,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::NEG); + assertArraysEquals(r, a, IntVector256Tests::NEG); } @Test(dataProvider = "intUnaryOpProvider") - static void negInt256VectorTests(IntFunction fa) { + static void negIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6279,11 +6322,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::neg); + assertArraysEquals(r, a, IntVector256Tests::neg); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NEGMaskedInt256VectorTests(IntFunction fa, + static void NEGMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6297,7 +6340,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::NEG); + assertArraysEquals(r, a, mask, IntVector256Tests::NEG); } static int ABS(int a) { @@ -6309,7 +6352,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ABSInt256VectorTests(IntFunction fa) { + static void ABSIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6320,11 +6363,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::ABS); + assertArraysEquals(r, a, IntVector256Tests::ABS); } @Test(dataProvider = "intUnaryOpProvider") - static void absInt256VectorTests(IntFunction fa) { + static void absIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6335,11 +6378,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::abs); + assertArraysEquals(r, a, IntVector256Tests::abs); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ABSMaskedInt256VectorTests(IntFunction fa, + static void ABSMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6353,7 +6396,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::ABS); + assertArraysEquals(r, a, mask, IntVector256Tests::ABS); } static int NOT(int a) { @@ -6365,7 +6408,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NOTInt256VectorTests(IntFunction fa) { + static void NOTIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6376,11 +6419,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::NOT); + assertArraysEquals(r, a, IntVector256Tests::NOT); } @Test(dataProvider = "intUnaryOpProvider") - static void notInt256VectorTests(IntFunction fa) { + static void notIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6391,11 +6434,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::not); + assertArraysEquals(r, a, IntVector256Tests::not); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NOTMaskedInt256VectorTests(IntFunction fa, + static void NOTMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6409,7 +6452,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::NOT); + assertArraysEquals(r, a, mask, IntVector256Tests::NOT); } static int ZOMO(int a) { @@ -6417,7 +6460,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZOMOInt256VectorTests(IntFunction fa) { + static void ZOMOIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6428,11 +6471,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::ZOMO); + assertArraysEquals(r, a, IntVector256Tests::ZOMO); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ZOMOMaskedInt256VectorTests(IntFunction fa, + static void ZOMOMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6446,7 +6489,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::ZOMO); + assertArraysEquals(r, a, mask, IntVector256Tests::ZOMO); } static int BIT_COUNT(int a) { @@ -6454,7 +6497,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BIT_COUNTInt256VectorTests(IntFunction fa) { + static void BIT_COUNTIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6465,11 +6508,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, IntVector256Tests::BIT_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void BIT_COUNTMaskedInt256VectorTests(IntFunction fa, + static void BIT_COUNTMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6483,7 +6526,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, IntVector256Tests::BIT_COUNT); } static int TRAILING_ZEROS_COUNT(int a) { @@ -6491,7 +6534,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void TRAILING_ZEROS_COUNTInt256VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6502,11 +6545,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector256Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedInt256VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6520,7 +6563,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector256Tests::TRAILING_ZEROS_COUNT); } static int LEADING_ZEROS_COUNT(int a) { @@ -6528,7 +6571,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LEADING_ZEROS_COUNTInt256VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6539,11 +6582,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector256Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedInt256VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6557,7 +6600,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector256Tests::LEADING_ZEROS_COUNT); } static int REVERSE(int a) { @@ -6565,7 +6608,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSEInt256VectorTests(IntFunction fa) { + static void REVERSEIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6576,11 +6619,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::REVERSE); + assertArraysEquals(r, a, IntVector256Tests::REVERSE); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSEMaskedInt256VectorTests(IntFunction fa, + static void REVERSEMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6594,7 +6637,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::REVERSE); + assertArraysEquals(r, a, mask, IntVector256Tests::REVERSE); } static int REVERSE_BYTES(int a) { @@ -6602,7 +6645,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSE_BYTESInt256VectorTests(IntFunction fa) { + static void REVERSE_BYTESIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6613,11 +6656,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, IntVector256Tests::REVERSE_BYTES); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedInt256VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedIntVector256Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6631,7 +6674,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, IntVector256Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6639,7 +6682,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandIntVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6652,7 +6695,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::band); + assertArraysEquals(r, a, b, IntVector256Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6660,7 +6703,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maskorIntVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6673,7 +6716,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::bor); + assertArraysEquals(r, a, b, IntVector256Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6681,7 +6724,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorIntVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6694,7 +6737,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::bxor); + assertArraysEquals(r, a, b, IntVector256Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6702,7 +6745,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotIntVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6715,7 +6758,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::bandNot); + assertArraysEquals(r, a, b, IntVector256Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6723,7 +6766,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqIntVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6736,7 +6779,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int256VectorTests::beq); + assertArraysEquals(r, a, b, IntVector256Tests::beq); } static boolean unot(boolean a) { @@ -6744,7 +6787,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotInt256VectorTests(IntFunction fa) { + static void masknotIntVector256Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6755,7 +6798,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int256VectorTests::unot); + assertArraysEquals(r, a, IntVector256Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6764,15 +6807,15 @@ public class Int256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongInt256VectorTests(IntFunction fa) { + static void maskFromToLongIntVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6786,7 +6829,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intCompareOpProvider") - static void ltInt256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltIntVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6796,13 +6839,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqIntVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6812,13 +6855,13 @@ public class Int256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intUnaryOpProvider") - static void toIntArrayInt256VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayIntVector256TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6829,7 +6872,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toLongArrayInt256VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayIntVector256TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6840,7 +6883,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toDoubleArrayInt256VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayIntVector256TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6851,7 +6894,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toStringInt256VectorTestsSmokeTest(IntFunction fa) { + static void toStringIntVector256TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6864,7 +6907,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void hashCodeInt256VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeIntVector256TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6897,7 +6940,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceLongInt256VectorTests(IntFunction fa) { + static void ADDReduceLongIntVector256Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6913,7 +6956,7 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Int256VectorTests::ADDReduceLong, Int256VectorTests::ADDReduceAllLong); + IntVector256Tests::ADDReduceLong, IntVector256Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(int[] a, int idx, boolean[] mask) { @@ -6936,7 +6979,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceLongInt256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongIntVector256TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6954,11 +6997,11 @@ public class Int256VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Int256VectorTests::ADDReduceLongMasked, Int256VectorTests::ADDReduceAllLongMasked); + IntVector256Tests::ADDReduceLongMasked, IntVector256Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastLongInt256VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongIntVector256TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -6969,7 +7012,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendIntVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6983,12 +7026,12 @@ public class Int256VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Int256VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector256Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void SelectFromInt256VectorTests(IntFunction fa, + static void SelectFromIntVector256Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -7004,7 +7047,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorIntVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] idx = fc.apply(SPECIES.length()); @@ -7022,7 +7065,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void SelectFromInt256VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromIntVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -7041,7 +7084,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousInt256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousIntVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7052,12 +7095,12 @@ public class Int256VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringInt256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringIntVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7071,7 +7114,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsInt256VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsIntVector256TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7080,12 +7123,12 @@ public class Int256VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsInt256VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsIntVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7095,13 +7138,13 @@ public class Int256VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeInt256VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeIntVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7123,7 +7166,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountInt256VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountIntVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7134,7 +7177,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int256VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, IntVector256Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7148,7 +7191,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueInt256VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueIntVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7159,7 +7202,7 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int256VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, IntVector256Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7173,7 +7216,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueInt256VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueIntVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7184,11 +7227,11 @@ public class Int256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int256VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, IntVector256Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressInt256VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressIntVector256TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7198,7 +7241,7 @@ public class Int256VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7216,7 +7259,7 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeInt256VectorTestsSmokeTest(int offset) { + static void indexInRangeIntVector256TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7224,13 +7267,13 @@ public class Int256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongInt256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongIntVector256TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7238,7 +7281,7 @@ public class Int256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7257,36 +7300,36 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundInt256VectorTestsSmokeTest(int length) { + static void loopBoundIntVector256TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongInt256VectorTestsSmokeTest(int _length) { + static void loopBoundLongIntVector256TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeInt256VectorTestsSmokeTest() { + static void ElementSizeIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Integer.SIZE); + assertEquals(elsize, Integer.SIZE); } @Test - static void VectorShapeInt256VectorTestsSmokeTest() { + static void VectorShapeIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_256_BIT)); } @Test - static void ShapeWithLanesInt256VectorTestsSmokeTest() { + static void ShapeWithLanesIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(int.class); @@ -7294,32 +7337,32 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeInt256VectorTestsSmokeTest() { + static void ElementTypeIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementType() == int.class); } @Test - static void SpeciesElementSizeInt256VectorTestsSmokeTest() { + static void SpeciesElementSizeIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementSize() == Integer.SIZE); } @Test - static void VectorTypeInt256VectorTestsSmokeTest() { + static void VectorTypeIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesInt256VectorTestsSmokeTest() { + static void WithLanesIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(int.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeInt256VectorTestsSmokeTest() { + static void WithShapeIntVector256TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7327,9 +7370,9 @@ public class Int256VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueInt256VectorTestsSmokeTest() { + static void MaskAllTrueIntVector256TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntVector512LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/IntVector512LoadStoreTests.java index 4c4ab6c4bc5..189a5540f7d 100644 --- a/test/jdk/jdk/incubator/vector/Int512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector512LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Int512VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation IntVector512LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class IntVector512LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = IntVector.SPECIES_512; @@ -61,14 +61,29 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(int[] r, int[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "intProviderForIOOBE") @@ -870,11 +885,11 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(int[] r, int[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Int512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Int512VectorTests.java b/test/jdk/jdk/incubator/vector/IntVector512Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Int512VectorTests.java rename to test/jdk/jdk/incubator/vector/IntVector512Tests.java index e2de7905a83..468d3b15efe 100644 --- a/test/jdk/jdk/incubator/vector/Int512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector512Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntVector512Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Int512VectorTests extends AbstractVectorTest { +public class IntVector512Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = IntVector.SPECIES_512; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(int actual, int expected, int delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(int actual, int expected, int delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final int CONST_SHIFT = Integer.SIZE / 2; @@ -96,10 +139,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { int[] ref = f.apply(a[i]); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Int512VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Int512VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Int512VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Int512VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Int512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (int)0); + assertEquals(r[i + k], (int)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Int512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (int)0); + assertEquals(r[i + j], (int)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Int512VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Int512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Int512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Int512VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Int512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(r, a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1543,7 +1586,7 @@ public class Int512VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); IntVector a = io.add((int)1); //[1,2] IntVector b = a.neg(); //[-1,-2] int[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1558,19 +1601,19 @@ public class Int512VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); IntVector uab0 = zab0.rearrange(unz0,zab1); IntVector uab1 = zab0.rearrange(unz1,zab1); int[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1585,7 +1628,7 @@ public class Int512VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1593,9 +1636,9 @@ public class Int512VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1624,7 +1667,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ADDIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1637,7 +1680,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::ADD); + assertArraysEquals(r, a, b, IntVector512Tests::ADD); } static int add(int a, int b) { @@ -1645,7 +1688,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void addInt512VectorTests(IntFunction fa, IntFunction fb) { + static void addIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1656,11 +1699,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::add); + assertArraysEquals(r, a, b, IntVector512Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1676,11 +1719,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::ADD); + assertArraysEquals(r, a, b, mask, IntVector512Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1694,7 +1737,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int512VectorTests::add); + assertArraysEquals(r, a, b, mask, IntVector512Tests::add); } static int SUB(int a, int b) { @@ -1702,7 +1745,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void SUBInt512VectorTests(IntFunction fa, IntFunction fb) { + static void SUBIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1715,7 +1758,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::SUB); + assertArraysEquals(r, a, b, IntVector512Tests::SUB); } static int sub(int a, int b) { @@ -1723,7 +1766,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void subInt512VectorTests(IntFunction fa, IntFunction fb) { + static void subIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1734,11 +1777,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::sub); + assertArraysEquals(r, a, b, IntVector512Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void SUBInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1754,11 +1797,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::SUB); + assertArraysEquals(r, a, b, mask, IntVector512Tests::SUB); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1772,7 +1815,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int512VectorTests::sub); + assertArraysEquals(r, a, b, mask, IntVector512Tests::sub); } static int MUL(int a, int b) { @@ -1780,7 +1823,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MULInt512VectorTests(IntFunction fa, IntFunction fb) { + static void MULIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1793,7 +1836,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::MUL); + assertArraysEquals(r, a, b, IntVector512Tests::MUL); } static int mul(int a, int b) { @@ -1801,7 +1844,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt512VectorTests(IntFunction fa, IntFunction fb) { + static void mulIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1812,11 +1855,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::mul); + assertArraysEquals(r, a, b, IntVector512Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void MULInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1832,11 +1875,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::MUL); + assertArraysEquals(r, a, b, mask, IntVector512Tests::MUL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1850,7 +1893,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int512VectorTests::mul); + assertArraysEquals(r, a, b, mask, IntVector512Tests::mul); } static int DIV(int a, int b) { @@ -1858,7 +1901,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void DIVInt512VectorTests(IntFunction fa, IntFunction fb) { + static void DIVIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1873,7 +1916,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::DIV); + assertArraysEquals(r, a, b, IntVector512Tests::DIV); } static int div(int a, int b) { @@ -1881,7 +1924,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void divInt512VectorTests(IntFunction fa, IntFunction fb) { + static void divIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1896,11 +1939,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::div); + assertArraysEquals(r, a, b, IntVector512Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void DIVInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1918,11 +1961,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::DIV); + assertArraysEquals(r, a, b, mask, IntVector512Tests::DIV); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1940,7 +1983,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::div); + assertArraysEquals(r, a, b, mask, IntVector512Tests::div); } static int FIRST_NONZERO(int a, int b) { @@ -1948,7 +1991,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void FIRST_NONZEROInt512VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1961,11 +2004,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, IntVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void FIRST_NONZEROInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1981,7 +2024,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, IntVector512Tests::FIRST_NONZERO); } static int AND(int a, int b) { @@ -1989,7 +2032,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ANDIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2002,7 +2045,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::AND); + assertArraysEquals(r, a, b, IntVector512Tests::AND); } static int and(int a, int b) { @@ -2010,7 +2053,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void andInt512VectorTests(IntFunction fa, IntFunction fb) { + static void andIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2021,11 +2064,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::and); + assertArraysEquals(r, a, b, IntVector512Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2041,7 +2084,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::AND); + assertArraysEquals(r, a, b, mask, IntVector512Tests::AND); } static int AND_NOT(int a, int b) { @@ -2049,7 +2092,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void AND_NOTInt512VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, IntVector512Tests::AND_NOT); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void AND_NOTInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2082,7 +2125,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, IntVector512Tests::AND_NOT); } static int OR(int a, int b) { @@ -2090,7 +2133,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ORIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2103,7 +2146,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::OR); + assertArraysEquals(r, a, b, IntVector512Tests::OR); } static int or(int a, int b) { @@ -2111,7 +2154,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void orInt512VectorTests(IntFunction fa, IntFunction fb) { + static void orIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2122,11 +2165,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::or); + assertArraysEquals(r, a, b, IntVector512Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2142,7 +2185,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::OR); + assertArraysEquals(r, a, b, mask, IntVector512Tests::OR); } static int XOR(int a, int b) { @@ -2150,7 +2193,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void XORInt512VectorTests(IntFunction fa, IntFunction fb) { + static void XORIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2163,11 +2206,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::XOR); + assertArraysEquals(r, a, b, IntVector512Tests::XOR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void XORInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2183,7 +2226,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::XOR); + assertArraysEquals(r, a, b, mask, IntVector512Tests::XOR); } static int COMPRESS_BITS(int a, int b) { @@ -2191,7 +2234,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void COMPRESS_BITSInt512VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2204,11 +2247,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, IntVector512Tests::COMPRESS_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void COMPRESS_BITSInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2224,7 +2267,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, IntVector512Tests::COMPRESS_BITS); } static int EXPAND_BITS(int a, int b) { @@ -2232,7 +2275,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void EXPAND_BITSInt512VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2245,11 +2288,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, IntVector512Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void EXPAND_BITSInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2265,11 +2308,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, IntVector512Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpProvider") - static void addInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2279,11 +2322,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2296,11 +2339,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, IntVector512Tests::add); } @Test(dataProvider = "intBinaryOpProvider") - static void subInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2310,11 +2353,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2327,11 +2370,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, IntVector512Tests::sub); } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2358,11 +2401,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, IntVector512Tests::mul); } @Test(dataProvider = "intBinaryOpProvider") - static void divInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2374,11 +2417,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2393,11 +2436,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, IntVector512Tests::div); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2407,11 +2450,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void orInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2421,11 +2464,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::or); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2438,11 +2481,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, IntVector512Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2452,11 +2495,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void andInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2466,11 +2509,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::and); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2483,11 +2526,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, IntVector512Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2497,11 +2540,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, IntVector512Tests::OR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2514,11 +2557,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector512Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDIntVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2528,11 +2571,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, IntVector512Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDIntVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2545,7 +2588,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector512Tests::ADD); } static int LSHL(int a, int b) { @@ -2553,7 +2596,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2566,11 +2609,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::LSHL); + assertArraysEquals(r, a, b, IntVector512Tests::LSHL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2586,7 +2629,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, IntVector512Tests::LSHL); } static int ASHR(int a, int b) { @@ -2594,7 +2637,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2607,11 +2650,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::ASHR); + assertArraysEquals(r, a, b, IntVector512Tests::ASHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2627,7 +2670,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, IntVector512Tests::ASHR); } static int LSHR(int a, int b) { @@ -2635,7 +2678,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2648,11 +2691,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::LSHR); + assertArraysEquals(r, a, b, IntVector512Tests::LSHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2668,7 +2711,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, IntVector512Tests::LSHR); } static int LSHL_unary(int a, int b) { @@ -2676,7 +2719,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLIntVector512TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2688,11 +2731,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, IntVector512Tests::LSHL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2707,7 +2750,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector512Tests::LSHL_unary); } static int LSHR_unary(int a, int b) { @@ -2715,7 +2758,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRIntVector512TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2727,11 +2770,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, IntVector512Tests::LSHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2746,7 +2789,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector512Tests::LSHR_unary); } static int ASHR_unary(int a, int b) { @@ -2754,7 +2797,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRIntVector512TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2766,11 +2809,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, IntVector512Tests::ASHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2785,7 +2828,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector512Tests::ASHR_unary); } static int ROR(int a, int b) { @@ -2793,7 +2836,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt512VectorTests(IntFunction fa, IntFunction fb) { + static void RORIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2806,11 +2849,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::ROR); + assertArraysEquals(r, a, b, IntVector512Tests::ROR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2826,7 +2869,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::ROR); + assertArraysEquals(r, a, b, mask, IntVector512Tests::ROR); } static int ROL(int a, int b) { @@ -2834,7 +2877,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ROLIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2847,11 +2890,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::ROL); + assertArraysEquals(r, a, b, IntVector512Tests::ROL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2867,7 +2910,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::ROL); + assertArraysEquals(r, a, b, mask, IntVector512Tests::ROL); } static int ROR_unary(int a, int b) { @@ -2875,7 +2918,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORIntVector512TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2887,11 +2930,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, IntVector512Tests::ROR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORIntVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2906,7 +2949,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector512Tests::ROR_unary); } static int ROL_unary(int a, int b) { @@ -2914,7 +2957,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLIntVector512TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2926,11 +2969,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, IntVector512Tests::ROL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2945,14 +2988,14 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector512Tests::ROL_unary); } static int LSHR_binary_const(int a) { return (int)((a >>> CONST_SHIFT)); } @Test(dataProvider = "intUnaryOpProvider") - static void LSHRInt512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRIntVector512TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2963,11 +3006,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, IntVector512Tests::LSHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHRInt512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRIntVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2981,7 +3024,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector512Tests::LSHR_binary_const); } static int LSHL_binary_const(int a) { @@ -2989,7 +3032,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LSHLInt512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLIntVector512TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3000,11 +3043,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, IntVector512Tests::LSHL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHLInt512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLIntVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3018,7 +3061,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector512Tests::LSHL_binary_const); } static int ASHR_binary_const(int a) { @@ -3026,7 +3069,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ASHRInt512VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRIntVector512TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3037,11 +3080,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, IntVector512Tests::ASHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ASHRInt512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRIntVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3055,7 +3098,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector512Tests::ASHR_binary_const); } static int ROR_binary_const(int a) { @@ -3063,7 +3106,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void RORInt512VectorTestsScalarShiftConst(IntFunction fa) { + static void RORIntVector512TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3074,11 +3117,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, IntVector512Tests::ROR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void RORInt512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORIntVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3092,7 +3135,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector512Tests::ROR_binary_const); } static int ROL_binary_const(int a) { @@ -3100,7 +3143,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ROLInt512VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLIntVector512TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3111,11 +3154,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, IntVector512Tests::ROL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ROLInt512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLIntVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3129,14 +3172,14 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector512Tests::ROL_binary_const); } static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MINInt512VectorTestsWithMemOp(IntFunction fa) { + static void MINIntVector512TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int512VectorTests::MIN); + assertArraysEquals(r, a, (int)10, IntVector512Tests::MIN); } static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void minInt512VectorTestsWithMemOp(IntFunction fa) { + static void minIntVector512TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int512VectorTests::min); + assertArraysEquals(r, a, (int)10, IntVector512Tests::min); } static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINInt512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINIntVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,13 +3226,13 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int512VectorTests::MIN); + assertArraysEquals(r, a, (int)10, mask, IntVector512Tests::MIN); } static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MAXInt512VectorTestsWithMemOp(IntFunction fa) { + static void MAXIntVector512TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3200,13 +3243,13 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int512VectorTests::MAX); + assertArraysEquals(r, a, (int)10, IntVector512Tests::MAX); } static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void maxInt512VectorTestsWithMemOp(IntFunction fa) { + static void maxIntVector512TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3217,13 +3260,13 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int512VectorTests::max); + assertArraysEquals(r, a, (int)10, IntVector512Tests::max); } static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXInt512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXIntVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3236,7 +3279,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int512VectorTests::MAX); + assertArraysEquals(r, a, (int)10, mask, IntVector512Tests::MAX); } static int MIN(int a, int b) { @@ -3244,7 +3287,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt512VectorTests(IntFunction fa, IntFunction fb) { + static void MINIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3257,7 +3300,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::MIN); + assertArraysEquals(r, a, b, IntVector512Tests::MIN); } static int min(int a, int b) { @@ -3265,7 +3308,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void minInt512VectorTests(IntFunction fa, IntFunction fb) { + static void minIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3276,7 +3319,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::min); + assertArraysEquals(r, a, b, IntVector512Tests::min); } static int MAX(int a, int b) { @@ -3284,7 +3327,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt512VectorTests(IntFunction fa, IntFunction fb) { + static void MAXIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3297,7 +3340,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::MAX); + assertArraysEquals(r, a, b, IntVector512Tests::MAX); } static int max(int a, int b) { @@ -3305,7 +3348,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maxIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3316,7 +3359,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int512VectorTests::max); + assertArraysEquals(r, a, b, IntVector512Tests::max); } static int UMIN(int a, int b) { @@ -3324,7 +3367,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMINInt512VectorTests(IntFunction fa, IntFunction fb) { + static void UMINIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3337,11 +3380,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::UMIN); + assertArraysEquals(r, a, b, IntVector512Tests::UMIN); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMINInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3357,7 +3400,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, IntVector512Tests::UMIN); } static int UMAX(int a, int b) { @@ -3365,7 +3408,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMAXInt512VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3378,11 +3421,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::UMAX); + assertArraysEquals(r, a, b, IntVector512Tests::UMAX); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMAXInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3398,7 +3441,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, IntVector512Tests::UMAX); } static int SADD(int a, int b) { @@ -3406,7 +3449,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SADDInt512VectorTests(IntFunction fa, IntFunction fb) { + static void SADDIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3419,11 +3462,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::SADD); + assertArraysEquals(r, a, b, IntVector512Tests::SADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SADDInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3439,7 +3482,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::SADD); + assertArraysEquals(r, a, b, mask, IntVector512Tests::SADD); } static int SSUB(int a, int b) { @@ -3447,7 +3490,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SSUBInt512VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3460,11 +3503,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::SSUB); + assertArraysEquals(r, a, b, IntVector512Tests::SSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SSUBInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3480,7 +3523,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, IntVector512Tests::SSUB); } static int SUADD(int a, int b) { @@ -3488,7 +3531,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUADDInt512VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3501,11 +3544,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::SUADD); + assertArraysEquals(r, a, b, IntVector512Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUADDInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3521,7 +3564,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, IntVector512Tests::SUADD); } static int SUSUB(int a, int b) { @@ -3529,7 +3572,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUSUBInt512VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3542,11 +3585,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::SUSUB); + assertArraysEquals(r, a, b, IntVector512Tests::SUSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUSUBInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3562,11 +3605,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, IntVector512Tests::SUSUB); } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3576,11 +3619,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::MIN); } @Test(dataProvider = "intBinaryOpProvider") - static void minInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3590,11 +3633,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::min); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::min); } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3604,11 +3647,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::MAX); } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3618,10 +3661,10 @@ public class Int512VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int512VectorTests::max); + assertBroadcastArraysEquals(r, a, b, IntVector512Tests::max); } @Test(dataProvider = "intSaturatingBinaryOpAssocProvider") - static void SUADDAssocInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocIntVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -3638,11 +3681,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Int512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, IntVector512Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3663,7 +3706,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Int512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, IntVector512Tests::SUADD); } static int ANDReduce(int[] a, int idx) { @@ -3685,7 +3728,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ANDReduceInt512VectorTests(IntFunction fa) { + static void ANDReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3701,7 +3744,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::ANDReduce, Int512VectorTests::ANDReduceAll); + IntVector512Tests::ANDReduce, IntVector512Tests::ANDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3709,20 +3752,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = AND_IDENTITY; - Assert.assertEquals((int) (id & id), id, + assertEquals((int) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id & x), x); - Assert.assertEquals((int) (x & id), x); + assertEquals((int) (id & x), x); + assertEquals((int) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id & x), x, + assertEquals((int) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x & id), x, + assertEquals((int) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3747,7 +3790,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ANDReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3765,7 +3808,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::ANDReduceMasked, Int512VectorTests::ANDReduceAllMasked); + IntVector512Tests::ANDReduceMasked, IntVector512Tests::ANDReduceAllMasked); } static int ORReduce(int[] a, int idx) { @@ -3787,7 +3830,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ORReduceInt512VectorTests(IntFunction fa) { + static void ORReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3803,7 +3846,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::ORReduce, Int512VectorTests::ORReduceAll); + IntVector512Tests::ORReduce, IntVector512Tests::ORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3811,20 +3854,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = OR_IDENTITY; - Assert.assertEquals((int) (id | id), id, + assertEquals((int) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id | x), x); - Assert.assertEquals((int) (x | id), x); + assertEquals((int) (id | x), x); + assertEquals((int) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id | x), x, + assertEquals((int) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x | id), x, + assertEquals((int) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3849,7 +3892,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ORReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3867,7 +3910,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::ORReduceMasked, Int512VectorTests::ORReduceAllMasked); + IntVector512Tests::ORReduceMasked, IntVector512Tests::ORReduceAllMasked); } static int XORReduce(int[] a, int idx) { @@ -3889,7 +3932,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void XORReduceInt512VectorTests(IntFunction fa) { + static void XORReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3905,7 +3948,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::XORReduce, Int512VectorTests::XORReduceAll); + IntVector512Tests::XORReduce, IntVector512Tests::XORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3913,20 +3956,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = XOR_IDENTITY; - Assert.assertEquals((int) (id ^ id), id, + assertEquals((int) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id ^ x), x); - Assert.assertEquals((int) (x ^ id), x); + assertEquals((int) (id ^ x), x); + assertEquals((int) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id ^ x), x, + assertEquals((int) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x ^ id), x, + assertEquals((int) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3951,7 +3994,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void XORReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3969,7 +4012,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::XORReduceMasked, Int512VectorTests::XORReduceAllMasked); + IntVector512Tests::XORReduceMasked, IntVector512Tests::XORReduceAllMasked); } static int ADDReduce(int[] a, int idx) { @@ -3991,7 +4034,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceInt512VectorTests(IntFunction fa) { + static void ADDReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4007,7 +4050,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::ADDReduce, Int512VectorTests::ADDReduceAll); + IntVector512Tests::ADDReduce, IntVector512Tests::ADDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4015,20 +4058,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = ADD_IDENTITY; - Assert.assertEquals((int) (id + id), id, + assertEquals((int) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id + x), x); - Assert.assertEquals((int) (x + id), x); + assertEquals((int) (id + x), x); + assertEquals((int) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id + x), x, + assertEquals((int) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x + id), x, + assertEquals((int) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4053,7 +4096,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4071,7 +4114,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::ADDReduceMasked, Int512VectorTests::ADDReduceAllMasked); + IntVector512Tests::ADDReduceMasked, IntVector512Tests::ADDReduceAllMasked); } static int MULReduce(int[] a, int idx) { @@ -4093,7 +4136,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MULReduceInt512VectorTests(IntFunction fa) { + static void MULReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4109,7 +4152,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::MULReduce, Int512VectorTests::MULReduceAll); + IntVector512Tests::MULReduce, IntVector512Tests::MULReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4117,20 +4160,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MUL_IDENTITY; - Assert.assertEquals((int) (id * id), id, + assertEquals((int) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id * x), x); - Assert.assertEquals((int) (x * id), x); + assertEquals((int) (id * x), x); + assertEquals((int) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id * x), x, + assertEquals((int) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x * id), x, + assertEquals((int) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4155,7 +4198,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MULReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4173,7 +4216,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::MULReduceMasked, Int512VectorTests::MULReduceAllMasked); + IntVector512Tests::MULReduceMasked, IntVector512Tests::MULReduceAllMasked); } static int MINReduce(int[] a, int idx) { @@ -4195,7 +4238,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MINReduceInt512VectorTests(IntFunction fa) { + static void MINReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4211,7 +4254,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::MINReduce, Int512VectorTests::MINReduceAll); + IntVector512Tests::MINReduce, IntVector512Tests::MINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4219,20 +4262,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MIN_IDENTITY; - Assert.assertEquals((int) Math.min(id, id), id, + assertEquals((int) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.min(id, x), x); - Assert.assertEquals((int) Math.min(x, id), x); + assertEquals((int) Math.min(id, x), x); + assertEquals((int) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.min(id, x), x, + assertEquals((int) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.min(x, id), x, + assertEquals((int) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4257,7 +4300,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4275,7 +4318,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::MINReduceMasked, Int512VectorTests::MINReduceAllMasked); + IntVector512Tests::MINReduceMasked, IntVector512Tests::MINReduceAllMasked); } static int MAXReduce(int[] a, int idx) { @@ -4297,7 +4340,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MAXReduceInt512VectorTests(IntFunction fa) { + static void MAXReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4313,7 +4356,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::MAXReduce, Int512VectorTests::MAXReduceAll); + IntVector512Tests::MAXReduce, IntVector512Tests::MAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4321,20 +4364,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MAX_IDENTITY; - Assert.assertEquals((int) Math.max(id, id), id, + assertEquals((int) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.max(id, x), x); - Assert.assertEquals((int) Math.max(x, id), x); + assertEquals((int) Math.max(id, x), x); + assertEquals((int) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.max(id, x), x, + assertEquals((int) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.max(x, id), x, + assertEquals((int) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4359,7 +4402,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4377,7 +4420,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::MAXReduceMasked, Int512VectorTests::MAXReduceAllMasked); + IntVector512Tests::MAXReduceMasked, IntVector512Tests::MAXReduceAllMasked); } static int UMINReduce(int[] a, int idx) { @@ -4399,7 +4442,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMINReduceInt512VectorTests(IntFunction fa) { + static void UMINReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4415,7 +4458,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::UMINReduce, Int512VectorTests::UMINReduceAll); + IntVector512Tests::UMINReduce, IntVector512Tests::UMINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4423,20 +4466,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMIN_IDENTITY; - Assert.assertEquals((int) VectorMath.minUnsigned(id, id), id, + assertEquals((int) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x); + assertEquals((int) VectorMath.minUnsigned(id, x), x); + assertEquals((int) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x, + assertEquals((int) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x, + assertEquals((int) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4461,7 +4504,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMINReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4479,7 +4522,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::UMINReduceMasked, Int512VectorTests::UMINReduceAllMasked); + IntVector512Tests::UMINReduceMasked, IntVector512Tests::UMINReduceAllMasked); } static int UMAXReduce(int[] a, int idx) { @@ -4501,7 +4544,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMAXReduceInt512VectorTests(IntFunction fa) { + static void UMAXReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4517,7 +4560,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::UMAXReduce, Int512VectorTests::UMAXReduceAll); + IntVector512Tests::UMAXReduce, IntVector512Tests::UMAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4525,20 +4568,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMAX_IDENTITY; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, id), id, + assertEquals((int) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x); + assertEquals((int) VectorMath.maxUnsigned(id, x), x); + assertEquals((int) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x, + assertEquals((int) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x, + assertEquals((int) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4563,7 +4606,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMAXReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4581,7 +4624,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::UMAXReduceMasked, Int512VectorTests::UMAXReduceAllMasked); + IntVector512Tests::UMAXReduceMasked, IntVector512Tests::UMAXReduceAllMasked); } static int FIRST_NONZEROReduce(int[] a, int idx) { @@ -4603,7 +4646,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void FIRST_NONZEROReduceInt512VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4619,7 +4662,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::FIRST_NONZEROReduce, Int512VectorTests::FIRST_NONZEROReduceAll); + IntVector512Tests::FIRST_NONZEROReduce, IntVector512Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4627,20 +4670,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4665,7 +4708,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void FIRST_NONZEROReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4683,7 +4726,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::FIRST_NONZEROReduceMasked, Int512VectorTests::FIRST_NONZEROReduceAllMasked); + IntVector512Tests::FIRST_NONZEROReduceMasked, IntVector512Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4696,7 +4739,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueInt512VectorTests(IntFunction fm) { + static void anyTrueIntVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4707,7 +4750,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int512VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, IntVector512Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4720,7 +4763,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueInt512VectorTests(IntFunction fm) { + static void allTrueIntVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4731,7 +4774,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int512VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, IntVector512Tests::allTrue); } static int SUADDReduce(int[] a, int idx) { @@ -4753,7 +4796,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingUnaryOpProvider") - static void SUADDReduceInt512VectorTests(IntFunction fa) { + static void SUADDReduceIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4769,7 +4812,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int512VectorTests::SUADDReduce, Int512VectorTests::SUADDReduceAll); + IntVector512Tests::SUADDReduce, IntVector512Tests::SUADDReduceAll); } @Test(dataProvider = "intSaturatingUnaryOpProvider") @@ -4777,20 +4820,20 @@ public class Int512VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = SUADD_IDENTITY; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4814,7 +4857,7 @@ public class Int512VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "intSaturatingUnaryOpMaskProvider") - static void SUADDReduceInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4832,11 +4875,11 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::SUADDReduceMasked, Int512VectorTests::SUADDReduceAllMasked); + IntVector512Tests::SUADDReduceMasked, IntVector512Tests::SUADDReduceAllMasked); } @Test(dataProvider = "intBinaryOpProvider") - static void withInt512VectorTests(IntFunction fa, IntFunction fb) { + static void withIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -4859,7 +4902,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_DEFAULTInt512VectorTests(IntFunction fa) { + static void IS_DEFAULTIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4869,14 +4912,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_DEFAULTMaskedInt512VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4889,7 +4932,7 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4900,7 +4943,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_NEGATIVEInt512VectorTests(IntFunction fa) { + static void IS_NEGATIVEIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4910,14 +4953,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_NEGATIVEMaskedInt512VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4930,14 +4973,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt512VectorTests(IntFunction fa, IntFunction fb) { + static void LTIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4949,14 +4992,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ltInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ltIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4968,14 +5011,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4991,14 +5034,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GTInt512VectorTests(IntFunction fa, IntFunction fb) { + static void GTIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5010,14 +5053,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GTInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5033,14 +5076,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt512VectorTests(IntFunction fa, IntFunction fb) { + static void EQIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5052,14 +5095,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt512VectorTests(IntFunction fa, IntFunction fb) { + static void eqIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5071,14 +5114,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5094,14 +5137,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void NEInt512VectorTests(IntFunction fa, IntFunction fb) { + static void NEIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5113,14 +5156,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void NEInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5136,14 +5179,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LEInt512VectorTests(IntFunction fa, IntFunction fb) { + static void LEIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5155,14 +5198,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LEInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5178,14 +5221,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GEInt512VectorTests(IntFunction fa, IntFunction fb) { + static void GEIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5197,14 +5240,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GEInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5220,14 +5263,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULTInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ULTIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5239,14 +5282,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULTInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5262,14 +5305,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGTInt512VectorTests(IntFunction fa, IntFunction fb) { + static void UGTIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5281,14 +5324,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGTInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5304,14 +5347,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULEInt512VectorTests(IntFunction fa, IntFunction fb) { + static void ULEIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5323,14 +5366,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULEInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5346,14 +5389,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGEInt512VectorTests(IntFunction fa, IntFunction fb) { + static void UGEIntVector512Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5365,14 +5408,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGEInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5388,14 +5431,14 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5405,13 +5448,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5425,13 +5468,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5441,13 +5484,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTIntVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5461,13 +5504,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5477,13 +5520,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5497,13 +5540,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5513,13 +5556,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQIntVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5533,7 +5576,7 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); } } } @@ -5543,7 +5586,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt512VectorTests(IntFunction fa, IntFunction fb, + static void blendIntVector512Tests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5559,11 +5602,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int512VectorTests::blend); + assertArraysEquals(r, a, b, mask, IntVector512Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void RearrangeInt512VectorTests(IntFunction fa, + static void RearrangeIntVector512Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5580,7 +5623,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void RearrangeInt512VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeIntVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -5598,7 +5641,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void compressInt512VectorTests(IntFunction fa, + static void compressIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5616,7 +5659,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void expandInt512VectorTests(IntFunction fa, + static void expandIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5634,7 +5677,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void getInt512VectorTests(IntFunction fa) { + static void getIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5790,7 +5833,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastInt512VectorTests(IntFunction fa) { + static void BroadcastIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5804,7 +5847,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZeroInt512VectorTests(IntFunction fa) { + static void ZeroIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5814,7 +5857,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static int[] sliceUnary(int[] a, int origin, int idx) { @@ -5829,7 +5872,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void sliceUnaryInt512VectorTests(IntFunction fa) { + static void sliceUnaryIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5840,7 +5883,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int512VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, IntVector512Tests::sliceUnary); } static int[] sliceBinary(int[] a, int[] b, int origin, int idx) { @@ -5857,7 +5900,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void sliceBinaryInt512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryIntVector512TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5870,7 +5913,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Int512VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, IntVector512Tests::sliceBinary); } static int[] slice(int[] a, int[] b, int origin, boolean[] mask, int idx) { @@ -5887,7 +5930,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void sliceInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5904,7 +5947,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Int512VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, IntVector512Tests::slice); } static int[] unsliceUnary(int[] a, int origin, int idx) { @@ -5921,7 +5964,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void unsliceUnaryInt512VectorTests(IntFunction fa) { + static void unsliceUnaryIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5932,7 +5975,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int512VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, IntVector512Tests::unsliceUnary); } static int[] unsliceBinary(int[] a, int[] b, int origin, int part, int idx) { @@ -5958,7 +6001,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void unsliceBinaryInt512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryIntVector512TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5972,7 +6015,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Int512VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, IntVector512Tests::unsliceBinary); } static int[] unslice(int[] a, int[] b, int origin, int part, boolean[] mask, int idx) { @@ -6012,7 +6055,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void unsliceInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6029,7 +6072,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Int512VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, IntVector512Tests::unslice); } static int BITWISE_BLEND(int a, int b, int c) { @@ -6041,7 +6084,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6056,11 +6099,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Int512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6073,11 +6116,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Int512VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, IntVector512Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6095,11 +6138,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Int512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6110,11 +6153,11 @@ public class Int512VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6125,11 +6168,11 @@ public class Int512VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Int512VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int512VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, IntVector512Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Int512VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int512VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector512Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6174,11 +6217,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Int512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt512VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector512TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6193,11 +6236,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Int512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6208,11 +6251,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6223,11 +6266,11 @@ public class Int512VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int512VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector512Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector512TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6241,7 +6284,7 @@ public class Int512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Int512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntVector512Tests::BITWISE_BLEND); } static int NEG(int a) { @@ -6253,7 +6296,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NEGInt512VectorTests(IntFunction fa) { + static void NEGIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6264,11 +6307,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::NEG); + assertArraysEquals(r, a, IntVector512Tests::NEG); } @Test(dataProvider = "intUnaryOpProvider") - static void negInt512VectorTests(IntFunction fa) { + static void negIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6279,11 +6322,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::neg); + assertArraysEquals(r, a, IntVector512Tests::neg); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NEGMaskedInt512VectorTests(IntFunction fa, + static void NEGMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6297,7 +6340,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::NEG); + assertArraysEquals(r, a, mask, IntVector512Tests::NEG); } static int ABS(int a) { @@ -6309,7 +6352,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ABSInt512VectorTests(IntFunction fa) { + static void ABSIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6320,11 +6363,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::ABS); + assertArraysEquals(r, a, IntVector512Tests::ABS); } @Test(dataProvider = "intUnaryOpProvider") - static void absInt512VectorTests(IntFunction fa) { + static void absIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6335,11 +6378,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::abs); + assertArraysEquals(r, a, IntVector512Tests::abs); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ABSMaskedInt512VectorTests(IntFunction fa, + static void ABSMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6353,7 +6396,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::ABS); + assertArraysEquals(r, a, mask, IntVector512Tests::ABS); } static int NOT(int a) { @@ -6365,7 +6408,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NOTInt512VectorTests(IntFunction fa) { + static void NOTIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6376,11 +6419,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::NOT); + assertArraysEquals(r, a, IntVector512Tests::NOT); } @Test(dataProvider = "intUnaryOpProvider") - static void notInt512VectorTests(IntFunction fa) { + static void notIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6391,11 +6434,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::not); + assertArraysEquals(r, a, IntVector512Tests::not); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NOTMaskedInt512VectorTests(IntFunction fa, + static void NOTMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6409,7 +6452,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::NOT); + assertArraysEquals(r, a, mask, IntVector512Tests::NOT); } static int ZOMO(int a) { @@ -6417,7 +6460,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZOMOInt512VectorTests(IntFunction fa) { + static void ZOMOIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6428,11 +6471,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::ZOMO); + assertArraysEquals(r, a, IntVector512Tests::ZOMO); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ZOMOMaskedInt512VectorTests(IntFunction fa, + static void ZOMOMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6446,7 +6489,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::ZOMO); + assertArraysEquals(r, a, mask, IntVector512Tests::ZOMO); } static int BIT_COUNT(int a) { @@ -6454,7 +6497,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BIT_COUNTInt512VectorTests(IntFunction fa) { + static void BIT_COUNTIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6465,11 +6508,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, IntVector512Tests::BIT_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void BIT_COUNTMaskedInt512VectorTests(IntFunction fa, + static void BIT_COUNTMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6483,7 +6526,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, IntVector512Tests::BIT_COUNT); } static int TRAILING_ZEROS_COUNT(int a) { @@ -6491,7 +6534,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void TRAILING_ZEROS_COUNTInt512VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6502,11 +6545,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector512Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedInt512VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6520,7 +6563,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector512Tests::TRAILING_ZEROS_COUNT); } static int LEADING_ZEROS_COUNT(int a) { @@ -6528,7 +6571,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LEADING_ZEROS_COUNTInt512VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6539,11 +6582,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector512Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedInt512VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6557,7 +6600,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector512Tests::LEADING_ZEROS_COUNT); } static int REVERSE(int a) { @@ -6565,7 +6608,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSEInt512VectorTests(IntFunction fa) { + static void REVERSEIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6576,11 +6619,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::REVERSE); + assertArraysEquals(r, a, IntVector512Tests::REVERSE); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSEMaskedInt512VectorTests(IntFunction fa, + static void REVERSEMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6594,7 +6637,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::REVERSE); + assertArraysEquals(r, a, mask, IntVector512Tests::REVERSE); } static int REVERSE_BYTES(int a) { @@ -6602,7 +6645,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSE_BYTESInt512VectorTests(IntFunction fa) { + static void REVERSE_BYTESIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6613,11 +6656,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, IntVector512Tests::REVERSE_BYTES); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedInt512VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedIntVector512Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6631,7 +6674,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, IntVector512Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6639,7 +6682,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandIntVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6652,7 +6695,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::band); + assertArraysEquals(r, a, b, IntVector512Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6660,7 +6703,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maskorIntVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6673,7 +6716,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::bor); + assertArraysEquals(r, a, b, IntVector512Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6681,7 +6724,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorIntVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6694,7 +6737,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::bxor); + assertArraysEquals(r, a, b, IntVector512Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6702,7 +6745,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotIntVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6715,7 +6758,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::bandNot); + assertArraysEquals(r, a, b, IntVector512Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6723,7 +6766,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqIntVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6736,7 +6779,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int512VectorTests::beq); + assertArraysEquals(r, a, b, IntVector512Tests::beq); } static boolean unot(boolean a) { @@ -6744,7 +6787,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotInt512VectorTests(IntFunction fa) { + static void masknotIntVector512Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6755,7 +6798,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int512VectorTests::unot); + assertArraysEquals(r, a, IntVector512Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6764,15 +6807,15 @@ public class Int512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongInt512VectorTests(IntFunction fa) { + static void maskFromToLongIntVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6786,7 +6829,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intCompareOpProvider") - static void ltInt512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltIntVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6796,13 +6839,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqIntVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6812,13 +6855,13 @@ public class Int512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intUnaryOpProvider") - static void toIntArrayInt512VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayIntVector512TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6829,7 +6872,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toLongArrayInt512VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayIntVector512TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6840,7 +6883,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toDoubleArrayInt512VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayIntVector512TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6851,7 +6894,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toStringInt512VectorTestsSmokeTest(IntFunction fa) { + static void toStringIntVector512TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6864,7 +6907,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void hashCodeInt512VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeIntVector512TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6897,7 +6940,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceLongInt512VectorTests(IntFunction fa) { + static void ADDReduceLongIntVector512Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6913,7 +6956,7 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Int512VectorTests::ADDReduceLong, Int512VectorTests::ADDReduceAllLong); + IntVector512Tests::ADDReduceLong, IntVector512Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(int[] a, int idx, boolean[] mask) { @@ -6936,7 +6979,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceLongInt512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongIntVector512TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6954,11 +6997,11 @@ public class Int512VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Int512VectorTests::ADDReduceLongMasked, Int512VectorTests::ADDReduceAllLongMasked); + IntVector512Tests::ADDReduceLongMasked, IntVector512Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastLongInt512VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongIntVector512TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -6969,7 +7012,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendIntVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6983,12 +7026,12 @@ public class Int512VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Int512VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector512Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void SelectFromInt512VectorTests(IntFunction fa, + static void SelectFromIntVector512Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -7004,7 +7047,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorIntVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] idx = fc.apply(SPECIES.length()); @@ -7022,7 +7065,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void SelectFromInt512VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromIntVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -7041,7 +7084,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousInt512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousIntVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7052,12 +7095,12 @@ public class Int512VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringInt512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringIntVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7071,7 +7114,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsInt512VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsIntVector512TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7080,12 +7123,12 @@ public class Int512VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsInt512VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsIntVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7095,13 +7138,13 @@ public class Int512VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeInt512VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeIntVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7123,7 +7166,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountInt512VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountIntVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7134,7 +7177,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int512VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, IntVector512Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7148,7 +7191,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueInt512VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueIntVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7159,7 +7202,7 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int512VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, IntVector512Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7173,7 +7216,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueInt512VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueIntVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7184,11 +7227,11 @@ public class Int512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int512VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, IntVector512Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressInt512VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressIntVector512TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7198,7 +7241,7 @@ public class Int512VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7216,7 +7259,7 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeInt512VectorTestsSmokeTest(int offset) { + static void indexInRangeIntVector512TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7224,13 +7267,13 @@ public class Int512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongInt512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongIntVector512TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7238,7 +7281,7 @@ public class Int512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7257,36 +7300,36 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundInt512VectorTestsSmokeTest(int length) { + static void loopBoundIntVector512TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongInt512VectorTestsSmokeTest(int _length) { + static void loopBoundLongIntVector512TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeInt512VectorTestsSmokeTest() { + static void ElementSizeIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Integer.SIZE); + assertEquals(elsize, Integer.SIZE); } @Test - static void VectorShapeInt512VectorTestsSmokeTest() { + static void VectorShapeIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_512_BIT)); } @Test - static void ShapeWithLanesInt512VectorTestsSmokeTest() { + static void ShapeWithLanesIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(int.class); @@ -7294,32 +7337,32 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeInt512VectorTestsSmokeTest() { + static void ElementTypeIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementType() == int.class); } @Test - static void SpeciesElementSizeInt512VectorTestsSmokeTest() { + static void SpeciesElementSizeIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementSize() == Integer.SIZE); } @Test - static void VectorTypeInt512VectorTestsSmokeTest() { + static void VectorTypeIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesInt512VectorTestsSmokeTest() { + static void WithLanesIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(int.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeInt512VectorTestsSmokeTest() { + static void WithShapeIntVector512TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7327,9 +7370,9 @@ public class Int512VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueInt512VectorTestsSmokeTest() { + static void MaskAllTrueIntVector512TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntVector64LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/IntVector64LoadStoreTests.java index a1fa9a8b16c..418a8bb8581 100644 --- a/test/jdk/jdk/incubator/vector/Int64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector64LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Int64VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation IntVector64LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class IntVector64LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = IntVector.SPECIES_64; @@ -61,14 +61,29 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 64); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(int[] r, int[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "intProviderForIOOBE") @@ -870,11 +885,11 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(int[] r, int[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Int64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Int64VectorTests.java b/test/jdk/jdk/incubator/vector/IntVector64Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Int64VectorTests.java rename to test/jdk/jdk/incubator/vector/IntVector64Tests.java index d64db80b94d..0715981e050 100644 --- a/test/jdk/jdk/incubator/vector/Int64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/IntVector64Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Int64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntVector64Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Int64VectorTests extends AbstractVectorTest { +public class IntVector64Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = IntVector.SPECIES_64; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(int actual, int expected, int delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(int actual, int expected, int delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final int CONST_SHIFT = Integer.SIZE / 2; @@ -96,10 +139,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { int[] ref = f.apply(a[i]); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Int64VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Int64VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Int64VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Int64VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Int64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (int)0); + assertEquals(r[i + k], (int)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Int64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (int)0); + assertEquals(r[i + j], (int)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Int64VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Int64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Int64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Int64VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Int64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(r, a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1543,7 +1586,7 @@ public class Int64VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); IntVector a = io.add((int)1); //[1,2] IntVector b = a.neg(); //[-1,-2] int[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1558,19 +1601,19 @@ public class Int64VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); IntVector uab0 = zab0.rearrange(unz0,zab1); IntVector uab1 = zab0.rearrange(unz1,zab1); int[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1585,7 +1628,7 @@ public class Int64VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1593,9 +1636,9 @@ public class Int64VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1624,7 +1667,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ADDIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1637,7 +1680,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::ADD); + assertArraysEquals(r, a, b, IntVector64Tests::ADD); } static int add(int a, int b) { @@ -1645,7 +1688,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void addInt64VectorTests(IntFunction fa, IntFunction fb) { + static void addIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1656,11 +1699,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::add); + assertArraysEquals(r, a, b, IntVector64Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1676,11 +1719,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::ADD); + assertArraysEquals(r, a, b, mask, IntVector64Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1694,7 +1737,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int64VectorTests::add); + assertArraysEquals(r, a, b, mask, IntVector64Tests::add); } static int SUB(int a, int b) { @@ -1702,7 +1745,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void SUBInt64VectorTests(IntFunction fa, IntFunction fb) { + static void SUBIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1715,7 +1758,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::SUB); + assertArraysEquals(r, a, b, IntVector64Tests::SUB); } static int sub(int a, int b) { @@ -1723,7 +1766,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void subInt64VectorTests(IntFunction fa, IntFunction fb) { + static void subIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1734,11 +1777,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::sub); + assertArraysEquals(r, a, b, IntVector64Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void SUBInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1754,11 +1797,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::SUB); + assertArraysEquals(r, a, b, mask, IntVector64Tests::SUB); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1772,7 +1815,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int64VectorTests::sub); + assertArraysEquals(r, a, b, mask, IntVector64Tests::sub); } static int MUL(int a, int b) { @@ -1780,7 +1823,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MULInt64VectorTests(IntFunction fa, IntFunction fb) { + static void MULIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1793,7 +1836,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::MUL); + assertArraysEquals(r, a, b, IntVector64Tests::MUL); } static int mul(int a, int b) { @@ -1801,7 +1844,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt64VectorTests(IntFunction fa, IntFunction fb) { + static void mulIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1812,11 +1855,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::mul); + assertArraysEquals(r, a, b, IntVector64Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void MULInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1832,11 +1875,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::MUL); + assertArraysEquals(r, a, b, mask, IntVector64Tests::MUL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1850,7 +1893,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Int64VectorTests::mul); + assertArraysEquals(r, a, b, mask, IntVector64Tests::mul); } static int DIV(int a, int b) { @@ -1858,7 +1901,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void DIVInt64VectorTests(IntFunction fa, IntFunction fb) { + static void DIVIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1873,7 +1916,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::DIV); + assertArraysEquals(r, a, b, IntVector64Tests::DIV); } static int div(int a, int b) { @@ -1881,7 +1924,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void divInt64VectorTests(IntFunction fa, IntFunction fb) { + static void divIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1896,11 +1939,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::div); + assertArraysEquals(r, a, b, IntVector64Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void DIVInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1918,11 +1961,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::DIV); + assertArraysEquals(r, a, b, mask, IntVector64Tests::DIV); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1940,7 +1983,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::div); + assertArraysEquals(r, a, b, mask, IntVector64Tests::div); } static int FIRST_NONZERO(int a, int b) { @@ -1948,7 +1991,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void FIRST_NONZEROInt64VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1961,11 +2004,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, IntVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void FIRST_NONZEROInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1981,7 +2024,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, IntVector64Tests::FIRST_NONZERO); } static int AND(int a, int b) { @@ -1989,7 +2032,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ANDIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2002,7 +2045,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::AND); + assertArraysEquals(r, a, b, IntVector64Tests::AND); } static int and(int a, int b) { @@ -2010,7 +2053,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void andInt64VectorTests(IntFunction fa, IntFunction fb) { + static void andIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2021,11 +2064,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::and); + assertArraysEquals(r, a, b, IntVector64Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2041,7 +2084,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::AND); + assertArraysEquals(r, a, b, mask, IntVector64Tests::AND); } static int AND_NOT(int a, int b) { @@ -2049,7 +2092,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void AND_NOTInt64VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2062,11 +2105,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, IntVector64Tests::AND_NOT); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void AND_NOTInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2082,7 +2125,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, IntVector64Tests::AND_NOT); } static int OR(int a, int b) { @@ -2090,7 +2133,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ORIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2103,7 +2146,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::OR); + assertArraysEquals(r, a, b, IntVector64Tests::OR); } static int or(int a, int b) { @@ -2111,7 +2154,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void orInt64VectorTests(IntFunction fa, IntFunction fb) { + static void orIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2122,11 +2165,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::or); + assertArraysEquals(r, a, b, IntVector64Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2142,7 +2185,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::OR); + assertArraysEquals(r, a, b, mask, IntVector64Tests::OR); } static int XOR(int a, int b) { @@ -2150,7 +2193,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void XORInt64VectorTests(IntFunction fa, IntFunction fb) { + static void XORIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2163,11 +2206,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::XOR); + assertArraysEquals(r, a, b, IntVector64Tests::XOR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void XORInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2183,7 +2226,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::XOR); + assertArraysEquals(r, a, b, mask, IntVector64Tests::XOR); } static int COMPRESS_BITS(int a, int b) { @@ -2191,7 +2234,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void COMPRESS_BITSInt64VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2204,11 +2247,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, IntVector64Tests::COMPRESS_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void COMPRESS_BITSInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2224,7 +2267,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, IntVector64Tests::COMPRESS_BITS); } static int EXPAND_BITS(int a, int b) { @@ -2232,7 +2275,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void EXPAND_BITSInt64VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2245,11 +2288,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, IntVector64Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void EXPAND_BITSInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2265,11 +2308,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, IntVector64Tests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpProvider") - static void addInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2279,11 +2322,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2296,11 +2339,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, IntVector64Tests::add); } @Test(dataProvider = "intBinaryOpProvider") - static void subInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2310,11 +2353,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2327,11 +2370,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, IntVector64Tests::sub); } @Test(dataProvider = "intBinaryOpProvider") - static void mulInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2341,11 +2384,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2358,11 +2401,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, IntVector64Tests::mul); } @Test(dataProvider = "intBinaryOpProvider") - static void divInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2374,11 +2417,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2393,11 +2436,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, IntVector64Tests::div); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2407,11 +2450,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void orInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2421,11 +2464,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::or); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2438,11 +2481,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, IntVector64Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ANDInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2452,11 +2495,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void andInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2466,11 +2509,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::and); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2483,11 +2526,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Int64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, IntVector64Tests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void ORInt64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2497,11 +2540,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, IntVector64Tests::OR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORInt64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2514,11 +2557,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector64Tests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ADDInt64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDIntVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2528,11 +2571,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Int64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, IntVector64Tests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDInt64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDIntVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2545,7 +2588,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Int64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector64Tests::ADD); } static int LSHL(int a, int b) { @@ -2553,7 +2596,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2566,11 +2609,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::LSHL); + assertArraysEquals(r, a, b, IntVector64Tests::LSHL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2586,7 +2629,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, IntVector64Tests::LSHL); } static int ASHR(int a, int b) { @@ -2594,7 +2637,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2607,11 +2650,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::ASHR); + assertArraysEquals(r, a, b, IntVector64Tests::ASHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2627,7 +2670,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, IntVector64Tests::ASHR); } static int LSHR(int a, int b) { @@ -2635,7 +2678,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2648,11 +2691,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::LSHR); + assertArraysEquals(r, a, b, IntVector64Tests::LSHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2668,7 +2711,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, IntVector64Tests::LSHR); } static int LSHL_unary(int a, int b) { @@ -2676,7 +2719,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLInt64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLIntVector64TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2688,11 +2731,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, IntVector64Tests::LSHL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLInt64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2707,7 +2750,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector64Tests::LSHL_unary); } static int LSHR_unary(int a, int b) { @@ -2715,7 +2758,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRInt64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRIntVector64TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2727,11 +2770,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, IntVector64Tests::LSHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRInt64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2746,7 +2789,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector64Tests::LSHR_unary); } static int ASHR_unary(int a, int b) { @@ -2754,7 +2797,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRInt64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRIntVector64TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2766,11 +2809,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, IntVector64Tests::ASHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRInt64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2785,7 +2828,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector64Tests::ASHR_unary); } static int ROR(int a, int b) { @@ -2793,7 +2836,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt64VectorTests(IntFunction fa, IntFunction fb) { + static void RORIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2806,11 +2849,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::ROR); + assertArraysEquals(r, a, b, IntVector64Tests::ROR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2826,7 +2869,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::ROR); + assertArraysEquals(r, a, b, mask, IntVector64Tests::ROR); } static int ROL(int a, int b) { @@ -2834,7 +2877,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ROLIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2847,11 +2890,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::ROL); + assertArraysEquals(r, a, b, IntVector64Tests::ROL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2867,7 +2910,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::ROL); + assertArraysEquals(r, a, b, mask, IntVector64Tests::ROL); } static int ROR_unary(int a, int b) { @@ -2875,7 +2918,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORInt64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORIntVector64TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2887,11 +2930,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, IntVector64Tests::ROR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORInt64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORIntVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2906,7 +2949,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector64Tests::ROR_unary); } static int ROL_unary(int a, int b) { @@ -2914,7 +2957,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLInt64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLIntVector64TestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2926,11 +2969,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Int64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, IntVector64Tests::ROL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLInt64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLIntVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2945,14 +2988,14 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Int64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVector64Tests::ROL_unary); } static int LSHR_binary_const(int a) { return (int)((a >>> CONST_SHIFT)); } @Test(dataProvider = "intUnaryOpProvider") - static void LSHRInt64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRIntVector64TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2963,11 +3006,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, IntVector64Tests::LSHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHRInt64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRIntVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2981,7 +3024,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector64Tests::LSHR_binary_const); } static int LSHL_binary_const(int a) { @@ -2989,7 +3032,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LSHLInt64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLIntVector64TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3000,11 +3043,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, IntVector64Tests::LSHL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHLInt64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLIntVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3018,7 +3061,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector64Tests::LSHL_binary_const); } static int ASHR_binary_const(int a) { @@ -3026,7 +3069,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ASHRInt64VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRIntVector64TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3037,11 +3080,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, IntVector64Tests::ASHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ASHRInt64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRIntVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3055,7 +3098,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector64Tests::ASHR_binary_const); } static int ROR_binary_const(int a) { @@ -3063,7 +3106,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void RORInt64VectorTestsScalarShiftConst(IntFunction fa) { + static void RORIntVector64TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3074,11 +3117,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, IntVector64Tests::ROR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void RORInt64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORIntVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3092,7 +3135,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, IntVector64Tests::ROR_binary_const); } static int ROL_binary_const(int a) { @@ -3100,7 +3143,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ROLInt64VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLIntVector64TestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3111,11 +3154,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Int64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, IntVector64Tests::ROL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ROLInt64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLIntVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3129,14 +3172,14 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Int64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, IntVector64Tests::ROL_binary_const); } static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MINInt64VectorTestsWithMemOp(IntFunction fa) { + static void MINIntVector64TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int64VectorTests::MIN); + assertArraysEquals(r, a, (int)10, IntVector64Tests::MIN); } static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void minInt64VectorTestsWithMemOp(IntFunction fa) { + static void minIntVector64TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int64VectorTests::min); + assertArraysEquals(r, a, (int)10, IntVector64Tests::min); } static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINInt64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINIntVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,13 +3226,13 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int64VectorTests::MIN); + assertArraysEquals(r, a, (int)10, mask, IntVector64Tests::MIN); } static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MAXInt64VectorTestsWithMemOp(IntFunction fa) { + static void MAXIntVector64TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3200,13 +3243,13 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int64VectorTests::MAX); + assertArraysEquals(r, a, (int)10, IntVector64Tests::MAX); } static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void maxInt64VectorTestsWithMemOp(IntFunction fa) { + static void maxIntVector64TestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3217,13 +3260,13 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, Int64VectorTests::max); + assertArraysEquals(r, a, (int)10, IntVector64Tests::max); } static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXInt64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXIntVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3236,7 +3279,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, Int64VectorTests::MAX); + assertArraysEquals(r, a, (int)10, mask, IntVector64Tests::MAX); } static int MIN(int a, int b) { @@ -3244,7 +3287,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt64VectorTests(IntFunction fa, IntFunction fb) { + static void MINIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3257,7 +3300,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::MIN); + assertArraysEquals(r, a, b, IntVector64Tests::MIN); } static int min(int a, int b) { @@ -3265,7 +3308,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void minInt64VectorTests(IntFunction fa, IntFunction fb) { + static void minIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3276,7 +3319,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::min); + assertArraysEquals(r, a, b, IntVector64Tests::min); } static int MAX(int a, int b) { @@ -3284,7 +3327,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt64VectorTests(IntFunction fa, IntFunction fb) { + static void MAXIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3297,7 +3340,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::MAX); + assertArraysEquals(r, a, b, IntVector64Tests::MAX); } static int max(int a, int b) { @@ -3305,7 +3348,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maxIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3316,7 +3359,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Int64VectorTests::max); + assertArraysEquals(r, a, b, IntVector64Tests::max); } static int UMIN(int a, int b) { @@ -3324,7 +3367,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMINInt64VectorTests(IntFunction fa, IntFunction fb) { + static void UMINIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3337,11 +3380,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::UMIN); + assertArraysEquals(r, a, b, IntVector64Tests::UMIN); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMINInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3357,7 +3400,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, IntVector64Tests::UMIN); } static int UMAX(int a, int b) { @@ -3365,7 +3408,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMAXInt64VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3378,11 +3421,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::UMAX); + assertArraysEquals(r, a, b, IntVector64Tests::UMAX); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMAXInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3398,7 +3441,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, IntVector64Tests::UMAX); } static int SADD(int a, int b) { @@ -3406,7 +3449,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SADDInt64VectorTests(IntFunction fa, IntFunction fb) { + static void SADDIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3419,11 +3462,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::SADD); + assertArraysEquals(r, a, b, IntVector64Tests::SADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SADDInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3439,7 +3482,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::SADD); + assertArraysEquals(r, a, b, mask, IntVector64Tests::SADD); } static int SSUB(int a, int b) { @@ -3447,7 +3490,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SSUBInt64VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3460,11 +3503,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::SSUB); + assertArraysEquals(r, a, b, IntVector64Tests::SSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SSUBInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3480,7 +3523,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, IntVector64Tests::SSUB); } static int SUADD(int a, int b) { @@ -3488,7 +3531,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUADDInt64VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3501,11 +3544,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::SUADD); + assertArraysEquals(r, a, b, IntVector64Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUADDInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3521,7 +3564,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, IntVector64Tests::SUADD); } static int SUSUB(int a, int b) { @@ -3529,7 +3572,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUSUBInt64VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3542,11 +3585,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::SUSUB); + assertArraysEquals(r, a, b, IntVector64Tests::SUSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUSUBInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3562,11 +3605,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, IntVector64Tests::SUSUB); } @Test(dataProvider = "intBinaryOpProvider") - static void MINInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3576,11 +3619,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::MIN); } @Test(dataProvider = "intBinaryOpProvider") - static void minInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3590,11 +3633,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::min); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::min); } @Test(dataProvider = "intBinaryOpProvider") - static void MAXInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3604,11 +3647,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::MAX); } @Test(dataProvider = "intBinaryOpProvider") - static void maxInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3618,10 +3661,10 @@ public class Int64VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Int64VectorTests::max); + assertBroadcastArraysEquals(r, a, b, IntVector64Tests::max); } @Test(dataProvider = "intSaturatingBinaryOpAssocProvider") - static void SUADDAssocInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocIntVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -3638,11 +3681,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Int64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, IntVector64Tests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3663,7 +3706,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Int64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, IntVector64Tests::SUADD); } static int ANDReduce(int[] a, int idx) { @@ -3685,7 +3728,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ANDReduceInt64VectorTests(IntFunction fa) { + static void ANDReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3701,7 +3744,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::ANDReduce, Int64VectorTests::ANDReduceAll); + IntVector64Tests::ANDReduce, IntVector64Tests::ANDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3709,20 +3752,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = AND_IDENTITY; - Assert.assertEquals((int) (id & id), id, + assertEquals((int) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id & x), x); - Assert.assertEquals((int) (x & id), x); + assertEquals((int) (id & x), x); + assertEquals((int) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id & x), x, + assertEquals((int) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x & id), x, + assertEquals((int) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3747,7 +3790,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ANDReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3765,7 +3808,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::ANDReduceMasked, Int64VectorTests::ANDReduceAllMasked); + IntVector64Tests::ANDReduceMasked, IntVector64Tests::ANDReduceAllMasked); } static int ORReduce(int[] a, int idx) { @@ -3787,7 +3830,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ORReduceInt64VectorTests(IntFunction fa) { + static void ORReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3803,7 +3846,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::ORReduce, Int64VectorTests::ORReduceAll); + IntVector64Tests::ORReduce, IntVector64Tests::ORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3811,20 +3854,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = OR_IDENTITY; - Assert.assertEquals((int) (id | id), id, + assertEquals((int) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id | x), x); - Assert.assertEquals((int) (x | id), x); + assertEquals((int) (id | x), x); + assertEquals((int) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id | x), x, + assertEquals((int) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x | id), x, + assertEquals((int) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3849,7 +3892,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ORReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3867,7 +3910,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::ORReduceMasked, Int64VectorTests::ORReduceAllMasked); + IntVector64Tests::ORReduceMasked, IntVector64Tests::ORReduceAllMasked); } static int XORReduce(int[] a, int idx) { @@ -3889,7 +3932,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void XORReduceInt64VectorTests(IntFunction fa) { + static void XORReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3905,7 +3948,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::XORReduce, Int64VectorTests::XORReduceAll); + IntVector64Tests::XORReduce, IntVector64Tests::XORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3913,20 +3956,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = XOR_IDENTITY; - Assert.assertEquals((int) (id ^ id), id, + assertEquals((int) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id ^ x), x); - Assert.assertEquals((int) (x ^ id), x); + assertEquals((int) (id ^ x), x); + assertEquals((int) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id ^ x), x, + assertEquals((int) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x ^ id), x, + assertEquals((int) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3951,7 +3994,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void XORReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3969,7 +4012,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::XORReduceMasked, Int64VectorTests::XORReduceAllMasked); + IntVector64Tests::XORReduceMasked, IntVector64Tests::XORReduceAllMasked); } static int ADDReduce(int[] a, int idx) { @@ -3991,7 +4034,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceInt64VectorTests(IntFunction fa) { + static void ADDReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4007,7 +4050,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::ADDReduce, Int64VectorTests::ADDReduceAll); + IntVector64Tests::ADDReduce, IntVector64Tests::ADDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4015,20 +4058,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = ADD_IDENTITY; - Assert.assertEquals((int) (id + id), id, + assertEquals((int) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id + x), x); - Assert.assertEquals((int) (x + id), x); + assertEquals((int) (id + x), x); + assertEquals((int) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id + x), x, + assertEquals((int) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x + id), x, + assertEquals((int) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4053,7 +4096,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4071,7 +4114,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::ADDReduceMasked, Int64VectorTests::ADDReduceAllMasked); + IntVector64Tests::ADDReduceMasked, IntVector64Tests::ADDReduceAllMasked); } static int MULReduce(int[] a, int idx) { @@ -4093,7 +4136,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MULReduceInt64VectorTests(IntFunction fa) { + static void MULReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4109,7 +4152,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::MULReduce, Int64VectorTests::MULReduceAll); + IntVector64Tests::MULReduce, IntVector64Tests::MULReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4117,20 +4160,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MUL_IDENTITY; - Assert.assertEquals((int) (id * id), id, + assertEquals((int) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id * x), x); - Assert.assertEquals((int) (x * id), x); + assertEquals((int) (id * x), x); + assertEquals((int) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id * x), x, + assertEquals((int) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x * id), x, + assertEquals((int) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4155,7 +4198,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MULReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4173,7 +4216,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::MULReduceMasked, Int64VectorTests::MULReduceAllMasked); + IntVector64Tests::MULReduceMasked, IntVector64Tests::MULReduceAllMasked); } static int MINReduce(int[] a, int idx) { @@ -4195,7 +4238,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MINReduceInt64VectorTests(IntFunction fa) { + static void MINReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4211,7 +4254,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::MINReduce, Int64VectorTests::MINReduceAll); + IntVector64Tests::MINReduce, IntVector64Tests::MINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4219,20 +4262,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MIN_IDENTITY; - Assert.assertEquals((int) Math.min(id, id), id, + assertEquals((int) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.min(id, x), x); - Assert.assertEquals((int) Math.min(x, id), x); + assertEquals((int) Math.min(id, x), x); + assertEquals((int) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.min(id, x), x, + assertEquals((int) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.min(x, id), x, + assertEquals((int) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4257,7 +4300,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4275,7 +4318,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::MINReduceMasked, Int64VectorTests::MINReduceAllMasked); + IntVector64Tests::MINReduceMasked, IntVector64Tests::MINReduceAllMasked); } static int MAXReduce(int[] a, int idx) { @@ -4297,7 +4340,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MAXReduceInt64VectorTests(IntFunction fa) { + static void MAXReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4313,7 +4356,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::MAXReduce, Int64VectorTests::MAXReduceAll); + IntVector64Tests::MAXReduce, IntVector64Tests::MAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4321,20 +4364,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MAX_IDENTITY; - Assert.assertEquals((int) Math.max(id, id), id, + assertEquals((int) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.max(id, x), x); - Assert.assertEquals((int) Math.max(x, id), x); + assertEquals((int) Math.max(id, x), x); + assertEquals((int) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.max(id, x), x, + assertEquals((int) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.max(x, id), x, + assertEquals((int) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4359,7 +4402,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4377,7 +4420,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::MAXReduceMasked, Int64VectorTests::MAXReduceAllMasked); + IntVector64Tests::MAXReduceMasked, IntVector64Tests::MAXReduceAllMasked); } static int UMINReduce(int[] a, int idx) { @@ -4399,7 +4442,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMINReduceInt64VectorTests(IntFunction fa) { + static void UMINReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4415,7 +4458,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::UMINReduce, Int64VectorTests::UMINReduceAll); + IntVector64Tests::UMINReduce, IntVector64Tests::UMINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4423,20 +4466,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMIN_IDENTITY; - Assert.assertEquals((int) VectorMath.minUnsigned(id, id), id, + assertEquals((int) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x); + assertEquals((int) VectorMath.minUnsigned(id, x), x); + assertEquals((int) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x, + assertEquals((int) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x, + assertEquals((int) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4461,7 +4504,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMINReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4479,7 +4522,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::UMINReduceMasked, Int64VectorTests::UMINReduceAllMasked); + IntVector64Tests::UMINReduceMasked, IntVector64Tests::UMINReduceAllMasked); } static int UMAXReduce(int[] a, int idx) { @@ -4501,7 +4544,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMAXReduceInt64VectorTests(IntFunction fa) { + static void UMAXReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4517,7 +4560,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::UMAXReduce, Int64VectorTests::UMAXReduceAll); + IntVector64Tests::UMAXReduce, IntVector64Tests::UMAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4525,20 +4568,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMAX_IDENTITY; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, id), id, + assertEquals((int) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x); + assertEquals((int) VectorMath.maxUnsigned(id, x), x); + assertEquals((int) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x, + assertEquals((int) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x, + assertEquals((int) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4563,7 +4606,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMAXReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4581,7 +4624,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::UMAXReduceMasked, Int64VectorTests::UMAXReduceAllMasked); + IntVector64Tests::UMAXReduceMasked, IntVector64Tests::UMAXReduceAllMasked); } static int FIRST_NONZEROReduce(int[] a, int idx) { @@ -4603,7 +4646,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void FIRST_NONZEROReduceInt64VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4619,7 +4662,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::FIRST_NONZEROReduce, Int64VectorTests::FIRST_NONZEROReduceAll); + IntVector64Tests::FIRST_NONZEROReduce, IntVector64Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4627,20 +4670,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4665,7 +4708,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void FIRST_NONZEROReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4683,7 +4726,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::FIRST_NONZEROReduceMasked, Int64VectorTests::FIRST_NONZEROReduceAllMasked); + IntVector64Tests::FIRST_NONZEROReduceMasked, IntVector64Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4696,7 +4739,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueInt64VectorTests(IntFunction fm) { + static void anyTrueIntVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4707,7 +4750,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int64VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, IntVector64Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4720,7 +4763,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueInt64VectorTests(IntFunction fm) { + static void allTrueIntVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4731,7 +4774,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Int64VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, IntVector64Tests::allTrue); } static int SUADDReduce(int[] a, int idx) { @@ -4753,7 +4796,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingUnaryOpProvider") - static void SUADDReduceInt64VectorTests(IntFunction fa) { + static void SUADDReduceIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4769,7 +4812,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Int64VectorTests::SUADDReduce, Int64VectorTests::SUADDReduceAll); + IntVector64Tests::SUADDReduce, IntVector64Tests::SUADDReduceAll); } @Test(dataProvider = "intSaturatingUnaryOpProvider") @@ -4777,20 +4820,20 @@ public class Int64VectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = SUADD_IDENTITY; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4814,7 +4857,7 @@ public class Int64VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "intSaturatingUnaryOpMaskProvider") - static void SUADDReduceInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4832,11 +4875,11 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::SUADDReduceMasked, Int64VectorTests::SUADDReduceAllMasked); + IntVector64Tests::SUADDReduceMasked, IntVector64Tests::SUADDReduceAllMasked); } @Test(dataProvider = "intBinaryOpProvider") - static void withInt64VectorTests(IntFunction fa, IntFunction fb) { + static void withIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -4859,7 +4902,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_DEFAULTInt64VectorTests(IntFunction fa) { + static void IS_DEFAULTIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4869,14 +4912,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_DEFAULTMaskedInt64VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4889,7 +4932,7 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4900,7 +4943,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_NEGATIVEInt64VectorTests(IntFunction fa) { + static void IS_NEGATIVEIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4910,14 +4953,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_NEGATIVEMaskedInt64VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4930,14 +4973,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt64VectorTests(IntFunction fa, IntFunction fb) { + static void LTIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4949,14 +4992,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ltInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ltIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4968,14 +5011,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4991,14 +5034,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GTInt64VectorTests(IntFunction fa, IntFunction fb) { + static void GTIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5010,14 +5053,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GTInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5033,14 +5076,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt64VectorTests(IntFunction fa, IntFunction fb) { + static void EQIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5052,14 +5095,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt64VectorTests(IntFunction fa, IntFunction fb) { + static void eqIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5071,14 +5114,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5094,14 +5137,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void NEInt64VectorTests(IntFunction fa, IntFunction fb) { + static void NEIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5113,14 +5156,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void NEInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5136,14 +5179,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LEInt64VectorTests(IntFunction fa, IntFunction fb) { + static void LEIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5155,14 +5198,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LEInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5178,14 +5221,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GEInt64VectorTests(IntFunction fa, IntFunction fb) { + static void GEIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5197,14 +5240,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GEInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5220,14 +5263,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULTInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ULTIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5239,14 +5282,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULTInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5262,14 +5305,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGTInt64VectorTests(IntFunction fa, IntFunction fb) { + static void UGTIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5281,14 +5324,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGTInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5304,14 +5347,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULEInt64VectorTests(IntFunction fa, IntFunction fb) { + static void ULEIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5323,14 +5366,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULEInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5346,14 +5389,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGEInt64VectorTests(IntFunction fa, IntFunction fb) { + static void UGEIntVector64Tests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5365,14 +5408,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGEInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5388,14 +5431,14 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5405,13 +5448,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5425,13 +5468,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void LTInt64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5441,13 +5484,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTInt64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTIntVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5461,13 +5504,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5477,13 +5520,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5497,13 +5540,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQInt64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5513,13 +5556,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQInt64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQIntVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5533,7 +5576,7 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); } } } @@ -5543,7 +5586,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt64VectorTests(IntFunction fa, IntFunction fb, + static void blendIntVector64Tests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5559,11 +5602,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Int64VectorTests::blend); + assertArraysEquals(r, a, b, mask, IntVector64Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void RearrangeInt64VectorTests(IntFunction fa, + static void RearrangeIntVector64Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5580,7 +5623,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void RearrangeInt64VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeIntVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -5598,7 +5641,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void compressInt64VectorTests(IntFunction fa, + static void compressIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5616,7 +5659,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void expandInt64VectorTests(IntFunction fa, + static void expandIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5634,7 +5677,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void getInt64VectorTests(IntFunction fa) { + static void getIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5790,7 +5833,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastInt64VectorTests(IntFunction fa) { + static void BroadcastIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5804,7 +5847,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZeroInt64VectorTests(IntFunction fa) { + static void ZeroIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5814,7 +5857,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static int[] sliceUnary(int[] a, int origin, int idx) { @@ -5829,7 +5872,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void sliceUnaryInt64VectorTests(IntFunction fa) { + static void sliceUnaryIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5840,7 +5883,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int64VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, IntVector64Tests::sliceUnary); } static int[] sliceBinary(int[] a, int[] b, int origin, int idx) { @@ -5857,7 +5900,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void sliceBinaryInt64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryIntVector64TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5870,7 +5913,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Int64VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, IntVector64Tests::sliceBinary); } static int[] slice(int[] a, int[] b, int origin, boolean[] mask, int idx) { @@ -5887,7 +5930,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void sliceInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5904,7 +5947,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Int64VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, IntVector64Tests::slice); } static int[] unsliceUnary(int[] a, int origin, int idx) { @@ -5921,7 +5964,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void unsliceUnaryInt64VectorTests(IntFunction fa) { + static void unsliceUnaryIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5932,7 +5975,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Int64VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, IntVector64Tests::unsliceUnary); } static int[] unsliceBinary(int[] a, int[] b, int origin, int part, int idx) { @@ -5958,7 +6001,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void unsliceBinaryInt64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryIntVector64TestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5972,7 +6015,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Int64VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, IntVector64Tests::unsliceBinary); } static int[] unslice(int[] a, int[] b, int origin, int part, boolean[] mask, int idx) { @@ -6012,7 +6055,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void unsliceInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6029,7 +6072,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Int64VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, IntVector64Tests::unslice); } static int BITWISE_BLEND(int a, int b, int c) { @@ -6041,7 +6084,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6056,11 +6099,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Int64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6073,11 +6116,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Int64VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, IntVector64Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6095,11 +6138,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Int64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6110,11 +6153,11 @@ public class Int64VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6125,11 +6168,11 @@ public class Int64VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Int64VectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Int64VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, IntVector64Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Int64VectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Int64VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, IntVector64Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6174,11 +6217,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Int64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt64VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector64TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6193,11 +6236,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Int64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDInt64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6208,11 +6251,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendInt64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6223,11 +6266,11 @@ public class Int64VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Int64VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVector64Tests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDInt64VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVector64TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6241,7 +6284,7 @@ public class Int64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Int64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntVector64Tests::BITWISE_BLEND); } static int NEG(int a) { @@ -6253,7 +6296,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NEGInt64VectorTests(IntFunction fa) { + static void NEGIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6264,11 +6307,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::NEG); + assertArraysEquals(r, a, IntVector64Tests::NEG); } @Test(dataProvider = "intUnaryOpProvider") - static void negInt64VectorTests(IntFunction fa) { + static void negIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6279,11 +6322,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::neg); + assertArraysEquals(r, a, IntVector64Tests::neg); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NEGMaskedInt64VectorTests(IntFunction fa, + static void NEGMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6297,7 +6340,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::NEG); + assertArraysEquals(r, a, mask, IntVector64Tests::NEG); } static int ABS(int a) { @@ -6309,7 +6352,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ABSInt64VectorTests(IntFunction fa) { + static void ABSIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6320,11 +6363,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::ABS); + assertArraysEquals(r, a, IntVector64Tests::ABS); } @Test(dataProvider = "intUnaryOpProvider") - static void absInt64VectorTests(IntFunction fa) { + static void absIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6335,11 +6378,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::abs); + assertArraysEquals(r, a, IntVector64Tests::abs); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ABSMaskedInt64VectorTests(IntFunction fa, + static void ABSMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6353,7 +6396,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::ABS); + assertArraysEquals(r, a, mask, IntVector64Tests::ABS); } static int NOT(int a) { @@ -6365,7 +6408,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NOTInt64VectorTests(IntFunction fa) { + static void NOTIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6376,11 +6419,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::NOT); + assertArraysEquals(r, a, IntVector64Tests::NOT); } @Test(dataProvider = "intUnaryOpProvider") - static void notInt64VectorTests(IntFunction fa) { + static void notIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6391,11 +6434,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::not); + assertArraysEquals(r, a, IntVector64Tests::not); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NOTMaskedInt64VectorTests(IntFunction fa, + static void NOTMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6409,7 +6452,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::NOT); + assertArraysEquals(r, a, mask, IntVector64Tests::NOT); } static int ZOMO(int a) { @@ -6417,7 +6460,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZOMOInt64VectorTests(IntFunction fa) { + static void ZOMOIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6428,11 +6471,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::ZOMO); + assertArraysEquals(r, a, IntVector64Tests::ZOMO); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ZOMOMaskedInt64VectorTests(IntFunction fa, + static void ZOMOMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6446,7 +6489,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::ZOMO); + assertArraysEquals(r, a, mask, IntVector64Tests::ZOMO); } static int BIT_COUNT(int a) { @@ -6454,7 +6497,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BIT_COUNTInt64VectorTests(IntFunction fa) { + static void BIT_COUNTIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6465,11 +6508,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, IntVector64Tests::BIT_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void BIT_COUNTMaskedInt64VectorTests(IntFunction fa, + static void BIT_COUNTMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6483,7 +6526,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, IntVector64Tests::BIT_COUNT); } static int TRAILING_ZEROS_COUNT(int a) { @@ -6491,7 +6534,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void TRAILING_ZEROS_COUNTInt64VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6502,11 +6545,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector64Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedInt64VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6520,7 +6563,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector64Tests::TRAILING_ZEROS_COUNT); } static int LEADING_ZEROS_COUNT(int a) { @@ -6528,7 +6571,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LEADING_ZEROS_COUNTInt64VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6539,11 +6582,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVector64Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedInt64VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6557,7 +6600,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVector64Tests::LEADING_ZEROS_COUNT); } static int REVERSE(int a) { @@ -6565,7 +6608,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSEInt64VectorTests(IntFunction fa) { + static void REVERSEIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6576,11 +6619,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::REVERSE); + assertArraysEquals(r, a, IntVector64Tests::REVERSE); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSEMaskedInt64VectorTests(IntFunction fa, + static void REVERSEMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6594,7 +6637,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::REVERSE); + assertArraysEquals(r, a, mask, IntVector64Tests::REVERSE); } static int REVERSE_BYTES(int a) { @@ -6602,7 +6645,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSE_BYTESInt64VectorTests(IntFunction fa) { + static void REVERSE_BYTESIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6613,11 +6656,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, IntVector64Tests::REVERSE_BYTES); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedInt64VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedIntVector64Tests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6631,7 +6674,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Int64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, IntVector64Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6639,7 +6682,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandIntVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6652,7 +6695,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::band); + assertArraysEquals(r, a, b, IntVector64Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6660,7 +6703,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maskorIntVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6673,7 +6716,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::bor); + assertArraysEquals(r, a, b, IntVector64Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6681,7 +6724,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorIntVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6694,7 +6737,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::bxor); + assertArraysEquals(r, a, b, IntVector64Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6702,7 +6745,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotIntVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6715,7 +6758,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::bandNot); + assertArraysEquals(r, a, b, IntVector64Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6723,7 +6766,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqIntVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6736,7 +6779,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Int64VectorTests::beq); + assertArraysEquals(r, a, b, IntVector64Tests::beq); } static boolean unot(boolean a) { @@ -6744,7 +6787,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotInt64VectorTests(IntFunction fa) { + static void masknotIntVector64Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6755,7 +6798,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Int64VectorTests::unot); + assertArraysEquals(r, a, IntVector64Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6764,15 +6807,15 @@ public class Int64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongInt64VectorTests(IntFunction fa) { + static void maskFromToLongIntVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6786,7 +6829,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intCompareOpProvider") - static void ltInt64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltIntVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6796,13 +6839,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpProvider") - static void eqInt64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqIntVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6812,13 +6855,13 @@ public class Int64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intUnaryOpProvider") - static void toIntArrayInt64VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayIntVector64TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6829,7 +6872,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toLongArrayInt64VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayIntVector64TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6840,7 +6883,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toDoubleArrayInt64VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayIntVector64TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6851,7 +6894,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toStringInt64VectorTestsSmokeTest(IntFunction fa) { + static void toStringIntVector64TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6864,7 +6907,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void hashCodeInt64VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeIntVector64TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6897,7 +6940,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceLongInt64VectorTests(IntFunction fa) { + static void ADDReduceLongIntVector64Tests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6913,7 +6956,7 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Int64VectorTests::ADDReduceLong, Int64VectorTests::ADDReduceAllLong); + IntVector64Tests::ADDReduceLong, IntVector64Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(int[] a, int idx, boolean[] mask) { @@ -6936,7 +6979,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceLongInt64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongIntVector64TestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6954,11 +6997,11 @@ public class Int64VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Int64VectorTests::ADDReduceLongMasked, Int64VectorTests::ADDReduceAllLongMasked); + IntVector64Tests::ADDReduceLongMasked, IntVector64Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastLongInt64VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongIntVector64TestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -6969,7 +7012,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendInt64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendIntVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6983,12 +7026,12 @@ public class Int64VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Int64VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVector64Tests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void SelectFromInt64VectorTests(IntFunction fa, + static void SelectFromIntVector64Tests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -7004,7 +7047,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorIntVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] idx = fc.apply(SPECIES.length()); @@ -7022,7 +7065,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void SelectFromInt64VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromIntVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -7041,7 +7084,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousInt64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousIntVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7052,12 +7095,12 @@ public class Int64VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringInt64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringIntVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7071,7 +7114,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsInt64VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsIntVector64TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7080,12 +7123,12 @@ public class Int64VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsInt64VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsIntVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7095,13 +7138,13 @@ public class Int64VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeInt64VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeIntVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7123,7 +7166,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountInt64VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountIntVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7134,7 +7177,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int64VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, IntVector64Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7148,7 +7191,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueInt64VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueIntVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7159,7 +7202,7 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int64VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, IntVector64Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7173,7 +7216,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueInt64VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueIntVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7184,11 +7227,11 @@ public class Int64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Int64VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, IntVector64Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressInt64VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressIntVector64TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7198,7 +7241,7 @@ public class Int64VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7216,7 +7259,7 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeInt64VectorTestsSmokeTest(int offset) { + static void indexInRangeIntVector64TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7224,13 +7267,13 @@ public class Int64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongInt64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongIntVector64TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7238,7 +7281,7 @@ public class Int64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7257,36 +7300,36 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundInt64VectorTestsSmokeTest(int length) { + static void loopBoundIntVector64TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongInt64VectorTestsSmokeTest(int _length) { + static void loopBoundLongIntVector64TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeInt64VectorTestsSmokeTest() { + static void ElementSizeIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Integer.SIZE); + assertEquals(elsize, Integer.SIZE); } @Test - static void VectorShapeInt64VectorTestsSmokeTest() { + static void VectorShapeIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_64_BIT)); } @Test - static void ShapeWithLanesInt64VectorTestsSmokeTest() { + static void ShapeWithLanesIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(int.class); @@ -7294,32 +7337,32 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeInt64VectorTestsSmokeTest() { + static void ElementTypeIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementType() == int.class); } @Test - static void SpeciesElementSizeInt64VectorTestsSmokeTest() { + static void SpeciesElementSizeIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementSize() == Integer.SIZE); } @Test - static void VectorTypeInt64VectorTestsSmokeTest() { + static void VectorTypeIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesInt64VectorTestsSmokeTest() { + static void WithLanesIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(int.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeInt64VectorTestsSmokeTest() { + static void WithShapeIntVector64TestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7327,9 +7370,9 @@ public class Int64VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueInt64VectorTestsSmokeTest() { + static void MaskAllTrueIntVector64TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/IntVectorMaxLoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/IntVectorMaxLoadStoreTests.java index 564849e22fd..c9adfe802b6 100644 --- a/test/jdk/jdk/incubator/vector/IntMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/IntVectorMaxLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED - * -XX:-TieredCompilation IntMaxVectorLoadStoreTests + * -XX:-TieredCompilation IntVectorMaxLoadStoreTests * */ @@ -52,7 +52,7 @@ import java.util.List; import java.util.function.*; @Test -public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class IntVectorMaxLoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = IntVector.SPECIES_MAX; @@ -68,14 +68,29 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / Max); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(int[] r, int[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (int) 0, "at index #" + i); } } @@ -329,7 +344,7 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "intProviderForIOOBE") @@ -877,11 +892,11 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -892,11 +907,11 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (int) 0, "at index #" + j); } } @@ -912,7 +927,7 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(int[] r, int[] a, int[] indexMap) { @@ -925,7 +940,7 @@ public class IntMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java b/test/jdk/jdk/incubator/vector/IntVectorMaxTests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/IntMaxVectorTests.java rename to test/jdk/jdk/incubator/vector/IntVectorMaxTests.java index 7bf4dc48171..ad519b36dc9 100644 --- a/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/IntVectorMaxTests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation IntVectorMaxTests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class IntMaxVectorTests extends AbstractVectorTest { +public class IntVectorMaxTests extends AbstractVectorTest { static final VectorSpecies SPECIES = IntVector.SPECIES_MAX; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(int actual, int expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int actual, int expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(int actual, int expected, int delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(int actual, int expected, int delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(int [] actual, int [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(int [] actual, int [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static VectorShape getMaxBit() { return VectorShape.S_Max_BIT; @@ -102,10 +145,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -117,13 +160,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { int[] ref = f.apply(a[i]); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -133,10 +176,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -152,13 +195,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -174,13 +217,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -196,13 +239,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -218,13 +261,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -236,10 +279,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -251,10 +294,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -263,12 +306,12 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -279,20 +322,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (int)0); + assertEquals(r[i + k], (int)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -304,19 +347,19 @@ public class IntMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (int)0); + assertEquals(r[i + j], (int)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (int)0, "at index #" + idx); + assertEquals(r[idx], (int)0, "at index #" + idx); } } } @@ -332,11 +375,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -345,12 +388,12 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -360,17 +403,17 @@ public class IntMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -380,17 +423,17 @@ public class IntMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (int)0); + assertEquals(r[i+j], (int)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (int)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -404,10 +447,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -419,10 +462,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -434,10 +477,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -458,18 +501,18 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -484,18 +527,18 @@ public class IntMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -503,10 +546,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -514,10 +557,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -525,10 +568,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -537,10 +580,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -553,10 +596,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -568,10 +611,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -583,10 +626,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -601,10 +644,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (int)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -617,11 +660,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -635,11 +678,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -661,11 +704,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -679,11 +722,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -703,10 +746,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -718,10 +761,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -730,10 +773,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -743,10 +786,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -762,11 +805,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -783,11 +826,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -798,11 +841,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -819,11 +862,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -841,13 +884,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -868,13 +911,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -889,13 +932,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { int[] ref = f.apply(r, a, i, mask, b, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -916,13 +959,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -936,13 +979,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -957,13 +1000,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -978,13 +1021,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1000,13 +1043,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { int[] ref = f.apply(a, b, origin, part, mask, i); int[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1019,10 +1062,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1032,10 +1075,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1043,10 +1086,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1549,7 +1592,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Do some zipping and shuffling. IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); IntVector a = io.add((int)1); //[1,2] IntVector b = a.neg(); //[-1,-2] int[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1564,19 +1607,19 @@ public class IntMaxVectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); IntVector uab0 = zab0.rearrange(unz0,zab1); IntVector uab1 = zab0.rearrange(unz1,zab1); int[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { IntVector io = (IntVector) SPECIES.broadcast(0).addIndex(1); IntVector io2 = (IntVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1591,7 +1634,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1599,9 +1642,9 @@ public class IntMaxVectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1630,7 +1673,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ADDIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ADDIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1643,7 +1686,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::ADD); + assertArraysEquals(r, a, b, IntVectorMaxTests::ADD); } static int add(int a, int b) { @@ -1651,7 +1694,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void addIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void addIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1662,11 +1705,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::add); + assertArraysEquals(r, a, b, IntVectorMaxTests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1682,11 +1725,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ADD); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void addIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1700,7 +1743,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::add); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::add); } static int SUB(int a, int b) { @@ -1708,7 +1751,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void SUBIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUBIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1721,7 +1764,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::SUB); + assertArraysEquals(r, a, b, IntVectorMaxTests::SUB); } static int sub(int a, int b) { @@ -1729,7 +1772,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void subIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void subIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1740,11 +1783,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::sub); + assertArraysEquals(r, a, b, IntVectorMaxTests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void SUBIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1760,11 +1803,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::SUB); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::SUB); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void subIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1778,7 +1821,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::sub); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::sub); } static int MUL(int a, int b) { @@ -1786,7 +1829,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MULIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MULIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1799,7 +1842,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::MUL); + assertArraysEquals(r, a, b, IntVectorMaxTests::MUL); } static int mul(int a, int b) { @@ -1807,7 +1850,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void mulIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void mulIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1818,11 +1861,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::mul); + assertArraysEquals(r, a, b, IntVectorMaxTests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void MULIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1838,11 +1881,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::MUL); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::MUL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1856,7 +1899,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::mul); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::mul); } static int DIV(int a, int b) { @@ -1864,7 +1907,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void DIVIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void DIVIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1879,7 +1922,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::DIV); + assertArraysEquals(r, a, b, IntVectorMaxTests::DIV); } static int div(int a, int b) { @@ -1887,7 +1930,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void divIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void divIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1902,11 +1945,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::div); + assertArraysEquals(r, a, b, IntVectorMaxTests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void DIVIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1924,11 +1967,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::DIV); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::DIV); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void divIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1946,7 +1989,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::div); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::div); } static int FIRST_NONZERO(int a, int b) { @@ -1954,7 +1997,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void FIRST_NONZEROIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -1967,11 +2010,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, IntVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void FIRST_NONZEROIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -1987,7 +2030,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::FIRST_NONZERO); } static int AND(int a, int b) { @@ -1995,7 +2038,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ANDIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ANDIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2008,7 +2051,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::AND); + assertArraysEquals(r, a, b, IntVectorMaxTests::AND); } static int and(int a, int b) { @@ -2016,7 +2059,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void andIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void andIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2027,11 +2070,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::and); + assertArraysEquals(r, a, b, IntVectorMaxTests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2047,7 +2090,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::AND); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::AND); } static int AND_NOT(int a, int b) { @@ -2055,7 +2098,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void AND_NOTIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2068,11 +2111,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, IntVectorMaxTests::AND_NOT); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void AND_NOTIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2088,7 +2131,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::AND_NOT); } static int OR(int a, int b) { @@ -2096,7 +2139,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ORIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ORIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2109,7 +2152,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::OR); + assertArraysEquals(r, a, b, IntVectorMaxTests::OR); } static int or(int a, int b) { @@ -2117,7 +2160,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void orIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void orIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2128,11 +2171,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::or); + assertArraysEquals(r, a, b, IntVectorMaxTests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2148,7 +2191,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::OR); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::OR); } static int XOR(int a, int b) { @@ -2156,7 +2199,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void XORIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void XORIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2169,11 +2212,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::XOR); + assertArraysEquals(r, a, b, IntVectorMaxTests::XOR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void XORIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2189,7 +2232,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::XOR); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::XOR); } static int COMPRESS_BITS(int a, int b) { @@ -2197,7 +2240,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void COMPRESS_BITSIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2210,11 +2253,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, IntVectorMaxTests::COMPRESS_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void COMPRESS_BITSIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2230,7 +2273,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::COMPRESS_BITS); } static int EXPAND_BITS(int a, int b) { @@ -2238,7 +2281,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void EXPAND_BITSIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2251,11 +2294,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, IntVectorMaxTests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void EXPAND_BITSIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2271,11 +2314,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::EXPAND_BITS); } @Test(dataProvider = "intBinaryOpProvider") - static void addIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2285,11 +2328,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::add); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void addIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2302,11 +2345,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, IntVectorMaxTests::add); } @Test(dataProvider = "intBinaryOpProvider") - static void subIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2316,11 +2359,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::sub); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void subIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2333,11 +2376,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, IntVectorMaxTests::sub); } @Test(dataProvider = "intBinaryOpProvider") - static void mulIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2347,11 +2390,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::mul); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void mulIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2364,11 +2407,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, IntVectorMaxTests::mul); } @Test(dataProvider = "intBinaryOpProvider") - static void divIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2380,11 +2423,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::div); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void divIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2399,11 +2442,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, IntVectorMaxTests::div); } @Test(dataProvider = "intBinaryOpProvider") - static void ORIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2413,11 +2456,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void orIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2427,11 +2470,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::or); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::or); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2444,11 +2487,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, IntVectorMaxTests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ANDIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2458,11 +2501,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void andIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2472,11 +2515,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::and); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::and); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ANDIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2489,11 +2532,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, IntVectorMaxTests::AND); } @Test(dataProvider = "intBinaryOpProvider") - static void ORIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORIntVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2503,11 +2546,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, IntMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, IntVectorMaxTests::OR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ORIntMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORIntVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2520,11 +2563,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, IntMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVectorMaxTests::OR); } @Test(dataProvider = "intBinaryOpProvider") - static void ADDIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDIntVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2534,11 +2577,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, IntMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, IntVectorMaxTests::ADD); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ADDIntMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDIntVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2551,7 +2594,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, IntMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVectorMaxTests::ADD); } static int LSHL(int a, int b) { @@ -2559,7 +2602,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHLIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2572,11 +2615,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, IntVectorMaxTests::LSHL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2592,7 +2635,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::LSHL); } static int ASHR(int a, int b) { @@ -2600,7 +2643,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ASHRIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2613,11 +2656,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, IntVectorMaxTests::ASHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2633,7 +2676,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::ASHR); } static int LSHR(int a, int b) { @@ -2641,7 +2684,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHRIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2654,11 +2697,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, IntVectorMaxTests::LSHR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2674,7 +2717,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::LSHR); } static int LSHL_unary(int a, int b) { @@ -2682,7 +2725,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHLIntMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLIntVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2694,11 +2737,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, IntMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, IntVectorMaxTests::LSHL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHLIntMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLIntVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2713,7 +2756,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVectorMaxTests::LSHL_unary); } static int LSHR_unary(int a, int b) { @@ -2721,7 +2764,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void LSHRIntMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRIntVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2733,11 +2776,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, IntMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, IntVectorMaxTests::LSHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void LSHRIntMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRIntVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2752,7 +2795,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVectorMaxTests::LSHR_unary); } static int ASHR_unary(int a, int b) { @@ -2760,7 +2803,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ASHRIntMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRIntVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2772,11 +2815,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, IntVectorMaxTests::ASHR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ASHRIntMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRIntVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2791,7 +2834,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVectorMaxTests::ASHR_unary); } static int ROR(int a, int b) { @@ -2799,7 +2842,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void RORIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2812,11 +2855,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::ROR); + assertArraysEquals(r, a, b, IntVectorMaxTests::ROR); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2832,7 +2875,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ROR); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::ROR); } static int ROL(int a, int b) { @@ -2840,7 +2883,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ROLIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2853,11 +2896,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::ROL); + assertArraysEquals(r, a, b, IntVectorMaxTests::ROL); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2873,7 +2916,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ROL); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::ROL); } static int ROR_unary(int a, int b) { @@ -2881,7 +2924,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void RORIntMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORIntVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2893,11 +2936,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, IntVectorMaxTests::ROR_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void RORIntMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORIntVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2912,7 +2955,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, IntVectorMaxTests::ROR_unary); } static int ROL_unary(int a, int b) { @@ -2920,7 +2963,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void ROLIntMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLIntVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2932,11 +2975,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, IntVectorMaxTests::ROL_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void ROLIntMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLIntVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -2951,14 +2994,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, IntVectorMaxTests::ROL_unary); } static int LSHR_binary_const(int a) { return (int)((a >>> CONST_SHIFT)); } @Test(dataProvider = "intUnaryOpProvider") - static void LSHRIntMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRIntVectorMaxTestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2969,11 +3012,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, IntMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, IntVectorMaxTests::LSHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHRIntMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRIntVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -2987,7 +3030,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, IntMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVectorMaxTests::LSHR_binary_const); } static int LSHL_binary_const(int a) { @@ -2995,7 +3038,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LSHLIntMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLIntVectorMaxTestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3006,11 +3049,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, IntMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, IntVectorMaxTests::LSHL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LSHLIntMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLIntVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3024,7 +3067,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, IntMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, IntVectorMaxTests::LSHL_binary_const); } static int ASHR_binary_const(int a) { @@ -3032,7 +3075,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ASHRIntMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRIntVectorMaxTestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3043,11 +3086,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, IntMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, IntVectorMaxTests::ASHR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ASHRIntMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRIntVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3061,7 +3104,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, IntMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, IntVectorMaxTests::ASHR_binary_const); } static int ROR_binary_const(int a) { @@ -3069,7 +3112,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void RORIntMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void RORIntVectorMaxTestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3080,11 +3123,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, IntMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, IntVectorMaxTests::ROR_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void RORIntMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORIntVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3098,7 +3141,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, IntMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, IntVectorMaxTests::ROR_binary_const); } static int ROL_binary_const(int a) { @@ -3106,7 +3149,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ROLIntMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ROLIntVectorMaxTestsScalarShiftConst(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3117,11 +3160,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, IntMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, IntVectorMaxTests::ROL_binary_const); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ROLIntMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLIntVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3135,14 +3178,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, IntMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, IntVectorMaxTests::ROL_binary_const); } static IntVector bv_MIN = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MINIntMaxVectorTestsWithMemOp(IntFunction fa) { + static void MINIntVectorMaxTestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3153,13 +3196,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, IntMaxVectorTests::MIN); + assertArraysEquals(r, a, (int)10, IntVectorMaxTests::MIN); } static IntVector bv_min = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void minIntMaxVectorTestsWithMemOp(IntFunction fa) { + static void minIntVectorMaxTestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3170,13 +3213,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, IntMaxVectorTests::min); + assertArraysEquals(r, a, (int)10, IntVectorMaxTests::min); } static IntVector bv_MIN_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINIntMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINIntVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3189,13 +3232,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, IntMaxVectorTests::MIN); + assertArraysEquals(r, a, (int)10, mask, IntVectorMaxTests::MIN); } static IntVector bv_MAX = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void MAXIntMaxVectorTestsWithMemOp(IntFunction fa) { + static void MAXIntVectorMaxTestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3206,13 +3249,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, IntMaxVectorTests::MAX); + assertArraysEquals(r, a, (int)10, IntVectorMaxTests::MAX); } static IntVector bv_max = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpProvider") - static void maxIntMaxVectorTestsWithMemOp(IntFunction fa) { + static void maxIntVectorMaxTestsWithMemOp(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3223,13 +3266,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, IntMaxVectorTests::max); + assertArraysEquals(r, a, (int)10, IntVectorMaxTests::max); } static IntVector bv_MAX_M = IntVector.broadcast(SPECIES, (int)10); @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXIntMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXIntVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3242,7 +3285,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (int)10, mask, IntMaxVectorTests::MAX); + assertArraysEquals(r, a, (int)10, mask, IntVectorMaxTests::MAX); } static int MIN(int a, int b) { @@ -3250,7 +3293,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MINIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MINIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3263,7 +3306,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::MIN); + assertArraysEquals(r, a, b, IntVectorMaxTests::MIN); } static int min(int a, int b) { @@ -3271,7 +3314,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void minIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void minIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3282,7 +3325,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::min); + assertArraysEquals(r, a, b, IntVectorMaxTests::min); } static int MAX(int a, int b) { @@ -3290,7 +3333,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void MAXIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MAXIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3303,7 +3346,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::MAX); + assertArraysEquals(r, a, b, IntVectorMaxTests::MAX); } static int max(int a, int b) { @@ -3311,7 +3354,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void maxIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maxIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3322,7 +3365,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, IntMaxVectorTests::max); + assertArraysEquals(r, a, b, IntVectorMaxTests::max); } static int UMIN(int a, int b) { @@ -3330,7 +3373,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMINIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMINIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3343,11 +3386,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, IntVectorMaxTests::UMIN); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMINIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3363,7 +3406,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::UMIN); } static int UMAX(int a, int b) { @@ -3371,7 +3414,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void UMAXIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMAXIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3384,11 +3427,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, IntVectorMaxTests::UMAX); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void UMAXIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3404,7 +3447,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::UMAX); } static int SADD(int a, int b) { @@ -3412,7 +3455,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SADDIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SADDIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3425,11 +3468,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::SADD); + assertArraysEquals(r, a, b, IntVectorMaxTests::SADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SADDIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3445,7 +3488,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::SADD); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::SADD); } static int SSUB(int a, int b) { @@ -3453,7 +3496,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SSUBIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SSUBIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3466,11 +3509,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, IntVectorMaxTests::SSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SSUBIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3486,7 +3529,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::SSUB); } static int SUADD(int a, int b) { @@ -3494,7 +3537,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUADDIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUADDIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3507,11 +3550,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, IntVectorMaxTests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUADDIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3527,7 +3570,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::SUADD); } static int SUSUB(int a, int b) { @@ -3535,7 +3578,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingBinaryOpProvider") - static void SUSUBIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3548,11 +3591,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, IntVectorMaxTests::SUSUB); } @Test(dataProvider = "intSaturatingBinaryOpMaskProvider") - static void SUSUBIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3568,11 +3611,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::SUSUB); } @Test(dataProvider = "intBinaryOpProvider") - static void MINIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3582,11 +3625,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::MIN); } @Test(dataProvider = "intBinaryOpProvider") - static void minIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3596,11 +3639,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::min); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::min); } @Test(dataProvider = "intBinaryOpProvider") - static void MAXIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3610,11 +3653,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::MAX); } @Test(dataProvider = "intBinaryOpProvider") - static void maxIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -3624,10 +3667,10 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::max); + assertBroadcastArraysEquals(r, a, b, IntVectorMaxTests::max); } @Test(dataProvider = "intSaturatingBinaryOpAssocProvider") - static void SUADDAssocIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocIntVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -3644,11 +3687,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, IntMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, IntVectorMaxTests::SUADD); } @Test(dataProvider = "intSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -3669,7 +3712,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, IntMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, IntVectorMaxTests::SUADD); } static int ANDReduce(int[] a, int idx) { @@ -3691,7 +3734,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ANDReduceIntMaxVectorTests(IntFunction fa) { + static void ANDReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3707,7 +3750,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::ANDReduce, IntMaxVectorTests::ANDReduceAll); + IntVectorMaxTests::ANDReduce, IntVectorMaxTests::ANDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3715,20 +3758,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = AND_IDENTITY; - Assert.assertEquals((int) (id & id), id, + assertEquals((int) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id & x), x); - Assert.assertEquals((int) (x & id), x); + assertEquals((int) (id & x), x); + assertEquals((int) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id & x), x, + assertEquals((int) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x & id), x, + assertEquals((int) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3753,7 +3796,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ANDReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3771,7 +3814,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::ANDReduceMasked, IntMaxVectorTests::ANDReduceAllMasked); + IntVectorMaxTests::ANDReduceMasked, IntVectorMaxTests::ANDReduceAllMasked); } static int ORReduce(int[] a, int idx) { @@ -3793,7 +3836,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ORReduceIntMaxVectorTests(IntFunction fa) { + static void ORReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3809,7 +3852,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::ORReduce, IntMaxVectorTests::ORReduceAll); + IntVectorMaxTests::ORReduce, IntVectorMaxTests::ORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3817,20 +3860,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = OR_IDENTITY; - Assert.assertEquals((int) (id | id), id, + assertEquals((int) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id | x), x); - Assert.assertEquals((int) (x | id), x); + assertEquals((int) (id | x), x); + assertEquals((int) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id | x), x, + assertEquals((int) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x | id), x, + assertEquals((int) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3855,7 +3898,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ORReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3873,7 +3916,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::ORReduceMasked, IntMaxVectorTests::ORReduceAllMasked); + IntVectorMaxTests::ORReduceMasked, IntVectorMaxTests::ORReduceAllMasked); } static int XORReduce(int[] a, int idx) { @@ -3895,7 +3938,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void XORReduceIntMaxVectorTests(IntFunction fa) { + static void XORReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -3911,7 +3954,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::XORReduce, IntMaxVectorTests::XORReduceAll); + IntVectorMaxTests::XORReduce, IntVectorMaxTests::XORReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -3919,20 +3962,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = XOR_IDENTITY; - Assert.assertEquals((int) (id ^ id), id, + assertEquals((int) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id ^ x), x); - Assert.assertEquals((int) (x ^ id), x); + assertEquals((int) (id ^ x), x); + assertEquals((int) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id ^ x), x, + assertEquals((int) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x ^ id), x, + assertEquals((int) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3957,7 +4000,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void XORReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3975,7 +4018,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::XORReduceMasked, IntMaxVectorTests::XORReduceAllMasked); + IntVectorMaxTests::XORReduceMasked, IntVectorMaxTests::XORReduceAllMasked); } static int ADDReduce(int[] a, int idx) { @@ -3997,7 +4040,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceIntMaxVectorTests(IntFunction fa) { + static void ADDReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4013,7 +4056,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::ADDReduce, IntMaxVectorTests::ADDReduceAll); + IntVectorMaxTests::ADDReduce, IntVectorMaxTests::ADDReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4021,20 +4064,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = ADD_IDENTITY; - Assert.assertEquals((int) (id + id), id, + assertEquals((int) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id + x), x); - Assert.assertEquals((int) (x + id), x); + assertEquals((int) (id + x), x); + assertEquals((int) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id + x), x, + assertEquals((int) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x + id), x, + assertEquals((int) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4059,7 +4102,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4077,7 +4120,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::ADDReduceMasked, IntMaxVectorTests::ADDReduceAllMasked); + IntVectorMaxTests::ADDReduceMasked, IntVectorMaxTests::ADDReduceAllMasked); } static int MULReduce(int[] a, int idx) { @@ -4099,7 +4142,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MULReduceIntMaxVectorTests(IntFunction fa) { + static void MULReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4115,7 +4158,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::MULReduce, IntMaxVectorTests::MULReduceAll); + IntVectorMaxTests::MULReduce, IntVectorMaxTests::MULReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4123,20 +4166,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MUL_IDENTITY; - Assert.assertEquals((int) (id * id), id, + assertEquals((int) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) (id * x), x); - Assert.assertEquals((int) (x * id), x); + assertEquals((int) (id * x), x); + assertEquals((int) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) (id * x), x, + assertEquals((int) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) (x * id), x, + assertEquals((int) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4161,7 +4204,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MULReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4179,7 +4222,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::MULReduceMasked, IntMaxVectorTests::MULReduceAllMasked); + IntVectorMaxTests::MULReduceMasked, IntVectorMaxTests::MULReduceAllMasked); } static int MINReduce(int[] a, int idx) { @@ -4201,7 +4244,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MINReduceIntMaxVectorTests(IntFunction fa) { + static void MINReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4217,7 +4260,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::MINReduce, IntMaxVectorTests::MINReduceAll); + IntVectorMaxTests::MINReduce, IntVectorMaxTests::MINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4225,20 +4268,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MIN_IDENTITY; - Assert.assertEquals((int) Math.min(id, id), id, + assertEquals((int) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.min(id, x), x); - Assert.assertEquals((int) Math.min(x, id), x); + assertEquals((int) Math.min(id, x), x); + assertEquals((int) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.min(id, x), x, + assertEquals((int) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.min(x, id), x, + assertEquals((int) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4263,7 +4306,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MINReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4281,7 +4324,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::MINReduceMasked, IntMaxVectorTests::MINReduceAllMasked); + IntVectorMaxTests::MINReduceMasked, IntVectorMaxTests::MINReduceAllMasked); } static int MAXReduce(int[] a, int idx) { @@ -4303,7 +4346,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void MAXReduceIntMaxVectorTests(IntFunction fa) { + static void MAXReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4319,7 +4362,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::MAXReduce, IntMaxVectorTests::MAXReduceAll); + IntVectorMaxTests::MAXReduce, IntVectorMaxTests::MAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4327,20 +4370,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = MAX_IDENTITY; - Assert.assertEquals((int) Math.max(id, id), id, + assertEquals((int) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) Math.max(id, x), x); - Assert.assertEquals((int) Math.max(x, id), x); + assertEquals((int) Math.max(id, x), x); + assertEquals((int) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) Math.max(id, x), x, + assertEquals((int) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) Math.max(x, id), x, + assertEquals((int) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4365,7 +4408,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void MAXReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4383,7 +4426,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::MAXReduceMasked, IntMaxVectorTests::MAXReduceAllMasked); + IntVectorMaxTests::MAXReduceMasked, IntVectorMaxTests::MAXReduceAllMasked); } static int UMINReduce(int[] a, int idx) { @@ -4405,7 +4448,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMINReduceIntMaxVectorTests(IntFunction fa) { + static void UMINReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4421,7 +4464,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::UMINReduce, IntMaxVectorTests::UMINReduceAll); + IntVectorMaxTests::UMINReduce, IntVectorMaxTests::UMINReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4429,20 +4472,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMIN_IDENTITY; - Assert.assertEquals((int) VectorMath.minUnsigned(id, id), id, + assertEquals((int) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x); + assertEquals((int) VectorMath.minUnsigned(id, x), x); + assertEquals((int) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.minUnsigned(id, x), x, + assertEquals((int) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.minUnsigned(x, id), x, + assertEquals((int) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4467,7 +4510,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMINReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4485,7 +4528,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::UMINReduceMasked, IntMaxVectorTests::UMINReduceAllMasked); + IntVectorMaxTests::UMINReduceMasked, IntVectorMaxTests::UMINReduceAllMasked); } static int UMAXReduce(int[] a, int idx) { @@ -4507,7 +4550,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void UMAXReduceIntMaxVectorTests(IntFunction fa) { + static void UMAXReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4523,7 +4566,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::UMAXReduce, IntMaxVectorTests::UMAXReduceAll); + IntVectorMaxTests::UMAXReduce, IntVectorMaxTests::UMAXReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4531,20 +4574,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = UMAX_IDENTITY; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, id), id, + assertEquals((int) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x); + assertEquals((int) VectorMath.maxUnsigned(id, x), x); + assertEquals((int) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.maxUnsigned(id, x), x, + assertEquals((int) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.maxUnsigned(x, id), x, + assertEquals((int) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4569,7 +4612,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void UMAXReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4587,7 +4630,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::UMAXReduceMasked, IntMaxVectorTests::UMAXReduceAllMasked); + IntVectorMaxTests::UMAXReduceMasked, IntVectorMaxTests::UMAXReduceAllMasked); } static int FIRST_NONZEROReduce(int[] a, int idx) { @@ -4609,7 +4652,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void FIRST_NONZEROReduceIntMaxVectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4625,7 +4668,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::FIRST_NONZEROReduce, IntMaxVectorTests::FIRST_NONZEROReduceAll); + IntVectorMaxTests::FIRST_NONZEROReduce, IntVectorMaxTests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "intUnaryOpProvider") @@ -4633,20 +4676,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4671,7 +4714,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void FIRST_NONZEROReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4689,7 +4732,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::FIRST_NONZEROReduceMasked, IntMaxVectorTests::FIRST_NONZEROReduceAllMasked); + IntVectorMaxTests::FIRST_NONZEROReduceMasked, IntVectorMaxTests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4702,7 +4745,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueIntMaxVectorTests(IntFunction fm) { + static void anyTrueIntVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4713,7 +4756,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, IntMaxVectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, IntVectorMaxTests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4726,7 +4769,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueIntMaxVectorTests(IntFunction fm) { + static void allTrueIntVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4737,7 +4780,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, IntMaxVectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, IntVectorMaxTests::allTrue); } static int SUADDReduce(int[] a, int idx) { @@ -4759,7 +4802,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSaturatingUnaryOpProvider") - static void SUADDReduceIntMaxVectorTests(IntFunction fa) { + static void SUADDReduceIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -4775,7 +4818,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - IntMaxVectorTests::SUADDReduce, IntMaxVectorTests::SUADDReduceAll); + IntVectorMaxTests::SUADDReduce, IntVectorMaxTests::SUADDReduceAll); } @Test(dataProvider = "intSaturatingUnaryOpProvider") @@ -4783,20 +4826,20 @@ public class IntMaxVectorTests extends AbstractVectorTest { int[] a = fa.apply(SPECIES.length()); int id = SUADD_IDENTITY; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); int x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((int) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4820,7 +4863,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "intSaturatingUnaryOpMaskProvider") - static void SUADDReduceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4838,11 +4881,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::SUADDReduceMasked, IntMaxVectorTests::SUADDReduceAllMasked); + IntVectorMaxTests::SUADDReduceMasked, IntVectorMaxTests::SUADDReduceAllMasked); } @Test(dataProvider = "intBinaryOpProvider") - static void withIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void withIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -4865,7 +4908,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_DEFAULTIntMaxVectorTests(IntFunction fa) { + static void IS_DEFAULTIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4875,14 +4918,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_DEFAULTMaskedIntMaxVectorTests(IntFunction fa, + static void IS_DEFAULTMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4895,7 +4938,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4906,7 +4949,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTestOpProvider") - static void IS_NEGATIVEIntMaxVectorTests(IntFunction fa) { + static void IS_NEGATIVEIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4916,14 +4959,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intTestOpMaskProvider") - static void IS_NEGATIVEMaskedIntMaxVectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4936,14 +4979,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LTIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4955,14 +4998,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ltIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ltIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4974,14 +5017,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -4997,14 +5040,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GTIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GTIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5016,14 +5059,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GTIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5039,14 +5082,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void EQIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EQIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5058,14 +5101,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void eqIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void eqIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5077,14 +5120,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5100,14 +5143,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void NEIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void NEIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5119,14 +5162,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void NEIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5142,14 +5185,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LEIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LEIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5161,14 +5204,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LEIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5184,14 +5227,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void GEIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GEIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5203,14 +5246,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void GEIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5226,14 +5269,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULTIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULTIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5245,14 +5288,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULTIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5268,14 +5311,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGTIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGTIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5287,14 +5330,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGTIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5310,14 +5353,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void ULEIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULEIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5329,14 +5372,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void ULEIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5352,14 +5395,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void UGEIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGEIntVectorMaxTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5371,14 +5414,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void UGEIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5394,14 +5437,14 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "intCompareOpProvider") - static void LTIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5411,13 +5454,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5431,13 +5474,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void LTIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTIntVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5447,13 +5490,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void LTIntMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTIntVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5467,13 +5510,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (int)((long)b[i]))); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5483,13 +5526,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5503,13 +5546,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "intCompareOpProvider") - static void EQIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQIntVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5519,13 +5562,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (int)((long)b[i])); } } } @Test(dataProvider = "intCompareOpMaskProvider") - static void EQIntMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQIntVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5539,7 +5582,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (int)((long)b[i]))); } } } @@ -5549,7 +5592,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendIntMaxVectorTests(IntFunction fa, IntFunction fb, + static void blendIntVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5565,11 +5608,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, IntMaxVectorTests::blend); + assertArraysEquals(r, a, b, mask, IntVectorMaxTests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void RearrangeIntMaxVectorTests(IntFunction fa, + static void RearrangeIntVectorMaxTests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5586,7 +5629,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void RearrangeIntMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeIntVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -5604,7 +5647,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void compressIntMaxVectorTests(IntFunction fa, + static void compressIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5622,7 +5665,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void expandIntMaxVectorTests(IntFunction fa, + static void expandIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5640,7 +5683,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void getIntMaxVectorTests(IntFunction fa) { + static void getIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -5796,7 +5839,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastIntMaxVectorTests(IntFunction fa) { + static void BroadcastIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5810,7 +5853,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZeroIntMaxVectorTests(IntFunction fa) { + static void ZeroIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5820,7 +5863,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static int[] sliceUnary(int[] a, int origin, int idx) { @@ -5835,7 +5878,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void sliceUnaryIntMaxVectorTests(IntFunction fa) { + static void sliceUnaryIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5846,7 +5889,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, IntMaxVectorTests::sliceUnary); + assertArraysEquals(r, a, origin, IntVectorMaxTests::sliceUnary); } static int[] sliceBinary(int[] a, int[] b, int origin, int idx) { @@ -5863,7 +5906,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void sliceBinaryIntMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryIntVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5876,7 +5919,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, IntMaxVectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, IntVectorMaxTests::sliceBinary); } static int[] slice(int[] a, int[] b, int origin, boolean[] mask, int idx) { @@ -5893,7 +5936,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void sliceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -5910,7 +5953,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, IntMaxVectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, IntVectorMaxTests::slice); } static int[] unsliceUnary(int[] a, int origin, int idx) { @@ -5927,7 +5970,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void unsliceUnaryIntMaxVectorTests(IntFunction fa) { + static void unsliceUnaryIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5938,7 +5981,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, IntMaxVectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, IntVectorMaxTests::unsliceUnary); } static int[] unsliceBinary(int[] a, int[] b, int origin, int part, int idx) { @@ -5964,7 +6007,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpProvider") - static void unsliceBinaryIntMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryIntVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -5978,7 +6021,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, IntMaxVectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, IntVectorMaxTests::unsliceBinary); } static int[] unslice(int[] a, int[] b, int origin, int part, boolean[] mask, int idx) { @@ -6018,7 +6061,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void unsliceIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6035,7 +6078,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, IntMaxVectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, IntVectorMaxTests::unslice); } static int BITWISE_BLEND(int a, int b, int c) { @@ -6047,7 +6090,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6062,11 +6105,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6079,11 +6122,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, IntVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDIntMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6101,11 +6144,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6116,11 +6159,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDIntMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6131,11 +6174,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6146,11 +6189,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { IntVector bv = IntVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, IntVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendIntMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6161,11 +6204,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { IntVector cv = IntVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, IntVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6180,11 +6223,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDIntMaxVectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVectorMaxTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6199,11 +6242,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void BITWISE_BLENDIntMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDIntVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6214,11 +6257,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "intTernaryOpProvider") - static void bitwiseBlendIntMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendIntVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] c = fc.apply(SPECIES.length()); @@ -6229,11 +6272,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, IntVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "intTernaryOpMaskProvider") - static void BITWISE_BLENDIntMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDIntVectorMaxTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6247,7 +6290,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntVectorMaxTests::BITWISE_BLEND); } static int NEG(int a) { @@ -6259,7 +6302,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NEGIntMaxVectorTests(IntFunction fa) { + static void NEGIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6270,11 +6313,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::NEG); + assertArraysEquals(r, a, IntVectorMaxTests::NEG); } @Test(dataProvider = "intUnaryOpProvider") - static void negIntMaxVectorTests(IntFunction fa) { + static void negIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6285,11 +6328,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::neg); + assertArraysEquals(r, a, IntVectorMaxTests::neg); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NEGMaskedIntMaxVectorTests(IntFunction fa, + static void NEGMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6303,7 +6346,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::NEG); + assertArraysEquals(r, a, mask, IntVectorMaxTests::NEG); } static int ABS(int a) { @@ -6315,7 +6358,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ABSIntMaxVectorTests(IntFunction fa) { + static void ABSIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6326,11 +6369,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::ABS); + assertArraysEquals(r, a, IntVectorMaxTests::ABS); } @Test(dataProvider = "intUnaryOpProvider") - static void absIntMaxVectorTests(IntFunction fa) { + static void absIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6341,11 +6384,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::abs); + assertArraysEquals(r, a, IntVectorMaxTests::abs); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ABSMaskedIntMaxVectorTests(IntFunction fa, + static void ABSMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6359,7 +6402,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::ABS); + assertArraysEquals(r, a, mask, IntVectorMaxTests::ABS); } static int NOT(int a) { @@ -6371,7 +6414,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void NOTIntMaxVectorTests(IntFunction fa) { + static void NOTIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6382,11 +6425,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::NOT); + assertArraysEquals(r, a, IntVectorMaxTests::NOT); } @Test(dataProvider = "intUnaryOpProvider") - static void notIntMaxVectorTests(IntFunction fa) { + static void notIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6397,11 +6440,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::not); + assertArraysEquals(r, a, IntVectorMaxTests::not); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void NOTMaskedIntMaxVectorTests(IntFunction fa, + static void NOTMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6415,7 +6458,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::NOT); + assertArraysEquals(r, a, mask, IntVectorMaxTests::NOT); } static int ZOMO(int a) { @@ -6423,7 +6466,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ZOMOIntMaxVectorTests(IntFunction fa) { + static void ZOMOIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6434,11 +6477,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::ZOMO); + assertArraysEquals(r, a, IntVectorMaxTests::ZOMO); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ZOMOMaskedIntMaxVectorTests(IntFunction fa, + static void ZOMOMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6452,7 +6495,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::ZOMO); + assertArraysEquals(r, a, mask, IntVectorMaxTests::ZOMO); } static int BIT_COUNT(int a) { @@ -6460,7 +6503,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void BIT_COUNTIntMaxVectorTests(IntFunction fa) { + static void BIT_COUNTIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6471,11 +6514,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, IntVectorMaxTests::BIT_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void BIT_COUNTMaskedIntMaxVectorTests(IntFunction fa, + static void BIT_COUNTMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6489,7 +6532,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, IntVectorMaxTests::BIT_COUNT); } static int TRAILING_ZEROS_COUNT(int a) { @@ -6497,7 +6540,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void TRAILING_ZEROS_COUNTIntMaxVectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6508,11 +6551,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVectorMaxTests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedIntMaxVectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6526,7 +6569,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVectorMaxTests::TRAILING_ZEROS_COUNT); } static int LEADING_ZEROS_COUNT(int a) { @@ -6534,7 +6577,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void LEADING_ZEROS_COUNTIntMaxVectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6545,11 +6588,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, IntVectorMaxTests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedIntMaxVectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6563,7 +6606,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, IntVectorMaxTests::LEADING_ZEROS_COUNT); } static int REVERSE(int a) { @@ -6571,7 +6614,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSEIntMaxVectorTests(IntFunction fa) { + static void REVERSEIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6582,11 +6625,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::REVERSE); + assertArraysEquals(r, a, IntVectorMaxTests::REVERSE); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSEMaskedIntMaxVectorTests(IntFunction fa, + static void REVERSEMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6600,7 +6643,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::REVERSE); + assertArraysEquals(r, a, mask, IntVectorMaxTests::REVERSE); } static int REVERSE_BYTES(int a) { @@ -6608,7 +6651,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void REVERSE_BYTESIntMaxVectorTests(IntFunction fa) { + static void REVERSE_BYTESIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6619,11 +6662,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, IntVectorMaxTests::REVERSE_BYTES); } @Test(dataProvider = "intUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedIntMaxVectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedIntVectorMaxTests(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -6637,7 +6680,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, IntMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, IntVectorMaxTests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6645,7 +6688,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandIntVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6658,7 +6701,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::band); + assertArraysEquals(r, a, b, IntVectorMaxTests::band); } static boolean bor(boolean a, boolean b) { @@ -6666,7 +6709,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskorIntVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6679,7 +6722,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::bor); + assertArraysEquals(r, a, b, IntVectorMaxTests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6687,7 +6730,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskxorIntVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6700,7 +6743,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::bxor); + assertArraysEquals(r, a, b, IntVectorMaxTests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6708,7 +6751,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotIntVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6721,7 +6764,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::bandNot); + assertArraysEquals(r, a, b, IntVectorMaxTests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6729,7 +6772,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskeqIntVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6742,7 +6785,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, IntMaxVectorTests::beq); + assertArraysEquals(r, a, b, IntVectorMaxTests::beq); } static boolean unot(boolean a) { @@ -6750,7 +6793,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotIntMaxVectorTests(IntFunction fa) { + static void masknotIntVectorMaxTests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6761,7 +6804,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, IntMaxVectorTests::unot); + assertArraysEquals(r, a, IntVectorMaxTests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6770,15 +6813,15 @@ public class IntMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongIntMaxVectorTests(IntFunction fa) { + static void maskFromToLongIntVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6792,7 +6835,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intCompareOpProvider") - static void ltIntMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltIntVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6802,13 +6845,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "intCompareOpProvider") - static void eqIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqIntVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6818,13 +6861,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "intUnaryOpProvider") - static void toIntArrayIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayIntVectorMaxTestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6835,7 +6878,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toLongArrayIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayIntVectorMaxTestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6846,7 +6889,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toDoubleArrayIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayIntVectorMaxTestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6857,7 +6900,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void toStringIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void toStringIntVectorMaxTestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6870,7 +6913,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void hashCodeIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void hashCodeIntVectorMaxTestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6903,7 +6946,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpProvider") - static void ADDReduceLongIntMaxVectorTests(IntFunction fa) { + static void ADDReduceLongIntVectorMaxTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6919,7 +6962,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - IntMaxVectorTests::ADDReduceLong, IntMaxVectorTests::ADDReduceAllLong); + IntVectorMaxTests::ADDReduceLong, IntVectorMaxTests::ADDReduceAllLong); } static long ADDReduceLongMasked(int[] a, int idx, boolean[] mask) { @@ -6942,7 +6985,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpMaskProvider") - static void ADDReduceLongIntMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongIntVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6960,11 +7003,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - IntMaxVectorTests::ADDReduceLongMasked, IntMaxVectorTests::ADDReduceAllLongMasked); + IntVectorMaxTests::ADDReduceLongMasked, IntVectorMaxTests::ADDReduceAllLongMasked); } @Test(dataProvider = "intUnaryOpProvider") - static void BroadcastLongIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongIntVectorMaxTestsSmokeTest(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -6975,7 +7018,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intBinaryOpMaskProvider") - static void blendIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendIntVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -6989,12 +7032,12 @@ public class IntMaxVectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, IntMaxVectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, IntVectorMaxTests::blend); } @Test(dataProvider = "intUnaryOpShuffleProvider") - static void SelectFromIntMaxVectorTests(IntFunction fa, + static void SelectFromIntVectorMaxTests(IntFunction fa, BiFunction fs) { int[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -7010,7 +7053,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorIntVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] idx = fc.apply(SPECIES.length()); @@ -7028,7 +7071,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "intUnaryOpShuffleMaskProvider") - static void SelectFromIntMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromIntVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); @@ -7047,7 +7090,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousIntMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousIntVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7058,12 +7101,12 @@ public class IntMaxVectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringIntMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringIntVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7077,7 +7120,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsIntMaxVectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsIntVectorMaxTestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7086,12 +7129,12 @@ public class IntMaxVectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsIntVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7101,13 +7144,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeIntVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7129,7 +7172,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountIntVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7140,7 +7183,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, IntMaxVectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, IntVectorMaxTests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7154,7 +7197,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueIntVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7165,7 +7208,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, IntMaxVectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, IntVectorMaxTests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7179,7 +7222,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueIntVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7190,11 +7233,11 @@ public class IntMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, IntMaxVectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, IntVectorMaxTests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressIntMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskCompressIntVectorMaxTestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7204,7 +7247,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7222,7 +7265,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeIntMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeIntVectorMaxTestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7230,13 +7273,13 @@ public class IntMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongIntMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongIntVectorMaxTestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7244,7 +7287,7 @@ public class IntMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7263,36 +7306,36 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundIntMaxVectorTestsSmokeTest(int length) { + static void loopBoundIntVectorMaxTestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongIntMaxVectorTestsSmokeTest(int _length) { + static void loopBoundLongIntVectorMaxTestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeIntMaxVectorTestsSmokeTest() { + static void ElementSizeIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Integer.SIZE); + assertEquals(elsize, Integer.SIZE); } @Test - static void VectorShapeIntMaxVectorTestsSmokeTest() { + static void VectorShapeIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_Max_BIT)); } @Test - static void ShapeWithLanesIntMaxVectorTestsSmokeTest() { + static void ShapeWithLanesIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(int.class); @@ -7300,32 +7343,32 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test - static void ElementTypeIntMaxVectorTestsSmokeTest() { + static void ElementTypeIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementType() == int.class); } @Test - static void SpeciesElementSizeIntMaxVectorTestsSmokeTest() { + static void SpeciesElementSizeIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().elementSize() == Integer.SIZE); } @Test - static void VectorTypeIntMaxVectorTestsSmokeTest() { + static void VectorTypeIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesIntMaxVectorTestsSmokeTest() { + static void WithLanesIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(int.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeIntMaxVectorTestsSmokeTest() { + static void WithShapeIntVectorMaxTestsSmokeTest() { IntVector av = IntVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7333,9 +7376,9 @@ public class IntMaxVectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueIntMaxVectorTestsSmokeTest() { + static void MaskAllTrueIntVectorMaxTestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongVector128LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/LongVector128LoadStoreTests.java index 57a0880aed3..3aa9c93e0d7 100644 --- a/test/jdk/jdk/incubator/vector/Long128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector128LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Long128VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation LongVector128LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class LongVector128LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = LongVector.SPECIES_128; @@ -61,14 +61,29 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(long[] r, long[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "longProviderForIOOBE") @@ -870,11 +885,11 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(long[] r, long[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Long128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Long128VectorTests.java b/test/jdk/jdk/incubator/vector/LongVector128Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Long128VectorTests.java rename to test/jdk/jdk/incubator/vector/LongVector128Tests.java index 227f196ffdf..1d3af1684b9 100644 --- a/test/jdk/jdk/incubator/vector/Long128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector128Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongVector128Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Long128VectorTests extends AbstractVectorTest { +public class LongVector128Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = LongVector.SPECIES_128; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected, long delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(long actual, long expected, long delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final long CONST_SHIFT = Long.SIZE / 2; @@ -96,10 +133,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +148,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { long[] ref = f.apply(a[i]); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +164,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +183,13 @@ public class Long128VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +205,13 @@ public class Long128VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -187,10 +224,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -202,10 +239,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -214,12 +251,12 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -230,20 +267,20 @@ public class Long128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (long)0); + assertEquals(r[i + k], (long)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -255,19 +292,19 @@ public class Long128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (long)0); + assertEquals(r[i + j], (long)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -283,11 +320,11 @@ public class Long128VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -296,12 +333,12 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -311,17 +348,17 @@ public class Long128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -331,17 +368,17 @@ public class Long128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -355,10 +392,10 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -370,10 +407,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -385,10 +422,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -409,18 +446,18 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -435,18 +472,18 @@ public class Long128VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -454,10 +491,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -465,10 +502,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -476,10 +513,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -488,10 +525,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -504,10 +541,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -519,10 +556,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -534,10 +571,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -552,10 +589,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -568,11 +605,11 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -586,11 +623,11 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -612,11 +649,11 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -630,11 +667,11 @@ public class Long128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -654,10 +691,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -669,10 +706,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -681,10 +718,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -694,10 +731,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -713,11 +750,11 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -734,11 +771,11 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -749,11 +786,11 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -770,11 +807,11 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -792,13 +829,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -819,13 +856,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -840,13 +877,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(r, a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -867,13 +904,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -887,13 +924,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -908,13 +945,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -929,13 +966,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -951,13 +988,13 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1003,10 +1040,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1016,10 +1053,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1027,10 +1064,10 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1565,7 +1602,7 @@ public class Long128VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); LongVector a = io.add((long)1); //[1,2] LongVector b = a.neg(); //[-1,-2] long[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1580,19 +1617,19 @@ public class Long128VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); LongVector uab0 = zab0.rearrange(unz0,zab1); LongVector uab1 = zab0.rearrange(unz1,zab1); long[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1607,7 +1644,7 @@ public class Long128VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1615,9 +1652,9 @@ public class Long128VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1646,7 +1683,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ADDLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1659,7 +1696,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::ADD); + assertArraysEquals(r, a, b, LongVector128Tests::ADD); } static long add(long a, long b) { @@ -1667,7 +1704,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void addLong128VectorTests(IntFunction fa, IntFunction fb) { + static void addLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1678,11 +1715,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::add); + assertArraysEquals(r, a, b, LongVector128Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1698,11 +1735,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::ADD); + assertArraysEquals(r, a, b, mask, LongVector128Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1716,7 +1753,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long128VectorTests::add); + assertArraysEquals(r, a, b, mask, LongVector128Tests::add); } static long SUB(long a, long b) { @@ -1724,7 +1761,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void SUBLong128VectorTests(IntFunction fa, IntFunction fb) { + static void SUBLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1737,7 +1774,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::SUB); + assertArraysEquals(r, a, b, LongVector128Tests::SUB); } static long sub(long a, long b) { @@ -1745,7 +1782,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void subLong128VectorTests(IntFunction fa, IntFunction fb) { + static void subLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1756,11 +1793,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::sub); + assertArraysEquals(r, a, b, LongVector128Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void SUBLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1776,11 +1813,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::SUB); + assertArraysEquals(r, a, b, mask, LongVector128Tests::SUB); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1794,7 +1831,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long128VectorTests::sub); + assertArraysEquals(r, a, b, mask, LongVector128Tests::sub); } static long MUL(long a, long b) { @@ -1802,7 +1839,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MULLong128VectorTests(IntFunction fa, IntFunction fb) { + static void MULLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1815,7 +1852,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::MUL); + assertArraysEquals(r, a, b, LongVector128Tests::MUL); } static long mul(long a, long b) { @@ -1823,7 +1860,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong128VectorTests(IntFunction fa, IntFunction fb) { + static void mulLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1834,11 +1871,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::mul); + assertArraysEquals(r, a, b, LongVector128Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void MULLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1854,11 +1891,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::MUL); + assertArraysEquals(r, a, b, mask, LongVector128Tests::MUL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1872,7 +1909,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long128VectorTests::mul); + assertArraysEquals(r, a, b, mask, LongVector128Tests::mul); } static long DIV(long a, long b) { @@ -1880,7 +1917,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void DIVLong128VectorTests(IntFunction fa, IntFunction fb) { + static void DIVLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1895,7 +1932,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::DIV); + assertArraysEquals(r, a, b, LongVector128Tests::DIV); } static long div(long a, long b) { @@ -1903,7 +1940,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void divLong128VectorTests(IntFunction fa, IntFunction fb) { + static void divLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1918,11 +1955,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::div); + assertArraysEquals(r, a, b, LongVector128Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void DIVLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1940,11 +1977,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::DIV); + assertArraysEquals(r, a, b, mask, LongVector128Tests::DIV); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1962,7 +1999,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::div); + assertArraysEquals(r, a, b, mask, LongVector128Tests::div); } static long FIRST_NONZERO(long a, long b) { @@ -1970,7 +2007,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void FIRST_NONZEROLong128VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1983,11 +2020,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, LongVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void FIRST_NONZEROLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2003,7 +2040,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, LongVector128Tests::FIRST_NONZERO); } static long AND(long a, long b) { @@ -2011,7 +2048,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ANDLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2024,7 +2061,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::AND); + assertArraysEquals(r, a, b, LongVector128Tests::AND); } static long and(long a, long b) { @@ -2032,7 +2069,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void andLong128VectorTests(IntFunction fa, IntFunction fb) { + static void andLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2043,11 +2080,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::and); + assertArraysEquals(r, a, b, LongVector128Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2063,7 +2100,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::AND); + assertArraysEquals(r, a, b, mask, LongVector128Tests::AND); } static long AND_NOT(long a, long b) { @@ -2071,7 +2108,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void AND_NOTLong128VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2084,11 +2121,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, LongVector128Tests::AND_NOT); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void AND_NOTLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2104,7 +2141,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, LongVector128Tests::AND_NOT); } static long OR(long a, long b) { @@ -2112,7 +2149,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ORLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2125,7 +2162,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::OR); + assertArraysEquals(r, a, b, LongVector128Tests::OR); } static long or(long a, long b) { @@ -2133,7 +2170,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void orLong128VectorTests(IntFunction fa, IntFunction fb) { + static void orLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2144,11 +2181,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::or); + assertArraysEquals(r, a, b, LongVector128Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2164,7 +2201,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::OR); + assertArraysEquals(r, a, b, mask, LongVector128Tests::OR); } static long XOR(long a, long b) { @@ -2172,7 +2209,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void XORLong128VectorTests(IntFunction fa, IntFunction fb) { + static void XORLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2185,11 +2222,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::XOR); + assertArraysEquals(r, a, b, LongVector128Tests::XOR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void XORLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2205,7 +2242,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::XOR); + assertArraysEquals(r, a, b, mask, LongVector128Tests::XOR); } static long COMPRESS_BITS(long a, long b) { @@ -2213,7 +2250,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void COMPRESS_BITSLong128VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2263,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, LongVector128Tests::COMPRESS_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void COMPRESS_BITSLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2246,7 +2283,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, LongVector128Tests::COMPRESS_BITS); } static long EXPAND_BITS(long a, long b) { @@ -2254,7 +2291,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void EXPAND_BITSLong128VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2267,11 +2304,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, LongVector128Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void EXPAND_BITSLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2287,11 +2324,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, LongVector128Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpProvider") - static void addLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2301,11 +2338,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2318,11 +2355,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, LongVector128Tests::add); } @Test(dataProvider = "longBinaryOpProvider") - static void subLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2332,11 +2369,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2386,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, LongVector128Tests::sub); } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2400,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2380,11 +2417,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, LongVector128Tests::mul); } @Test(dataProvider = "longBinaryOpProvider") - static void divLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2396,11 +2433,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2415,11 +2452,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, LongVector128Tests::div); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2429,11 +2466,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void orLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2443,11 +2480,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::or); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2460,11 +2497,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, LongVector128Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2474,11 +2511,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void andLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2488,11 +2525,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::and); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2505,11 +2542,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, LongVector128Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2519,11 +2556,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, LongVector128Tests::OR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2536,11 +2573,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector128Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDLongVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2550,11 +2587,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, LongVector128Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDLongVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2567,7 +2604,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector128Tests::ADD); } static long LSHL(long a, long b) { @@ -2575,7 +2612,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2588,11 +2625,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::LSHL); + assertArraysEquals(r, a, b, LongVector128Tests::LSHL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2608,7 +2645,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, LongVector128Tests::LSHL); } static long ASHR(long a, long b) { @@ -2616,7 +2653,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2629,11 +2666,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::ASHR); + assertArraysEquals(r, a, b, LongVector128Tests::ASHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2649,7 +2686,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, LongVector128Tests::ASHR); } static long LSHR(long a, long b) { @@ -2657,7 +2694,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2670,11 +2707,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::LSHR); + assertArraysEquals(r, a, b, LongVector128Tests::LSHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2690,7 +2727,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, LongVector128Tests::LSHR); } static long LSHL_unary(long a, long b) { @@ -2698,7 +2735,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLLongVector128TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2710,11 +2747,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, LongVector128Tests::LSHL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2729,7 +2766,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector128Tests::LSHL_unary); } static long LSHR_unary(long a, long b) { @@ -2737,7 +2774,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRLongVector128TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2749,11 +2786,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, LongVector128Tests::LSHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2768,7 +2805,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector128Tests::LSHR_unary); } static long ASHR_unary(long a, long b) { @@ -2776,7 +2813,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRLongVector128TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2788,11 +2825,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, LongVector128Tests::ASHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2807,7 +2844,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector128Tests::ASHR_unary); } static long ROR(long a, long b) { @@ -2815,7 +2852,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong128VectorTests(IntFunction fa, IntFunction fb) { + static void RORLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2828,11 +2865,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::ROR); + assertArraysEquals(r, a, b, LongVector128Tests::ROR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2848,7 +2885,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::ROR); + assertArraysEquals(r, a, b, mask, LongVector128Tests::ROR); } static long ROL(long a, long b) { @@ -2856,7 +2893,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ROLLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2869,11 +2906,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::ROL); + assertArraysEquals(r, a, b, LongVector128Tests::ROL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2889,7 +2926,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::ROL); + assertArraysEquals(r, a, b, mask, LongVector128Tests::ROL); } static long ROR_unary(long a, long b) { @@ -2897,7 +2934,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORLongVector128TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2909,11 +2946,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, LongVector128Tests::ROR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORLongVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2928,7 +2965,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector128Tests::ROR_unary); } static long ROL_unary(long a, long b) { @@ -2936,7 +2973,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLLongVector128TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2948,11 +2985,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, LongVector128Tests::ROL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2967,14 +3004,14 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector128Tests::ROL_unary); } static long LSHR_binary_const(long a) { return (long)((a >>> CONST_SHIFT)); } @Test(dataProvider = "longUnaryOpProvider") - static void LSHRLong128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRLongVector128TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2985,11 +3022,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, LongVector128Tests::LSHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHRLong128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRLongVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3003,7 +3040,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector128Tests::LSHR_binary_const); } static long LSHL_binary_const(long a) { @@ -3011,7 +3048,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LSHLLong128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLLongVector128TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3022,11 +3059,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, LongVector128Tests::LSHL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHLLong128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLLongVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3040,7 +3077,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector128Tests::LSHL_binary_const); } static long ASHR_binary_const(long a) { @@ -3048,7 +3085,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ASHRLong128VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRLongVector128TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3059,11 +3096,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, LongVector128Tests::ASHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ASHRLong128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRLongVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3077,7 +3114,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector128Tests::ASHR_binary_const); } static long ROR_binary_const(long a) { @@ -3085,7 +3122,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void RORLong128VectorTestsScalarShiftConst(IntFunction fa) { + static void RORLongVector128TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3096,11 +3133,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, LongVector128Tests::ROR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void RORLong128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORLongVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3114,7 +3151,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector128Tests::ROR_binary_const); } static long ROL_binary_const(long a) { @@ -3122,7 +3159,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ROLLong128VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLLongVector128TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3133,11 +3170,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, LongVector128Tests::ROL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ROLLong128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLLongVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3151,14 +3188,14 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector128Tests::ROL_binary_const); } static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MINLong128VectorTestsWithMemOp(IntFunction fa) { + static void MINLongVector128TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3169,13 +3206,13 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long128VectorTests::MIN); + assertArraysEquals(r, a, (long)10, LongVector128Tests::MIN); } static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void minLong128VectorTestsWithMemOp(IntFunction fa) { + static void minLongVector128TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3186,13 +3223,13 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long128VectorTests::min); + assertArraysEquals(r, a, (long)10, LongVector128Tests::min); } static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINLong128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINLongVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3205,13 +3242,13 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long128VectorTests::MIN); + assertArraysEquals(r, a, (long)10, mask, LongVector128Tests::MIN); } static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MAXLong128VectorTestsWithMemOp(IntFunction fa) { + static void MAXLongVector128TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3222,13 +3259,13 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long128VectorTests::MAX); + assertArraysEquals(r, a, (long)10, LongVector128Tests::MAX); } static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void maxLong128VectorTestsWithMemOp(IntFunction fa) { + static void maxLongVector128TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3239,13 +3276,13 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long128VectorTests::max); + assertArraysEquals(r, a, (long)10, LongVector128Tests::max); } static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXLong128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXLongVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3258,7 +3295,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long128VectorTests::MAX); + assertArraysEquals(r, a, (long)10, mask, LongVector128Tests::MAX); } static long MIN(long a, long b) { @@ -3266,7 +3303,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong128VectorTests(IntFunction fa, IntFunction fb) { + static void MINLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3279,7 +3316,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::MIN); + assertArraysEquals(r, a, b, LongVector128Tests::MIN); } static long min(long a, long b) { @@ -3287,7 +3324,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void minLong128VectorTests(IntFunction fa, IntFunction fb) { + static void minLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3298,7 +3335,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::min); + assertArraysEquals(r, a, b, LongVector128Tests::min); } static long MAX(long a, long b) { @@ -3306,7 +3343,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong128VectorTests(IntFunction fa, IntFunction fb) { + static void MAXLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3319,7 +3356,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::MAX); + assertArraysEquals(r, a, b, LongVector128Tests::MAX); } static long max(long a, long b) { @@ -3327,7 +3364,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maxLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3338,7 +3375,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long128VectorTests::max); + assertArraysEquals(r, a, b, LongVector128Tests::max); } static long UMIN(long a, long b) { @@ -3346,7 +3383,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMINLong128VectorTests(IntFunction fa, IntFunction fb) { + static void UMINLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3359,11 +3396,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::UMIN); + assertArraysEquals(r, a, b, LongVector128Tests::UMIN); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMINLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3379,7 +3416,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, LongVector128Tests::UMIN); } static long UMAX(long a, long b) { @@ -3387,7 +3424,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMAXLong128VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3400,11 +3437,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::UMAX); + assertArraysEquals(r, a, b, LongVector128Tests::UMAX); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMAXLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3420,7 +3457,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, LongVector128Tests::UMAX); } static long SADD(long a, long b) { @@ -3428,7 +3465,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SADDLong128VectorTests(IntFunction fa, IntFunction fb) { + static void SADDLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3441,11 +3478,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::SADD); + assertArraysEquals(r, a, b, LongVector128Tests::SADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SADDLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3461,7 +3498,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::SADD); + assertArraysEquals(r, a, b, mask, LongVector128Tests::SADD); } static long SSUB(long a, long b) { @@ -3469,7 +3506,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SSUBLong128VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3482,11 +3519,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::SSUB); + assertArraysEquals(r, a, b, LongVector128Tests::SSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SSUBLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3502,7 +3539,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, LongVector128Tests::SSUB); } static long SUADD(long a, long b) { @@ -3510,7 +3547,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUADDLong128VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3560,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::SUADD); + assertArraysEquals(r, a, b, LongVector128Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUADDLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3543,7 +3580,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, LongVector128Tests::SUADD); } static long SUSUB(long a, long b) { @@ -3551,7 +3588,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUSUBLong128VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3564,11 +3601,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::SUSUB); + assertArraysEquals(r, a, b, LongVector128Tests::SUSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUSUBLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3584,11 +3621,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, LongVector128Tests::SUSUB); } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3598,11 +3635,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::MIN); } @Test(dataProvider = "longBinaryOpProvider") - static void minLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3612,11 +3649,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::min); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::min); } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3626,11 +3663,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::MAX); } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3640,10 +3677,10 @@ public class Long128VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long128VectorTests::max); + assertBroadcastArraysEquals(r, a, b, LongVector128Tests::max); } @Test(dataProvider = "longSaturatingBinaryOpAssocProvider") - static void SUADDAssocLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocLongVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -3660,11 +3697,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Long128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, LongVector128Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3685,7 +3722,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Long128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, LongVector128Tests::SUADD); } static long ANDReduce(long[] a, int idx) { @@ -3707,7 +3744,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ANDReduceLong128VectorTests(IntFunction fa) { + static void ANDReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3723,7 +3760,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::ANDReduce, Long128VectorTests::ANDReduceAll); + LongVector128Tests::ANDReduce, LongVector128Tests::ANDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3731,20 +3768,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = AND_IDENTITY; - Assert.assertEquals((long) (id & id), id, + assertEquals((long) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id & x), x); - Assert.assertEquals((long) (x & id), x); + assertEquals((long) (id & x), x); + assertEquals((long) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id & x), x, + assertEquals((long) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x & id), x, + assertEquals((long) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3769,7 +3806,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ANDReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3787,7 +3824,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::ANDReduceMasked, Long128VectorTests::ANDReduceAllMasked); + LongVector128Tests::ANDReduceMasked, LongVector128Tests::ANDReduceAllMasked); } static long ORReduce(long[] a, int idx) { @@ -3809,7 +3846,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ORReduceLong128VectorTests(IntFunction fa) { + static void ORReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3825,7 +3862,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::ORReduce, Long128VectorTests::ORReduceAll); + LongVector128Tests::ORReduce, LongVector128Tests::ORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3833,20 +3870,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = OR_IDENTITY; - Assert.assertEquals((long) (id | id), id, + assertEquals((long) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id | x), x); - Assert.assertEquals((long) (x | id), x); + assertEquals((long) (id | x), x); + assertEquals((long) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id | x), x, + assertEquals((long) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x | id), x, + assertEquals((long) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3871,7 +3908,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ORReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3889,7 +3926,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::ORReduceMasked, Long128VectorTests::ORReduceAllMasked); + LongVector128Tests::ORReduceMasked, LongVector128Tests::ORReduceAllMasked); } static long XORReduce(long[] a, int idx) { @@ -3911,7 +3948,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void XORReduceLong128VectorTests(IntFunction fa) { + static void XORReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3927,7 +3964,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::XORReduce, Long128VectorTests::XORReduceAll); + LongVector128Tests::XORReduce, LongVector128Tests::XORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3935,20 +3972,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = XOR_IDENTITY; - Assert.assertEquals((long) (id ^ id), id, + assertEquals((long) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id ^ x), x); - Assert.assertEquals((long) (x ^ id), x); + assertEquals((long) (id ^ x), x); + assertEquals((long) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id ^ x), x, + assertEquals((long) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x ^ id), x, + assertEquals((long) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3973,7 +4010,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void XORReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3991,7 +4028,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::XORReduceMasked, Long128VectorTests::XORReduceAllMasked); + LongVector128Tests::XORReduceMasked, LongVector128Tests::XORReduceAllMasked); } static long ADDReduce(long[] a, int idx) { @@ -4013,7 +4050,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLong128VectorTests(IntFunction fa) { + static void ADDReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4029,7 +4066,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::ADDReduce, Long128VectorTests::ADDReduceAll); + LongVector128Tests::ADDReduce, LongVector128Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4037,20 +4074,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = ADD_IDENTITY; - Assert.assertEquals((long) (id + id), id, + assertEquals((long) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id + x), x); - Assert.assertEquals((long) (x + id), x); + assertEquals((long) (id + x), x); + assertEquals((long) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id + x), x, + assertEquals((long) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x + id), x, + assertEquals((long) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4075,7 +4112,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4093,7 +4130,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::ADDReduceMasked, Long128VectorTests::ADDReduceAllMasked); + LongVector128Tests::ADDReduceMasked, LongVector128Tests::ADDReduceAllMasked); } static long MULReduce(long[] a, int idx) { @@ -4115,7 +4152,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MULReduceLong128VectorTests(IntFunction fa) { + static void MULReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4131,7 +4168,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::MULReduce, Long128VectorTests::MULReduceAll); + LongVector128Tests::MULReduce, LongVector128Tests::MULReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4139,20 +4176,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MUL_IDENTITY; - Assert.assertEquals((long) (id * id), id, + assertEquals((long) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id * x), x); - Assert.assertEquals((long) (x * id), x); + assertEquals((long) (id * x), x); + assertEquals((long) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id * x), x, + assertEquals((long) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x * id), x, + assertEquals((long) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4177,7 +4214,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MULReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4195,7 +4232,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::MULReduceMasked, Long128VectorTests::MULReduceAllMasked); + LongVector128Tests::MULReduceMasked, LongVector128Tests::MULReduceAllMasked); } static long MINReduce(long[] a, int idx) { @@ -4217,7 +4254,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MINReduceLong128VectorTests(IntFunction fa) { + static void MINReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4233,7 +4270,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::MINReduce, Long128VectorTests::MINReduceAll); + LongVector128Tests::MINReduce, LongVector128Tests::MINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4241,20 +4278,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MIN_IDENTITY; - Assert.assertEquals((long) Math.min(id, id), id, + assertEquals((long) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.min(id, x), x); - Assert.assertEquals((long) Math.min(x, id), x); + assertEquals((long) Math.min(id, x), x); + assertEquals((long) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.min(id, x), x, + assertEquals((long) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.min(x, id), x, + assertEquals((long) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4279,7 +4316,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4297,7 +4334,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::MINReduceMasked, Long128VectorTests::MINReduceAllMasked); + LongVector128Tests::MINReduceMasked, LongVector128Tests::MINReduceAllMasked); } static long MAXReduce(long[] a, int idx) { @@ -4319,7 +4356,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MAXReduceLong128VectorTests(IntFunction fa) { + static void MAXReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4335,7 +4372,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::MAXReduce, Long128VectorTests::MAXReduceAll); + LongVector128Tests::MAXReduce, LongVector128Tests::MAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4343,20 +4380,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MAX_IDENTITY; - Assert.assertEquals((long) Math.max(id, id), id, + assertEquals((long) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.max(id, x), x); - Assert.assertEquals((long) Math.max(x, id), x); + assertEquals((long) Math.max(id, x), x); + assertEquals((long) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.max(id, x), x, + assertEquals((long) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.max(x, id), x, + assertEquals((long) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4381,7 +4418,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4399,7 +4436,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::MAXReduceMasked, Long128VectorTests::MAXReduceAllMasked); + LongVector128Tests::MAXReduceMasked, LongVector128Tests::MAXReduceAllMasked); } static long UMINReduce(long[] a, int idx) { @@ -4421,7 +4458,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMINReduceLong128VectorTests(IntFunction fa) { + static void UMINReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4437,7 +4474,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::UMINReduce, Long128VectorTests::UMINReduceAll); + LongVector128Tests::UMINReduce, LongVector128Tests::UMINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4445,20 +4482,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMIN_IDENTITY; - Assert.assertEquals((long) VectorMath.minUnsigned(id, id), id, + assertEquals((long) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x); + assertEquals((long) VectorMath.minUnsigned(id, x), x); + assertEquals((long) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x, + assertEquals((long) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x, + assertEquals((long) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4483,7 +4520,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMINReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4501,7 +4538,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::UMINReduceMasked, Long128VectorTests::UMINReduceAllMasked); + LongVector128Tests::UMINReduceMasked, LongVector128Tests::UMINReduceAllMasked); } static long UMAXReduce(long[] a, int idx) { @@ -4523,7 +4560,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMAXReduceLong128VectorTests(IntFunction fa) { + static void UMAXReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4539,7 +4576,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::UMAXReduce, Long128VectorTests::UMAXReduceAll); + LongVector128Tests::UMAXReduce, LongVector128Tests::UMAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4547,20 +4584,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMAX_IDENTITY; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, id), id, + assertEquals((long) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x); + assertEquals((long) VectorMath.maxUnsigned(id, x), x); + assertEquals((long) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x, + assertEquals((long) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x, + assertEquals((long) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4585,7 +4622,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMAXReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4603,7 +4640,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::UMAXReduceMasked, Long128VectorTests::UMAXReduceAllMasked); + LongVector128Tests::UMAXReduceMasked, LongVector128Tests::UMAXReduceAllMasked); } static long FIRST_NONZEROReduce(long[] a, int idx) { @@ -4625,7 +4662,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void FIRST_NONZEROReduceLong128VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4641,7 +4678,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::FIRST_NONZEROReduce, Long128VectorTests::FIRST_NONZEROReduceAll); + LongVector128Tests::FIRST_NONZEROReduce, LongVector128Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4649,20 +4686,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4687,7 +4724,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void FIRST_NONZEROReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4705,7 +4742,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::FIRST_NONZEROReduceMasked, Long128VectorTests::FIRST_NONZEROReduceAllMasked); + LongVector128Tests::FIRST_NONZEROReduceMasked, LongVector128Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4718,7 +4755,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueLong128VectorTests(IntFunction fm) { + static void anyTrueLongVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4729,7 +4766,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long128VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, LongVector128Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4742,7 +4779,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueLong128VectorTests(IntFunction fm) { + static void allTrueLongVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4753,7 +4790,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long128VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, LongVector128Tests::allTrue); } static long SUADDReduce(long[] a, int idx) { @@ -4775,7 +4812,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingUnaryOpProvider") - static void SUADDReduceLong128VectorTests(IntFunction fa) { + static void SUADDReduceLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4791,7 +4828,7 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::SUADDReduce, Long128VectorTests::SUADDReduceAll); + LongVector128Tests::SUADDReduce, LongVector128Tests::SUADDReduceAll); } @Test(dataProvider = "longSaturatingUnaryOpProvider") @@ -4799,20 +4836,20 @@ public class Long128VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = SUADD_IDENTITY; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4836,7 +4873,7 @@ public class Long128VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "longSaturatingUnaryOpMaskProvider") - static void SUADDReduceLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4854,11 +4891,11 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::SUADDReduceMasked, Long128VectorTests::SUADDReduceAllMasked); + LongVector128Tests::SUADDReduceMasked, LongVector128Tests::SUADDReduceAllMasked); } @Test(dataProvider = "longBinaryOpProvider") - static void withLong128VectorTests(IntFunction fa, IntFunction fb) { + static void withLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -4881,7 +4918,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_DEFAULTLong128VectorTests(IntFunction fa) { + static void IS_DEFAULTLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4891,14 +4928,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_DEFAULTMaskedLong128VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4911,7 +4948,7 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4922,7 +4959,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_NEGATIVELong128VectorTests(IntFunction fa) { + static void IS_NEGATIVELongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4932,14 +4969,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_NEGATIVEMaskedLong128VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4952,14 +4989,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong128VectorTests(IntFunction fa, IntFunction fb) { + static void LTLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4971,14 +5008,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ltLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ltLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4990,14 +5027,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5013,14 +5050,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GTLong128VectorTests(IntFunction fa, IntFunction fb) { + static void GTLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5032,14 +5069,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GTLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5055,14 +5092,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong128VectorTests(IntFunction fa, IntFunction fb) { + static void EQLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5074,14 +5111,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong128VectorTests(IntFunction fa, IntFunction fb) { + static void eqLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5093,14 +5130,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5116,14 +5153,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void NELong128VectorTests(IntFunction fa, IntFunction fb) { + static void NELongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5135,14 +5172,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void NELong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NELongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5158,14 +5195,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LELong128VectorTests(IntFunction fa, IntFunction fb) { + static void LELongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5177,14 +5214,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LELong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LELongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5200,14 +5237,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GELong128VectorTests(IntFunction fa, IntFunction fb) { + static void GELongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5219,14 +5256,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GELong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GELongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5242,14 +5279,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULTLong128VectorTests(IntFunction fa, IntFunction fb) { + static void ULTLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5261,14 +5298,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULTLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5284,14 +5321,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGTLong128VectorTests(IntFunction fa, IntFunction fb) { + static void UGTLongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5303,14 +5340,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGTLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5326,14 +5363,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULELong128VectorTests(IntFunction fa, IntFunction fb) { + static void ULELongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5345,14 +5382,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULELong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULELongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5368,14 +5405,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGELong128VectorTests(IntFunction fa, IntFunction fb) { + static void UGELongVector128Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5387,14 +5424,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGELong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGELongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5410,14 +5447,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5427,13 +5464,13 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5447,14 +5484,14 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5464,13 +5501,13 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5484,7 +5521,7 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @@ -5495,7 +5532,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void blendLong128VectorTests(IntFunction fa, IntFunction fb, + static void blendLongVector128Tests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5511,11 +5548,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long128VectorTests::blend); + assertArraysEquals(r, a, b, mask, LongVector128Tests::blend); } @Test(dataProvider = "longUnaryOpShuffleProvider") - static void RearrangeLong128VectorTests(IntFunction fa, + static void RearrangeLongVector128Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5532,7 +5569,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpShuffleMaskProvider") - static void RearrangeLong128VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeLongVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -5550,7 +5587,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void compressLong128VectorTests(IntFunction fa, + static void compressLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5568,7 +5605,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void expandLong128VectorTests(IntFunction fa, + static void expandLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5586,7 +5623,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void getLong128VectorTests(IntFunction fa) { + static void getLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5742,7 +5779,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BroadcastLong128VectorTests(IntFunction fa) { + static void BroadcastLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5756,7 +5793,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZeroLong128VectorTests(IntFunction fa) { + static void ZeroLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5766,7 +5803,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static long[] sliceUnary(long[] a, int origin, int idx) { @@ -5781,7 +5818,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void sliceUnaryLong128VectorTests(IntFunction fa) { + static void sliceUnaryLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5792,7 +5829,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long128VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, LongVector128Tests::sliceUnary); } static long[] sliceBinary(long[] a, long[] b, int origin, int idx) { @@ -5809,7 +5846,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void sliceBinaryLong128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryLongVector128TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5822,7 +5859,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Long128VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, LongVector128Tests::sliceBinary); } static long[] slice(long[] a, long[] b, int origin, boolean[] mask, int idx) { @@ -5839,7 +5876,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void sliceLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5856,7 +5893,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Long128VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, LongVector128Tests::slice); } static long[] unsliceUnary(long[] a, int origin, int idx) { @@ -5873,7 +5910,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void unsliceUnaryLong128VectorTests(IntFunction fa) { + static void unsliceUnaryLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5884,7 +5921,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long128VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, LongVector128Tests::unsliceUnary); } static long[] unsliceBinary(long[] a, long[] b, int origin, int part, int idx) { @@ -5910,7 +5947,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void unsliceBinaryLong128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryLongVector128TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5924,7 +5961,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Long128VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, LongVector128Tests::unsliceBinary); } static long[] unslice(long[] a, long[] b, int origin, int part, boolean[] mask, int idx) { @@ -5964,7 +6001,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void unsliceLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5981,7 +6018,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Long128VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, LongVector128Tests::unslice); } static long BITWISE_BLEND(long a, long b, long c) { @@ -5993,7 +6030,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6008,11 +6045,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Long128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6025,11 +6062,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Long128VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, LongVector128Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6047,11 +6084,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Long128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6062,11 +6099,11 @@ public class Long128VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6077,11 +6114,11 @@ public class Long128VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6092,11 +6129,11 @@ public class Long128VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long128VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, LongVector128Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6107,11 +6144,11 @@ public class Long128VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long128VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector128Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6126,11 +6163,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Long128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong128VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector128TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6145,11 +6182,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Long128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6160,11 +6197,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6175,11 +6212,11 @@ public class Long128VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long128VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector128Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector128TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6193,7 +6230,7 @@ public class Long128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Long128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongVector128Tests::BITWISE_BLEND); } static long NEG(long a) { @@ -6205,7 +6242,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NEGLong128VectorTests(IntFunction fa) { + static void NEGLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6216,11 +6253,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::NEG); + assertArraysEquals(r, a, LongVector128Tests::NEG); } @Test(dataProvider = "longUnaryOpProvider") - static void negLong128VectorTests(IntFunction fa) { + static void negLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6231,11 +6268,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::neg); + assertArraysEquals(r, a, LongVector128Tests::neg); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NEGMaskedLong128VectorTests(IntFunction fa, + static void NEGMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6249,7 +6286,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::NEG); + assertArraysEquals(r, a, mask, LongVector128Tests::NEG); } static long ABS(long a) { @@ -6261,7 +6298,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ABSLong128VectorTests(IntFunction fa) { + static void ABSLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6272,11 +6309,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::ABS); + assertArraysEquals(r, a, LongVector128Tests::ABS); } @Test(dataProvider = "longUnaryOpProvider") - static void absLong128VectorTests(IntFunction fa) { + static void absLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6287,11 +6324,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::abs); + assertArraysEquals(r, a, LongVector128Tests::abs); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ABSMaskedLong128VectorTests(IntFunction fa, + static void ABSMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6305,7 +6342,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::ABS); + assertArraysEquals(r, a, mask, LongVector128Tests::ABS); } static long NOT(long a) { @@ -6317,7 +6354,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NOTLong128VectorTests(IntFunction fa) { + static void NOTLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6328,11 +6365,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::NOT); + assertArraysEquals(r, a, LongVector128Tests::NOT); } @Test(dataProvider = "longUnaryOpProvider") - static void notLong128VectorTests(IntFunction fa) { + static void notLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6343,11 +6380,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::not); + assertArraysEquals(r, a, LongVector128Tests::not); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NOTMaskedLong128VectorTests(IntFunction fa, + static void NOTMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6361,7 +6398,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::NOT); + assertArraysEquals(r, a, mask, LongVector128Tests::NOT); } static long ZOMO(long a) { @@ -6369,7 +6406,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZOMOLong128VectorTests(IntFunction fa) { + static void ZOMOLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6380,11 +6417,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::ZOMO); + assertArraysEquals(r, a, LongVector128Tests::ZOMO); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ZOMOMaskedLong128VectorTests(IntFunction fa, + static void ZOMOMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6398,7 +6435,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::ZOMO); + assertArraysEquals(r, a, mask, LongVector128Tests::ZOMO); } static long BIT_COUNT(long a) { @@ -6406,7 +6443,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BIT_COUNTLong128VectorTests(IntFunction fa) { + static void BIT_COUNTLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6417,11 +6454,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, LongVector128Tests::BIT_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void BIT_COUNTMaskedLong128VectorTests(IntFunction fa, + static void BIT_COUNTMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6435,7 +6472,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, LongVector128Tests::BIT_COUNT); } static long TRAILING_ZEROS_COUNT(long a) { @@ -6443,7 +6480,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void TRAILING_ZEROS_COUNTLong128VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6454,11 +6491,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector128Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedLong128VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6472,7 +6509,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector128Tests::TRAILING_ZEROS_COUNT); } static long LEADING_ZEROS_COUNT(long a) { @@ -6480,7 +6517,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LEADING_ZEROS_COUNTLong128VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6491,11 +6528,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector128Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedLong128VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6509,7 +6546,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector128Tests::LEADING_ZEROS_COUNT); } static long REVERSE(long a) { @@ -6517,7 +6554,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSELong128VectorTests(IntFunction fa) { + static void REVERSELongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6528,11 +6565,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::REVERSE); + assertArraysEquals(r, a, LongVector128Tests::REVERSE); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSEMaskedLong128VectorTests(IntFunction fa, + static void REVERSEMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6546,7 +6583,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::REVERSE); + assertArraysEquals(r, a, mask, LongVector128Tests::REVERSE); } static long REVERSE_BYTES(long a) { @@ -6554,7 +6591,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSE_BYTESLong128VectorTests(IntFunction fa) { + static void REVERSE_BYTESLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6565,11 +6602,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, LongVector128Tests::REVERSE_BYTES); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedLong128VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedLongVector128Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6583,7 +6620,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, LongVector128Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6591,7 +6628,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandLongVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6604,7 +6641,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::band); + assertArraysEquals(r, a, b, LongVector128Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6612,7 +6649,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maskorLongVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6625,7 +6662,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::bor); + assertArraysEquals(r, a, b, LongVector128Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6633,7 +6670,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorLongVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6646,7 +6683,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::bxor); + assertArraysEquals(r, a, b, LongVector128Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6654,7 +6691,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotLongVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6667,7 +6704,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::bandNot); + assertArraysEquals(r, a, b, LongVector128Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6675,7 +6712,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqLongVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6688,7 +6725,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long128VectorTests::beq); + assertArraysEquals(r, a, b, LongVector128Tests::beq); } static boolean unot(boolean a) { @@ -6696,7 +6733,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotLong128VectorTests(IntFunction fa) { + static void masknotLongVector128Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6707,7 +6744,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long128VectorTests::unot); + assertArraysEquals(r, a, LongVector128Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6716,15 +6753,15 @@ public class Long128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongLong128VectorTests(IntFunction fa) { + static void maskFromToLongLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6738,7 +6775,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longCompareOpProvider") - static void ltLong128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltLongVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6748,13 +6785,13 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqLongVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6764,13 +6801,13 @@ public class Long128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longtoIntUnaryOpProvider") - static void toIntArrayLong128VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayLongVector128TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6781,7 +6818,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toLongArrayLong128VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayLongVector128TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6792,7 +6829,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toDoubleArrayLong128VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayLongVector128TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6803,7 +6840,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toStringLong128VectorTestsSmokeTest(IntFunction fa) { + static void toStringLongVector128TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6816,7 +6853,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void hashCodeLong128VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeLongVector128TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6832,7 +6869,7 @@ public class Long128VectorTests extends AbstractVectorTest { @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLongLong128VectorTests(IntFunction fa) { + static void ADDReduceLongLongVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -6848,11 +6885,11 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long128VectorTests::ADDReduce, Long128VectorTests::ADDReduceAll); + LongVector128Tests::ADDReduce, LongVector128Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLongLong128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongLongVector128TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6870,11 +6907,11 @@ public class Long128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long128VectorTests::ADDReduceMasked, Long128VectorTests::ADDReduceAllMasked); + LongVector128Tests::ADDReduceMasked, LongVector128Tests::ADDReduceAllMasked); } @Test(dataProvider = "longUnaryOpSelectFromProvider") - static void SelectFromLong128VectorTests(IntFunction fa, + static void SelectFromLongVector128Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); long[] order = fs.apply(a.length, SPECIES.length()); @@ -6890,7 +6927,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorLongVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] idx = fc.apply(SPECIES.length()); @@ -6908,7 +6945,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpSelectFromMaskProvider") - static void SelectFromLong128VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromLongVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -6927,7 +6964,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousLong128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousLongVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6938,12 +6975,12 @@ public class Long128VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringLong128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringLongVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6957,7 +6994,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsLong128VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsLongVector128TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -6966,12 +7003,12 @@ public class Long128VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsLong128VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsLongVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -6981,13 +7018,13 @@ public class Long128VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeLong128VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeLongVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7009,7 +7046,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountLong128VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountLongVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7020,7 +7057,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long128VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, LongVector128Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7034,7 +7071,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueLong128VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueLongVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7045,7 +7082,7 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long128VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, LongVector128Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7059,7 +7096,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueLong128VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueLongVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7070,11 +7107,11 @@ public class Long128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long128VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, LongVector128Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressLong128VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressLongVector128TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7084,7 +7121,7 @@ public class Long128VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7102,7 +7139,7 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeLong128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongVector128TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7110,13 +7147,13 @@ public class Long128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongLong128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongLongVector128TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7124,7 +7161,7 @@ public class Long128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7143,36 +7180,36 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundLong128VectorTestsSmokeTest(int length) { + static void loopBoundLongVector128TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongLong128VectorTestsSmokeTest(int _length) { + static void loopBoundLongLongVector128TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeLong128VectorTestsSmokeTest() { + static void ElementSizeLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Long.SIZE); + assertEquals(elsize, Long.SIZE); } @Test - static void VectorShapeLong128VectorTestsSmokeTest() { + static void VectorShapeLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_128_BIT)); } @Test - static void ShapeWithLanesLong128VectorTestsSmokeTest() { + static void ShapeWithLanesLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(long.class); @@ -7180,32 +7217,32 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeLong128VectorTestsSmokeTest() { + static void ElementTypeLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementType() == long.class); } @Test - static void SpeciesElementSizeLong128VectorTestsSmokeTest() { + static void SpeciesElementSizeLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementSize() == Long.SIZE); } @Test - static void VectorTypeLong128VectorTestsSmokeTest() { + static void VectorTypeLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesLong128VectorTestsSmokeTest() { + static void WithLanesLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(long.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeLong128VectorTestsSmokeTest() { + static void WithShapeLongVector128TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7213,9 +7250,9 @@ public class Long128VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueLong128VectorTestsSmokeTest() { + static void MaskAllTrueLongVector128TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongVector256LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/LongVector256LoadStoreTests.java index f07cf3e68b7..411c48dc7cb 100644 --- a/test/jdk/jdk/incubator/vector/Long256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector256LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Long256VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation LongVector256LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class LongVector256LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = LongVector.SPECIES_256; @@ -61,14 +61,29 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(long[] r, long[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "longProviderForIOOBE") @@ -870,11 +885,11 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(long[] r, long[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Long256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Long256VectorTests.java b/test/jdk/jdk/incubator/vector/LongVector256Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Long256VectorTests.java rename to test/jdk/jdk/incubator/vector/LongVector256Tests.java index c37e68e3728..a766abe920f 100644 --- a/test/jdk/jdk/incubator/vector/Long256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector256Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongVector256Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Long256VectorTests extends AbstractVectorTest { +public class LongVector256Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = LongVector.SPECIES_256; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected, long delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(long actual, long expected, long delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final long CONST_SHIFT = Long.SIZE / 2; @@ -96,10 +133,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +148,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { long[] ref = f.apply(a[i]); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +164,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +183,13 @@ public class Long256VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +205,13 @@ public class Long256VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -187,10 +224,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -202,10 +239,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -214,12 +251,12 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -230,20 +267,20 @@ public class Long256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (long)0); + assertEquals(r[i + k], (long)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -255,19 +292,19 @@ public class Long256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (long)0); + assertEquals(r[i + j], (long)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -283,11 +320,11 @@ public class Long256VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -296,12 +333,12 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -311,17 +348,17 @@ public class Long256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -331,17 +368,17 @@ public class Long256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -355,10 +392,10 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -370,10 +407,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -385,10 +422,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -409,18 +446,18 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -435,18 +472,18 @@ public class Long256VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -454,10 +491,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -465,10 +502,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -476,10 +513,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -488,10 +525,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -504,10 +541,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -519,10 +556,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -534,10 +571,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -552,10 +589,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -568,11 +605,11 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -586,11 +623,11 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -612,11 +649,11 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -630,11 +667,11 @@ public class Long256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -654,10 +691,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -669,10 +706,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -681,10 +718,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -694,10 +731,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -713,11 +750,11 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -734,11 +771,11 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -749,11 +786,11 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -770,11 +807,11 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -792,13 +829,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -819,13 +856,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -840,13 +877,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(r, a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -867,13 +904,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -887,13 +924,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -908,13 +945,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -929,13 +966,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -951,13 +988,13 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1003,10 +1040,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1016,10 +1053,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1027,10 +1064,10 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1565,7 +1602,7 @@ public class Long256VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); LongVector a = io.add((long)1); //[1,2] LongVector b = a.neg(); //[-1,-2] long[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1580,19 +1617,19 @@ public class Long256VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); LongVector uab0 = zab0.rearrange(unz0,zab1); LongVector uab1 = zab0.rearrange(unz1,zab1); long[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1607,7 +1644,7 @@ public class Long256VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1615,9 +1652,9 @@ public class Long256VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1646,7 +1683,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ADDLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1659,7 +1696,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::ADD); + assertArraysEquals(r, a, b, LongVector256Tests::ADD); } static long add(long a, long b) { @@ -1667,7 +1704,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void addLong256VectorTests(IntFunction fa, IntFunction fb) { + static void addLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1678,11 +1715,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::add); + assertArraysEquals(r, a, b, LongVector256Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1698,11 +1735,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::ADD); + assertArraysEquals(r, a, b, mask, LongVector256Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1716,7 +1753,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long256VectorTests::add); + assertArraysEquals(r, a, b, mask, LongVector256Tests::add); } static long SUB(long a, long b) { @@ -1724,7 +1761,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void SUBLong256VectorTests(IntFunction fa, IntFunction fb) { + static void SUBLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1737,7 +1774,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::SUB); + assertArraysEquals(r, a, b, LongVector256Tests::SUB); } static long sub(long a, long b) { @@ -1745,7 +1782,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void subLong256VectorTests(IntFunction fa, IntFunction fb) { + static void subLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1756,11 +1793,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::sub); + assertArraysEquals(r, a, b, LongVector256Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void SUBLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1776,11 +1813,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::SUB); + assertArraysEquals(r, a, b, mask, LongVector256Tests::SUB); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1794,7 +1831,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long256VectorTests::sub); + assertArraysEquals(r, a, b, mask, LongVector256Tests::sub); } static long MUL(long a, long b) { @@ -1802,7 +1839,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MULLong256VectorTests(IntFunction fa, IntFunction fb) { + static void MULLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1815,7 +1852,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::MUL); + assertArraysEquals(r, a, b, LongVector256Tests::MUL); } static long mul(long a, long b) { @@ -1823,7 +1860,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong256VectorTests(IntFunction fa, IntFunction fb) { + static void mulLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1834,11 +1871,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::mul); + assertArraysEquals(r, a, b, LongVector256Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void MULLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1854,11 +1891,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::MUL); + assertArraysEquals(r, a, b, mask, LongVector256Tests::MUL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1872,7 +1909,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long256VectorTests::mul); + assertArraysEquals(r, a, b, mask, LongVector256Tests::mul); } static long DIV(long a, long b) { @@ -1880,7 +1917,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void DIVLong256VectorTests(IntFunction fa, IntFunction fb) { + static void DIVLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1895,7 +1932,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::DIV); + assertArraysEquals(r, a, b, LongVector256Tests::DIV); } static long div(long a, long b) { @@ -1903,7 +1940,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void divLong256VectorTests(IntFunction fa, IntFunction fb) { + static void divLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1918,11 +1955,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::div); + assertArraysEquals(r, a, b, LongVector256Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void DIVLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1940,11 +1977,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::DIV); + assertArraysEquals(r, a, b, mask, LongVector256Tests::DIV); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1962,7 +1999,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::div); + assertArraysEquals(r, a, b, mask, LongVector256Tests::div); } static long FIRST_NONZERO(long a, long b) { @@ -1970,7 +2007,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void FIRST_NONZEROLong256VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1983,11 +2020,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, LongVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void FIRST_NONZEROLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2003,7 +2040,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, LongVector256Tests::FIRST_NONZERO); } static long AND(long a, long b) { @@ -2011,7 +2048,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ANDLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2024,7 +2061,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::AND); + assertArraysEquals(r, a, b, LongVector256Tests::AND); } static long and(long a, long b) { @@ -2032,7 +2069,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void andLong256VectorTests(IntFunction fa, IntFunction fb) { + static void andLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2043,11 +2080,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::and); + assertArraysEquals(r, a, b, LongVector256Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2063,7 +2100,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::AND); + assertArraysEquals(r, a, b, mask, LongVector256Tests::AND); } static long AND_NOT(long a, long b) { @@ -2071,7 +2108,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void AND_NOTLong256VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2084,11 +2121,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, LongVector256Tests::AND_NOT); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void AND_NOTLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2104,7 +2141,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, LongVector256Tests::AND_NOT); } static long OR(long a, long b) { @@ -2112,7 +2149,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ORLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2125,7 +2162,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::OR); + assertArraysEquals(r, a, b, LongVector256Tests::OR); } static long or(long a, long b) { @@ -2133,7 +2170,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void orLong256VectorTests(IntFunction fa, IntFunction fb) { + static void orLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2144,11 +2181,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::or); + assertArraysEquals(r, a, b, LongVector256Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2164,7 +2201,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::OR); + assertArraysEquals(r, a, b, mask, LongVector256Tests::OR); } static long XOR(long a, long b) { @@ -2172,7 +2209,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void XORLong256VectorTests(IntFunction fa, IntFunction fb) { + static void XORLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2185,11 +2222,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::XOR); + assertArraysEquals(r, a, b, LongVector256Tests::XOR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void XORLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2205,7 +2242,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::XOR); + assertArraysEquals(r, a, b, mask, LongVector256Tests::XOR); } static long COMPRESS_BITS(long a, long b) { @@ -2213,7 +2250,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void COMPRESS_BITSLong256VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2263,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, LongVector256Tests::COMPRESS_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void COMPRESS_BITSLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2246,7 +2283,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, LongVector256Tests::COMPRESS_BITS); } static long EXPAND_BITS(long a, long b) { @@ -2254,7 +2291,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void EXPAND_BITSLong256VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2267,11 +2304,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, LongVector256Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void EXPAND_BITSLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2287,11 +2324,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, LongVector256Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpProvider") - static void addLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2301,11 +2338,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2318,11 +2355,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, LongVector256Tests::add); } @Test(dataProvider = "longBinaryOpProvider") - static void subLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2332,11 +2369,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2386,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, LongVector256Tests::sub); } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2400,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2380,11 +2417,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, LongVector256Tests::mul); } @Test(dataProvider = "longBinaryOpProvider") - static void divLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2396,11 +2433,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2415,11 +2452,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, LongVector256Tests::div); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2429,11 +2466,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void orLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2443,11 +2480,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::or); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2460,11 +2497,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, LongVector256Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2474,11 +2511,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void andLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2488,11 +2525,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::and); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2505,11 +2542,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, LongVector256Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2519,11 +2556,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, LongVector256Tests::OR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2536,11 +2573,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector256Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDLongVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2550,11 +2587,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, LongVector256Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDLongVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2567,7 +2604,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector256Tests::ADD); } static long LSHL(long a, long b) { @@ -2575,7 +2612,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2588,11 +2625,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::LSHL); + assertArraysEquals(r, a, b, LongVector256Tests::LSHL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2608,7 +2645,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, LongVector256Tests::LSHL); } static long ASHR(long a, long b) { @@ -2616,7 +2653,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2629,11 +2666,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::ASHR); + assertArraysEquals(r, a, b, LongVector256Tests::ASHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2649,7 +2686,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, LongVector256Tests::ASHR); } static long LSHR(long a, long b) { @@ -2657,7 +2694,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2670,11 +2707,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::LSHR); + assertArraysEquals(r, a, b, LongVector256Tests::LSHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2690,7 +2727,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, LongVector256Tests::LSHR); } static long LSHL_unary(long a, long b) { @@ -2698,7 +2735,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLLongVector256TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2710,11 +2747,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, LongVector256Tests::LSHL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2729,7 +2766,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector256Tests::LSHL_unary); } static long LSHR_unary(long a, long b) { @@ -2737,7 +2774,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRLongVector256TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2749,11 +2786,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, LongVector256Tests::LSHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2768,7 +2805,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector256Tests::LSHR_unary); } static long ASHR_unary(long a, long b) { @@ -2776,7 +2813,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRLongVector256TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2788,11 +2825,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, LongVector256Tests::ASHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2807,7 +2844,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector256Tests::ASHR_unary); } static long ROR(long a, long b) { @@ -2815,7 +2852,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong256VectorTests(IntFunction fa, IntFunction fb) { + static void RORLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2828,11 +2865,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::ROR); + assertArraysEquals(r, a, b, LongVector256Tests::ROR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2848,7 +2885,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::ROR); + assertArraysEquals(r, a, b, mask, LongVector256Tests::ROR); } static long ROL(long a, long b) { @@ -2856,7 +2893,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ROLLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2869,11 +2906,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::ROL); + assertArraysEquals(r, a, b, LongVector256Tests::ROL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2889,7 +2926,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::ROL); + assertArraysEquals(r, a, b, mask, LongVector256Tests::ROL); } static long ROR_unary(long a, long b) { @@ -2897,7 +2934,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORLongVector256TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2909,11 +2946,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, LongVector256Tests::ROR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORLongVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2928,7 +2965,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector256Tests::ROR_unary); } static long ROL_unary(long a, long b) { @@ -2936,7 +2973,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLLongVector256TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2948,11 +2985,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, LongVector256Tests::ROL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2967,14 +3004,14 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector256Tests::ROL_unary); } static long LSHR_binary_const(long a) { return (long)((a >>> CONST_SHIFT)); } @Test(dataProvider = "longUnaryOpProvider") - static void LSHRLong256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRLongVector256TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2985,11 +3022,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, LongVector256Tests::LSHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHRLong256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRLongVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3003,7 +3040,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector256Tests::LSHR_binary_const); } static long LSHL_binary_const(long a) { @@ -3011,7 +3048,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LSHLLong256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLLongVector256TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3022,11 +3059,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, LongVector256Tests::LSHL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHLLong256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLLongVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3040,7 +3077,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector256Tests::LSHL_binary_const); } static long ASHR_binary_const(long a) { @@ -3048,7 +3085,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ASHRLong256VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRLongVector256TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3059,11 +3096,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, LongVector256Tests::ASHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ASHRLong256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRLongVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3077,7 +3114,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector256Tests::ASHR_binary_const); } static long ROR_binary_const(long a) { @@ -3085,7 +3122,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void RORLong256VectorTestsScalarShiftConst(IntFunction fa) { + static void RORLongVector256TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3096,11 +3133,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, LongVector256Tests::ROR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void RORLong256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORLongVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3114,7 +3151,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector256Tests::ROR_binary_const); } static long ROL_binary_const(long a) { @@ -3122,7 +3159,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ROLLong256VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLLongVector256TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3133,11 +3170,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, LongVector256Tests::ROL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ROLLong256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLLongVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3151,14 +3188,14 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector256Tests::ROL_binary_const); } static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MINLong256VectorTestsWithMemOp(IntFunction fa) { + static void MINLongVector256TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3169,13 +3206,13 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long256VectorTests::MIN); + assertArraysEquals(r, a, (long)10, LongVector256Tests::MIN); } static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void minLong256VectorTestsWithMemOp(IntFunction fa) { + static void minLongVector256TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3186,13 +3223,13 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long256VectorTests::min); + assertArraysEquals(r, a, (long)10, LongVector256Tests::min); } static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINLong256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINLongVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3205,13 +3242,13 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long256VectorTests::MIN); + assertArraysEquals(r, a, (long)10, mask, LongVector256Tests::MIN); } static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MAXLong256VectorTestsWithMemOp(IntFunction fa) { + static void MAXLongVector256TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3222,13 +3259,13 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long256VectorTests::MAX); + assertArraysEquals(r, a, (long)10, LongVector256Tests::MAX); } static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void maxLong256VectorTestsWithMemOp(IntFunction fa) { + static void maxLongVector256TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3239,13 +3276,13 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long256VectorTests::max); + assertArraysEquals(r, a, (long)10, LongVector256Tests::max); } static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXLong256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXLongVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3258,7 +3295,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long256VectorTests::MAX); + assertArraysEquals(r, a, (long)10, mask, LongVector256Tests::MAX); } static long MIN(long a, long b) { @@ -3266,7 +3303,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong256VectorTests(IntFunction fa, IntFunction fb) { + static void MINLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3279,7 +3316,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::MIN); + assertArraysEquals(r, a, b, LongVector256Tests::MIN); } static long min(long a, long b) { @@ -3287,7 +3324,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void minLong256VectorTests(IntFunction fa, IntFunction fb) { + static void minLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3298,7 +3335,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::min); + assertArraysEquals(r, a, b, LongVector256Tests::min); } static long MAX(long a, long b) { @@ -3306,7 +3343,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong256VectorTests(IntFunction fa, IntFunction fb) { + static void MAXLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3319,7 +3356,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::MAX); + assertArraysEquals(r, a, b, LongVector256Tests::MAX); } static long max(long a, long b) { @@ -3327,7 +3364,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maxLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3338,7 +3375,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long256VectorTests::max); + assertArraysEquals(r, a, b, LongVector256Tests::max); } static long UMIN(long a, long b) { @@ -3346,7 +3383,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMINLong256VectorTests(IntFunction fa, IntFunction fb) { + static void UMINLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3359,11 +3396,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::UMIN); + assertArraysEquals(r, a, b, LongVector256Tests::UMIN); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMINLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3379,7 +3416,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, LongVector256Tests::UMIN); } static long UMAX(long a, long b) { @@ -3387,7 +3424,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMAXLong256VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3400,11 +3437,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::UMAX); + assertArraysEquals(r, a, b, LongVector256Tests::UMAX); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMAXLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3420,7 +3457,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, LongVector256Tests::UMAX); } static long SADD(long a, long b) { @@ -3428,7 +3465,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SADDLong256VectorTests(IntFunction fa, IntFunction fb) { + static void SADDLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3441,11 +3478,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::SADD); + assertArraysEquals(r, a, b, LongVector256Tests::SADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SADDLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3461,7 +3498,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::SADD); + assertArraysEquals(r, a, b, mask, LongVector256Tests::SADD); } static long SSUB(long a, long b) { @@ -3469,7 +3506,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SSUBLong256VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3482,11 +3519,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::SSUB); + assertArraysEquals(r, a, b, LongVector256Tests::SSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SSUBLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3502,7 +3539,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, LongVector256Tests::SSUB); } static long SUADD(long a, long b) { @@ -3510,7 +3547,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUADDLong256VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3560,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::SUADD); + assertArraysEquals(r, a, b, LongVector256Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUADDLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3543,7 +3580,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, LongVector256Tests::SUADD); } static long SUSUB(long a, long b) { @@ -3551,7 +3588,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUSUBLong256VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3564,11 +3601,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::SUSUB); + assertArraysEquals(r, a, b, LongVector256Tests::SUSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUSUBLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3584,11 +3621,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, LongVector256Tests::SUSUB); } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3598,11 +3635,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::MIN); } @Test(dataProvider = "longBinaryOpProvider") - static void minLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3612,11 +3649,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::min); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::min); } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3626,11 +3663,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::MAX); } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3640,10 +3677,10 @@ public class Long256VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long256VectorTests::max); + assertBroadcastArraysEquals(r, a, b, LongVector256Tests::max); } @Test(dataProvider = "longSaturatingBinaryOpAssocProvider") - static void SUADDAssocLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocLongVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -3660,11 +3697,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Long256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, LongVector256Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3685,7 +3722,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Long256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, LongVector256Tests::SUADD); } static long ANDReduce(long[] a, int idx) { @@ -3707,7 +3744,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ANDReduceLong256VectorTests(IntFunction fa) { + static void ANDReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3723,7 +3760,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::ANDReduce, Long256VectorTests::ANDReduceAll); + LongVector256Tests::ANDReduce, LongVector256Tests::ANDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3731,20 +3768,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = AND_IDENTITY; - Assert.assertEquals((long) (id & id), id, + assertEquals((long) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id & x), x); - Assert.assertEquals((long) (x & id), x); + assertEquals((long) (id & x), x); + assertEquals((long) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id & x), x, + assertEquals((long) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x & id), x, + assertEquals((long) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3769,7 +3806,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ANDReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3787,7 +3824,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::ANDReduceMasked, Long256VectorTests::ANDReduceAllMasked); + LongVector256Tests::ANDReduceMasked, LongVector256Tests::ANDReduceAllMasked); } static long ORReduce(long[] a, int idx) { @@ -3809,7 +3846,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ORReduceLong256VectorTests(IntFunction fa) { + static void ORReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3825,7 +3862,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::ORReduce, Long256VectorTests::ORReduceAll); + LongVector256Tests::ORReduce, LongVector256Tests::ORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3833,20 +3870,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = OR_IDENTITY; - Assert.assertEquals((long) (id | id), id, + assertEquals((long) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id | x), x); - Assert.assertEquals((long) (x | id), x); + assertEquals((long) (id | x), x); + assertEquals((long) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id | x), x, + assertEquals((long) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x | id), x, + assertEquals((long) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3871,7 +3908,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ORReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3889,7 +3926,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::ORReduceMasked, Long256VectorTests::ORReduceAllMasked); + LongVector256Tests::ORReduceMasked, LongVector256Tests::ORReduceAllMasked); } static long XORReduce(long[] a, int idx) { @@ -3911,7 +3948,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void XORReduceLong256VectorTests(IntFunction fa) { + static void XORReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3927,7 +3964,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::XORReduce, Long256VectorTests::XORReduceAll); + LongVector256Tests::XORReduce, LongVector256Tests::XORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3935,20 +3972,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = XOR_IDENTITY; - Assert.assertEquals((long) (id ^ id), id, + assertEquals((long) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id ^ x), x); - Assert.assertEquals((long) (x ^ id), x); + assertEquals((long) (id ^ x), x); + assertEquals((long) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id ^ x), x, + assertEquals((long) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x ^ id), x, + assertEquals((long) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3973,7 +4010,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void XORReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3991,7 +4028,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::XORReduceMasked, Long256VectorTests::XORReduceAllMasked); + LongVector256Tests::XORReduceMasked, LongVector256Tests::XORReduceAllMasked); } static long ADDReduce(long[] a, int idx) { @@ -4013,7 +4050,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLong256VectorTests(IntFunction fa) { + static void ADDReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4029,7 +4066,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::ADDReduce, Long256VectorTests::ADDReduceAll); + LongVector256Tests::ADDReduce, LongVector256Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4037,20 +4074,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = ADD_IDENTITY; - Assert.assertEquals((long) (id + id), id, + assertEquals((long) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id + x), x); - Assert.assertEquals((long) (x + id), x); + assertEquals((long) (id + x), x); + assertEquals((long) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id + x), x, + assertEquals((long) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x + id), x, + assertEquals((long) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4075,7 +4112,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4093,7 +4130,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::ADDReduceMasked, Long256VectorTests::ADDReduceAllMasked); + LongVector256Tests::ADDReduceMasked, LongVector256Tests::ADDReduceAllMasked); } static long MULReduce(long[] a, int idx) { @@ -4115,7 +4152,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MULReduceLong256VectorTests(IntFunction fa) { + static void MULReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4131,7 +4168,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::MULReduce, Long256VectorTests::MULReduceAll); + LongVector256Tests::MULReduce, LongVector256Tests::MULReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4139,20 +4176,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MUL_IDENTITY; - Assert.assertEquals((long) (id * id), id, + assertEquals((long) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id * x), x); - Assert.assertEquals((long) (x * id), x); + assertEquals((long) (id * x), x); + assertEquals((long) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id * x), x, + assertEquals((long) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x * id), x, + assertEquals((long) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4177,7 +4214,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MULReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4195,7 +4232,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::MULReduceMasked, Long256VectorTests::MULReduceAllMasked); + LongVector256Tests::MULReduceMasked, LongVector256Tests::MULReduceAllMasked); } static long MINReduce(long[] a, int idx) { @@ -4217,7 +4254,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MINReduceLong256VectorTests(IntFunction fa) { + static void MINReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4233,7 +4270,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::MINReduce, Long256VectorTests::MINReduceAll); + LongVector256Tests::MINReduce, LongVector256Tests::MINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4241,20 +4278,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MIN_IDENTITY; - Assert.assertEquals((long) Math.min(id, id), id, + assertEquals((long) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.min(id, x), x); - Assert.assertEquals((long) Math.min(x, id), x); + assertEquals((long) Math.min(id, x), x); + assertEquals((long) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.min(id, x), x, + assertEquals((long) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.min(x, id), x, + assertEquals((long) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4279,7 +4316,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4297,7 +4334,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::MINReduceMasked, Long256VectorTests::MINReduceAllMasked); + LongVector256Tests::MINReduceMasked, LongVector256Tests::MINReduceAllMasked); } static long MAXReduce(long[] a, int idx) { @@ -4319,7 +4356,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MAXReduceLong256VectorTests(IntFunction fa) { + static void MAXReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4335,7 +4372,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::MAXReduce, Long256VectorTests::MAXReduceAll); + LongVector256Tests::MAXReduce, LongVector256Tests::MAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4343,20 +4380,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MAX_IDENTITY; - Assert.assertEquals((long) Math.max(id, id), id, + assertEquals((long) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.max(id, x), x); - Assert.assertEquals((long) Math.max(x, id), x); + assertEquals((long) Math.max(id, x), x); + assertEquals((long) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.max(id, x), x, + assertEquals((long) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.max(x, id), x, + assertEquals((long) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4381,7 +4418,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4399,7 +4436,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::MAXReduceMasked, Long256VectorTests::MAXReduceAllMasked); + LongVector256Tests::MAXReduceMasked, LongVector256Tests::MAXReduceAllMasked); } static long UMINReduce(long[] a, int idx) { @@ -4421,7 +4458,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMINReduceLong256VectorTests(IntFunction fa) { + static void UMINReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4437,7 +4474,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::UMINReduce, Long256VectorTests::UMINReduceAll); + LongVector256Tests::UMINReduce, LongVector256Tests::UMINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4445,20 +4482,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMIN_IDENTITY; - Assert.assertEquals((long) VectorMath.minUnsigned(id, id), id, + assertEquals((long) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x); + assertEquals((long) VectorMath.minUnsigned(id, x), x); + assertEquals((long) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x, + assertEquals((long) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x, + assertEquals((long) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4483,7 +4520,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMINReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4501,7 +4538,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::UMINReduceMasked, Long256VectorTests::UMINReduceAllMasked); + LongVector256Tests::UMINReduceMasked, LongVector256Tests::UMINReduceAllMasked); } static long UMAXReduce(long[] a, int idx) { @@ -4523,7 +4560,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMAXReduceLong256VectorTests(IntFunction fa) { + static void UMAXReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4539,7 +4576,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::UMAXReduce, Long256VectorTests::UMAXReduceAll); + LongVector256Tests::UMAXReduce, LongVector256Tests::UMAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4547,20 +4584,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMAX_IDENTITY; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, id), id, + assertEquals((long) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x); + assertEquals((long) VectorMath.maxUnsigned(id, x), x); + assertEquals((long) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x, + assertEquals((long) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x, + assertEquals((long) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4585,7 +4622,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMAXReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4603,7 +4640,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::UMAXReduceMasked, Long256VectorTests::UMAXReduceAllMasked); + LongVector256Tests::UMAXReduceMasked, LongVector256Tests::UMAXReduceAllMasked); } static long FIRST_NONZEROReduce(long[] a, int idx) { @@ -4625,7 +4662,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void FIRST_NONZEROReduceLong256VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4641,7 +4678,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::FIRST_NONZEROReduce, Long256VectorTests::FIRST_NONZEROReduceAll); + LongVector256Tests::FIRST_NONZEROReduce, LongVector256Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4649,20 +4686,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4687,7 +4724,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void FIRST_NONZEROReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4705,7 +4742,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::FIRST_NONZEROReduceMasked, Long256VectorTests::FIRST_NONZEROReduceAllMasked); + LongVector256Tests::FIRST_NONZEROReduceMasked, LongVector256Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4718,7 +4755,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueLong256VectorTests(IntFunction fm) { + static void anyTrueLongVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4729,7 +4766,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long256VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, LongVector256Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4742,7 +4779,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueLong256VectorTests(IntFunction fm) { + static void allTrueLongVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4753,7 +4790,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long256VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, LongVector256Tests::allTrue); } static long SUADDReduce(long[] a, int idx) { @@ -4775,7 +4812,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingUnaryOpProvider") - static void SUADDReduceLong256VectorTests(IntFunction fa) { + static void SUADDReduceLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4791,7 +4828,7 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::SUADDReduce, Long256VectorTests::SUADDReduceAll); + LongVector256Tests::SUADDReduce, LongVector256Tests::SUADDReduceAll); } @Test(dataProvider = "longSaturatingUnaryOpProvider") @@ -4799,20 +4836,20 @@ public class Long256VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = SUADD_IDENTITY; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4836,7 +4873,7 @@ public class Long256VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "longSaturatingUnaryOpMaskProvider") - static void SUADDReduceLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4854,11 +4891,11 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::SUADDReduceMasked, Long256VectorTests::SUADDReduceAllMasked); + LongVector256Tests::SUADDReduceMasked, LongVector256Tests::SUADDReduceAllMasked); } @Test(dataProvider = "longBinaryOpProvider") - static void withLong256VectorTests(IntFunction fa, IntFunction fb) { + static void withLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -4881,7 +4918,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_DEFAULTLong256VectorTests(IntFunction fa) { + static void IS_DEFAULTLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4891,14 +4928,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_DEFAULTMaskedLong256VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4911,7 +4948,7 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4922,7 +4959,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_NEGATIVELong256VectorTests(IntFunction fa) { + static void IS_NEGATIVELongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4932,14 +4969,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_NEGATIVEMaskedLong256VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4952,14 +4989,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong256VectorTests(IntFunction fa, IntFunction fb) { + static void LTLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4971,14 +5008,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ltLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ltLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4990,14 +5027,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5013,14 +5050,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GTLong256VectorTests(IntFunction fa, IntFunction fb) { + static void GTLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5032,14 +5069,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GTLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5055,14 +5092,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong256VectorTests(IntFunction fa, IntFunction fb) { + static void EQLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5074,14 +5111,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong256VectorTests(IntFunction fa, IntFunction fb) { + static void eqLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5093,14 +5130,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5116,14 +5153,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void NELong256VectorTests(IntFunction fa, IntFunction fb) { + static void NELongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5135,14 +5172,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void NELong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NELongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5158,14 +5195,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LELong256VectorTests(IntFunction fa, IntFunction fb) { + static void LELongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5177,14 +5214,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LELong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LELongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5200,14 +5237,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GELong256VectorTests(IntFunction fa, IntFunction fb) { + static void GELongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5219,14 +5256,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GELong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GELongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5242,14 +5279,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULTLong256VectorTests(IntFunction fa, IntFunction fb) { + static void ULTLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5261,14 +5298,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULTLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5284,14 +5321,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGTLong256VectorTests(IntFunction fa, IntFunction fb) { + static void UGTLongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5303,14 +5340,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGTLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5326,14 +5363,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULELong256VectorTests(IntFunction fa, IntFunction fb) { + static void ULELongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5345,14 +5382,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULELong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULELongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5368,14 +5405,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGELong256VectorTests(IntFunction fa, IntFunction fb) { + static void UGELongVector256Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5387,14 +5424,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGELong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGELongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5410,14 +5447,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5427,13 +5464,13 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5447,14 +5484,14 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5464,13 +5501,13 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5484,7 +5521,7 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @@ -5495,7 +5532,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void blendLong256VectorTests(IntFunction fa, IntFunction fb, + static void blendLongVector256Tests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5511,11 +5548,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long256VectorTests::blend); + assertArraysEquals(r, a, b, mask, LongVector256Tests::blend); } @Test(dataProvider = "longUnaryOpShuffleProvider") - static void RearrangeLong256VectorTests(IntFunction fa, + static void RearrangeLongVector256Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5532,7 +5569,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpShuffleMaskProvider") - static void RearrangeLong256VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeLongVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -5550,7 +5587,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void compressLong256VectorTests(IntFunction fa, + static void compressLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5568,7 +5605,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void expandLong256VectorTests(IntFunction fa, + static void expandLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5586,7 +5623,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void getLong256VectorTests(IntFunction fa) { + static void getLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5742,7 +5779,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BroadcastLong256VectorTests(IntFunction fa) { + static void BroadcastLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5756,7 +5793,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZeroLong256VectorTests(IntFunction fa) { + static void ZeroLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5766,7 +5803,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static long[] sliceUnary(long[] a, int origin, int idx) { @@ -5781,7 +5818,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void sliceUnaryLong256VectorTests(IntFunction fa) { + static void sliceUnaryLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5792,7 +5829,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long256VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, LongVector256Tests::sliceUnary); } static long[] sliceBinary(long[] a, long[] b, int origin, int idx) { @@ -5809,7 +5846,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void sliceBinaryLong256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryLongVector256TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5822,7 +5859,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Long256VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, LongVector256Tests::sliceBinary); } static long[] slice(long[] a, long[] b, int origin, boolean[] mask, int idx) { @@ -5839,7 +5876,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void sliceLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5856,7 +5893,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Long256VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, LongVector256Tests::slice); } static long[] unsliceUnary(long[] a, int origin, int idx) { @@ -5873,7 +5910,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void unsliceUnaryLong256VectorTests(IntFunction fa) { + static void unsliceUnaryLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5884,7 +5921,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long256VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, LongVector256Tests::unsliceUnary); } static long[] unsliceBinary(long[] a, long[] b, int origin, int part, int idx) { @@ -5910,7 +5947,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void unsliceBinaryLong256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryLongVector256TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5924,7 +5961,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Long256VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, LongVector256Tests::unsliceBinary); } static long[] unslice(long[] a, long[] b, int origin, int part, boolean[] mask, int idx) { @@ -5964,7 +6001,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void unsliceLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5981,7 +6018,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Long256VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, LongVector256Tests::unslice); } static long BITWISE_BLEND(long a, long b, long c) { @@ -5993,7 +6030,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6008,11 +6045,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Long256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6025,11 +6062,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Long256VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, LongVector256Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6047,11 +6084,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Long256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6062,11 +6099,11 @@ public class Long256VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6077,11 +6114,11 @@ public class Long256VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6092,11 +6129,11 @@ public class Long256VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long256VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, LongVector256Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6107,11 +6144,11 @@ public class Long256VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long256VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector256Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6126,11 +6163,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Long256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong256VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector256TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6145,11 +6182,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Long256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6160,11 +6197,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6175,11 +6212,11 @@ public class Long256VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long256VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector256Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong256VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector256TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6193,7 +6230,7 @@ public class Long256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Long256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongVector256Tests::BITWISE_BLEND); } static long NEG(long a) { @@ -6205,7 +6242,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NEGLong256VectorTests(IntFunction fa) { + static void NEGLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6216,11 +6253,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::NEG); + assertArraysEquals(r, a, LongVector256Tests::NEG); } @Test(dataProvider = "longUnaryOpProvider") - static void negLong256VectorTests(IntFunction fa) { + static void negLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6231,11 +6268,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::neg); + assertArraysEquals(r, a, LongVector256Tests::neg); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NEGMaskedLong256VectorTests(IntFunction fa, + static void NEGMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6249,7 +6286,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::NEG); + assertArraysEquals(r, a, mask, LongVector256Tests::NEG); } static long ABS(long a) { @@ -6261,7 +6298,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ABSLong256VectorTests(IntFunction fa) { + static void ABSLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6272,11 +6309,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::ABS); + assertArraysEquals(r, a, LongVector256Tests::ABS); } @Test(dataProvider = "longUnaryOpProvider") - static void absLong256VectorTests(IntFunction fa) { + static void absLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6287,11 +6324,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::abs); + assertArraysEquals(r, a, LongVector256Tests::abs); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ABSMaskedLong256VectorTests(IntFunction fa, + static void ABSMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6305,7 +6342,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::ABS); + assertArraysEquals(r, a, mask, LongVector256Tests::ABS); } static long NOT(long a) { @@ -6317,7 +6354,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NOTLong256VectorTests(IntFunction fa) { + static void NOTLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6328,11 +6365,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::NOT); + assertArraysEquals(r, a, LongVector256Tests::NOT); } @Test(dataProvider = "longUnaryOpProvider") - static void notLong256VectorTests(IntFunction fa) { + static void notLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6343,11 +6380,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::not); + assertArraysEquals(r, a, LongVector256Tests::not); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NOTMaskedLong256VectorTests(IntFunction fa, + static void NOTMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6361,7 +6398,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::NOT); + assertArraysEquals(r, a, mask, LongVector256Tests::NOT); } static long ZOMO(long a) { @@ -6369,7 +6406,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZOMOLong256VectorTests(IntFunction fa) { + static void ZOMOLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6380,11 +6417,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::ZOMO); + assertArraysEquals(r, a, LongVector256Tests::ZOMO); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ZOMOMaskedLong256VectorTests(IntFunction fa, + static void ZOMOMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6398,7 +6435,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::ZOMO); + assertArraysEquals(r, a, mask, LongVector256Tests::ZOMO); } static long BIT_COUNT(long a) { @@ -6406,7 +6443,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BIT_COUNTLong256VectorTests(IntFunction fa) { + static void BIT_COUNTLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6417,11 +6454,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, LongVector256Tests::BIT_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void BIT_COUNTMaskedLong256VectorTests(IntFunction fa, + static void BIT_COUNTMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6435,7 +6472,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, LongVector256Tests::BIT_COUNT); } static long TRAILING_ZEROS_COUNT(long a) { @@ -6443,7 +6480,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void TRAILING_ZEROS_COUNTLong256VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6454,11 +6491,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector256Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedLong256VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6472,7 +6509,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector256Tests::TRAILING_ZEROS_COUNT); } static long LEADING_ZEROS_COUNT(long a) { @@ -6480,7 +6517,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LEADING_ZEROS_COUNTLong256VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6491,11 +6528,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector256Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedLong256VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6509,7 +6546,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector256Tests::LEADING_ZEROS_COUNT); } static long REVERSE(long a) { @@ -6517,7 +6554,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSELong256VectorTests(IntFunction fa) { + static void REVERSELongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6528,11 +6565,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::REVERSE); + assertArraysEquals(r, a, LongVector256Tests::REVERSE); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSEMaskedLong256VectorTests(IntFunction fa, + static void REVERSEMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6546,7 +6583,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::REVERSE); + assertArraysEquals(r, a, mask, LongVector256Tests::REVERSE); } static long REVERSE_BYTES(long a) { @@ -6554,7 +6591,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSE_BYTESLong256VectorTests(IntFunction fa) { + static void REVERSE_BYTESLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6565,11 +6602,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, LongVector256Tests::REVERSE_BYTES); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedLong256VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedLongVector256Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6583,7 +6620,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, LongVector256Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6591,7 +6628,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandLongVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6604,7 +6641,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::band); + assertArraysEquals(r, a, b, LongVector256Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6612,7 +6649,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maskorLongVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6625,7 +6662,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::bor); + assertArraysEquals(r, a, b, LongVector256Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6633,7 +6670,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorLongVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6646,7 +6683,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::bxor); + assertArraysEquals(r, a, b, LongVector256Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6654,7 +6691,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotLongVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6667,7 +6704,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::bandNot); + assertArraysEquals(r, a, b, LongVector256Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6675,7 +6712,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqLongVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6688,7 +6725,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long256VectorTests::beq); + assertArraysEquals(r, a, b, LongVector256Tests::beq); } static boolean unot(boolean a) { @@ -6696,7 +6733,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotLong256VectorTests(IntFunction fa) { + static void masknotLongVector256Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6707,7 +6744,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long256VectorTests::unot); + assertArraysEquals(r, a, LongVector256Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6716,15 +6753,15 @@ public class Long256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongLong256VectorTests(IntFunction fa) { + static void maskFromToLongLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6738,7 +6775,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longCompareOpProvider") - static void ltLong256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltLongVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6748,13 +6785,13 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqLongVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6764,13 +6801,13 @@ public class Long256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longtoIntUnaryOpProvider") - static void toIntArrayLong256VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayLongVector256TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6781,7 +6818,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toLongArrayLong256VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayLongVector256TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6792,7 +6829,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toDoubleArrayLong256VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayLongVector256TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6803,7 +6840,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toStringLong256VectorTestsSmokeTest(IntFunction fa) { + static void toStringLongVector256TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6816,7 +6853,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void hashCodeLong256VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeLongVector256TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6832,7 +6869,7 @@ public class Long256VectorTests extends AbstractVectorTest { @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLongLong256VectorTests(IntFunction fa) { + static void ADDReduceLongLongVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -6848,11 +6885,11 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long256VectorTests::ADDReduce, Long256VectorTests::ADDReduceAll); + LongVector256Tests::ADDReduce, LongVector256Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLongLong256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongLongVector256TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6870,11 +6907,11 @@ public class Long256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long256VectorTests::ADDReduceMasked, Long256VectorTests::ADDReduceAllMasked); + LongVector256Tests::ADDReduceMasked, LongVector256Tests::ADDReduceAllMasked); } @Test(dataProvider = "longUnaryOpSelectFromProvider") - static void SelectFromLong256VectorTests(IntFunction fa, + static void SelectFromLongVector256Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); long[] order = fs.apply(a.length, SPECIES.length()); @@ -6890,7 +6927,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorLongVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] idx = fc.apply(SPECIES.length()); @@ -6908,7 +6945,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpSelectFromMaskProvider") - static void SelectFromLong256VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromLongVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -6927,7 +6964,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousLong256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousLongVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6938,12 +6975,12 @@ public class Long256VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringLong256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringLongVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6957,7 +6994,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsLong256VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsLongVector256TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -6966,12 +7003,12 @@ public class Long256VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsLong256VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsLongVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -6981,13 +7018,13 @@ public class Long256VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeLong256VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeLongVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7009,7 +7046,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountLong256VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountLongVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7020,7 +7057,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long256VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, LongVector256Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7034,7 +7071,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueLong256VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueLongVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7045,7 +7082,7 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long256VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, LongVector256Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7059,7 +7096,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueLong256VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueLongVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7070,11 +7107,11 @@ public class Long256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long256VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, LongVector256Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressLong256VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressLongVector256TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7084,7 +7121,7 @@ public class Long256VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7102,7 +7139,7 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeLong256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongVector256TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7110,13 +7147,13 @@ public class Long256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongLong256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongLongVector256TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7124,7 +7161,7 @@ public class Long256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7143,36 +7180,36 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundLong256VectorTestsSmokeTest(int length) { + static void loopBoundLongVector256TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongLong256VectorTestsSmokeTest(int _length) { + static void loopBoundLongLongVector256TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeLong256VectorTestsSmokeTest() { + static void ElementSizeLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Long.SIZE); + assertEquals(elsize, Long.SIZE); } @Test - static void VectorShapeLong256VectorTestsSmokeTest() { + static void VectorShapeLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_256_BIT)); } @Test - static void ShapeWithLanesLong256VectorTestsSmokeTest() { + static void ShapeWithLanesLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(long.class); @@ -7180,32 +7217,32 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeLong256VectorTestsSmokeTest() { + static void ElementTypeLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementType() == long.class); } @Test - static void SpeciesElementSizeLong256VectorTestsSmokeTest() { + static void SpeciesElementSizeLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementSize() == Long.SIZE); } @Test - static void VectorTypeLong256VectorTestsSmokeTest() { + static void VectorTypeLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesLong256VectorTestsSmokeTest() { + static void WithLanesLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(long.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeLong256VectorTestsSmokeTest() { + static void WithShapeLongVector256TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7213,9 +7250,9 @@ public class Long256VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueLong256VectorTestsSmokeTest() { + static void MaskAllTrueLongVector256TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongVector512LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/LongVector512LoadStoreTests.java index 1b70f8d1ba4..095616595f8 100644 --- a/test/jdk/jdk/incubator/vector/Long512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector512LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Long512VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation LongVector512LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class LongVector512LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = LongVector.SPECIES_512; @@ -61,14 +61,29 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(long[] r, long[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "longProviderForIOOBE") @@ -870,11 +885,11 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(long[] r, long[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Long512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Long512VectorTests.java b/test/jdk/jdk/incubator/vector/LongVector512Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Long512VectorTests.java rename to test/jdk/jdk/incubator/vector/LongVector512Tests.java index 5f8abb5bdd5..503bd7942f2 100644 --- a/test/jdk/jdk/incubator/vector/Long512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector512Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongVector512Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Long512VectorTests extends AbstractVectorTest { +public class LongVector512Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = LongVector.SPECIES_512; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected, long delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(long actual, long expected, long delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final long CONST_SHIFT = Long.SIZE / 2; @@ -96,10 +133,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +148,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { long[] ref = f.apply(a[i]); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +164,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +183,13 @@ public class Long512VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +205,13 @@ public class Long512VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -187,10 +224,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -202,10 +239,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -214,12 +251,12 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -230,20 +267,20 @@ public class Long512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (long)0); + assertEquals(r[i + k], (long)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -255,19 +292,19 @@ public class Long512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (long)0); + assertEquals(r[i + j], (long)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -283,11 +320,11 @@ public class Long512VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -296,12 +333,12 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -311,17 +348,17 @@ public class Long512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -331,17 +368,17 @@ public class Long512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -355,10 +392,10 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -370,10 +407,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -385,10 +422,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -409,18 +446,18 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -435,18 +472,18 @@ public class Long512VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -454,10 +491,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -465,10 +502,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -476,10 +513,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -488,10 +525,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -504,10 +541,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -519,10 +556,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -534,10 +571,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -552,10 +589,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -568,11 +605,11 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -586,11 +623,11 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -612,11 +649,11 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -630,11 +667,11 @@ public class Long512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -654,10 +691,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -669,10 +706,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -681,10 +718,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -694,10 +731,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -713,11 +750,11 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -734,11 +771,11 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -749,11 +786,11 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -770,11 +807,11 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -792,13 +829,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -819,13 +856,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -840,13 +877,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(r, a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -867,13 +904,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -887,13 +924,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -908,13 +945,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -929,13 +966,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -951,13 +988,13 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1003,10 +1040,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1016,10 +1053,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1027,10 +1064,10 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1565,7 +1602,7 @@ public class Long512VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); LongVector a = io.add((long)1); //[1,2] LongVector b = a.neg(); //[-1,-2] long[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1580,19 +1617,19 @@ public class Long512VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); LongVector uab0 = zab0.rearrange(unz0,zab1); LongVector uab1 = zab0.rearrange(unz1,zab1); long[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1607,7 +1644,7 @@ public class Long512VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1615,9 +1652,9 @@ public class Long512VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1646,7 +1683,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ADDLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1659,7 +1696,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::ADD); + assertArraysEquals(r, a, b, LongVector512Tests::ADD); } static long add(long a, long b) { @@ -1667,7 +1704,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void addLong512VectorTests(IntFunction fa, IntFunction fb) { + static void addLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1678,11 +1715,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::add); + assertArraysEquals(r, a, b, LongVector512Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1698,11 +1735,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::ADD); + assertArraysEquals(r, a, b, mask, LongVector512Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1716,7 +1753,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long512VectorTests::add); + assertArraysEquals(r, a, b, mask, LongVector512Tests::add); } static long SUB(long a, long b) { @@ -1724,7 +1761,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void SUBLong512VectorTests(IntFunction fa, IntFunction fb) { + static void SUBLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1737,7 +1774,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::SUB); + assertArraysEquals(r, a, b, LongVector512Tests::SUB); } static long sub(long a, long b) { @@ -1745,7 +1782,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void subLong512VectorTests(IntFunction fa, IntFunction fb) { + static void subLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1756,11 +1793,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::sub); + assertArraysEquals(r, a, b, LongVector512Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void SUBLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1776,11 +1813,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::SUB); + assertArraysEquals(r, a, b, mask, LongVector512Tests::SUB); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1794,7 +1831,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long512VectorTests::sub); + assertArraysEquals(r, a, b, mask, LongVector512Tests::sub); } static long MUL(long a, long b) { @@ -1802,7 +1839,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MULLong512VectorTests(IntFunction fa, IntFunction fb) { + static void MULLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1815,7 +1852,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::MUL); + assertArraysEquals(r, a, b, LongVector512Tests::MUL); } static long mul(long a, long b) { @@ -1823,7 +1860,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong512VectorTests(IntFunction fa, IntFunction fb) { + static void mulLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1834,11 +1871,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::mul); + assertArraysEquals(r, a, b, LongVector512Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void MULLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1854,11 +1891,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::MUL); + assertArraysEquals(r, a, b, mask, LongVector512Tests::MUL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1872,7 +1909,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long512VectorTests::mul); + assertArraysEquals(r, a, b, mask, LongVector512Tests::mul); } static long DIV(long a, long b) { @@ -1880,7 +1917,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void DIVLong512VectorTests(IntFunction fa, IntFunction fb) { + static void DIVLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1895,7 +1932,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::DIV); + assertArraysEquals(r, a, b, LongVector512Tests::DIV); } static long div(long a, long b) { @@ -1903,7 +1940,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void divLong512VectorTests(IntFunction fa, IntFunction fb) { + static void divLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1918,11 +1955,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::div); + assertArraysEquals(r, a, b, LongVector512Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void DIVLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1940,11 +1977,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::DIV); + assertArraysEquals(r, a, b, mask, LongVector512Tests::DIV); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1962,7 +1999,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::div); + assertArraysEquals(r, a, b, mask, LongVector512Tests::div); } static long FIRST_NONZERO(long a, long b) { @@ -1970,7 +2007,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void FIRST_NONZEROLong512VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1983,11 +2020,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, LongVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void FIRST_NONZEROLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2003,7 +2040,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, LongVector512Tests::FIRST_NONZERO); } static long AND(long a, long b) { @@ -2011,7 +2048,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ANDLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2024,7 +2061,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::AND); + assertArraysEquals(r, a, b, LongVector512Tests::AND); } static long and(long a, long b) { @@ -2032,7 +2069,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void andLong512VectorTests(IntFunction fa, IntFunction fb) { + static void andLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2043,11 +2080,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::and); + assertArraysEquals(r, a, b, LongVector512Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2063,7 +2100,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::AND); + assertArraysEquals(r, a, b, mask, LongVector512Tests::AND); } static long AND_NOT(long a, long b) { @@ -2071,7 +2108,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void AND_NOTLong512VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2084,11 +2121,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, LongVector512Tests::AND_NOT); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void AND_NOTLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2104,7 +2141,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, LongVector512Tests::AND_NOT); } static long OR(long a, long b) { @@ -2112,7 +2149,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ORLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2125,7 +2162,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::OR); + assertArraysEquals(r, a, b, LongVector512Tests::OR); } static long or(long a, long b) { @@ -2133,7 +2170,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void orLong512VectorTests(IntFunction fa, IntFunction fb) { + static void orLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2144,11 +2181,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::or); + assertArraysEquals(r, a, b, LongVector512Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2164,7 +2201,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::OR); + assertArraysEquals(r, a, b, mask, LongVector512Tests::OR); } static long XOR(long a, long b) { @@ -2172,7 +2209,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void XORLong512VectorTests(IntFunction fa, IntFunction fb) { + static void XORLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2185,11 +2222,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::XOR); + assertArraysEquals(r, a, b, LongVector512Tests::XOR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void XORLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2205,7 +2242,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::XOR); + assertArraysEquals(r, a, b, mask, LongVector512Tests::XOR); } static long COMPRESS_BITS(long a, long b) { @@ -2213,7 +2250,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void COMPRESS_BITSLong512VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2263,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, LongVector512Tests::COMPRESS_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void COMPRESS_BITSLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2246,7 +2283,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, LongVector512Tests::COMPRESS_BITS); } static long EXPAND_BITS(long a, long b) { @@ -2254,7 +2291,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void EXPAND_BITSLong512VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2267,11 +2304,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, LongVector512Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void EXPAND_BITSLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2287,11 +2324,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, LongVector512Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpProvider") - static void addLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2301,11 +2338,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2318,11 +2355,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, LongVector512Tests::add); } @Test(dataProvider = "longBinaryOpProvider") - static void subLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2332,11 +2369,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2386,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, LongVector512Tests::sub); } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2400,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2380,11 +2417,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, LongVector512Tests::mul); } @Test(dataProvider = "longBinaryOpProvider") - static void divLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2396,11 +2433,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2415,11 +2452,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, LongVector512Tests::div); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2429,11 +2466,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void orLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2443,11 +2480,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::or); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2460,11 +2497,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, LongVector512Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2474,11 +2511,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void andLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2488,11 +2525,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::and); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2505,11 +2542,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, LongVector512Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2519,11 +2556,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, LongVector512Tests::OR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2536,11 +2573,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector512Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDLongVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2550,11 +2587,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, LongVector512Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDLongVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2567,7 +2604,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector512Tests::ADD); } static long LSHL(long a, long b) { @@ -2575,7 +2612,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2588,11 +2625,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::LSHL); + assertArraysEquals(r, a, b, LongVector512Tests::LSHL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2608,7 +2645,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, LongVector512Tests::LSHL); } static long ASHR(long a, long b) { @@ -2616,7 +2653,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2629,11 +2666,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::ASHR); + assertArraysEquals(r, a, b, LongVector512Tests::ASHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2649,7 +2686,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, LongVector512Tests::ASHR); } static long LSHR(long a, long b) { @@ -2657,7 +2694,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2670,11 +2707,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::LSHR); + assertArraysEquals(r, a, b, LongVector512Tests::LSHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2690,7 +2727,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, LongVector512Tests::LSHR); } static long LSHL_unary(long a, long b) { @@ -2698,7 +2735,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLLongVector512TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2710,11 +2747,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, LongVector512Tests::LSHL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2729,7 +2766,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector512Tests::LSHL_unary); } static long LSHR_unary(long a, long b) { @@ -2737,7 +2774,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRLongVector512TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2749,11 +2786,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, LongVector512Tests::LSHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2768,7 +2805,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector512Tests::LSHR_unary); } static long ASHR_unary(long a, long b) { @@ -2776,7 +2813,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRLongVector512TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2788,11 +2825,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, LongVector512Tests::ASHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2807,7 +2844,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector512Tests::ASHR_unary); } static long ROR(long a, long b) { @@ -2815,7 +2852,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong512VectorTests(IntFunction fa, IntFunction fb) { + static void RORLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2828,11 +2865,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::ROR); + assertArraysEquals(r, a, b, LongVector512Tests::ROR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2848,7 +2885,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::ROR); + assertArraysEquals(r, a, b, mask, LongVector512Tests::ROR); } static long ROL(long a, long b) { @@ -2856,7 +2893,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ROLLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2869,11 +2906,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::ROL); + assertArraysEquals(r, a, b, LongVector512Tests::ROL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2889,7 +2926,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::ROL); + assertArraysEquals(r, a, b, mask, LongVector512Tests::ROL); } static long ROR_unary(long a, long b) { @@ -2897,7 +2934,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORLongVector512TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2909,11 +2946,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, LongVector512Tests::ROR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORLongVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2928,7 +2965,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector512Tests::ROR_unary); } static long ROL_unary(long a, long b) { @@ -2936,7 +2973,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLLongVector512TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2948,11 +2985,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, LongVector512Tests::ROL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2967,14 +3004,14 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector512Tests::ROL_unary); } static long LSHR_binary_const(long a) { return (long)((a >>> CONST_SHIFT)); } @Test(dataProvider = "longUnaryOpProvider") - static void LSHRLong512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRLongVector512TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2985,11 +3022,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, LongVector512Tests::LSHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHRLong512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRLongVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3003,7 +3040,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector512Tests::LSHR_binary_const); } static long LSHL_binary_const(long a) { @@ -3011,7 +3048,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LSHLLong512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLLongVector512TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3022,11 +3059,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, LongVector512Tests::LSHL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHLLong512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLLongVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3040,7 +3077,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector512Tests::LSHL_binary_const); } static long ASHR_binary_const(long a) { @@ -3048,7 +3085,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ASHRLong512VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRLongVector512TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3059,11 +3096,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, LongVector512Tests::ASHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ASHRLong512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRLongVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3077,7 +3114,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector512Tests::ASHR_binary_const); } static long ROR_binary_const(long a) { @@ -3085,7 +3122,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void RORLong512VectorTestsScalarShiftConst(IntFunction fa) { + static void RORLongVector512TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3096,11 +3133,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, LongVector512Tests::ROR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void RORLong512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORLongVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3114,7 +3151,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector512Tests::ROR_binary_const); } static long ROL_binary_const(long a) { @@ -3122,7 +3159,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ROLLong512VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLLongVector512TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3133,11 +3170,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, LongVector512Tests::ROL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ROLLong512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLLongVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3151,14 +3188,14 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector512Tests::ROL_binary_const); } static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MINLong512VectorTestsWithMemOp(IntFunction fa) { + static void MINLongVector512TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3169,13 +3206,13 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long512VectorTests::MIN); + assertArraysEquals(r, a, (long)10, LongVector512Tests::MIN); } static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void minLong512VectorTestsWithMemOp(IntFunction fa) { + static void minLongVector512TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3186,13 +3223,13 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long512VectorTests::min); + assertArraysEquals(r, a, (long)10, LongVector512Tests::min); } static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINLong512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINLongVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3205,13 +3242,13 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long512VectorTests::MIN); + assertArraysEquals(r, a, (long)10, mask, LongVector512Tests::MIN); } static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MAXLong512VectorTestsWithMemOp(IntFunction fa) { + static void MAXLongVector512TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3222,13 +3259,13 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long512VectorTests::MAX); + assertArraysEquals(r, a, (long)10, LongVector512Tests::MAX); } static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void maxLong512VectorTestsWithMemOp(IntFunction fa) { + static void maxLongVector512TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3239,13 +3276,13 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long512VectorTests::max); + assertArraysEquals(r, a, (long)10, LongVector512Tests::max); } static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXLong512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXLongVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3258,7 +3295,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long512VectorTests::MAX); + assertArraysEquals(r, a, (long)10, mask, LongVector512Tests::MAX); } static long MIN(long a, long b) { @@ -3266,7 +3303,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong512VectorTests(IntFunction fa, IntFunction fb) { + static void MINLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3279,7 +3316,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::MIN); + assertArraysEquals(r, a, b, LongVector512Tests::MIN); } static long min(long a, long b) { @@ -3287,7 +3324,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void minLong512VectorTests(IntFunction fa, IntFunction fb) { + static void minLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3298,7 +3335,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::min); + assertArraysEquals(r, a, b, LongVector512Tests::min); } static long MAX(long a, long b) { @@ -3306,7 +3343,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong512VectorTests(IntFunction fa, IntFunction fb) { + static void MAXLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3319,7 +3356,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::MAX); + assertArraysEquals(r, a, b, LongVector512Tests::MAX); } static long max(long a, long b) { @@ -3327,7 +3364,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maxLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3338,7 +3375,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long512VectorTests::max); + assertArraysEquals(r, a, b, LongVector512Tests::max); } static long UMIN(long a, long b) { @@ -3346,7 +3383,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMINLong512VectorTests(IntFunction fa, IntFunction fb) { + static void UMINLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3359,11 +3396,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::UMIN); + assertArraysEquals(r, a, b, LongVector512Tests::UMIN); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMINLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3379,7 +3416,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, LongVector512Tests::UMIN); } static long UMAX(long a, long b) { @@ -3387,7 +3424,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMAXLong512VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3400,11 +3437,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::UMAX); + assertArraysEquals(r, a, b, LongVector512Tests::UMAX); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMAXLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3420,7 +3457,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, LongVector512Tests::UMAX); } static long SADD(long a, long b) { @@ -3428,7 +3465,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SADDLong512VectorTests(IntFunction fa, IntFunction fb) { + static void SADDLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3441,11 +3478,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::SADD); + assertArraysEquals(r, a, b, LongVector512Tests::SADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SADDLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3461,7 +3498,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::SADD); + assertArraysEquals(r, a, b, mask, LongVector512Tests::SADD); } static long SSUB(long a, long b) { @@ -3469,7 +3506,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SSUBLong512VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3482,11 +3519,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::SSUB); + assertArraysEquals(r, a, b, LongVector512Tests::SSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SSUBLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3502,7 +3539,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, LongVector512Tests::SSUB); } static long SUADD(long a, long b) { @@ -3510,7 +3547,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUADDLong512VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3560,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::SUADD); + assertArraysEquals(r, a, b, LongVector512Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUADDLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3543,7 +3580,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, LongVector512Tests::SUADD); } static long SUSUB(long a, long b) { @@ -3551,7 +3588,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUSUBLong512VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3564,11 +3601,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::SUSUB); + assertArraysEquals(r, a, b, LongVector512Tests::SUSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUSUBLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3584,11 +3621,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, LongVector512Tests::SUSUB); } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3598,11 +3635,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::MIN); } @Test(dataProvider = "longBinaryOpProvider") - static void minLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3612,11 +3649,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::min); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::min); } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3626,11 +3663,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::MAX); } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3640,10 +3677,10 @@ public class Long512VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long512VectorTests::max); + assertBroadcastArraysEquals(r, a, b, LongVector512Tests::max); } @Test(dataProvider = "longSaturatingBinaryOpAssocProvider") - static void SUADDAssocLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocLongVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -3660,11 +3697,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Long512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, LongVector512Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3685,7 +3722,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Long512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, LongVector512Tests::SUADD); } static long ANDReduce(long[] a, int idx) { @@ -3707,7 +3744,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ANDReduceLong512VectorTests(IntFunction fa) { + static void ANDReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3723,7 +3760,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::ANDReduce, Long512VectorTests::ANDReduceAll); + LongVector512Tests::ANDReduce, LongVector512Tests::ANDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3731,20 +3768,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = AND_IDENTITY; - Assert.assertEquals((long) (id & id), id, + assertEquals((long) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id & x), x); - Assert.assertEquals((long) (x & id), x); + assertEquals((long) (id & x), x); + assertEquals((long) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id & x), x, + assertEquals((long) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x & id), x, + assertEquals((long) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3769,7 +3806,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ANDReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3787,7 +3824,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::ANDReduceMasked, Long512VectorTests::ANDReduceAllMasked); + LongVector512Tests::ANDReduceMasked, LongVector512Tests::ANDReduceAllMasked); } static long ORReduce(long[] a, int idx) { @@ -3809,7 +3846,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ORReduceLong512VectorTests(IntFunction fa) { + static void ORReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3825,7 +3862,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::ORReduce, Long512VectorTests::ORReduceAll); + LongVector512Tests::ORReduce, LongVector512Tests::ORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3833,20 +3870,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = OR_IDENTITY; - Assert.assertEquals((long) (id | id), id, + assertEquals((long) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id | x), x); - Assert.assertEquals((long) (x | id), x); + assertEquals((long) (id | x), x); + assertEquals((long) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id | x), x, + assertEquals((long) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x | id), x, + assertEquals((long) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3871,7 +3908,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ORReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3889,7 +3926,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::ORReduceMasked, Long512VectorTests::ORReduceAllMasked); + LongVector512Tests::ORReduceMasked, LongVector512Tests::ORReduceAllMasked); } static long XORReduce(long[] a, int idx) { @@ -3911,7 +3948,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void XORReduceLong512VectorTests(IntFunction fa) { + static void XORReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3927,7 +3964,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::XORReduce, Long512VectorTests::XORReduceAll); + LongVector512Tests::XORReduce, LongVector512Tests::XORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3935,20 +3972,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = XOR_IDENTITY; - Assert.assertEquals((long) (id ^ id), id, + assertEquals((long) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id ^ x), x); - Assert.assertEquals((long) (x ^ id), x); + assertEquals((long) (id ^ x), x); + assertEquals((long) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id ^ x), x, + assertEquals((long) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x ^ id), x, + assertEquals((long) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3973,7 +4010,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void XORReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3991,7 +4028,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::XORReduceMasked, Long512VectorTests::XORReduceAllMasked); + LongVector512Tests::XORReduceMasked, LongVector512Tests::XORReduceAllMasked); } static long ADDReduce(long[] a, int idx) { @@ -4013,7 +4050,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLong512VectorTests(IntFunction fa) { + static void ADDReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4029,7 +4066,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::ADDReduce, Long512VectorTests::ADDReduceAll); + LongVector512Tests::ADDReduce, LongVector512Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4037,20 +4074,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = ADD_IDENTITY; - Assert.assertEquals((long) (id + id), id, + assertEquals((long) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id + x), x); - Assert.assertEquals((long) (x + id), x); + assertEquals((long) (id + x), x); + assertEquals((long) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id + x), x, + assertEquals((long) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x + id), x, + assertEquals((long) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4075,7 +4112,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4093,7 +4130,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::ADDReduceMasked, Long512VectorTests::ADDReduceAllMasked); + LongVector512Tests::ADDReduceMasked, LongVector512Tests::ADDReduceAllMasked); } static long MULReduce(long[] a, int idx) { @@ -4115,7 +4152,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MULReduceLong512VectorTests(IntFunction fa) { + static void MULReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4131,7 +4168,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::MULReduce, Long512VectorTests::MULReduceAll); + LongVector512Tests::MULReduce, LongVector512Tests::MULReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4139,20 +4176,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MUL_IDENTITY; - Assert.assertEquals((long) (id * id), id, + assertEquals((long) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id * x), x); - Assert.assertEquals((long) (x * id), x); + assertEquals((long) (id * x), x); + assertEquals((long) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id * x), x, + assertEquals((long) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x * id), x, + assertEquals((long) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4177,7 +4214,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MULReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4195,7 +4232,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::MULReduceMasked, Long512VectorTests::MULReduceAllMasked); + LongVector512Tests::MULReduceMasked, LongVector512Tests::MULReduceAllMasked); } static long MINReduce(long[] a, int idx) { @@ -4217,7 +4254,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MINReduceLong512VectorTests(IntFunction fa) { + static void MINReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4233,7 +4270,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::MINReduce, Long512VectorTests::MINReduceAll); + LongVector512Tests::MINReduce, LongVector512Tests::MINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4241,20 +4278,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MIN_IDENTITY; - Assert.assertEquals((long) Math.min(id, id), id, + assertEquals((long) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.min(id, x), x); - Assert.assertEquals((long) Math.min(x, id), x); + assertEquals((long) Math.min(id, x), x); + assertEquals((long) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.min(id, x), x, + assertEquals((long) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.min(x, id), x, + assertEquals((long) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4279,7 +4316,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4297,7 +4334,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::MINReduceMasked, Long512VectorTests::MINReduceAllMasked); + LongVector512Tests::MINReduceMasked, LongVector512Tests::MINReduceAllMasked); } static long MAXReduce(long[] a, int idx) { @@ -4319,7 +4356,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MAXReduceLong512VectorTests(IntFunction fa) { + static void MAXReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4335,7 +4372,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::MAXReduce, Long512VectorTests::MAXReduceAll); + LongVector512Tests::MAXReduce, LongVector512Tests::MAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4343,20 +4380,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MAX_IDENTITY; - Assert.assertEquals((long) Math.max(id, id), id, + assertEquals((long) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.max(id, x), x); - Assert.assertEquals((long) Math.max(x, id), x); + assertEquals((long) Math.max(id, x), x); + assertEquals((long) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.max(id, x), x, + assertEquals((long) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.max(x, id), x, + assertEquals((long) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4381,7 +4418,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4399,7 +4436,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::MAXReduceMasked, Long512VectorTests::MAXReduceAllMasked); + LongVector512Tests::MAXReduceMasked, LongVector512Tests::MAXReduceAllMasked); } static long UMINReduce(long[] a, int idx) { @@ -4421,7 +4458,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMINReduceLong512VectorTests(IntFunction fa) { + static void UMINReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4437,7 +4474,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::UMINReduce, Long512VectorTests::UMINReduceAll); + LongVector512Tests::UMINReduce, LongVector512Tests::UMINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4445,20 +4482,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMIN_IDENTITY; - Assert.assertEquals((long) VectorMath.minUnsigned(id, id), id, + assertEquals((long) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x); + assertEquals((long) VectorMath.minUnsigned(id, x), x); + assertEquals((long) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x, + assertEquals((long) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x, + assertEquals((long) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4483,7 +4520,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMINReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4501,7 +4538,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::UMINReduceMasked, Long512VectorTests::UMINReduceAllMasked); + LongVector512Tests::UMINReduceMasked, LongVector512Tests::UMINReduceAllMasked); } static long UMAXReduce(long[] a, int idx) { @@ -4523,7 +4560,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMAXReduceLong512VectorTests(IntFunction fa) { + static void UMAXReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4539,7 +4576,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::UMAXReduce, Long512VectorTests::UMAXReduceAll); + LongVector512Tests::UMAXReduce, LongVector512Tests::UMAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4547,20 +4584,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMAX_IDENTITY; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, id), id, + assertEquals((long) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x); + assertEquals((long) VectorMath.maxUnsigned(id, x), x); + assertEquals((long) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x, + assertEquals((long) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x, + assertEquals((long) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4585,7 +4622,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMAXReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4603,7 +4640,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::UMAXReduceMasked, Long512VectorTests::UMAXReduceAllMasked); + LongVector512Tests::UMAXReduceMasked, LongVector512Tests::UMAXReduceAllMasked); } static long FIRST_NONZEROReduce(long[] a, int idx) { @@ -4625,7 +4662,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void FIRST_NONZEROReduceLong512VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4641,7 +4678,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::FIRST_NONZEROReduce, Long512VectorTests::FIRST_NONZEROReduceAll); + LongVector512Tests::FIRST_NONZEROReduce, LongVector512Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4649,20 +4686,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4687,7 +4724,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void FIRST_NONZEROReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4705,7 +4742,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::FIRST_NONZEROReduceMasked, Long512VectorTests::FIRST_NONZEROReduceAllMasked); + LongVector512Tests::FIRST_NONZEROReduceMasked, LongVector512Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4718,7 +4755,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueLong512VectorTests(IntFunction fm) { + static void anyTrueLongVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4729,7 +4766,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long512VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, LongVector512Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4742,7 +4779,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueLong512VectorTests(IntFunction fm) { + static void allTrueLongVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4753,7 +4790,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long512VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, LongVector512Tests::allTrue); } static long SUADDReduce(long[] a, int idx) { @@ -4775,7 +4812,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingUnaryOpProvider") - static void SUADDReduceLong512VectorTests(IntFunction fa) { + static void SUADDReduceLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4791,7 +4828,7 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::SUADDReduce, Long512VectorTests::SUADDReduceAll); + LongVector512Tests::SUADDReduce, LongVector512Tests::SUADDReduceAll); } @Test(dataProvider = "longSaturatingUnaryOpProvider") @@ -4799,20 +4836,20 @@ public class Long512VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = SUADD_IDENTITY; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4836,7 +4873,7 @@ public class Long512VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "longSaturatingUnaryOpMaskProvider") - static void SUADDReduceLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4854,11 +4891,11 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::SUADDReduceMasked, Long512VectorTests::SUADDReduceAllMasked); + LongVector512Tests::SUADDReduceMasked, LongVector512Tests::SUADDReduceAllMasked); } @Test(dataProvider = "longBinaryOpProvider") - static void withLong512VectorTests(IntFunction fa, IntFunction fb) { + static void withLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -4881,7 +4918,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_DEFAULTLong512VectorTests(IntFunction fa) { + static void IS_DEFAULTLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4891,14 +4928,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_DEFAULTMaskedLong512VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4911,7 +4948,7 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4922,7 +4959,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_NEGATIVELong512VectorTests(IntFunction fa) { + static void IS_NEGATIVELongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4932,14 +4969,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_NEGATIVEMaskedLong512VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4952,14 +4989,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong512VectorTests(IntFunction fa, IntFunction fb) { + static void LTLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4971,14 +5008,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ltLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ltLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4990,14 +5027,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5013,14 +5050,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GTLong512VectorTests(IntFunction fa, IntFunction fb) { + static void GTLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5032,14 +5069,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GTLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5055,14 +5092,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong512VectorTests(IntFunction fa, IntFunction fb) { + static void EQLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5074,14 +5111,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong512VectorTests(IntFunction fa, IntFunction fb) { + static void eqLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5093,14 +5130,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5116,14 +5153,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void NELong512VectorTests(IntFunction fa, IntFunction fb) { + static void NELongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5135,14 +5172,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void NELong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NELongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5158,14 +5195,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LELong512VectorTests(IntFunction fa, IntFunction fb) { + static void LELongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5177,14 +5214,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LELong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LELongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5200,14 +5237,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GELong512VectorTests(IntFunction fa, IntFunction fb) { + static void GELongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5219,14 +5256,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GELong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GELongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5242,14 +5279,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULTLong512VectorTests(IntFunction fa, IntFunction fb) { + static void ULTLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5261,14 +5298,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULTLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5284,14 +5321,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGTLong512VectorTests(IntFunction fa, IntFunction fb) { + static void UGTLongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5303,14 +5340,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGTLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5326,14 +5363,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULELong512VectorTests(IntFunction fa, IntFunction fb) { + static void ULELongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5345,14 +5382,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULELong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULELongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5368,14 +5405,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGELong512VectorTests(IntFunction fa, IntFunction fb) { + static void UGELongVector512Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5387,14 +5424,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGELong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGELongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5410,14 +5447,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5427,13 +5464,13 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5447,14 +5484,14 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5464,13 +5501,13 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5484,7 +5521,7 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @@ -5495,7 +5532,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void blendLong512VectorTests(IntFunction fa, IntFunction fb, + static void blendLongVector512Tests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5511,11 +5548,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long512VectorTests::blend); + assertArraysEquals(r, a, b, mask, LongVector512Tests::blend); } @Test(dataProvider = "longUnaryOpShuffleProvider") - static void RearrangeLong512VectorTests(IntFunction fa, + static void RearrangeLongVector512Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5532,7 +5569,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpShuffleMaskProvider") - static void RearrangeLong512VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeLongVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -5550,7 +5587,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void compressLong512VectorTests(IntFunction fa, + static void compressLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5568,7 +5605,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void expandLong512VectorTests(IntFunction fa, + static void expandLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5586,7 +5623,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void getLong512VectorTests(IntFunction fa) { + static void getLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5742,7 +5779,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BroadcastLong512VectorTests(IntFunction fa) { + static void BroadcastLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5756,7 +5793,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZeroLong512VectorTests(IntFunction fa) { + static void ZeroLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5766,7 +5803,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static long[] sliceUnary(long[] a, int origin, int idx) { @@ -5781,7 +5818,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void sliceUnaryLong512VectorTests(IntFunction fa) { + static void sliceUnaryLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5792,7 +5829,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long512VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, LongVector512Tests::sliceUnary); } static long[] sliceBinary(long[] a, long[] b, int origin, int idx) { @@ -5809,7 +5846,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void sliceBinaryLong512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryLongVector512TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5822,7 +5859,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Long512VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, LongVector512Tests::sliceBinary); } static long[] slice(long[] a, long[] b, int origin, boolean[] mask, int idx) { @@ -5839,7 +5876,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void sliceLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5856,7 +5893,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Long512VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, LongVector512Tests::slice); } static long[] unsliceUnary(long[] a, int origin, int idx) { @@ -5873,7 +5910,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void unsliceUnaryLong512VectorTests(IntFunction fa) { + static void unsliceUnaryLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5884,7 +5921,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long512VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, LongVector512Tests::unsliceUnary); } static long[] unsliceBinary(long[] a, long[] b, int origin, int part, int idx) { @@ -5910,7 +5947,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void unsliceBinaryLong512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryLongVector512TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5924,7 +5961,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Long512VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, LongVector512Tests::unsliceBinary); } static long[] unslice(long[] a, long[] b, int origin, int part, boolean[] mask, int idx) { @@ -5964,7 +6001,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void unsliceLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5981,7 +6018,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Long512VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, LongVector512Tests::unslice); } static long BITWISE_BLEND(long a, long b, long c) { @@ -5993,7 +6030,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6008,11 +6045,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6025,11 +6062,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, LongVector512Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6047,11 +6084,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6062,11 +6099,11 @@ public class Long512VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6077,11 +6114,11 @@ public class Long512VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6092,11 +6129,11 @@ public class Long512VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, LongVector512Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6107,11 +6144,11 @@ public class Long512VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector512Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6126,11 +6163,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong512VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector512TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6145,11 +6182,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6160,11 +6197,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6175,11 +6212,11 @@ public class Long512VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector512Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector512TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6193,7 +6230,7 @@ public class Long512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongVector512Tests::BITWISE_BLEND); } static long NEG(long a) { @@ -6205,7 +6242,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NEGLong512VectorTests(IntFunction fa) { + static void NEGLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6216,11 +6253,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::NEG); + assertArraysEquals(r, a, LongVector512Tests::NEG); } @Test(dataProvider = "longUnaryOpProvider") - static void negLong512VectorTests(IntFunction fa) { + static void negLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6231,11 +6268,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::neg); + assertArraysEquals(r, a, LongVector512Tests::neg); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NEGMaskedLong512VectorTests(IntFunction fa, + static void NEGMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6249,7 +6286,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::NEG); + assertArraysEquals(r, a, mask, LongVector512Tests::NEG); } static long ABS(long a) { @@ -6261,7 +6298,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ABSLong512VectorTests(IntFunction fa) { + static void ABSLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6272,11 +6309,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::ABS); + assertArraysEquals(r, a, LongVector512Tests::ABS); } @Test(dataProvider = "longUnaryOpProvider") - static void absLong512VectorTests(IntFunction fa) { + static void absLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6287,11 +6324,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::abs); + assertArraysEquals(r, a, LongVector512Tests::abs); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ABSMaskedLong512VectorTests(IntFunction fa, + static void ABSMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6305,7 +6342,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::ABS); + assertArraysEquals(r, a, mask, LongVector512Tests::ABS); } static long NOT(long a) { @@ -6317,7 +6354,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NOTLong512VectorTests(IntFunction fa) { + static void NOTLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6328,11 +6365,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::NOT); + assertArraysEquals(r, a, LongVector512Tests::NOT); } @Test(dataProvider = "longUnaryOpProvider") - static void notLong512VectorTests(IntFunction fa) { + static void notLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6343,11 +6380,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::not); + assertArraysEquals(r, a, LongVector512Tests::not); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NOTMaskedLong512VectorTests(IntFunction fa, + static void NOTMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6361,7 +6398,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::NOT); + assertArraysEquals(r, a, mask, LongVector512Tests::NOT); } static long ZOMO(long a) { @@ -6369,7 +6406,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZOMOLong512VectorTests(IntFunction fa) { + static void ZOMOLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6380,11 +6417,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::ZOMO); + assertArraysEquals(r, a, LongVector512Tests::ZOMO); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ZOMOMaskedLong512VectorTests(IntFunction fa, + static void ZOMOMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6398,7 +6435,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::ZOMO); + assertArraysEquals(r, a, mask, LongVector512Tests::ZOMO); } static long BIT_COUNT(long a) { @@ -6406,7 +6443,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BIT_COUNTLong512VectorTests(IntFunction fa) { + static void BIT_COUNTLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6417,11 +6454,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, LongVector512Tests::BIT_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void BIT_COUNTMaskedLong512VectorTests(IntFunction fa, + static void BIT_COUNTMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6435,7 +6472,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, LongVector512Tests::BIT_COUNT); } static long TRAILING_ZEROS_COUNT(long a) { @@ -6443,7 +6480,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void TRAILING_ZEROS_COUNTLong512VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6454,11 +6491,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector512Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedLong512VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6472,7 +6509,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector512Tests::TRAILING_ZEROS_COUNT); } static long LEADING_ZEROS_COUNT(long a) { @@ -6480,7 +6517,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LEADING_ZEROS_COUNTLong512VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6491,11 +6528,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector512Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedLong512VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6509,7 +6546,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector512Tests::LEADING_ZEROS_COUNT); } static long REVERSE(long a) { @@ -6517,7 +6554,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSELong512VectorTests(IntFunction fa) { + static void REVERSELongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6528,11 +6565,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::REVERSE); + assertArraysEquals(r, a, LongVector512Tests::REVERSE); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSEMaskedLong512VectorTests(IntFunction fa, + static void REVERSEMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6546,7 +6583,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::REVERSE); + assertArraysEquals(r, a, mask, LongVector512Tests::REVERSE); } static long REVERSE_BYTES(long a) { @@ -6554,7 +6591,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSE_BYTESLong512VectorTests(IntFunction fa) { + static void REVERSE_BYTESLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6565,11 +6602,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, LongVector512Tests::REVERSE_BYTES); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedLong512VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedLongVector512Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6583,7 +6620,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, LongVector512Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6591,7 +6628,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandLongVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6604,7 +6641,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::band); + assertArraysEquals(r, a, b, LongVector512Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6612,7 +6649,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maskorLongVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6625,7 +6662,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::bor); + assertArraysEquals(r, a, b, LongVector512Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6633,7 +6670,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorLongVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6646,7 +6683,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::bxor); + assertArraysEquals(r, a, b, LongVector512Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6654,7 +6691,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotLongVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6667,7 +6704,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::bandNot); + assertArraysEquals(r, a, b, LongVector512Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6675,7 +6712,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqLongVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6688,7 +6725,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long512VectorTests::beq); + assertArraysEquals(r, a, b, LongVector512Tests::beq); } static boolean unot(boolean a) { @@ -6696,7 +6733,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotLong512VectorTests(IntFunction fa) { + static void masknotLongVector512Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6707,7 +6744,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long512VectorTests::unot); + assertArraysEquals(r, a, LongVector512Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6716,15 +6753,15 @@ public class Long512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongLong512VectorTests(IntFunction fa) { + static void maskFromToLongLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6738,7 +6775,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longCompareOpProvider") - static void ltLong512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltLongVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6748,13 +6785,13 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqLongVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6764,13 +6801,13 @@ public class Long512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longtoIntUnaryOpProvider") - static void toIntArrayLong512VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayLongVector512TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6781,7 +6818,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toLongArrayLong512VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayLongVector512TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6792,7 +6829,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toDoubleArrayLong512VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayLongVector512TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6803,7 +6840,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toStringLong512VectorTestsSmokeTest(IntFunction fa) { + static void toStringLongVector512TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6816,7 +6853,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void hashCodeLong512VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeLongVector512TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6832,7 +6869,7 @@ public class Long512VectorTests extends AbstractVectorTest { @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLongLong512VectorTests(IntFunction fa) { + static void ADDReduceLongLongVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -6848,11 +6885,11 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long512VectorTests::ADDReduce, Long512VectorTests::ADDReduceAll); + LongVector512Tests::ADDReduce, LongVector512Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLongLong512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongLongVector512TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6870,11 +6907,11 @@ public class Long512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long512VectorTests::ADDReduceMasked, Long512VectorTests::ADDReduceAllMasked); + LongVector512Tests::ADDReduceMasked, LongVector512Tests::ADDReduceAllMasked); } @Test(dataProvider = "longUnaryOpSelectFromProvider") - static void SelectFromLong512VectorTests(IntFunction fa, + static void SelectFromLongVector512Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); long[] order = fs.apply(a.length, SPECIES.length()); @@ -6890,7 +6927,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorLongVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] idx = fc.apply(SPECIES.length()); @@ -6908,7 +6945,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpSelectFromMaskProvider") - static void SelectFromLong512VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromLongVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -6927,7 +6964,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousLong512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousLongVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6938,12 +6975,12 @@ public class Long512VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringLong512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringLongVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6957,7 +6994,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsLong512VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsLongVector512TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -6966,12 +7003,12 @@ public class Long512VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsLong512VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsLongVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -6981,13 +7018,13 @@ public class Long512VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeLong512VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeLongVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7009,7 +7046,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountLong512VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountLongVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7020,7 +7057,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long512VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, LongVector512Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7034,7 +7071,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueLong512VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueLongVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7045,7 +7082,7 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long512VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, LongVector512Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7059,7 +7096,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueLong512VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueLongVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7070,11 +7107,11 @@ public class Long512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long512VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, LongVector512Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressLong512VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressLongVector512TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7084,7 +7121,7 @@ public class Long512VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7102,7 +7139,7 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeLong512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongVector512TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7110,13 +7147,13 @@ public class Long512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongLong512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongLongVector512TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7124,7 +7161,7 @@ public class Long512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7143,36 +7180,36 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundLong512VectorTestsSmokeTest(int length) { + static void loopBoundLongVector512TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongLong512VectorTestsSmokeTest(int _length) { + static void loopBoundLongLongVector512TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeLong512VectorTestsSmokeTest() { + static void ElementSizeLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Long.SIZE); + assertEquals(elsize, Long.SIZE); } @Test - static void VectorShapeLong512VectorTestsSmokeTest() { + static void VectorShapeLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_512_BIT)); } @Test - static void ShapeWithLanesLong512VectorTestsSmokeTest() { + static void ShapeWithLanesLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(long.class); @@ -7180,32 +7217,32 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeLong512VectorTestsSmokeTest() { + static void ElementTypeLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementType() == long.class); } @Test - static void SpeciesElementSizeLong512VectorTestsSmokeTest() { + static void SpeciesElementSizeLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementSize() == Long.SIZE); } @Test - static void VectorTypeLong512VectorTestsSmokeTest() { + static void VectorTypeLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesLong512VectorTestsSmokeTest() { + static void WithLanesLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(long.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeLong512VectorTestsSmokeTest() { + static void WithShapeLongVector512TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7213,9 +7250,9 @@ public class Long512VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueLong512VectorTestsSmokeTest() { + static void MaskAllTrueLongVector512TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongVector64LoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/LongVector64LoadStoreTests.java index 53df5e4e092..c1eb1e87561 100644 --- a/test/jdk/jdk/incubator/vector/Long64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector64LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Long64VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation LongVector64LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class LongVector64LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = LongVector.SPECIES_64; @@ -61,14 +61,29 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 64); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(long[] r, long[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "longProviderForIOOBE") @@ -870,11 +885,11 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -885,11 +900,11 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); } } @@ -905,7 +920,7 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(long[] r, long[] a, int[] indexMap) { @@ -918,7 +933,7 @@ public class Long64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Long64VectorTests.java b/test/jdk/jdk/incubator/vector/LongVector64Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Long64VectorTests.java rename to test/jdk/jdk/incubator/vector/LongVector64Tests.java index 5f8a9018384..6ca3c63054a 100644 --- a/test/jdk/jdk/incubator/vector/Long64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/LongVector64Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Long64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongVector64Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Long64VectorTests extends AbstractVectorTest { +public class LongVector64Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = LongVector.SPECIES_64; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected, long delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(long actual, long expected, long delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final long CONST_SHIFT = Long.SIZE / 2; @@ -96,10 +133,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +148,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { long[] ref = f.apply(a[i]); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +164,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +183,13 @@ public class Long64VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +205,13 @@ public class Long64VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -187,10 +224,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -202,10 +239,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -214,12 +251,12 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -230,20 +267,20 @@ public class Long64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (long)0); + assertEquals(r[i + k], (long)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -255,19 +292,19 @@ public class Long64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (long)0); + assertEquals(r[i + j], (long)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -283,11 +320,11 @@ public class Long64VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -296,12 +333,12 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -311,17 +348,17 @@ public class Long64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -331,17 +368,17 @@ public class Long64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -355,10 +392,10 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -370,10 +407,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -385,10 +422,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -409,18 +446,18 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -435,18 +472,18 @@ public class Long64VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -454,10 +491,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -465,10 +502,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -476,10 +513,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -488,10 +525,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -504,10 +541,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -519,10 +556,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -534,10 +571,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -552,10 +589,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -568,11 +605,11 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -586,11 +623,11 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -612,11 +649,11 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -630,11 +667,11 @@ public class Long64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -654,10 +691,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -669,10 +706,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -681,10 +718,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -694,10 +731,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -713,11 +750,11 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -734,11 +771,11 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -749,11 +786,11 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -770,11 +807,11 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -792,13 +829,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -819,13 +856,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -840,13 +877,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(r, a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -867,13 +904,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -887,13 +924,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -908,13 +945,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -929,13 +966,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -951,13 +988,13 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1003,10 +1040,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1016,10 +1053,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1027,10 +1064,10 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1565,7 +1602,7 @@ public class Long64VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); LongVector a = io.add((long)1); //[1,2] LongVector b = a.neg(); //[-1,-2] long[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1580,19 +1617,19 @@ public class Long64VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); LongVector uab0 = zab0.rearrange(unz0,zab1); LongVector uab1 = zab0.rearrange(unz1,zab1); long[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1607,7 +1644,7 @@ public class Long64VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1615,9 +1652,9 @@ public class Long64VectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1646,7 +1683,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ADDLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1659,7 +1696,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::ADD); + assertArraysEquals(r, a, b, LongVector64Tests::ADD); } static long add(long a, long b) { @@ -1667,7 +1704,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void addLong64VectorTests(IntFunction fa, IntFunction fb) { + static void addLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1678,11 +1715,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::add); + assertArraysEquals(r, a, b, LongVector64Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1698,11 +1735,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::ADD); + assertArraysEquals(r, a, b, mask, LongVector64Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1716,7 +1753,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long64VectorTests::add); + assertArraysEquals(r, a, b, mask, LongVector64Tests::add); } static long SUB(long a, long b) { @@ -1724,7 +1761,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void SUBLong64VectorTests(IntFunction fa, IntFunction fb) { + static void SUBLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1737,7 +1774,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::SUB); + assertArraysEquals(r, a, b, LongVector64Tests::SUB); } static long sub(long a, long b) { @@ -1745,7 +1782,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void subLong64VectorTests(IntFunction fa, IntFunction fb) { + static void subLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1756,11 +1793,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::sub); + assertArraysEquals(r, a, b, LongVector64Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void SUBLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1776,11 +1813,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::SUB); + assertArraysEquals(r, a, b, mask, LongVector64Tests::SUB); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1794,7 +1831,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long64VectorTests::sub); + assertArraysEquals(r, a, b, mask, LongVector64Tests::sub); } static long MUL(long a, long b) { @@ -1802,7 +1839,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MULLong64VectorTests(IntFunction fa, IntFunction fb) { + static void MULLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1815,7 +1852,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::MUL); + assertArraysEquals(r, a, b, LongVector64Tests::MUL); } static long mul(long a, long b) { @@ -1823,7 +1860,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong64VectorTests(IntFunction fa, IntFunction fb) { + static void mulLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1834,11 +1871,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::mul); + assertArraysEquals(r, a, b, LongVector64Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void MULLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1854,11 +1891,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::MUL); + assertArraysEquals(r, a, b, mask, LongVector64Tests::MUL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1872,7 +1909,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Long64VectorTests::mul); + assertArraysEquals(r, a, b, mask, LongVector64Tests::mul); } static long DIV(long a, long b) { @@ -1880,7 +1917,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void DIVLong64VectorTests(IntFunction fa, IntFunction fb) { + static void DIVLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1895,7 +1932,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::DIV); + assertArraysEquals(r, a, b, LongVector64Tests::DIV); } static long div(long a, long b) { @@ -1903,7 +1940,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void divLong64VectorTests(IntFunction fa, IntFunction fb) { + static void divLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1918,11 +1955,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::div); + assertArraysEquals(r, a, b, LongVector64Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void DIVLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1940,11 +1977,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::DIV); + assertArraysEquals(r, a, b, mask, LongVector64Tests::DIV); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1962,7 +1999,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::div); + assertArraysEquals(r, a, b, mask, LongVector64Tests::div); } static long FIRST_NONZERO(long a, long b) { @@ -1970,7 +2007,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void FIRST_NONZEROLong64VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1983,11 +2020,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, LongVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void FIRST_NONZEROLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2003,7 +2040,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, LongVector64Tests::FIRST_NONZERO); } static long AND(long a, long b) { @@ -2011,7 +2048,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ANDLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2024,7 +2061,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::AND); + assertArraysEquals(r, a, b, LongVector64Tests::AND); } static long and(long a, long b) { @@ -2032,7 +2069,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void andLong64VectorTests(IntFunction fa, IntFunction fb) { + static void andLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2043,11 +2080,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::and); + assertArraysEquals(r, a, b, LongVector64Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2063,7 +2100,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::AND); + assertArraysEquals(r, a, b, mask, LongVector64Tests::AND); } static long AND_NOT(long a, long b) { @@ -2071,7 +2108,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void AND_NOTLong64VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2084,11 +2121,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, LongVector64Tests::AND_NOT); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void AND_NOTLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2104,7 +2141,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, LongVector64Tests::AND_NOT); } static long OR(long a, long b) { @@ -2112,7 +2149,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ORLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2125,7 +2162,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::OR); + assertArraysEquals(r, a, b, LongVector64Tests::OR); } static long or(long a, long b) { @@ -2133,7 +2170,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void orLong64VectorTests(IntFunction fa, IntFunction fb) { + static void orLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2144,11 +2181,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::or); + assertArraysEquals(r, a, b, LongVector64Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2164,7 +2201,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::OR); + assertArraysEquals(r, a, b, mask, LongVector64Tests::OR); } static long XOR(long a, long b) { @@ -2172,7 +2209,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void XORLong64VectorTests(IntFunction fa, IntFunction fb) { + static void XORLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2185,11 +2222,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::XOR); + assertArraysEquals(r, a, b, LongVector64Tests::XOR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void XORLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2205,7 +2242,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::XOR); + assertArraysEquals(r, a, b, mask, LongVector64Tests::XOR); } static long COMPRESS_BITS(long a, long b) { @@ -2213,7 +2250,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void COMPRESS_BITSLong64VectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2263,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, LongVector64Tests::COMPRESS_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void COMPRESS_BITSLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2246,7 +2283,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, LongVector64Tests::COMPRESS_BITS); } static long EXPAND_BITS(long a, long b) { @@ -2254,7 +2291,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void EXPAND_BITSLong64VectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2267,11 +2304,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, LongVector64Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void EXPAND_BITSLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2287,11 +2324,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, LongVector64Tests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpProvider") - static void addLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2301,11 +2338,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2318,11 +2355,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, LongVector64Tests::add); } @Test(dataProvider = "longBinaryOpProvider") - static void subLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2332,11 +2369,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2349,11 +2386,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, LongVector64Tests::sub); } @Test(dataProvider = "longBinaryOpProvider") - static void mulLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2363,11 +2400,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2380,11 +2417,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, LongVector64Tests::mul); } @Test(dataProvider = "longBinaryOpProvider") - static void divLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2396,11 +2433,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2415,11 +2452,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, LongVector64Tests::div); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2429,11 +2466,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void orLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2443,11 +2480,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::or); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2460,11 +2497,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, LongVector64Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2474,11 +2511,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void andLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2488,11 +2525,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::and); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2505,11 +2542,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Long64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, LongVector64Tests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLong64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2519,11 +2556,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, LongVector64Tests::OR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLong64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2536,11 +2573,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector64Tests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLong64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDLongVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2550,11 +2587,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Long64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, LongVector64Tests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLong64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDLongVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2567,7 +2604,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Long64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVector64Tests::ADD); } static long LSHL(long a, long b) { @@ -2575,7 +2612,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2588,11 +2625,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::LSHL); + assertArraysEquals(r, a, b, LongVector64Tests::LSHL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2608,7 +2645,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, LongVector64Tests::LSHL); } static long ASHR(long a, long b) { @@ -2616,7 +2653,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2629,11 +2666,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::ASHR); + assertArraysEquals(r, a, b, LongVector64Tests::ASHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2649,7 +2686,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, LongVector64Tests::ASHR); } static long LSHR(long a, long b) { @@ -2657,7 +2694,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2670,11 +2707,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::LSHR); + assertArraysEquals(r, a, b, LongVector64Tests::LSHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2690,7 +2727,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, LongVector64Tests::LSHR); } static long LSHL_unary(long a, long b) { @@ -2698,7 +2735,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLong64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLLongVector64TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2710,11 +2747,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, LongVector64Tests::LSHL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLong64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2729,7 +2766,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector64Tests::LSHL_unary); } static long LSHR_unary(long a, long b) { @@ -2737,7 +2774,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLong64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRLongVector64TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2749,11 +2786,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, LongVector64Tests::LSHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLong64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2768,7 +2805,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector64Tests::LSHR_unary); } static long ASHR_unary(long a, long b) { @@ -2776,7 +2813,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLong64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRLongVector64TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2788,11 +2825,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, LongVector64Tests::ASHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLong64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2807,7 +2844,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector64Tests::ASHR_unary); } static long ROR(long a, long b) { @@ -2815,7 +2852,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong64VectorTests(IntFunction fa, IntFunction fb) { + static void RORLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2828,11 +2865,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::ROR); + assertArraysEquals(r, a, b, LongVector64Tests::ROR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2848,7 +2885,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::ROR); + assertArraysEquals(r, a, b, mask, LongVector64Tests::ROR); } static long ROL(long a, long b) { @@ -2856,7 +2893,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ROLLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2869,11 +2906,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::ROL); + assertArraysEquals(r, a, b, LongVector64Tests::ROL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2889,7 +2926,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::ROL); + assertArraysEquals(r, a, b, mask, LongVector64Tests::ROL); } static long ROR_unary(long a, long b) { @@ -2897,7 +2934,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLong64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORLongVector64TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2909,11 +2946,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, LongVector64Tests::ROR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLong64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORLongVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2928,7 +2965,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector64Tests::ROR_unary); } static long ROL_unary(long a, long b) { @@ -2936,7 +2973,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLong64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLLongVector64TestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2948,11 +2985,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Long64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, LongVector64Tests::ROL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLong64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLLongVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2967,14 +3004,14 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Long64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVector64Tests::ROL_unary); } static long LSHR_binary_const(long a) { return (long)((a >>> CONST_SHIFT)); } @Test(dataProvider = "longUnaryOpProvider") - static void LSHRLong64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRLongVector64TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2985,11 +3022,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, LongVector64Tests::LSHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHRLong64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRLongVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3003,7 +3040,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector64Tests::LSHR_binary_const); } static long LSHL_binary_const(long a) { @@ -3011,7 +3048,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LSHLLong64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLLongVector64TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3022,11 +3059,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, LongVector64Tests::LSHL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHLLong64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLLongVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3040,7 +3077,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector64Tests::LSHL_binary_const); } static long ASHR_binary_const(long a) { @@ -3048,7 +3085,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ASHRLong64VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRLongVector64TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3059,11 +3096,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, LongVector64Tests::ASHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ASHRLong64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRLongVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3077,7 +3114,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector64Tests::ASHR_binary_const); } static long ROR_binary_const(long a) { @@ -3085,7 +3122,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void RORLong64VectorTestsScalarShiftConst(IntFunction fa) { + static void RORLongVector64TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3096,11 +3133,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, LongVector64Tests::ROR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void RORLong64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORLongVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3114,7 +3151,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, LongVector64Tests::ROR_binary_const); } static long ROL_binary_const(long a) { @@ -3122,7 +3159,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ROLLong64VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLLongVector64TestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3133,11 +3170,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Long64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, LongVector64Tests::ROL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ROLLong64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLLongVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3151,14 +3188,14 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Long64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, LongVector64Tests::ROL_binary_const); } static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MINLong64VectorTestsWithMemOp(IntFunction fa) { + static void MINLongVector64TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3169,13 +3206,13 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long64VectorTests::MIN); + assertArraysEquals(r, a, (long)10, LongVector64Tests::MIN); } static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void minLong64VectorTestsWithMemOp(IntFunction fa) { + static void minLongVector64TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3186,13 +3223,13 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long64VectorTests::min); + assertArraysEquals(r, a, (long)10, LongVector64Tests::min); } static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINLong64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINLongVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3205,13 +3242,13 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long64VectorTests::MIN); + assertArraysEquals(r, a, (long)10, mask, LongVector64Tests::MIN); } static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MAXLong64VectorTestsWithMemOp(IntFunction fa) { + static void MAXLongVector64TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3222,13 +3259,13 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long64VectorTests::MAX); + assertArraysEquals(r, a, (long)10, LongVector64Tests::MAX); } static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void maxLong64VectorTestsWithMemOp(IntFunction fa) { + static void maxLongVector64TestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3239,13 +3276,13 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, Long64VectorTests::max); + assertArraysEquals(r, a, (long)10, LongVector64Tests::max); } static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXLong64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXLongVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3258,7 +3295,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, Long64VectorTests::MAX); + assertArraysEquals(r, a, (long)10, mask, LongVector64Tests::MAX); } static long MIN(long a, long b) { @@ -3266,7 +3303,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong64VectorTests(IntFunction fa, IntFunction fb) { + static void MINLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3279,7 +3316,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::MIN); + assertArraysEquals(r, a, b, LongVector64Tests::MIN); } static long min(long a, long b) { @@ -3287,7 +3324,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void minLong64VectorTests(IntFunction fa, IntFunction fb) { + static void minLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3298,7 +3335,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::min); + assertArraysEquals(r, a, b, LongVector64Tests::min); } static long MAX(long a, long b) { @@ -3306,7 +3343,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong64VectorTests(IntFunction fa, IntFunction fb) { + static void MAXLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3319,7 +3356,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::MAX); + assertArraysEquals(r, a, b, LongVector64Tests::MAX); } static long max(long a, long b) { @@ -3327,7 +3364,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maxLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3338,7 +3375,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Long64VectorTests::max); + assertArraysEquals(r, a, b, LongVector64Tests::max); } static long UMIN(long a, long b) { @@ -3346,7 +3383,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMINLong64VectorTests(IntFunction fa, IntFunction fb) { + static void UMINLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3359,11 +3396,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::UMIN); + assertArraysEquals(r, a, b, LongVector64Tests::UMIN); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMINLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3379,7 +3416,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, LongVector64Tests::UMIN); } static long UMAX(long a, long b) { @@ -3387,7 +3424,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMAXLong64VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3400,11 +3437,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::UMAX); + assertArraysEquals(r, a, b, LongVector64Tests::UMAX); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMAXLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3420,7 +3457,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, LongVector64Tests::UMAX); } static long SADD(long a, long b) { @@ -3428,7 +3465,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SADDLong64VectorTests(IntFunction fa, IntFunction fb) { + static void SADDLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3441,11 +3478,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::SADD); + assertArraysEquals(r, a, b, LongVector64Tests::SADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SADDLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3461,7 +3498,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::SADD); + assertArraysEquals(r, a, b, mask, LongVector64Tests::SADD); } static long SSUB(long a, long b) { @@ -3469,7 +3506,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SSUBLong64VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3482,11 +3519,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::SSUB); + assertArraysEquals(r, a, b, LongVector64Tests::SSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SSUBLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3502,7 +3539,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, LongVector64Tests::SSUB); } static long SUADD(long a, long b) { @@ -3510,7 +3547,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUADDLong64VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3560,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::SUADD); + assertArraysEquals(r, a, b, LongVector64Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUADDLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3543,7 +3580,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, LongVector64Tests::SUADD); } static long SUSUB(long a, long b) { @@ -3551,7 +3588,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUSUBLong64VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3564,11 +3601,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::SUSUB); + assertArraysEquals(r, a, b, LongVector64Tests::SUSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUSUBLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3584,11 +3621,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, LongVector64Tests::SUSUB); } @Test(dataProvider = "longBinaryOpProvider") - static void MINLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3598,11 +3635,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::MIN); } @Test(dataProvider = "longBinaryOpProvider") - static void minLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3612,11 +3649,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::min); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::min); } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3626,11 +3663,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::MAX); } @Test(dataProvider = "longBinaryOpProvider") - static void maxLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3640,10 +3677,10 @@ public class Long64VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Long64VectorTests::max); + assertBroadcastArraysEquals(r, a, b, LongVector64Tests::max); } @Test(dataProvider = "longSaturatingBinaryOpAssocProvider") - static void SUADDAssocLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocLongVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -3660,11 +3697,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Long64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, LongVector64Tests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3685,7 +3722,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Long64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, LongVector64Tests::SUADD); } static long ANDReduce(long[] a, int idx) { @@ -3707,7 +3744,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ANDReduceLong64VectorTests(IntFunction fa) { + static void ANDReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3723,7 +3760,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::ANDReduce, Long64VectorTests::ANDReduceAll); + LongVector64Tests::ANDReduce, LongVector64Tests::ANDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3731,20 +3768,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = AND_IDENTITY; - Assert.assertEquals((long) (id & id), id, + assertEquals((long) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id & x), x); - Assert.assertEquals((long) (x & id), x); + assertEquals((long) (id & x), x); + assertEquals((long) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id & x), x, + assertEquals((long) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x & id), x, + assertEquals((long) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3769,7 +3806,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ANDReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3787,7 +3824,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::ANDReduceMasked, Long64VectorTests::ANDReduceAllMasked); + LongVector64Tests::ANDReduceMasked, LongVector64Tests::ANDReduceAllMasked); } static long ORReduce(long[] a, int idx) { @@ -3809,7 +3846,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ORReduceLong64VectorTests(IntFunction fa) { + static void ORReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3825,7 +3862,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::ORReduce, Long64VectorTests::ORReduceAll); + LongVector64Tests::ORReduce, LongVector64Tests::ORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3833,20 +3870,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = OR_IDENTITY; - Assert.assertEquals((long) (id | id), id, + assertEquals((long) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id | x), x); - Assert.assertEquals((long) (x | id), x); + assertEquals((long) (id | x), x); + assertEquals((long) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id | x), x, + assertEquals((long) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x | id), x, + assertEquals((long) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3871,7 +3908,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ORReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3889,7 +3926,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::ORReduceMasked, Long64VectorTests::ORReduceAllMasked); + LongVector64Tests::ORReduceMasked, LongVector64Tests::ORReduceAllMasked); } static long XORReduce(long[] a, int idx) { @@ -3911,7 +3948,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void XORReduceLong64VectorTests(IntFunction fa) { + static void XORReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3927,7 +3964,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::XORReduce, Long64VectorTests::XORReduceAll); + LongVector64Tests::XORReduce, LongVector64Tests::XORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3935,20 +3972,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = XOR_IDENTITY; - Assert.assertEquals((long) (id ^ id), id, + assertEquals((long) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id ^ x), x); - Assert.assertEquals((long) (x ^ id), x); + assertEquals((long) (id ^ x), x); + assertEquals((long) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id ^ x), x, + assertEquals((long) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x ^ id), x, + assertEquals((long) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3973,7 +4010,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void XORReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3991,7 +4028,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::XORReduceMasked, Long64VectorTests::XORReduceAllMasked); + LongVector64Tests::XORReduceMasked, LongVector64Tests::XORReduceAllMasked); } static long ADDReduce(long[] a, int idx) { @@ -4013,7 +4050,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLong64VectorTests(IntFunction fa) { + static void ADDReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4029,7 +4066,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::ADDReduce, Long64VectorTests::ADDReduceAll); + LongVector64Tests::ADDReduce, LongVector64Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4037,20 +4074,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = ADD_IDENTITY; - Assert.assertEquals((long) (id + id), id, + assertEquals((long) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id + x), x); - Assert.assertEquals((long) (x + id), x); + assertEquals((long) (id + x), x); + assertEquals((long) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id + x), x, + assertEquals((long) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x + id), x, + assertEquals((long) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4075,7 +4112,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4093,7 +4130,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::ADDReduceMasked, Long64VectorTests::ADDReduceAllMasked); + LongVector64Tests::ADDReduceMasked, LongVector64Tests::ADDReduceAllMasked); } static long MULReduce(long[] a, int idx) { @@ -4115,7 +4152,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MULReduceLong64VectorTests(IntFunction fa) { + static void MULReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4131,7 +4168,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::MULReduce, Long64VectorTests::MULReduceAll); + LongVector64Tests::MULReduce, LongVector64Tests::MULReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4139,20 +4176,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MUL_IDENTITY; - Assert.assertEquals((long) (id * id), id, + assertEquals((long) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id * x), x); - Assert.assertEquals((long) (x * id), x); + assertEquals((long) (id * x), x); + assertEquals((long) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id * x), x, + assertEquals((long) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x * id), x, + assertEquals((long) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4177,7 +4214,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MULReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4195,7 +4232,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::MULReduceMasked, Long64VectorTests::MULReduceAllMasked); + LongVector64Tests::MULReduceMasked, LongVector64Tests::MULReduceAllMasked); } static long MINReduce(long[] a, int idx) { @@ -4217,7 +4254,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MINReduceLong64VectorTests(IntFunction fa) { + static void MINReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4233,7 +4270,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::MINReduce, Long64VectorTests::MINReduceAll); + LongVector64Tests::MINReduce, LongVector64Tests::MINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4241,20 +4278,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MIN_IDENTITY; - Assert.assertEquals((long) Math.min(id, id), id, + assertEquals((long) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.min(id, x), x); - Assert.assertEquals((long) Math.min(x, id), x); + assertEquals((long) Math.min(id, x), x); + assertEquals((long) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.min(id, x), x, + assertEquals((long) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.min(x, id), x, + assertEquals((long) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4279,7 +4316,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4297,7 +4334,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::MINReduceMasked, Long64VectorTests::MINReduceAllMasked); + LongVector64Tests::MINReduceMasked, LongVector64Tests::MINReduceAllMasked); } static long MAXReduce(long[] a, int idx) { @@ -4319,7 +4356,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MAXReduceLong64VectorTests(IntFunction fa) { + static void MAXReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4335,7 +4372,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::MAXReduce, Long64VectorTests::MAXReduceAll); + LongVector64Tests::MAXReduce, LongVector64Tests::MAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4343,20 +4380,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MAX_IDENTITY; - Assert.assertEquals((long) Math.max(id, id), id, + assertEquals((long) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.max(id, x), x); - Assert.assertEquals((long) Math.max(x, id), x); + assertEquals((long) Math.max(id, x), x); + assertEquals((long) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.max(id, x), x, + assertEquals((long) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.max(x, id), x, + assertEquals((long) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4381,7 +4418,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4399,7 +4436,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::MAXReduceMasked, Long64VectorTests::MAXReduceAllMasked); + LongVector64Tests::MAXReduceMasked, LongVector64Tests::MAXReduceAllMasked); } static long UMINReduce(long[] a, int idx) { @@ -4421,7 +4458,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMINReduceLong64VectorTests(IntFunction fa) { + static void UMINReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4437,7 +4474,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::UMINReduce, Long64VectorTests::UMINReduceAll); + LongVector64Tests::UMINReduce, LongVector64Tests::UMINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4445,20 +4482,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMIN_IDENTITY; - Assert.assertEquals((long) VectorMath.minUnsigned(id, id), id, + assertEquals((long) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x); + assertEquals((long) VectorMath.minUnsigned(id, x), x); + assertEquals((long) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x, + assertEquals((long) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x, + assertEquals((long) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4483,7 +4520,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMINReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4501,7 +4538,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::UMINReduceMasked, Long64VectorTests::UMINReduceAllMasked); + LongVector64Tests::UMINReduceMasked, LongVector64Tests::UMINReduceAllMasked); } static long UMAXReduce(long[] a, int idx) { @@ -4523,7 +4560,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMAXReduceLong64VectorTests(IntFunction fa) { + static void UMAXReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4539,7 +4576,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::UMAXReduce, Long64VectorTests::UMAXReduceAll); + LongVector64Tests::UMAXReduce, LongVector64Tests::UMAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4547,20 +4584,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMAX_IDENTITY; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, id), id, + assertEquals((long) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x); + assertEquals((long) VectorMath.maxUnsigned(id, x), x); + assertEquals((long) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x, + assertEquals((long) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x, + assertEquals((long) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4585,7 +4622,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMAXReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4603,7 +4640,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::UMAXReduceMasked, Long64VectorTests::UMAXReduceAllMasked); + LongVector64Tests::UMAXReduceMasked, LongVector64Tests::UMAXReduceAllMasked); } static long FIRST_NONZEROReduce(long[] a, int idx) { @@ -4625,7 +4662,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void FIRST_NONZEROReduceLong64VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4641,7 +4678,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::FIRST_NONZEROReduce, Long64VectorTests::FIRST_NONZEROReduceAll); + LongVector64Tests::FIRST_NONZEROReduce, LongVector64Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4649,20 +4686,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4687,7 +4724,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void FIRST_NONZEROReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4705,7 +4742,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::FIRST_NONZEROReduceMasked, Long64VectorTests::FIRST_NONZEROReduceAllMasked); + LongVector64Tests::FIRST_NONZEROReduceMasked, LongVector64Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4718,7 +4755,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueLong64VectorTests(IntFunction fm) { + static void anyTrueLongVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4729,7 +4766,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long64VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, LongVector64Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4742,7 +4779,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueLong64VectorTests(IntFunction fm) { + static void allTrueLongVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4753,7 +4790,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Long64VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, LongVector64Tests::allTrue); } static long SUADDReduce(long[] a, int idx) { @@ -4775,7 +4812,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingUnaryOpProvider") - static void SUADDReduceLong64VectorTests(IntFunction fa) { + static void SUADDReduceLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4791,7 +4828,7 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::SUADDReduce, Long64VectorTests::SUADDReduceAll); + LongVector64Tests::SUADDReduce, LongVector64Tests::SUADDReduceAll); } @Test(dataProvider = "longSaturatingUnaryOpProvider") @@ -4799,20 +4836,20 @@ public class Long64VectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = SUADD_IDENTITY; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4836,7 +4873,7 @@ public class Long64VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "longSaturatingUnaryOpMaskProvider") - static void SUADDReduceLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4854,11 +4891,11 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::SUADDReduceMasked, Long64VectorTests::SUADDReduceAllMasked); + LongVector64Tests::SUADDReduceMasked, LongVector64Tests::SUADDReduceAllMasked); } @Test(dataProvider = "longBinaryOpProvider") - static void withLong64VectorTests(IntFunction fa, IntFunction fb) { + static void withLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -4881,7 +4918,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_DEFAULTLong64VectorTests(IntFunction fa) { + static void IS_DEFAULTLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4891,14 +4928,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_DEFAULTMaskedLong64VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4911,7 +4948,7 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4922,7 +4959,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_NEGATIVELong64VectorTests(IntFunction fa) { + static void IS_NEGATIVELongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4932,14 +4969,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_NEGATIVEMaskedLong64VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4952,14 +4989,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong64VectorTests(IntFunction fa, IntFunction fb) { + static void LTLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4971,14 +5008,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ltLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ltLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4990,14 +5027,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5013,14 +5050,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GTLong64VectorTests(IntFunction fa, IntFunction fb) { + static void GTLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5032,14 +5069,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GTLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5055,14 +5092,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong64VectorTests(IntFunction fa, IntFunction fb) { + static void EQLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5074,14 +5111,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong64VectorTests(IntFunction fa, IntFunction fb) { + static void eqLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5093,14 +5130,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5116,14 +5153,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void NELong64VectorTests(IntFunction fa, IntFunction fb) { + static void NELongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5135,14 +5172,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void NELong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NELongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5158,14 +5195,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LELong64VectorTests(IntFunction fa, IntFunction fb) { + static void LELongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5177,14 +5214,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LELong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LELongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5200,14 +5237,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GELong64VectorTests(IntFunction fa, IntFunction fb) { + static void GELongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5219,14 +5256,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GELong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GELongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5242,14 +5279,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULTLong64VectorTests(IntFunction fa, IntFunction fb) { + static void ULTLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5261,14 +5298,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULTLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5284,14 +5321,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGTLong64VectorTests(IntFunction fa, IntFunction fb) { + static void UGTLongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5303,14 +5340,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGTLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5326,14 +5363,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULELong64VectorTests(IntFunction fa, IntFunction fb) { + static void ULELongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5345,14 +5382,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULELong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULELongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5368,14 +5405,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGELong64VectorTests(IntFunction fa, IntFunction fb) { + static void UGELongVector64Tests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5387,14 +5424,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGELong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGELongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5410,14 +5447,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5427,13 +5464,13 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5447,14 +5484,14 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5464,13 +5501,13 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5484,7 +5521,7 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @@ -5495,7 +5532,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void blendLong64VectorTests(IntFunction fa, IntFunction fb, + static void blendLongVector64Tests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5511,11 +5548,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Long64VectorTests::blend); + assertArraysEquals(r, a, b, mask, LongVector64Tests::blend); } @Test(dataProvider = "longUnaryOpShuffleProvider") - static void RearrangeLong64VectorTests(IntFunction fa, + static void RearrangeLongVector64Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5532,7 +5569,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpShuffleMaskProvider") - static void RearrangeLong64VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeLongVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -5550,7 +5587,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void compressLong64VectorTests(IntFunction fa, + static void compressLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5568,7 +5605,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void expandLong64VectorTests(IntFunction fa, + static void expandLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5586,7 +5623,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void getLong64VectorTests(IntFunction fa) { + static void getLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5742,7 +5779,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BroadcastLong64VectorTests(IntFunction fa) { + static void BroadcastLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5756,7 +5793,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZeroLong64VectorTests(IntFunction fa) { + static void ZeroLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5766,7 +5803,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static long[] sliceUnary(long[] a, int origin, int idx) { @@ -5781,7 +5818,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void sliceUnaryLong64VectorTests(IntFunction fa) { + static void sliceUnaryLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5792,7 +5829,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long64VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, LongVector64Tests::sliceUnary); } static long[] sliceBinary(long[] a, long[] b, int origin, int idx) { @@ -5809,7 +5846,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void sliceBinaryLong64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryLongVector64TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5822,7 +5859,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Long64VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, LongVector64Tests::sliceBinary); } static long[] slice(long[] a, long[] b, int origin, boolean[] mask, int idx) { @@ -5839,7 +5876,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void sliceLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5856,7 +5893,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Long64VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, LongVector64Tests::slice); } static long[] unsliceUnary(long[] a, int origin, int idx) { @@ -5873,7 +5910,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void unsliceUnaryLong64VectorTests(IntFunction fa) { + static void unsliceUnaryLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5884,7 +5921,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Long64VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, LongVector64Tests::unsliceUnary); } static long[] unsliceBinary(long[] a, long[] b, int origin, int part, int idx) { @@ -5910,7 +5947,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void unsliceBinaryLong64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryLongVector64TestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5924,7 +5961,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Long64VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, LongVector64Tests::unsliceBinary); } static long[] unslice(long[] a, long[] b, int origin, int part, boolean[] mask, int idx) { @@ -5964,7 +6001,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void unsliceLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5981,7 +6018,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Long64VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, LongVector64Tests::unslice); } static long BITWISE_BLEND(long a, long b, long c) { @@ -5993,7 +6030,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6008,11 +6045,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Long64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6025,11 +6062,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Long64VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, LongVector64Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6047,11 +6084,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Long64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6062,11 +6099,11 @@ public class Long64VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6077,11 +6114,11 @@ public class Long64VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6092,11 +6129,11 @@ public class Long64VectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Long64VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, LongVector64Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6107,11 +6144,11 @@ public class Long64VectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Long64VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, LongVector64Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6126,11 +6163,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Long64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong64VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector64TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6145,11 +6182,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Long64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLong64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6160,11 +6197,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLong64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6175,11 +6212,11 @@ public class Long64VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Long64VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVector64Tests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLong64VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVector64TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6193,7 +6230,7 @@ public class Long64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Long64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongVector64Tests::BITWISE_BLEND); } static long NEG(long a) { @@ -6205,7 +6242,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NEGLong64VectorTests(IntFunction fa) { + static void NEGLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6216,11 +6253,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::NEG); + assertArraysEquals(r, a, LongVector64Tests::NEG); } @Test(dataProvider = "longUnaryOpProvider") - static void negLong64VectorTests(IntFunction fa) { + static void negLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6231,11 +6268,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::neg); + assertArraysEquals(r, a, LongVector64Tests::neg); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NEGMaskedLong64VectorTests(IntFunction fa, + static void NEGMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6249,7 +6286,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::NEG); + assertArraysEquals(r, a, mask, LongVector64Tests::NEG); } static long ABS(long a) { @@ -6261,7 +6298,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ABSLong64VectorTests(IntFunction fa) { + static void ABSLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6272,11 +6309,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::ABS); + assertArraysEquals(r, a, LongVector64Tests::ABS); } @Test(dataProvider = "longUnaryOpProvider") - static void absLong64VectorTests(IntFunction fa) { + static void absLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6287,11 +6324,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::abs); + assertArraysEquals(r, a, LongVector64Tests::abs); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ABSMaskedLong64VectorTests(IntFunction fa, + static void ABSMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6305,7 +6342,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::ABS); + assertArraysEquals(r, a, mask, LongVector64Tests::ABS); } static long NOT(long a) { @@ -6317,7 +6354,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NOTLong64VectorTests(IntFunction fa) { + static void NOTLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6328,11 +6365,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::NOT); + assertArraysEquals(r, a, LongVector64Tests::NOT); } @Test(dataProvider = "longUnaryOpProvider") - static void notLong64VectorTests(IntFunction fa) { + static void notLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6343,11 +6380,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::not); + assertArraysEquals(r, a, LongVector64Tests::not); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NOTMaskedLong64VectorTests(IntFunction fa, + static void NOTMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6361,7 +6398,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::NOT); + assertArraysEquals(r, a, mask, LongVector64Tests::NOT); } static long ZOMO(long a) { @@ -6369,7 +6406,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZOMOLong64VectorTests(IntFunction fa) { + static void ZOMOLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6380,11 +6417,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::ZOMO); + assertArraysEquals(r, a, LongVector64Tests::ZOMO); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ZOMOMaskedLong64VectorTests(IntFunction fa, + static void ZOMOMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6398,7 +6435,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::ZOMO); + assertArraysEquals(r, a, mask, LongVector64Tests::ZOMO); } static long BIT_COUNT(long a) { @@ -6406,7 +6443,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BIT_COUNTLong64VectorTests(IntFunction fa) { + static void BIT_COUNTLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6417,11 +6454,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, LongVector64Tests::BIT_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void BIT_COUNTMaskedLong64VectorTests(IntFunction fa, + static void BIT_COUNTMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6435,7 +6472,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, LongVector64Tests::BIT_COUNT); } static long TRAILING_ZEROS_COUNT(long a) { @@ -6443,7 +6480,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void TRAILING_ZEROS_COUNTLong64VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6454,11 +6491,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector64Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedLong64VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6472,7 +6509,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector64Tests::TRAILING_ZEROS_COUNT); } static long LEADING_ZEROS_COUNT(long a) { @@ -6480,7 +6517,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LEADING_ZEROS_COUNTLong64VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6491,11 +6528,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVector64Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedLong64VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6509,7 +6546,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVector64Tests::LEADING_ZEROS_COUNT); } static long REVERSE(long a) { @@ -6517,7 +6554,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSELong64VectorTests(IntFunction fa) { + static void REVERSELongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6528,11 +6565,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::REVERSE); + assertArraysEquals(r, a, LongVector64Tests::REVERSE); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSEMaskedLong64VectorTests(IntFunction fa, + static void REVERSEMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6546,7 +6583,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::REVERSE); + assertArraysEquals(r, a, mask, LongVector64Tests::REVERSE); } static long REVERSE_BYTES(long a) { @@ -6554,7 +6591,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSE_BYTESLong64VectorTests(IntFunction fa) { + static void REVERSE_BYTESLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6565,11 +6602,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, LongVector64Tests::REVERSE_BYTES); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedLong64VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedLongVector64Tests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6583,7 +6620,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Long64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, LongVector64Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6591,7 +6628,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandLongVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6604,7 +6641,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::band); + assertArraysEquals(r, a, b, LongVector64Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6612,7 +6649,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maskorLongVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6625,7 +6662,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::bor); + assertArraysEquals(r, a, b, LongVector64Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6633,7 +6670,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorLongVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6646,7 +6683,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::bxor); + assertArraysEquals(r, a, b, LongVector64Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6654,7 +6691,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotLongVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6667,7 +6704,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::bandNot); + assertArraysEquals(r, a, b, LongVector64Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6675,7 +6712,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqLongVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6688,7 +6725,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Long64VectorTests::beq); + assertArraysEquals(r, a, b, LongVector64Tests::beq); } static boolean unot(boolean a) { @@ -6696,7 +6733,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotLong64VectorTests(IntFunction fa) { + static void masknotLongVector64Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6707,7 +6744,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Long64VectorTests::unot); + assertArraysEquals(r, a, LongVector64Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6716,15 +6753,15 @@ public class Long64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongLong64VectorTests(IntFunction fa) { + static void maskFromToLongLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6738,7 +6775,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longCompareOpProvider") - static void ltLong64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltLongVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6748,13 +6785,13 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLong64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqLongVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6764,13 +6801,13 @@ public class Long64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longtoIntUnaryOpProvider") - static void toIntArrayLong64VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayLongVector64TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6781,7 +6818,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toLongArrayLong64VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayLongVector64TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6792,7 +6829,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toDoubleArrayLong64VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayLongVector64TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6803,7 +6840,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toStringLong64VectorTestsSmokeTest(IntFunction fa) { + static void toStringLongVector64TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6816,7 +6853,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void hashCodeLong64VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeLongVector64TestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6832,7 +6869,7 @@ public class Long64VectorTests extends AbstractVectorTest { @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLongLong64VectorTests(IntFunction fa) { + static void ADDReduceLongLongVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -6848,11 +6885,11 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Long64VectorTests::ADDReduce, Long64VectorTests::ADDReduceAll); + LongVector64Tests::ADDReduce, LongVector64Tests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLongLong64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongLongVector64TestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6870,11 +6907,11 @@ public class Long64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Long64VectorTests::ADDReduceMasked, Long64VectorTests::ADDReduceAllMasked); + LongVector64Tests::ADDReduceMasked, LongVector64Tests::ADDReduceAllMasked); } @Test(dataProvider = "longUnaryOpSelectFromProvider") - static void SelectFromLong64VectorTests(IntFunction fa, + static void SelectFromLongVector64Tests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); long[] order = fs.apply(a.length, SPECIES.length()); @@ -6890,7 +6927,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorLongVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] idx = fc.apply(SPECIES.length()); @@ -6908,7 +6945,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpSelectFromMaskProvider") - static void SelectFromLong64VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromLongVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -6927,7 +6964,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousLong64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousLongVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6938,12 +6975,12 @@ public class Long64VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringLong64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringLongVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6957,7 +6994,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsLong64VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsLongVector64TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -6966,12 +7003,12 @@ public class Long64VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsLong64VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsLongVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -6981,13 +7018,13 @@ public class Long64VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeLong64VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeLongVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7009,7 +7046,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountLong64VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountLongVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7020,7 +7057,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long64VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, LongVector64Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7034,7 +7071,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueLong64VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueLongVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7045,7 +7082,7 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long64VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, LongVector64Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7059,7 +7096,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueLong64VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueLongVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7070,11 +7107,11 @@ public class Long64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Long64VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, LongVector64Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressLong64VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressLongVector64TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7084,7 +7121,7 @@ public class Long64VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7102,7 +7139,7 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeLong64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongVector64TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7110,13 +7147,13 @@ public class Long64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongLong64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongLongVector64TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7124,7 +7161,7 @@ public class Long64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7143,36 +7180,36 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundLong64VectorTestsSmokeTest(int length) { + static void loopBoundLongVector64TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongLong64VectorTestsSmokeTest(int _length) { + static void loopBoundLongLongVector64TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeLong64VectorTestsSmokeTest() { + static void ElementSizeLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Long.SIZE); + assertEquals(elsize, Long.SIZE); } @Test - static void VectorShapeLong64VectorTestsSmokeTest() { + static void VectorShapeLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_64_BIT)); } @Test - static void ShapeWithLanesLong64VectorTestsSmokeTest() { + static void ShapeWithLanesLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(long.class); @@ -7180,32 +7217,32 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeLong64VectorTestsSmokeTest() { + static void ElementTypeLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementType() == long.class); } @Test - static void SpeciesElementSizeLong64VectorTestsSmokeTest() { + static void SpeciesElementSizeLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementSize() == Long.SIZE); } @Test - static void VectorTypeLong64VectorTestsSmokeTest() { + static void VectorTypeLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesLong64VectorTestsSmokeTest() { + static void WithLanesLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(long.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeLong64VectorTestsSmokeTest() { + static void WithShapeLongVector64TestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7213,9 +7250,9 @@ public class Long64VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueLong64VectorTestsSmokeTest() { + static void MaskAllTrueLongVector64TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/LongVectorMaxLoadStoreTests.java similarity index 96% rename from test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/LongVectorMaxLoadStoreTests.java index e0f8b548228..cb5bb74424a 100644 --- a/test/jdk/jdk/incubator/vector/LongMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/LongVectorMaxLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED - * -XX:-TieredCompilation LongMaxVectorLoadStoreTests + * -XX:-TieredCompilation LongVectorMaxLoadStoreTests * */ @@ -52,7 +52,7 @@ import java.util.List; import java.util.function.*; @Test -public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class LongVectorMaxLoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = LongVector.SPECIES_MAX; @@ -68,14 +68,29 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / Max); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(long[] r, long[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (long) 0, "at index #" + i); } } @@ -329,7 +344,7 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "longProviderForIOOBE") @@ -877,11 +892,11 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -892,11 +907,11 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (long) 0, "at index #" + j); } } @@ -912,7 +927,7 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(long[] r, long[] a, int[] indexMap) { @@ -925,7 +940,7 @@ public class LongMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java b/test/jdk/jdk/incubator/vector/LongVectorMaxTests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/LongMaxVectorTests.java rename to test/jdk/jdk/incubator/vector/LongVectorMaxTests.java index 17fee0a7765..aef89af5893 100644 --- a/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/LongVectorMaxTests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation LongVectorMaxTests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,49 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class LongMaxVectorTests extends AbstractVectorTest { +public class LongVectorMaxTests extends AbstractVectorTest { static final VectorSpecies SPECIES = LongVector.SPECIES_MAX; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected, long delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(long actual, long expected, long delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(long [] actual, long [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long [] actual, long [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static VectorShape getMaxBit() { return VectorShape.S_Max_BIT; @@ -102,10 +139,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -117,13 +154,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { long[] ref = f.apply(a[i]); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -133,10 +170,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -152,13 +189,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -174,13 +211,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -193,10 +230,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -208,10 +245,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -220,12 +257,12 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -236,20 +273,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (long)0); + assertEquals(r[i + k], (long)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -261,19 +298,19 @@ public class LongMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (long)0); + assertEquals(r[i + j], (long)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (long)0, "at index #" + idx); + assertEquals(r[idx], (long)0, "at index #" + idx); } } } @@ -289,11 +326,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -302,12 +339,12 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -317,17 +354,17 @@ public class LongMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -337,17 +374,17 @@ public class LongMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (long)0); + assertEquals(r[i+j], (long)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (long)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -361,10 +398,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -376,10 +413,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -391,10 +428,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -415,18 +452,18 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -441,18 +478,18 @@ public class LongMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -460,10 +497,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -471,10 +508,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -482,10 +519,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -494,10 +531,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -510,10 +547,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -525,10 +562,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -540,10 +577,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -558,10 +595,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (long)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -574,11 +611,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -592,11 +629,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -618,11 +655,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -636,11 +673,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -660,10 +697,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -675,10 +712,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -687,10 +724,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -700,10 +737,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -719,11 +756,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -740,11 +777,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -755,11 +792,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -776,11 +813,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -798,13 +835,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -825,13 +862,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -846,13 +883,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { long[] ref = f.apply(r, a, i, mask, b, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -873,13 +910,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -893,13 +930,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -914,13 +951,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -935,13 +972,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -957,13 +994,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { long[] ref = f.apply(a, b, origin, part, mask, i); long[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1009,10 +1046,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1022,10 +1059,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1033,10 +1070,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1571,7 +1608,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Do some zipping and shuffling. LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); LongVector a = io.add((long)1); //[1,2] LongVector b = a.neg(); //[-1,-2] long[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1586,19 +1623,19 @@ public class LongMaxVectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); LongVector uab0 = zab0.rearrange(unz0,zab1); LongVector uab1 = zab0.rearrange(unz1,zab1); long[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { LongVector io = (LongVector) SPECIES.broadcast(0).addIndex(1); LongVector io2 = (LongVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1613,7 +1650,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test @@ -1621,9 +1658,9 @@ public class LongMaxVectorTests extends AbstractVectorTest { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } @Test @@ -1652,7 +1689,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ADDLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1665,7 +1702,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::ADD); + assertArraysEquals(r, a, b, LongVectorMaxTests::ADD); } static long add(long a, long b) { @@ -1673,7 +1710,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void addLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void addLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1684,11 +1721,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::add); + assertArraysEquals(r, a, b, LongVectorMaxTests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1704,11 +1741,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::ADD); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void addLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1722,7 +1759,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::add); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::add); } static long SUB(long a, long b) { @@ -1730,7 +1767,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void SUBLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUBLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1743,7 +1780,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::SUB); + assertArraysEquals(r, a, b, LongVectorMaxTests::SUB); } static long sub(long a, long b) { @@ -1751,7 +1788,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void subLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void subLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1762,11 +1799,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::sub); + assertArraysEquals(r, a, b, LongVectorMaxTests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void SUBLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1782,11 +1819,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::SUB); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::SUB); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void subLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1800,7 +1837,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::sub); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::sub); } static long MUL(long a, long b) { @@ -1808,7 +1845,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MULLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MULLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1821,7 +1858,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::MUL); + assertArraysEquals(r, a, b, LongVectorMaxTests::MUL); } static long mul(long a, long b) { @@ -1829,7 +1866,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void mulLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void mulLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1840,11 +1877,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::mul); + assertArraysEquals(r, a, b, LongVectorMaxTests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void MULLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1860,11 +1897,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::MUL); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::MUL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1878,7 +1915,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::mul); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::mul); } static long DIV(long a, long b) { @@ -1886,7 +1923,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void DIVLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void DIVLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1901,7 +1938,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::DIV); + assertArraysEquals(r, a, b, LongVectorMaxTests::DIV); } static long div(long a, long b) { @@ -1909,7 +1946,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void divLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void divLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1924,11 +1961,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::div); + assertArraysEquals(r, a, b, LongVectorMaxTests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void DIVLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1946,11 +1983,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::DIV); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::DIV); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void divLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -1968,7 +2005,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::div); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::div); } static long FIRST_NONZERO(long a, long b) { @@ -1976,7 +2013,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void FIRST_NONZEROLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -1989,11 +2026,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, LongVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void FIRST_NONZEROLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2009,7 +2046,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::FIRST_NONZERO); } static long AND(long a, long b) { @@ -2017,7 +2054,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ANDLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2030,7 +2067,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::AND); + assertArraysEquals(r, a, b, LongVectorMaxTests::AND); } static long and(long a, long b) { @@ -2038,7 +2075,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void andLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void andLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2049,11 +2086,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::and); + assertArraysEquals(r, a, b, LongVectorMaxTests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2069,7 +2106,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::AND); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::AND); } static long AND_NOT(long a, long b) { @@ -2077,7 +2114,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void AND_NOTLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2090,11 +2127,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, LongVectorMaxTests::AND_NOT); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void AND_NOTLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2110,7 +2147,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::AND_NOT); } static long OR(long a, long b) { @@ -2118,7 +2155,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ORLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ORLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2131,7 +2168,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::OR); + assertArraysEquals(r, a, b, LongVectorMaxTests::OR); } static long or(long a, long b) { @@ -2139,7 +2176,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void orLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void orLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2150,11 +2187,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::or); + assertArraysEquals(r, a, b, LongVectorMaxTests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2170,7 +2207,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::OR); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::OR); } static long XOR(long a, long b) { @@ -2178,7 +2215,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void XORLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void XORLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2191,11 +2228,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::XOR); + assertArraysEquals(r, a, b, LongVectorMaxTests::XOR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void XORLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2211,7 +2248,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::XOR); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::XOR); } static long COMPRESS_BITS(long a, long b) { @@ -2219,7 +2256,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void COMPRESS_BITSLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void COMPRESS_BITSLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2232,11 +2269,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, LongVectorMaxTests::COMPRESS_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void COMPRESS_BITSLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void COMPRESS_BITSLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2252,7 +2289,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::COMPRESS_BITS); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::COMPRESS_BITS); } static long EXPAND_BITS(long a, long b) { @@ -2260,7 +2297,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void EXPAND_BITSLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EXPAND_BITSLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2273,11 +2310,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, LongVectorMaxTests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void EXPAND_BITSLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EXPAND_BITSLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2293,11 +2330,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::EXPAND_BITS); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::EXPAND_BITS); } @Test(dataProvider = "longBinaryOpProvider") - static void addLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2307,11 +2344,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::add); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void addLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2324,11 +2361,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, LongMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, LongVectorMaxTests::add); } @Test(dataProvider = "longBinaryOpProvider") - static void subLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2338,11 +2375,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::sub); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void subLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2355,11 +2392,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, LongMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, LongVectorMaxTests::sub); } @Test(dataProvider = "longBinaryOpProvider") - static void mulLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2369,11 +2406,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::mul); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void mulLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2386,11 +2423,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, LongMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, LongVectorMaxTests::mul); } @Test(dataProvider = "longBinaryOpProvider") - static void divLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2402,11 +2439,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::div); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void divLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2421,11 +2458,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, LongMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, LongVectorMaxTests::div); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2435,11 +2472,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void orLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2449,11 +2486,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::or); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::or); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2466,11 +2503,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, LongMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, LongVectorMaxTests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ANDLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2480,11 +2517,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void andLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2494,11 +2531,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::and); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::and); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ANDLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2511,11 +2548,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, LongMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, LongVectorMaxTests::AND); } @Test(dataProvider = "longBinaryOpProvider") - static void ORLongMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORLongVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2525,11 +2562,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, LongMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, LongVectorMaxTests::OR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ORLongMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORLongVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2542,11 +2579,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, LongMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVectorMaxTests::OR); } @Test(dataProvider = "longBinaryOpProvider") - static void ADDLongMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDLongVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2556,11 +2593,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, LongMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, LongVectorMaxTests::ADD); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ADDLongMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDLongVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2573,7 +2610,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, LongMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, LongVectorMaxTests::ADD); } static long LSHL(long a, long b) { @@ -2581,7 +2618,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHLLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2594,11 +2631,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, LongVectorMaxTests::LSHL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2614,7 +2651,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::LSHL); } static long ASHR(long a, long b) { @@ -2622,7 +2659,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ASHRLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2635,11 +2672,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, LongVectorMaxTests::ASHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2655,7 +2692,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::ASHR); } static long LSHR(long a, long b) { @@ -2663,7 +2700,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHRLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2676,11 +2713,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, LongVectorMaxTests::LSHR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2696,7 +2733,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::LSHR); } static long LSHL_unary(long a, long b) { @@ -2704,7 +2741,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHLLongMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLLongVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2716,11 +2753,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, LongMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, LongVectorMaxTests::LSHL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHLLongMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLLongVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2735,7 +2772,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVectorMaxTests::LSHL_unary); } static long LSHR_unary(long a, long b) { @@ -2743,7 +2780,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void LSHRLongMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRLongVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2755,11 +2792,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, LongMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, LongVectorMaxTests::LSHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void LSHRLongMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRLongVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2774,7 +2811,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVectorMaxTests::LSHR_unary); } static long ASHR_unary(long a, long b) { @@ -2782,7 +2819,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ASHRLongMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRLongVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2794,11 +2831,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, LongMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, LongVectorMaxTests::ASHR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ASHRLongMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRLongVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2813,7 +2850,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVectorMaxTests::ASHR_unary); } static long ROR(long a, long b) { @@ -2821,7 +2858,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void RORLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2834,11 +2871,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::ROR); + assertArraysEquals(r, a, b, LongVectorMaxTests::ROR); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2854,7 +2891,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::ROR); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::ROR); } static long ROL(long a, long b) { @@ -2862,7 +2899,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ROLLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2875,11 +2912,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::ROL); + assertArraysEquals(r, a, b, LongVectorMaxTests::ROL); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2895,7 +2932,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::ROL); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::ROL); } static long ROR_unary(long a, long b) { @@ -2903,7 +2940,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void RORLongMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORLongVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2915,11 +2952,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, LongMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, LongVectorMaxTests::ROR_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void RORLongMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORLongVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2934,7 +2971,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, LongVectorMaxTests::ROR_unary); } static long ROL_unary(long a, long b) { @@ -2942,7 +2979,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void ROLLongMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLLongVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2954,11 +2991,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, LongMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, LongVectorMaxTests::ROL_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void ROLLongMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLLongVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -2973,14 +3010,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, LongMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, LongVectorMaxTests::ROL_unary); } static long LSHR_binary_const(long a) { return (long)((a >>> CONST_SHIFT)); } @Test(dataProvider = "longUnaryOpProvider") - static void LSHRLongMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRLongVectorMaxTestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -2991,11 +3028,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, LongMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, LongVectorMaxTests::LSHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHRLongMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRLongVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3009,7 +3046,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, LongMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVectorMaxTests::LSHR_binary_const); } static long LSHL_binary_const(long a) { @@ -3017,7 +3054,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LSHLLongMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLLongVectorMaxTestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3028,11 +3065,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, LongMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, LongVectorMaxTests::LSHL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LSHLLongMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLLongVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3046,7 +3083,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, LongMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, LongVectorMaxTests::LSHL_binary_const); } static long ASHR_binary_const(long a) { @@ -3054,7 +3091,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ASHRLongMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRLongVectorMaxTestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3065,11 +3102,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, LongMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, LongVectorMaxTests::ASHR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ASHRLongMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRLongVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3083,7 +3120,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, LongMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, LongVectorMaxTests::ASHR_binary_const); } static long ROR_binary_const(long a) { @@ -3091,7 +3128,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void RORLongMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void RORLongVectorMaxTestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3102,11 +3139,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, LongMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, LongVectorMaxTests::ROR_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void RORLongMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORLongVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3120,7 +3157,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, LongMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, LongVectorMaxTests::ROR_binary_const); } static long ROL_binary_const(long a) { @@ -3128,7 +3165,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ROLLongMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ROLLongVectorMaxTestsScalarShiftConst(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3139,11 +3176,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, LongMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, LongVectorMaxTests::ROL_binary_const); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ROLLongMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLLongVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3157,14 +3194,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, LongMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, LongVectorMaxTests::ROL_binary_const); } static LongVector bv_MIN = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MINLongMaxVectorTestsWithMemOp(IntFunction fa) { + static void MINLongVectorMaxTestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3175,13 +3212,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, LongMaxVectorTests::MIN); + assertArraysEquals(r, a, (long)10, LongVectorMaxTests::MIN); } static LongVector bv_min = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void minLongMaxVectorTestsWithMemOp(IntFunction fa) { + static void minLongVectorMaxTestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3192,13 +3229,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, LongMaxVectorTests::min); + assertArraysEquals(r, a, (long)10, LongVectorMaxTests::min); } static LongVector bv_MIN_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINLongMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINLongVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3211,13 +3248,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, LongMaxVectorTests::MIN); + assertArraysEquals(r, a, (long)10, mask, LongVectorMaxTests::MIN); } static LongVector bv_MAX = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void MAXLongMaxVectorTestsWithMemOp(IntFunction fa) { + static void MAXLongVectorMaxTestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3228,13 +3265,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, LongMaxVectorTests::MAX); + assertArraysEquals(r, a, (long)10, LongVectorMaxTests::MAX); } static LongVector bv_max = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpProvider") - static void maxLongMaxVectorTestsWithMemOp(IntFunction fa) { + static void maxLongVectorMaxTestsWithMemOp(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3245,13 +3282,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, LongMaxVectorTests::max); + assertArraysEquals(r, a, (long)10, LongVectorMaxTests::max); } static LongVector bv_MAX_M = LongVector.broadcast(SPECIES, (long)10); @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXLongMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXLongVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3264,7 +3301,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (long)10, mask, LongMaxVectorTests::MAX); + assertArraysEquals(r, a, (long)10, mask, LongVectorMaxTests::MAX); } static long MIN(long a, long b) { @@ -3272,7 +3309,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MINLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MINLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3285,7 +3322,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::MIN); + assertArraysEquals(r, a, b, LongVectorMaxTests::MIN); } static long min(long a, long b) { @@ -3293,7 +3330,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void minLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void minLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3304,7 +3341,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::min); + assertArraysEquals(r, a, b, LongVectorMaxTests::min); } static long MAX(long a, long b) { @@ -3312,7 +3349,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MAXLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3325,7 +3362,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::MAX); + assertArraysEquals(r, a, b, LongVectorMaxTests::MAX); } static long max(long a, long b) { @@ -3333,7 +3370,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void maxLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maxLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3344,7 +3381,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, LongMaxVectorTests::max); + assertArraysEquals(r, a, b, LongVectorMaxTests::max); } static long UMIN(long a, long b) { @@ -3352,7 +3389,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMINLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMINLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3365,11 +3402,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, LongVectorMaxTests::UMIN); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMINLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3385,7 +3422,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::UMIN); } static long UMAX(long a, long b) { @@ -3393,7 +3430,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void UMAXLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMAXLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3406,11 +3443,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, LongVectorMaxTests::UMAX); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void UMAXLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3426,7 +3463,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::UMAX); } static long SADD(long a, long b) { @@ -3434,7 +3471,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SADDLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SADDLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3447,11 +3484,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::SADD); + assertArraysEquals(r, a, b, LongVectorMaxTests::SADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SADDLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3467,7 +3504,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::SADD); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::SADD); } static long SSUB(long a, long b) { @@ -3475,7 +3512,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SSUBLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SSUBLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3488,11 +3525,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, LongVectorMaxTests::SSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SSUBLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3508,7 +3545,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::SSUB); } static long SUADD(long a, long b) { @@ -3516,7 +3553,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUADDLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUADDLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3529,11 +3566,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, LongVectorMaxTests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUADDLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3549,7 +3586,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::SUADD); } static long SUSUB(long a, long b) { @@ -3557,7 +3594,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingBinaryOpProvider") - static void SUSUBLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3570,11 +3607,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, LongVectorMaxTests::SUSUB); } @Test(dataProvider = "longSaturatingBinaryOpMaskProvider") - static void SUSUBLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3590,11 +3627,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::SUSUB); } @Test(dataProvider = "longBinaryOpProvider") - static void MINLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3604,11 +3641,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::MIN); } @Test(dataProvider = "longBinaryOpProvider") - static void minLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3618,11 +3655,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::min); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::min); } @Test(dataProvider = "longBinaryOpProvider") - static void MAXLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3632,11 +3669,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::MAX); } @Test(dataProvider = "longBinaryOpProvider") - static void maxLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -3646,10 +3683,10 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, LongMaxVectorTests::max); + assertBroadcastArraysEquals(r, a, b, LongVectorMaxTests::max); } @Test(dataProvider = "longSaturatingBinaryOpAssocProvider") - static void SUADDAssocLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocLongVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -3666,11 +3703,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, LongMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, LongVectorMaxTests::SUADD); } @Test(dataProvider = "longSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -3691,7 +3728,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, LongMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, LongVectorMaxTests::SUADD); } static long ANDReduce(long[] a, int idx) { @@ -3713,7 +3750,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ANDReduceLongMaxVectorTests(IntFunction fa) { + static void ANDReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3729,7 +3766,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::ANDReduce, LongMaxVectorTests::ANDReduceAll); + LongVectorMaxTests::ANDReduce, LongVectorMaxTests::ANDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3737,20 +3774,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = AND_IDENTITY; - Assert.assertEquals((long) (id & id), id, + assertEquals((long) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id & x), x); - Assert.assertEquals((long) (x & id), x); + assertEquals((long) (id & x), x); + assertEquals((long) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id & x), x, + assertEquals((long) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x & id), x, + assertEquals((long) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3775,7 +3812,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ANDReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3793,7 +3830,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::ANDReduceMasked, LongMaxVectorTests::ANDReduceAllMasked); + LongVectorMaxTests::ANDReduceMasked, LongVectorMaxTests::ANDReduceAllMasked); } static long ORReduce(long[] a, int idx) { @@ -3815,7 +3852,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ORReduceLongMaxVectorTests(IntFunction fa) { + static void ORReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3831,7 +3868,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::ORReduce, LongMaxVectorTests::ORReduceAll); + LongVectorMaxTests::ORReduce, LongVectorMaxTests::ORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3839,20 +3876,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = OR_IDENTITY; - Assert.assertEquals((long) (id | id), id, + assertEquals((long) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id | x), x); - Assert.assertEquals((long) (x | id), x); + assertEquals((long) (id | x), x); + assertEquals((long) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id | x), x, + assertEquals((long) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x | id), x, + assertEquals((long) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3877,7 +3914,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ORReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3895,7 +3932,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::ORReduceMasked, LongMaxVectorTests::ORReduceAllMasked); + LongVectorMaxTests::ORReduceMasked, LongVectorMaxTests::ORReduceAllMasked); } static long XORReduce(long[] a, int idx) { @@ -3917,7 +3954,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void XORReduceLongMaxVectorTests(IntFunction fa) { + static void XORReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -3933,7 +3970,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::XORReduce, LongMaxVectorTests::XORReduceAll); + LongVectorMaxTests::XORReduce, LongVectorMaxTests::XORReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -3941,20 +3978,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = XOR_IDENTITY; - Assert.assertEquals((long) (id ^ id), id, + assertEquals((long) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id ^ x), x); - Assert.assertEquals((long) (x ^ id), x); + assertEquals((long) (id ^ x), x); + assertEquals((long) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id ^ x), x, + assertEquals((long) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x ^ id), x, + assertEquals((long) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3979,7 +4016,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void XORReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3997,7 +4034,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::XORReduceMasked, LongMaxVectorTests::XORReduceAllMasked); + LongVectorMaxTests::XORReduceMasked, LongVectorMaxTests::XORReduceAllMasked); } static long ADDReduce(long[] a, int idx) { @@ -4019,7 +4056,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLongMaxVectorTests(IntFunction fa) { + static void ADDReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4035,7 +4072,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::ADDReduce, LongMaxVectorTests::ADDReduceAll); + LongVectorMaxTests::ADDReduce, LongVectorMaxTests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4043,20 +4080,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = ADD_IDENTITY; - Assert.assertEquals((long) (id + id), id, + assertEquals((long) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id + x), x); - Assert.assertEquals((long) (x + id), x); + assertEquals((long) (id + x), x); + assertEquals((long) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id + x), x, + assertEquals((long) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x + id), x, + assertEquals((long) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4081,7 +4118,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4099,7 +4136,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::ADDReduceMasked, LongMaxVectorTests::ADDReduceAllMasked); + LongVectorMaxTests::ADDReduceMasked, LongVectorMaxTests::ADDReduceAllMasked); } static long MULReduce(long[] a, int idx) { @@ -4121,7 +4158,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MULReduceLongMaxVectorTests(IntFunction fa) { + static void MULReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4137,7 +4174,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::MULReduce, LongMaxVectorTests::MULReduceAll); + LongVectorMaxTests::MULReduce, LongVectorMaxTests::MULReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4145,20 +4182,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MUL_IDENTITY; - Assert.assertEquals((long) (id * id), id, + assertEquals((long) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) (id * x), x); - Assert.assertEquals((long) (x * id), x); + assertEquals((long) (id * x), x); + assertEquals((long) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) (id * x), x, + assertEquals((long) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) (x * id), x, + assertEquals((long) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4183,7 +4220,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MULReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4201,7 +4238,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::MULReduceMasked, LongMaxVectorTests::MULReduceAllMasked); + LongVectorMaxTests::MULReduceMasked, LongVectorMaxTests::MULReduceAllMasked); } static long MINReduce(long[] a, int idx) { @@ -4223,7 +4260,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MINReduceLongMaxVectorTests(IntFunction fa) { + static void MINReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4239,7 +4276,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::MINReduce, LongMaxVectorTests::MINReduceAll); + LongVectorMaxTests::MINReduce, LongVectorMaxTests::MINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4247,20 +4284,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MIN_IDENTITY; - Assert.assertEquals((long) Math.min(id, id), id, + assertEquals((long) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.min(id, x), x); - Assert.assertEquals((long) Math.min(x, id), x); + assertEquals((long) Math.min(id, x), x); + assertEquals((long) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.min(id, x), x, + assertEquals((long) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.min(x, id), x, + assertEquals((long) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4285,7 +4322,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MINReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4303,7 +4340,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::MINReduceMasked, LongMaxVectorTests::MINReduceAllMasked); + LongVectorMaxTests::MINReduceMasked, LongVectorMaxTests::MINReduceAllMasked); } static long MAXReduce(long[] a, int idx) { @@ -4325,7 +4362,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void MAXReduceLongMaxVectorTests(IntFunction fa) { + static void MAXReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4341,7 +4378,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::MAXReduce, LongMaxVectorTests::MAXReduceAll); + LongVectorMaxTests::MAXReduce, LongVectorMaxTests::MAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4349,20 +4386,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = MAX_IDENTITY; - Assert.assertEquals((long) Math.max(id, id), id, + assertEquals((long) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) Math.max(id, x), x); - Assert.assertEquals((long) Math.max(x, id), x); + assertEquals((long) Math.max(id, x), x); + assertEquals((long) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) Math.max(id, x), x, + assertEquals((long) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) Math.max(x, id), x, + assertEquals((long) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4387,7 +4424,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void MAXReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4405,7 +4442,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::MAXReduceMasked, LongMaxVectorTests::MAXReduceAllMasked); + LongVectorMaxTests::MAXReduceMasked, LongVectorMaxTests::MAXReduceAllMasked); } static long UMINReduce(long[] a, int idx) { @@ -4427,7 +4464,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMINReduceLongMaxVectorTests(IntFunction fa) { + static void UMINReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4443,7 +4480,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::UMINReduce, LongMaxVectorTests::UMINReduceAll); + LongVectorMaxTests::UMINReduce, LongVectorMaxTests::UMINReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4451,20 +4488,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMIN_IDENTITY; - Assert.assertEquals((long) VectorMath.minUnsigned(id, id), id, + assertEquals((long) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x); + assertEquals((long) VectorMath.minUnsigned(id, x), x); + assertEquals((long) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.minUnsigned(id, x), x, + assertEquals((long) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.minUnsigned(x, id), x, + assertEquals((long) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4489,7 +4526,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMINReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4507,7 +4544,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::UMINReduceMasked, LongMaxVectorTests::UMINReduceAllMasked); + LongVectorMaxTests::UMINReduceMasked, LongVectorMaxTests::UMINReduceAllMasked); } static long UMAXReduce(long[] a, int idx) { @@ -4529,7 +4566,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void UMAXReduceLongMaxVectorTests(IntFunction fa) { + static void UMAXReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4545,7 +4582,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::UMAXReduce, LongMaxVectorTests::UMAXReduceAll); + LongVectorMaxTests::UMAXReduce, LongVectorMaxTests::UMAXReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4553,20 +4590,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = UMAX_IDENTITY; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, id), id, + assertEquals((long) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x); + assertEquals((long) VectorMath.maxUnsigned(id, x), x); + assertEquals((long) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.maxUnsigned(id, x), x, + assertEquals((long) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.maxUnsigned(x, id), x, + assertEquals((long) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4591,7 +4628,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void UMAXReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4609,7 +4646,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::UMAXReduceMasked, LongMaxVectorTests::UMAXReduceAllMasked); + LongVectorMaxTests::UMAXReduceMasked, LongVectorMaxTests::UMAXReduceAllMasked); } static long FIRST_NONZEROReduce(long[] a, int idx) { @@ -4631,7 +4668,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void FIRST_NONZEROReduceLongMaxVectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4647,7 +4684,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::FIRST_NONZEROReduce, LongMaxVectorTests::FIRST_NONZEROReduceAll); + LongVectorMaxTests::FIRST_NONZEROReduce, LongVectorMaxTests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "longUnaryOpProvider") @@ -4655,20 +4692,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4693,7 +4730,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void FIRST_NONZEROReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4711,7 +4748,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::FIRST_NONZEROReduceMasked, LongMaxVectorTests::FIRST_NONZEROReduceAllMasked); + LongVectorMaxTests::FIRST_NONZEROReduceMasked, LongVectorMaxTests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4724,7 +4761,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueLongMaxVectorTests(IntFunction fm) { + static void anyTrueLongVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4735,7 +4772,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, LongMaxVectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, LongVectorMaxTests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4748,7 +4785,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueLongMaxVectorTests(IntFunction fm) { + static void allTrueLongVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4759,7 +4796,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, LongMaxVectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, LongVectorMaxTests::allTrue); } static long SUADDReduce(long[] a, int idx) { @@ -4781,7 +4818,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSaturatingUnaryOpProvider") - static void SUADDReduceLongMaxVectorTests(IntFunction fa) { + static void SUADDReduceLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -4797,7 +4834,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::SUADDReduce, LongMaxVectorTests::SUADDReduceAll); + LongVectorMaxTests::SUADDReduce, LongVectorMaxTests::SUADDReduceAll); } @Test(dataProvider = "longSaturatingUnaryOpProvider") @@ -4805,20 +4842,20 @@ public class LongMaxVectorTests extends AbstractVectorTest { long[] a = fa.apply(SPECIES.length()); long id = SUADD_IDENTITY; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); long x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((long) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4842,7 +4879,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "longSaturatingUnaryOpMaskProvider") - static void SUADDReduceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4860,11 +4897,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::SUADDReduceMasked, LongMaxVectorTests::SUADDReduceAllMasked); + LongVectorMaxTests::SUADDReduceMasked, LongVectorMaxTests::SUADDReduceAllMasked); } @Test(dataProvider = "longBinaryOpProvider") - static void withLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void withLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -4887,7 +4924,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_DEFAULTLongMaxVectorTests(IntFunction fa) { + static void IS_DEFAULTLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4897,14 +4934,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_DEFAULTMaskedLongMaxVectorTests(IntFunction fa, + static void IS_DEFAULTMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4917,7 +4954,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4928,7 +4965,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTestOpProvider") - static void IS_NEGATIVELongMaxVectorTests(IntFunction fa) { + static void IS_NEGATIVELongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4938,14 +4975,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longTestOpMaskProvider") - static void IS_NEGATIVEMaskedLongMaxVectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4958,14 +4995,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LTLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4977,14 +5014,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ltLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ltLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -4996,14 +5033,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5019,14 +5056,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GTLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GTLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5038,14 +5075,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GTLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5061,14 +5098,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EQLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5080,14 +5117,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void eqLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5099,14 +5136,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5122,14 +5159,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void NELongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void NELongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5141,14 +5178,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void NELongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void NELongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5164,14 +5201,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LELongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LELongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5183,14 +5220,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LELongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LELongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5206,14 +5243,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void GELongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GELongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5225,14 +5262,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void GELongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GELongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5248,14 +5285,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULTLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULTLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5267,14 +5304,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULTLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5290,14 +5327,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGTLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGTLongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5309,14 +5346,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGTLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5332,14 +5369,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void ULELongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULELongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5351,14 +5388,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void ULELongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULELongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5374,14 +5411,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void UGELongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGELongVectorMaxTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5393,14 +5430,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void UGELongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGELongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5416,14 +5453,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "longCompareOpProvider") - static void LTLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5433,13 +5470,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void LTLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5453,14 +5490,14 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "longCompareOpProvider") - static void EQLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5470,13 +5507,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longCompareOpMaskProvider") - static void EQLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5490,7 +5527,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @@ -5501,7 +5538,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void blendLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void blendLongVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5517,11 +5554,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, LongMaxVectorTests::blend); + assertArraysEquals(r, a, b, mask, LongVectorMaxTests::blend); } @Test(dataProvider = "longUnaryOpShuffleProvider") - static void RearrangeLongMaxVectorTests(IntFunction fa, + static void RearrangeLongVectorMaxTests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5538,7 +5575,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpShuffleMaskProvider") - static void RearrangeLongMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeLongVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -5556,7 +5593,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void compressLongMaxVectorTests(IntFunction fa, + static void compressLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5574,7 +5611,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpMaskProvider") - static void expandLongMaxVectorTests(IntFunction fa, + static void expandLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5592,7 +5629,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void getLongMaxVectorTests(IntFunction fa) { + static void getLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -5748,7 +5785,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BroadcastLongMaxVectorTests(IntFunction fa) { + static void BroadcastLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5762,7 +5799,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZeroLongMaxVectorTests(IntFunction fa) { + static void ZeroLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5772,7 +5809,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static long[] sliceUnary(long[] a, int origin, int idx) { @@ -5787,7 +5824,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void sliceUnaryLongMaxVectorTests(IntFunction fa) { + static void sliceUnaryLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5798,7 +5835,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, LongMaxVectorTests::sliceUnary); + assertArraysEquals(r, a, origin, LongVectorMaxTests::sliceUnary); } static long[] sliceBinary(long[] a, long[] b, int origin, int idx) { @@ -5815,7 +5852,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void sliceBinaryLongMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryLongVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5828,7 +5865,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, LongMaxVectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, LongVectorMaxTests::sliceBinary); } static long[] slice(long[] a, long[] b, int origin, boolean[] mask, int idx) { @@ -5845,7 +5882,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void sliceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5862,7 +5899,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, LongMaxVectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, LongVectorMaxTests::slice); } static long[] unsliceUnary(long[] a, int origin, int idx) { @@ -5879,7 +5916,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void unsliceUnaryLongMaxVectorTests(IntFunction fa) { + static void unsliceUnaryLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5890,7 +5927,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, LongMaxVectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, LongVectorMaxTests::unsliceUnary); } static long[] unsliceBinary(long[] a, long[] b, int origin, int part, int idx) { @@ -5916,7 +5953,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpProvider") - static void unsliceBinaryLongMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryLongVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -5930,7 +5967,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, LongMaxVectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, LongVectorMaxTests::unsliceBinary); } static long[] unslice(long[] a, long[] b, int origin, int part, boolean[] mask, int idx) { @@ -5970,7 +6007,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longBinaryOpMaskProvider") - static void unsliceLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -5987,7 +6024,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, LongMaxVectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, LongVectorMaxTests::unslice); } static long BITWISE_BLEND(long a, long b, long c) { @@ -5999,7 +6036,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6014,11 +6051,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6031,11 +6068,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, LongMaxVectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, LongVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLongMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6053,11 +6090,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6068,11 +6105,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLongMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6083,11 +6120,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6098,11 +6135,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { LongVector bv = LongVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, LongVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLongMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6113,11 +6150,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { LongVector cv = LongVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, LongVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6132,11 +6169,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLongMaxVectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVectorMaxTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6151,11 +6188,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void BITWISE_BLENDLongMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDLongVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6166,11 +6203,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "longTernaryOpProvider") - static void bitwiseBlendLongMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendLongVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] c = fc.apply(SPECIES.length()); @@ -6181,11 +6218,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, LongVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "longTernaryOpMaskProvider") - static void BITWISE_BLENDLongMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDLongVectorMaxTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6199,7 +6236,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongVectorMaxTests::BITWISE_BLEND); } static long NEG(long a) { @@ -6211,7 +6248,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NEGLongMaxVectorTests(IntFunction fa) { + static void NEGLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6222,11 +6259,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::NEG); + assertArraysEquals(r, a, LongVectorMaxTests::NEG); } @Test(dataProvider = "longUnaryOpProvider") - static void negLongMaxVectorTests(IntFunction fa) { + static void negLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6237,11 +6274,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::neg); + assertArraysEquals(r, a, LongVectorMaxTests::neg); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NEGMaskedLongMaxVectorTests(IntFunction fa, + static void NEGMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6255,7 +6292,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::NEG); + assertArraysEquals(r, a, mask, LongVectorMaxTests::NEG); } static long ABS(long a) { @@ -6267,7 +6304,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ABSLongMaxVectorTests(IntFunction fa) { + static void ABSLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6278,11 +6315,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::ABS); + assertArraysEquals(r, a, LongVectorMaxTests::ABS); } @Test(dataProvider = "longUnaryOpProvider") - static void absLongMaxVectorTests(IntFunction fa) { + static void absLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6293,11 +6330,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::abs); + assertArraysEquals(r, a, LongVectorMaxTests::abs); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ABSMaskedLongMaxVectorTests(IntFunction fa, + static void ABSMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6311,7 +6348,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::ABS); + assertArraysEquals(r, a, mask, LongVectorMaxTests::ABS); } static long NOT(long a) { @@ -6323,7 +6360,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void NOTLongMaxVectorTests(IntFunction fa) { + static void NOTLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6334,11 +6371,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::NOT); + assertArraysEquals(r, a, LongVectorMaxTests::NOT); } @Test(dataProvider = "longUnaryOpProvider") - static void notLongMaxVectorTests(IntFunction fa) { + static void notLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6349,11 +6386,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::not); + assertArraysEquals(r, a, LongVectorMaxTests::not); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void NOTMaskedLongMaxVectorTests(IntFunction fa, + static void NOTMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6367,7 +6404,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::NOT); + assertArraysEquals(r, a, mask, LongVectorMaxTests::NOT); } static long ZOMO(long a) { @@ -6375,7 +6412,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void ZOMOLongMaxVectorTests(IntFunction fa) { + static void ZOMOLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6386,11 +6423,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::ZOMO); + assertArraysEquals(r, a, LongVectorMaxTests::ZOMO); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ZOMOMaskedLongMaxVectorTests(IntFunction fa, + static void ZOMOMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6404,7 +6441,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::ZOMO); + assertArraysEquals(r, a, mask, LongVectorMaxTests::ZOMO); } static long BIT_COUNT(long a) { @@ -6412,7 +6449,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void BIT_COUNTLongMaxVectorTests(IntFunction fa) { + static void BIT_COUNTLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6423,11 +6460,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, LongVectorMaxTests::BIT_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void BIT_COUNTMaskedLongMaxVectorTests(IntFunction fa, + static void BIT_COUNTMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6441,7 +6478,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, LongVectorMaxTests::BIT_COUNT); } static long TRAILING_ZEROS_COUNT(long a) { @@ -6449,7 +6486,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void TRAILING_ZEROS_COUNTLongMaxVectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6460,11 +6497,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVectorMaxTests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedLongMaxVectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6478,7 +6515,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVectorMaxTests::TRAILING_ZEROS_COUNT); } static long LEADING_ZEROS_COUNT(long a) { @@ -6486,7 +6523,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void LEADING_ZEROS_COUNTLongMaxVectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6497,11 +6534,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, LongVectorMaxTests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedLongMaxVectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6515,7 +6552,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, LongVectorMaxTests::LEADING_ZEROS_COUNT); } static long REVERSE(long a) { @@ -6523,7 +6560,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSELongMaxVectorTests(IntFunction fa) { + static void REVERSELongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6534,11 +6571,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::REVERSE); + assertArraysEquals(r, a, LongVectorMaxTests::REVERSE); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSEMaskedLongMaxVectorTests(IntFunction fa, + static void REVERSEMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6552,7 +6589,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::REVERSE); + assertArraysEquals(r, a, mask, LongVectorMaxTests::REVERSE); } static long REVERSE_BYTES(long a) { @@ -6560,7 +6597,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void REVERSE_BYTESLongMaxVectorTests(IntFunction fa) { + static void REVERSE_BYTESLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6571,11 +6608,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, LongVectorMaxTests::REVERSE_BYTES); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedLongMaxVectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedLongVectorMaxTests(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -6589,7 +6626,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, LongMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, LongVectorMaxTests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6597,7 +6634,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandLongVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6610,7 +6647,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::band); + assertArraysEquals(r, a, b, LongVectorMaxTests::band); } static boolean bor(boolean a, boolean b) { @@ -6618,7 +6655,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskorLongVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6631,7 +6668,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::bor); + assertArraysEquals(r, a, b, LongVectorMaxTests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6639,7 +6676,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskxorLongVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6652,7 +6689,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::bxor); + assertArraysEquals(r, a, b, LongVectorMaxTests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6660,7 +6697,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotLongVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6673,7 +6710,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::bandNot); + assertArraysEquals(r, a, b, LongVectorMaxTests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6681,7 +6718,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskeqLongVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6694,7 +6731,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, LongMaxVectorTests::beq); + assertArraysEquals(r, a, b, LongVectorMaxTests::beq); } static boolean unot(boolean a) { @@ -6702,7 +6739,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotLongMaxVectorTests(IntFunction fa) { + static void masknotLongVectorMaxTests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6713,7 +6750,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, LongMaxVectorTests::unot); + assertArraysEquals(r, a, LongVectorMaxTests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6722,15 +6759,15 @@ public class LongMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongLongMaxVectorTests(IntFunction fa) { + static void maskFromToLongLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6744,7 +6781,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longCompareOpProvider") - static void ltLongMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltLongVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6754,13 +6791,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "longCompareOpProvider") - static void eqLongMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqLongVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -6770,13 +6807,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "longtoIntUnaryOpProvider") - static void toIntArrayLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayLongVectorMaxTestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6787,7 +6824,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toLongArrayLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayLongVectorMaxTestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6798,7 +6835,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toDoubleArrayLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayLongVectorMaxTestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6809,7 +6846,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void toStringLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void toStringLongVectorMaxTestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6822,7 +6859,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpProvider") - static void hashCodeLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void hashCodeLongVectorMaxTestsSmokeTest(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6838,7 +6875,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { @Test(dataProvider = "longUnaryOpProvider") - static void ADDReduceLongLongMaxVectorTests(IntFunction fa) { + static void ADDReduceLongLongVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -6854,11 +6891,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - LongMaxVectorTests::ADDReduce, LongMaxVectorTests::ADDReduceAll); + LongVectorMaxTests::ADDReduce, LongVectorMaxTests::ADDReduceAll); } @Test(dataProvider = "longUnaryOpMaskProvider") - static void ADDReduceLongLongMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongLongVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6876,11 +6913,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - LongMaxVectorTests::ADDReduceMasked, LongMaxVectorTests::ADDReduceAllMasked); + LongVectorMaxTests::ADDReduceMasked, LongVectorMaxTests::ADDReduceAllMasked); } @Test(dataProvider = "longUnaryOpSelectFromProvider") - static void SelectFromLongMaxVectorTests(IntFunction fa, + static void SelectFromLongVectorMaxTests(IntFunction fa, BiFunction fs) { long[] a = fa.apply(SPECIES.length()); long[] order = fs.apply(a.length, SPECIES.length()); @@ -6896,7 +6933,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorLongVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] idx = fc.apply(SPECIES.length()); @@ -6914,7 +6951,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "longUnaryOpSelectFromMaskProvider") - static void SelectFromLongMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromLongVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); @@ -6933,7 +6970,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousLongMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousLongVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6944,12 +6981,12 @@ public class LongMaxVectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringLongMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringLongVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6963,7 +7000,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsLongMaxVectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsLongVectorMaxTestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -6972,12 +7009,12 @@ public class LongMaxVectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsLongVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -6987,13 +7024,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeLongVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7015,7 +7052,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountLongVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7026,7 +7063,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, LongMaxVectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, LongVectorMaxTests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7040,7 +7077,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueLongVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7051,7 +7088,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, LongMaxVectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, LongVectorMaxTests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7065,7 +7102,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueLongVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7076,11 +7113,11 @@ public class LongMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, LongMaxVectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, LongVectorMaxTests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressLongMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskCompressLongVectorMaxTestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7090,7 +7127,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7108,7 +7145,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongVectorMaxTestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7116,13 +7153,13 @@ public class LongMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongLongMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongLongVectorMaxTestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7130,7 +7167,7 @@ public class LongMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7149,36 +7186,36 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundLongMaxVectorTestsSmokeTest(int length) { + static void loopBoundLongVectorMaxTestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongLongMaxVectorTestsSmokeTest(int _length) { + static void loopBoundLongLongVectorMaxTestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeLongMaxVectorTestsSmokeTest() { + static void ElementSizeLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Long.SIZE); + assertEquals(elsize, Long.SIZE); } @Test - static void VectorShapeLongMaxVectorTestsSmokeTest() { + static void VectorShapeLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_Max_BIT)); } @Test - static void ShapeWithLanesLongMaxVectorTestsSmokeTest() { + static void ShapeWithLanesLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(long.class); @@ -7186,32 +7223,32 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test - static void ElementTypeLongMaxVectorTestsSmokeTest() { + static void ElementTypeLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementType() == long.class); } @Test - static void SpeciesElementSizeLongMaxVectorTestsSmokeTest() { + static void SpeciesElementSizeLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().elementSize() == Long.SIZE); } @Test - static void VectorTypeLongMaxVectorTestsSmokeTest() { + static void VectorTypeLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesLongMaxVectorTestsSmokeTest() { + static void WithLanesLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(long.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeLongMaxVectorTestsSmokeTest() { + static void WithShapeLongVectorMaxTestsSmokeTest() { LongVector av = LongVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7219,9 +7256,9 @@ public class LongMaxVectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueLongMaxVectorTestsSmokeTest() { + static void MaskAllTrueLongVectorMaxTestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortVector128LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ShortVector128LoadStoreTests.java index 5a71c5550f3..2c9a9198be9 100644 --- a/test/jdk/jdk/incubator/vector/Short128VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector128LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Short128VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ShortVector128LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ShortVector128LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_128; @@ -61,14 +61,29 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(short[] r, short[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "shortProviderForIOOBE") @@ -1114,11 +1129,11 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -1129,11 +1144,11 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); } } @@ -1149,7 +1164,7 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(short[] r, short[] a, int[] indexMap) { @@ -1162,7 +1177,7 @@ public class Short128VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Short128VectorTests.java b/test/jdk/jdk/incubator/vector/ShortVector128Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Short128VectorTests.java rename to test/jdk/jdk/incubator/vector/ShortVector128Tests.java index fb740fedfd4..7cf49513620 100644 --- a/test/jdk/jdk/incubator/vector/Short128VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector128Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short128VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortVector128Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Short128VectorTests extends AbstractVectorTest { +public class ShortVector128Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_128; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(short actual, short expected, short delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(short actual, short expected, short delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final short CONST_SHIFT = Short.SIZE / 2; @@ -96,10 +139,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { short[] ref = f.apply(a[i]); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Short128VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Short128VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Short128VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Short128VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Short128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (short)0); + assertEquals(r[i + k], (short)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Short128VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (short)0); + assertEquals(r[i + j], (short)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Short128VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Short128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Short128VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Short128VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Short128VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(r, a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1577,7 +1620,7 @@ public class Short128VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ShortVector a = io.add((short)1); //[1,2] ShortVector b = a.neg(); //[-1,-2] short[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1592,19 +1635,19 @@ public class Short128VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ShortVector uab0 = zab0.rearrange(unz0,zab1); ShortVector uab1 = zab0.rearrange(unz1,zab1); short[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1619,7 +1662,7 @@ public class Short128VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1653,7 +1696,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ADDShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1666,7 +1709,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::ADD); + assertArraysEquals(r, a, b, ShortVector128Tests::ADD); } static short add(short a, short b) { @@ -1674,7 +1717,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort128VectorTests(IntFunction fa, IntFunction fb) { + static void addShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1685,11 +1728,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::add); + assertArraysEquals(r, a, b, ShortVector128Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1705,11 +1748,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1723,7 +1766,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short128VectorTests::add); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::add); } static short SUB(short a, short b) { @@ -1731,7 +1774,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void SUBShort128VectorTests(IntFunction fa, IntFunction fb) { + static void SUBShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1744,7 +1787,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::SUB); + assertArraysEquals(r, a, b, ShortVector128Tests::SUB); } static short sub(short a, short b) { @@ -1752,7 +1795,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort128VectorTests(IntFunction fa, IntFunction fb) { + static void subShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1763,11 +1806,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::sub); + assertArraysEquals(r, a, b, ShortVector128Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void SUBShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1783,11 +1826,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::SUB); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1801,7 +1844,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short128VectorTests::sub); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::sub); } static short MUL(short a, short b) { @@ -1809,7 +1852,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MULShort128VectorTests(IntFunction fa, IntFunction fb) { + static void MULShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1822,7 +1865,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::MUL); + assertArraysEquals(r, a, b, ShortVector128Tests::MUL); } static short mul(short a, short b) { @@ -1830,7 +1873,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort128VectorTests(IntFunction fa, IntFunction fb) { + static void mulShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1841,11 +1884,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::mul); + assertArraysEquals(r, a, b, ShortVector128Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void MULShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1861,11 +1904,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::MUL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1879,7 +1922,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short128VectorTests::mul); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::mul); } static short DIV(short a, short b) { @@ -1887,7 +1930,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void DIVShort128VectorTests(IntFunction fa, IntFunction fb) { + static void DIVShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::DIV); + assertArraysEquals(r, a, b, ShortVector128Tests::DIV); } static short div(short a, short b) { @@ -1910,7 +1953,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort128VectorTests(IntFunction fa, IntFunction fb) { + static void divShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1925,11 +1968,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::div); + assertArraysEquals(r, a, b, ShortVector128Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void DIVShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1947,11 +1990,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::DIV); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1969,7 +2012,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::div); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::div); } static short FIRST_NONZERO(short a, short b) { @@ -1977,7 +2020,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void FIRST_NONZEROShort128VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1990,11 +2033,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ShortVector128Tests::FIRST_NONZERO); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void FIRST_NONZEROShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2010,7 +2053,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::FIRST_NONZERO); } static short AND(short a, short b) { @@ -2018,7 +2061,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ANDShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2031,7 +2074,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::AND); + assertArraysEquals(r, a, b, ShortVector128Tests::AND); } static short and(short a, short b) { @@ -2039,7 +2082,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort128VectorTests(IntFunction fa, IntFunction fb) { + static void andShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2050,11 +2093,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::and); + assertArraysEquals(r, a, b, ShortVector128Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2070,7 +2113,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::AND); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::AND); } static short AND_NOT(short a, short b) { @@ -2078,7 +2121,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void AND_NOTShort128VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2091,11 +2134,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ShortVector128Tests::AND_NOT); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void AND_NOTShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2111,7 +2154,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::AND_NOT); } static short OR(short a, short b) { @@ -2119,7 +2162,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ORShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2132,7 +2175,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::OR); + assertArraysEquals(r, a, b, ShortVector128Tests::OR); } static short or(short a, short b) { @@ -2140,7 +2183,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort128VectorTests(IntFunction fa, IntFunction fb) { + static void orShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2151,11 +2194,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::or); + assertArraysEquals(r, a, b, ShortVector128Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2171,7 +2214,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::OR); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::OR); } static short XOR(short a, short b) { @@ -2179,7 +2222,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void XORShort128VectorTests(IntFunction fa, IntFunction fb) { + static void XORShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2192,11 +2235,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::XOR); + assertArraysEquals(r, a, b, ShortVector128Tests::XOR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void XORShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2212,11 +2255,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::XOR); } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2269,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2243,11 +2286,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short128VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector128Tests::add); } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2257,11 +2300,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2274,11 +2317,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short128VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector128Tests::sub); } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2288,11 +2331,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2305,11 +2348,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short128VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector128Tests::mul); } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2321,11 +2364,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2340,11 +2383,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short128VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector128Tests::div); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2354,11 +2397,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2368,11 +2411,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2385,11 +2428,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short128VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector128Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2399,11 +2442,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2413,11 +2456,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2430,11 +2473,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short128VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector128Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2444,11 +2487,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ShortVector128Tests::OR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2461,11 +2504,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short128VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector128Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDShortVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2475,11 +2518,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ShortVector128Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort128VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDShortVector128TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2492,7 +2535,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short128VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector128Tests::ADD); } static short LSHL(short a, short b) { @@ -2500,7 +2543,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2513,11 +2556,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::LSHL); + assertArraysEquals(r, a, b, ShortVector128Tests::LSHL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2533,7 +2576,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::LSHL); } static short ASHR(short a, short b) { @@ -2541,7 +2584,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2554,11 +2597,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::ASHR); + assertArraysEquals(r, a, b, ShortVector128Tests::ASHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2574,7 +2617,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::ASHR); } static short LSHR(short a, short b) { @@ -2582,7 +2625,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort128VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2595,11 +2638,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::LSHR); + assertArraysEquals(r, a, b, ShortVector128Tests::LSHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2615,7 +2658,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::LSHR); } static short LSHL_unary(short a, short b) { @@ -2623,7 +2666,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLShortVector128TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2635,11 +2678,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ShortVector128Tests::LSHL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2654,7 +2697,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector128Tests::LSHL_unary); } static short LSHR_unary(short a, short b) { @@ -2662,7 +2705,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRShortVector128TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2674,11 +2717,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector128Tests::LSHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2693,7 +2736,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector128Tests::LSHR_unary); } static short ASHR_unary(short a, short b) { @@ -2701,7 +2744,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRShortVector128TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2713,11 +2756,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector128Tests::ASHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2732,7 +2775,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector128Tests::ASHR_unary); } static short ROR(short a, short b) { @@ -2740,7 +2783,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort128VectorTests(IntFunction fa, IntFunction fb) { + static void RORShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2753,11 +2796,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::ROR); + assertArraysEquals(r, a, b, ShortVector128Tests::ROR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2773,7 +2816,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::ROR); } static short ROL(short a, short b) { @@ -2781,7 +2824,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ROLShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2794,11 +2837,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::ROL); + assertArraysEquals(r, a, b, ShortVector128Tests::ROL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2814,7 +2857,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::ROL); } static short ROR_unary(short a, short b) { @@ -2822,7 +2865,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORShortVector128TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2834,11 +2877,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ShortVector128Tests::ROR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORShortVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2853,7 +2896,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector128Tests::ROR_unary); } static short ROL_unary(short a, short b) { @@ -2861,7 +2904,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort128VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLShortVector128TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2873,11 +2916,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ShortVector128Tests::ROL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort128VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector128TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2892,14 +2935,14 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short128VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector128Tests::ROL_unary); } static short LSHR_binary_const(short a) { return (short)(((a & 0xFFFF) >>> CONST_SHIFT)); } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHRShort128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRShortVector128TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2910,11 +2953,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ShortVector128Tests::LSHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHRShort128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRShortVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2928,7 +2971,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short128VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector128Tests::LSHR_binary_const); } static short LSHL_binary_const(short a) { @@ -2936,7 +2979,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHLShort128VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLShortVector128TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2947,11 +2990,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ShortVector128Tests::LSHL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHLShort128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLShortVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2965,7 +3008,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short128VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector128Tests::LSHL_binary_const); } static short ASHR_binary_const(short a) { @@ -2973,7 +3016,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ASHRShort128VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRShortVector128TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2984,11 +3027,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ShortVector128Tests::ASHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ASHRShort128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRShortVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3002,7 +3045,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short128VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector128Tests::ASHR_binary_const); } static short ROR_binary_const(short a) { @@ -3010,7 +3053,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void RORShort128VectorTestsScalarShiftConst(IntFunction fa) { + static void RORShortVector128TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3021,11 +3064,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ShortVector128Tests::ROR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void RORShort128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORShortVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3039,7 +3082,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short128VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector128Tests::ROR_binary_const); } static short ROL_binary_const(short a) { @@ -3047,7 +3090,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ROLShort128VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLShortVector128TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3058,11 +3101,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ShortVector128Tests::ROL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ROLShort128VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLShortVector128TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3076,14 +3119,14 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short128VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector128Tests::ROL_binary_const); } static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MINShort128VectorTestsWithMemOp(IntFunction fa) { + static void MINShortVector128TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3094,13 +3137,13 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short128VectorTests::MIN); + assertArraysEquals(r, a, (short)10, ShortVector128Tests::MIN); } static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void minShort128VectorTestsWithMemOp(IntFunction fa) { + static void minShortVector128TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3111,13 +3154,13 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short128VectorTests::min); + assertArraysEquals(r, a, (short)10, ShortVector128Tests::min); } static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINShort128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINShortVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3130,13 +3173,13 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short128VectorTests::MIN); + assertArraysEquals(r, a, (short)10, mask, ShortVector128Tests::MIN); } static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MAXShort128VectorTestsWithMemOp(IntFunction fa) { + static void MAXShortVector128TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short128VectorTests::MAX); + assertArraysEquals(r, a, (short)10, ShortVector128Tests::MAX); } static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void maxShort128VectorTestsWithMemOp(IntFunction fa) { + static void maxShortVector128TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short128VectorTests::max); + assertArraysEquals(r, a, (short)10, ShortVector128Tests::max); } static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXShort128VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXShortVector128TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,7 +3226,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short128VectorTests::MAX); + assertArraysEquals(r, a, (short)10, mask, ShortVector128Tests::MAX); } static short MIN(short a, short b) { @@ -3191,7 +3234,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort128VectorTests(IntFunction fa, IntFunction fb) { + static void MINShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3204,7 +3247,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::MIN); + assertArraysEquals(r, a, b, ShortVector128Tests::MIN); } static short min(short a, short b) { @@ -3212,7 +3255,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort128VectorTests(IntFunction fa, IntFunction fb) { + static void minShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3223,7 +3266,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::min); + assertArraysEquals(r, a, b, ShortVector128Tests::min); } static short MAX(short a, short b) { @@ -3231,7 +3274,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort128VectorTests(IntFunction fa, IntFunction fb) { + static void MAXShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3244,7 +3287,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::MAX); + assertArraysEquals(r, a, b, ShortVector128Tests::MAX); } static short max(short a, short b) { @@ -3252,7 +3295,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maxShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3263,7 +3306,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short128VectorTests::max); + assertArraysEquals(r, a, b, ShortVector128Tests::max); } static short UMIN(short a, short b) { @@ -3271,7 +3314,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMINShort128VectorTests(IntFunction fa, IntFunction fb) { + static void UMINShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3284,11 +3327,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::UMIN); + assertArraysEquals(r, a, b, ShortVector128Tests::UMIN); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMINShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3304,7 +3347,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::UMIN); } static short UMAX(short a, short b) { @@ -3312,7 +3355,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMAXShort128VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3325,11 +3368,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::UMAX); + assertArraysEquals(r, a, b, ShortVector128Tests::UMAX); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMAXShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3345,7 +3388,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::UMAX); } static short SADD(short a, short b) { @@ -3353,7 +3396,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SADDShort128VectorTests(IntFunction fa, IntFunction fb) { + static void SADDShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3366,11 +3409,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::SADD); + assertArraysEquals(r, a, b, ShortVector128Tests::SADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SADDShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3386,7 +3429,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::SADD); } static short SSUB(short a, short b) { @@ -3394,7 +3437,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SSUBShort128VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3407,11 +3450,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::SSUB); + assertArraysEquals(r, a, b, ShortVector128Tests::SSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SSUBShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3427,7 +3470,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::SSUB); } static short SUADD(short a, short b) { @@ -3435,7 +3478,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUADDShort128VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3448,11 +3491,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::SUADD); + assertArraysEquals(r, a, b, ShortVector128Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUADDShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3468,7 +3511,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::SUADD); } static short SUSUB(short a, short b) { @@ -3476,7 +3519,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUSUBShort128VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3489,11 +3532,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::SUSUB); + assertArraysEquals(r, a, b, ShortVector128Tests::SUSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUSUBShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3509,11 +3552,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::SUSUB); } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3566,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::MIN); } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3537,11 +3580,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::min); } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3551,11 +3594,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::MAX); } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3565,10 +3608,10 @@ public class Short128VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short128VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ShortVector128Tests::max); } @Test(dataProvider = "shortSaturatingBinaryOpAssocProvider") - static void SUADDAssocShort128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocShortVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -3585,11 +3628,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Short128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ShortVector128Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3610,7 +3653,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Short128VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ShortVector128Tests::SUADD); } static short ANDReduce(short[] a, int idx) { @@ -3632,7 +3675,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ANDReduceShort128VectorTests(IntFunction fa) { + static void ANDReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3648,7 +3691,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::ANDReduce, Short128VectorTests::ANDReduceAll); + ShortVector128Tests::ANDReduce, ShortVector128Tests::ANDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3656,20 +3699,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = AND_IDENTITY; - Assert.assertEquals((short) (id & id), id, + assertEquals((short) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id & x), x); - Assert.assertEquals((short) (x & id), x); + assertEquals((short) (id & x), x); + assertEquals((short) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id & x), x, + assertEquals((short) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x & id), x, + assertEquals((short) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3694,7 +3737,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ANDReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3712,7 +3755,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::ANDReduceMasked, Short128VectorTests::ANDReduceAllMasked); + ShortVector128Tests::ANDReduceMasked, ShortVector128Tests::ANDReduceAllMasked); } static short ORReduce(short[] a, int idx) { @@ -3734,7 +3777,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ORReduceShort128VectorTests(IntFunction fa) { + static void ORReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3750,7 +3793,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::ORReduce, Short128VectorTests::ORReduceAll); + ShortVector128Tests::ORReduce, ShortVector128Tests::ORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3758,20 +3801,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = OR_IDENTITY; - Assert.assertEquals((short) (id | id), id, + assertEquals((short) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id | x), x); - Assert.assertEquals((short) (x | id), x); + assertEquals((short) (id | x), x); + assertEquals((short) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id | x), x, + assertEquals((short) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x | id), x, + assertEquals((short) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3796,7 +3839,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ORReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3814,7 +3857,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::ORReduceMasked, Short128VectorTests::ORReduceAllMasked); + ShortVector128Tests::ORReduceMasked, ShortVector128Tests::ORReduceAllMasked); } static short XORReduce(short[] a, int idx) { @@ -3836,7 +3879,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void XORReduceShort128VectorTests(IntFunction fa) { + static void XORReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3852,7 +3895,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::XORReduce, Short128VectorTests::XORReduceAll); + ShortVector128Tests::XORReduce, ShortVector128Tests::XORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3860,20 +3903,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = XOR_IDENTITY; - Assert.assertEquals((short) (id ^ id), id, + assertEquals((short) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id ^ x), x); - Assert.assertEquals((short) (x ^ id), x); + assertEquals((short) (id ^ x), x); + assertEquals((short) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id ^ x), x, + assertEquals((short) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x ^ id), x, + assertEquals((short) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3898,7 +3941,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void XORReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3916,7 +3959,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::XORReduceMasked, Short128VectorTests::XORReduceAllMasked); + ShortVector128Tests::XORReduceMasked, ShortVector128Tests::XORReduceAllMasked); } static short ADDReduce(short[] a, int idx) { @@ -3938,7 +3981,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceShort128VectorTests(IntFunction fa) { + static void ADDReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3954,7 +3997,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::ADDReduce, Short128VectorTests::ADDReduceAll); + ShortVector128Tests::ADDReduce, ShortVector128Tests::ADDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3962,20 +4005,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = ADD_IDENTITY; - Assert.assertEquals((short) (id + id), id, + assertEquals((short) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id + x), x); - Assert.assertEquals((short) (x + id), x); + assertEquals((short) (id + x), x); + assertEquals((short) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id + x), x, + assertEquals((short) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x + id), x, + assertEquals((short) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4000,7 +4043,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4018,7 +4061,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::ADDReduceMasked, Short128VectorTests::ADDReduceAllMasked); + ShortVector128Tests::ADDReduceMasked, ShortVector128Tests::ADDReduceAllMasked); } static short MULReduce(short[] a, int idx) { @@ -4040,7 +4083,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MULReduceShort128VectorTests(IntFunction fa) { + static void MULReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4056,7 +4099,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::MULReduce, Short128VectorTests::MULReduceAll); + ShortVector128Tests::MULReduce, ShortVector128Tests::MULReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4064,20 +4107,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MUL_IDENTITY; - Assert.assertEquals((short) (id * id), id, + assertEquals((short) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id * x), x); - Assert.assertEquals((short) (x * id), x); + assertEquals((short) (id * x), x); + assertEquals((short) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id * x), x, + assertEquals((short) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x * id), x, + assertEquals((short) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4102,7 +4145,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MULReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4120,7 +4163,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::MULReduceMasked, Short128VectorTests::MULReduceAllMasked); + ShortVector128Tests::MULReduceMasked, ShortVector128Tests::MULReduceAllMasked); } static short MINReduce(short[] a, int idx) { @@ -4142,7 +4185,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MINReduceShort128VectorTests(IntFunction fa) { + static void MINReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4158,7 +4201,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::MINReduce, Short128VectorTests::MINReduceAll); + ShortVector128Tests::MINReduce, ShortVector128Tests::MINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4166,20 +4209,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MIN_IDENTITY; - Assert.assertEquals((short) Math.min(id, id), id, + assertEquals((short) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.min(id, x), x); - Assert.assertEquals((short) Math.min(x, id), x); + assertEquals((short) Math.min(id, x), x); + assertEquals((short) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.min(id, x), x, + assertEquals((short) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.min(x, id), x, + assertEquals((short) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4204,7 +4247,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4222,7 +4265,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::MINReduceMasked, Short128VectorTests::MINReduceAllMasked); + ShortVector128Tests::MINReduceMasked, ShortVector128Tests::MINReduceAllMasked); } static short MAXReduce(short[] a, int idx) { @@ -4244,7 +4287,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MAXReduceShort128VectorTests(IntFunction fa) { + static void MAXReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4260,7 +4303,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::MAXReduce, Short128VectorTests::MAXReduceAll); + ShortVector128Tests::MAXReduce, ShortVector128Tests::MAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4268,20 +4311,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MAX_IDENTITY; - Assert.assertEquals((short) Math.max(id, id), id, + assertEquals((short) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.max(id, x), x); - Assert.assertEquals((short) Math.max(x, id), x); + assertEquals((short) Math.max(id, x), x); + assertEquals((short) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.max(id, x), x, + assertEquals((short) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.max(x, id), x, + assertEquals((short) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4306,7 +4349,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4324,7 +4367,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::MAXReduceMasked, Short128VectorTests::MAXReduceAllMasked); + ShortVector128Tests::MAXReduceMasked, ShortVector128Tests::MAXReduceAllMasked); } static short UMINReduce(short[] a, int idx) { @@ -4346,7 +4389,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMINReduceShort128VectorTests(IntFunction fa) { + static void UMINReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4362,7 +4405,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::UMINReduce, Short128VectorTests::UMINReduceAll); + ShortVector128Tests::UMINReduce, ShortVector128Tests::UMINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4370,20 +4413,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMIN_IDENTITY; - Assert.assertEquals((short) VectorMath.minUnsigned(id, id), id, + assertEquals((short) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x); + assertEquals((short) VectorMath.minUnsigned(id, x), x); + assertEquals((short) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x, + assertEquals((short) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x, + assertEquals((short) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4408,7 +4451,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMINReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4426,7 +4469,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::UMINReduceMasked, Short128VectorTests::UMINReduceAllMasked); + ShortVector128Tests::UMINReduceMasked, ShortVector128Tests::UMINReduceAllMasked); } static short UMAXReduce(short[] a, int idx) { @@ -4448,7 +4491,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMAXReduceShort128VectorTests(IntFunction fa) { + static void UMAXReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4464,7 +4507,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::UMAXReduce, Short128VectorTests::UMAXReduceAll); + ShortVector128Tests::UMAXReduce, ShortVector128Tests::UMAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4472,20 +4515,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMAX_IDENTITY; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, id), id, + assertEquals((short) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x); + assertEquals((short) VectorMath.maxUnsigned(id, x), x); + assertEquals((short) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x, + assertEquals((short) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x, + assertEquals((short) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4510,7 +4553,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMAXReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4528,7 +4571,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::UMAXReduceMasked, Short128VectorTests::UMAXReduceAllMasked); + ShortVector128Tests::UMAXReduceMasked, ShortVector128Tests::UMAXReduceAllMasked); } static short FIRST_NONZEROReduce(short[] a, int idx) { @@ -4550,7 +4593,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void FIRST_NONZEROReduceShort128VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4566,7 +4609,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::FIRST_NONZEROReduce, Short128VectorTests::FIRST_NONZEROReduceAll); + ShortVector128Tests::FIRST_NONZEROReduce, ShortVector128Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4574,20 +4617,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4612,7 +4655,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void FIRST_NONZEROReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4630,7 +4673,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::FIRST_NONZEROReduceMasked, Short128VectorTests::FIRST_NONZEROReduceAllMasked); + ShortVector128Tests::FIRST_NONZEROReduceMasked, ShortVector128Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4643,7 +4686,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueShort128VectorTests(IntFunction fm) { + static void anyTrueShortVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4654,7 +4697,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short128VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector128Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4667,7 +4710,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueShort128VectorTests(IntFunction fm) { + static void allTrueShortVector128Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4678,7 +4721,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short128VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector128Tests::allTrue); } static short SUADDReduce(short[] a, int idx) { @@ -4700,7 +4743,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingUnaryOpProvider") - static void SUADDReduceShort128VectorTests(IntFunction fa) { + static void SUADDReduceShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4716,7 +4759,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short128VectorTests::SUADDReduce, Short128VectorTests::SUADDReduceAll); + ShortVector128Tests::SUADDReduce, ShortVector128Tests::SUADDReduceAll); } @Test(dataProvider = "shortSaturatingUnaryOpProvider") @@ -4724,20 +4767,20 @@ public class Short128VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = SUADD_IDENTITY; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4761,7 +4804,7 @@ public class Short128VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "shortSaturatingUnaryOpMaskProvider") - static void SUADDReduceShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4779,11 +4822,11 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::SUADDReduceMasked, Short128VectorTests::SUADDReduceAllMasked); + ShortVector128Tests::SUADDReduceMasked, ShortVector128Tests::SUADDReduceAllMasked); } @Test(dataProvider = "shortBinaryOpProvider") - static void withShort128VectorTests(IntFunction fa, IntFunction fb) { + static void withShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -4806,7 +4849,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_DEFAULTShort128VectorTests(IntFunction fa) { + static void IS_DEFAULTShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4816,14 +4859,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_DEFAULTMaskedShort128VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4836,7 +4879,7 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4847,7 +4890,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_NEGATIVEShort128VectorTests(IntFunction fa) { + static void IS_NEGATIVEShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4857,14 +4900,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_NEGATIVEMaskedShort128VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4877,14 +4920,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort128VectorTests(IntFunction fa, IntFunction fb) { + static void LTShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4896,14 +4939,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ltShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4915,14 +4958,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4938,14 +4981,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GTShort128VectorTests(IntFunction fa, IntFunction fb) { + static void GTShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4957,14 +5000,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GTShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4980,14 +5023,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort128VectorTests(IntFunction fa, IntFunction fb) { + static void EQShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4999,14 +5042,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort128VectorTests(IntFunction fa, IntFunction fb) { + static void eqShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5018,14 +5061,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5041,14 +5084,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void NEShort128VectorTests(IntFunction fa, IntFunction fb) { + static void NEShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5060,14 +5103,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void NEShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5083,14 +5126,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LEShort128VectorTests(IntFunction fa, IntFunction fb) { + static void LEShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5102,14 +5145,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LEShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5125,14 +5168,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GEShort128VectorTests(IntFunction fa, IntFunction fb) { + static void GEShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5144,14 +5187,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GEShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5167,14 +5210,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULTShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ULTShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5186,14 +5229,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULTShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5209,14 +5252,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGTShort128VectorTests(IntFunction fa, IntFunction fb) { + static void UGTShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5228,14 +5271,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGTShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5251,14 +5294,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULEShort128VectorTests(IntFunction fa, IntFunction fb) { + static void ULEShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5270,14 +5313,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULEShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5293,14 +5336,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGEShort128VectorTests(IntFunction fa, IntFunction fb) { + static void UGEShortVector128Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5312,14 +5355,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGEShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5335,14 +5378,14 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5372,13 +5415,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5388,13 +5431,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTShortVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5408,13 +5451,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5424,13 +5467,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5444,13 +5487,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5460,13 +5503,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQShortVector128TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5480,7 +5523,7 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); } } } @@ -5490,7 +5533,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort128VectorTests(IntFunction fa, IntFunction fb, + static void blendShortVector128Tests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5506,11 +5549,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short128VectorTests::blend); + assertArraysEquals(r, a, b, mask, ShortVector128Tests::blend); } @Test(dataProvider = "shortUnaryOpShuffleProvider") - static void RearrangeShort128VectorTests(IntFunction fa, + static void RearrangeShortVector128Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5527,7 +5570,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpShuffleMaskProvider") - static void RearrangeShort128VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeShortVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -5545,7 +5588,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void compressShort128VectorTests(IntFunction fa, + static void compressShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5563,7 +5606,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void expandShort128VectorTests(IntFunction fa, + static void expandShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5581,7 +5624,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void getShort128VectorTests(IntFunction fa) { + static void getShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5737,7 +5780,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastShort128VectorTests(IntFunction fa) { + static void BroadcastShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5751,7 +5794,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZeroShort128VectorTests(IntFunction fa) { + static void ZeroShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5761,7 +5804,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static short[] sliceUnary(short[] a, int origin, int idx) { @@ -5776,7 +5819,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void sliceUnaryShort128VectorTests(IntFunction fa) { + static void sliceUnaryShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5787,7 +5830,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short128VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ShortVector128Tests::sliceUnary); } static short[] sliceBinary(short[] a, short[] b, int origin, int idx) { @@ -5804,7 +5847,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void sliceBinaryShort128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryShortVector128TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5817,7 +5860,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Short128VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ShortVector128Tests::sliceBinary); } static short[] slice(short[] a, short[] b, int origin, boolean[] mask, int idx) { @@ -5834,7 +5877,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void sliceShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5851,7 +5894,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Short128VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ShortVector128Tests::slice); } static short[] unsliceUnary(short[] a, int origin, int idx) { @@ -5868,7 +5911,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void unsliceUnaryShort128VectorTests(IntFunction fa) { + static void unsliceUnaryShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5879,7 +5922,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short128VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ShortVector128Tests::unsliceUnary); } static short[] unsliceBinary(short[] a, short[] b, int origin, int part, int idx) { @@ -5905,7 +5948,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void unsliceBinaryShort128VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryShortVector128TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5919,7 +5962,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Short128VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ShortVector128Tests::unsliceBinary); } static short[] unslice(short[] a, short[] b, int origin, int part, boolean[] mask, int idx) { @@ -5959,7 +6002,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void unsliceShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5976,7 +6019,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Short128VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ShortVector128Tests::unslice); } static short BITWISE_BLEND(short a, short b, short c) { @@ -5988,7 +6031,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6003,11 +6046,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Short128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6020,11 +6063,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Short128VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ShortVector128Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort128VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector128TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6042,11 +6085,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Short128VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6057,11 +6100,11 @@ public class Short128VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6072,11 +6115,11 @@ public class Short128VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6087,11 +6130,11 @@ public class Short128VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short128VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ShortVector128Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort128VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector128TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6102,11 +6145,11 @@ public class Short128VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short128VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector128Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6121,11 +6164,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Short128VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort128VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector128TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Short128VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector128Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort128VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector128TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6170,11 +6213,11 @@ public class Short128VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short128VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector128Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector128TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6188,7 +6231,7 @@ public class Short128VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Short128VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortVector128Tests::BITWISE_BLEND); } static short NEG(short a) { @@ -6200,7 +6243,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NEGShort128VectorTests(IntFunction fa) { + static void NEGShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6211,11 +6254,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::NEG); + assertArraysEquals(r, a, ShortVector128Tests::NEG); } @Test(dataProvider = "shortUnaryOpProvider") - static void negShort128VectorTests(IntFunction fa) { + static void negShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6226,11 +6269,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::neg); + assertArraysEquals(r, a, ShortVector128Tests::neg); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NEGMaskedShort128VectorTests(IntFunction fa, + static void NEGMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6244,7 +6287,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::NEG); + assertArraysEquals(r, a, mask, ShortVector128Tests::NEG); } static short ABS(short a) { @@ -6256,7 +6299,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ABSShort128VectorTests(IntFunction fa) { + static void ABSShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6267,11 +6310,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::ABS); + assertArraysEquals(r, a, ShortVector128Tests::ABS); } @Test(dataProvider = "shortUnaryOpProvider") - static void absShort128VectorTests(IntFunction fa) { + static void absShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6282,11 +6325,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::abs); + assertArraysEquals(r, a, ShortVector128Tests::abs); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ABSMaskedShort128VectorTests(IntFunction fa, + static void ABSMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6300,7 +6343,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::ABS); + assertArraysEquals(r, a, mask, ShortVector128Tests::ABS); } static short NOT(short a) { @@ -6312,7 +6355,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NOTShort128VectorTests(IntFunction fa) { + static void NOTShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6323,11 +6366,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::NOT); + assertArraysEquals(r, a, ShortVector128Tests::NOT); } @Test(dataProvider = "shortUnaryOpProvider") - static void notShort128VectorTests(IntFunction fa) { + static void notShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6338,11 +6381,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::not); + assertArraysEquals(r, a, ShortVector128Tests::not); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NOTMaskedShort128VectorTests(IntFunction fa, + static void NOTMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6356,7 +6399,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::NOT); + assertArraysEquals(r, a, mask, ShortVector128Tests::NOT); } static short ZOMO(short a) { @@ -6364,7 +6407,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZOMOShort128VectorTests(IntFunction fa) { + static void ZOMOShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6375,11 +6418,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::ZOMO); + assertArraysEquals(r, a, ShortVector128Tests::ZOMO); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ZOMOMaskedShort128VectorTests(IntFunction fa, + static void ZOMOMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6393,7 +6436,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ShortVector128Tests::ZOMO); } static short BIT_COUNT(short a) { @@ -6401,7 +6444,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BIT_COUNTShort128VectorTests(IntFunction fa) { + static void BIT_COUNTShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6412,11 +6455,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ShortVector128Tests::BIT_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void BIT_COUNTMaskedShort128VectorTests(IntFunction fa, + static void BIT_COUNTMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6430,7 +6473,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ShortVector128Tests::BIT_COUNT); } static short TRAILING_ZEROS_COUNT(short a) { @@ -6438,7 +6481,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void TRAILING_ZEROS_COUNTShort128VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6449,11 +6492,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector128Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedShort128VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6467,7 +6510,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector128Tests::TRAILING_ZEROS_COUNT); } static short LEADING_ZEROS_COUNT(short a) { @@ -6475,7 +6518,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LEADING_ZEROS_COUNTShort128VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6486,11 +6529,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector128Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedShort128VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6504,7 +6547,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector128Tests::LEADING_ZEROS_COUNT); } static short REVERSE(short a) { @@ -6512,7 +6555,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSEShort128VectorTests(IntFunction fa) { + static void REVERSEShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6523,11 +6566,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::REVERSE); + assertArraysEquals(r, a, ShortVector128Tests::REVERSE); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSEMaskedShort128VectorTests(IntFunction fa, + static void REVERSEMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6541,7 +6584,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ShortVector128Tests::REVERSE); } static short REVERSE_BYTES(short a) { @@ -6549,7 +6592,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSE_BYTESShort128VectorTests(IntFunction fa) { + static void REVERSE_BYTESShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6560,11 +6603,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ShortVector128Tests::REVERSE_BYTES); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedShort128VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedShortVector128Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6578,7 +6621,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short128VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ShortVector128Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6586,7 +6629,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandShortVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6599,7 +6642,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::band); + assertArraysEquals(r, a, b, ShortVector128Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6607,7 +6650,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maskorShortVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6620,7 +6663,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::bor); + assertArraysEquals(r, a, b, ShortVector128Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6628,7 +6671,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorShortVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6641,7 +6684,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::bxor); + assertArraysEquals(r, a, b, ShortVector128Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6649,7 +6692,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotShortVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6662,7 +6705,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::bandNot); + assertArraysEquals(r, a, b, ShortVector128Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6670,7 +6713,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqShortVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6683,7 +6726,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short128VectorTests::beq); + assertArraysEquals(r, a, b, ShortVector128Tests::beq); } static boolean unot(boolean a) { @@ -6691,7 +6734,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotShort128VectorTests(IntFunction fa) { + static void masknotShortVector128Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6702,7 +6745,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short128VectorTests::unot); + assertArraysEquals(r, a, ShortVector128Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6711,15 +6754,15 @@ public class Short128VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongShort128VectorTests(IntFunction fa) { + static void maskFromToLongShortVector128Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6733,7 +6776,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort128VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltShortVector128TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6743,13 +6786,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort128VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqShortVector128TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6759,13 +6802,13 @@ public class Short128VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortUnaryOpProvider") - static void toIntArrayShort128VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayShortVector128TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6776,7 +6819,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toLongArrayShort128VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayShortVector128TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6787,7 +6830,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toDoubleArrayShort128VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayShortVector128TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6798,7 +6841,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toStringShort128VectorTestsSmokeTest(IntFunction fa) { + static void toStringShortVector128TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6811,7 +6854,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void hashCodeShort128VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeShortVector128TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6844,7 +6887,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceLongShort128VectorTests(IntFunction fa) { + static void ADDReduceLongShortVector128Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6860,7 +6903,7 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Short128VectorTests::ADDReduceLong, Short128VectorTests::ADDReduceAllLong); + ShortVector128Tests::ADDReduceLong, ShortVector128Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(short[] a, int idx, boolean[] mask) { @@ -6883,7 +6926,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceLongShort128VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongShortVector128TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6901,11 +6944,11 @@ public class Short128VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Short128VectorTests::ADDReduceLongMasked, Short128VectorTests::ADDReduceAllLongMasked); + ShortVector128Tests::ADDReduceLongMasked, ShortVector128Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastLongShort128VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongShortVector128TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -6916,7 +6959,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort128VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendShortVector128TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6930,12 +6973,12 @@ public class Short128VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Short128VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector128Tests::blend); } @Test(dataProvider = "shortUnaryOpSelectFromProvider") - static void SelectFromShort128VectorTests(IntFunction fa, + static void SelectFromShortVector128Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); short[] order = fs.apply(a.length, SPECIES.length()); @@ -6951,7 +6994,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorShort128VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorShortVector128Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] idx = fc.apply(SPECIES.length()); @@ -6969,7 +7012,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpSelectFromMaskProvider") - static void SelectFromShort128VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromShortVector128TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -6988,7 +7031,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousShort128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousShortVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6999,12 +7042,12 @@ public class Short128VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringShort128VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringShortVector128TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7018,7 +7061,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsShort128VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsShortVector128TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7027,12 +7070,12 @@ public class Short128VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsShort128VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsShortVector128Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7042,13 +7085,13 @@ public class Short128VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeShort128VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeShortVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7070,7 +7113,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountShort128VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountShortVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7081,7 +7124,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short128VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ShortVector128Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7095,7 +7138,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueShort128VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueShortVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7106,7 +7149,7 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short128VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ShortVector128Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7120,7 +7163,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueShort128VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueShortVector128TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7131,11 +7174,11 @@ public class Short128VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short128VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ShortVector128Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressShort128VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressShortVector128TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7145,7 +7188,7 @@ public class Short128VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7163,7 +7206,7 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeShort128VectorTestsSmokeTest(int offset) { + static void indexInRangeShortVector128TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7171,13 +7214,13 @@ public class Short128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongShort128VectorTestsSmokeTest(int offset) { + static void indexInRangeLongShortVector128TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7185,7 +7228,7 @@ public class Short128VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7204,36 +7247,36 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundShort128VectorTestsSmokeTest(int length) { + static void loopBoundShortVector128TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongShort128VectorTestsSmokeTest(int _length) { + static void loopBoundLongShortVector128TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeShort128VectorTestsSmokeTest() { + static void ElementSizeShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Short.SIZE); + assertEquals(elsize, Short.SIZE); } @Test - static void VectorShapeShort128VectorTestsSmokeTest() { + static void VectorShapeShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_128_BIT)); } @Test - static void ShapeWithLanesShort128VectorTestsSmokeTest() { + static void ShapeWithLanesShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(short.class); @@ -7241,32 +7284,32 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeShort128VectorTestsSmokeTest() { + static void ElementTypeShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementType() == short.class); } @Test - static void SpeciesElementSizeShort128VectorTestsSmokeTest() { + static void SpeciesElementSizeShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementSize() == Short.SIZE); } @Test - static void VectorTypeShort128VectorTestsSmokeTest() { + static void VectorTypeShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesShort128VectorTestsSmokeTest() { + static void WithLanesShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(short.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeShort128VectorTestsSmokeTest() { + static void WithShapeShortVector128TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7274,9 +7317,9 @@ public class Short128VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueShort128VectorTestsSmokeTest() { + static void MaskAllTrueShortVector128TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortVector256LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ShortVector256LoadStoreTests.java index 335d51add59..70ed351908f 100644 --- a/test/jdk/jdk/incubator/vector/Short256VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector256LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Short256VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ShortVector256LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ShortVector256LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_256; @@ -61,14 +61,29 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 256); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(short[] r, short[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "shortProviderForIOOBE") @@ -1114,11 +1129,11 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -1129,11 +1144,11 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); } } @@ -1149,7 +1164,7 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(short[] r, short[] a, int[] indexMap) { @@ -1162,7 +1177,7 @@ public class Short256VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Short256VectorTests.java b/test/jdk/jdk/incubator/vector/ShortVector256Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Short256VectorTests.java rename to test/jdk/jdk/incubator/vector/ShortVector256Tests.java index cd6aa113b84..5104e3724f7 100644 --- a/test/jdk/jdk/incubator/vector/Short256VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector256Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short256VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortVector256Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Short256VectorTests extends AbstractVectorTest { +public class ShortVector256Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_256; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(short actual, short expected, short delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(short actual, short expected, short delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final short CONST_SHIFT = Short.SIZE / 2; @@ -96,10 +139,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { short[] ref = f.apply(a[i]); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Short256VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Short256VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Short256VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Short256VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Short256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (short)0); + assertEquals(r[i + k], (short)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Short256VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (short)0); + assertEquals(r[i + j], (short)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Short256VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Short256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Short256VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Short256VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Short256VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(r, a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1577,7 +1620,7 @@ public class Short256VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ShortVector a = io.add((short)1); //[1,2] ShortVector b = a.neg(); //[-1,-2] short[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1592,19 +1635,19 @@ public class Short256VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ShortVector uab0 = zab0.rearrange(unz0,zab1); ShortVector uab1 = zab0.rearrange(unz1,zab1); short[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1619,7 +1662,7 @@ public class Short256VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1653,7 +1696,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ADDShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1666,7 +1709,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::ADD); + assertArraysEquals(r, a, b, ShortVector256Tests::ADD); } static short add(short a, short b) { @@ -1674,7 +1717,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort256VectorTests(IntFunction fa, IntFunction fb) { + static void addShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1685,11 +1728,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::add); + assertArraysEquals(r, a, b, ShortVector256Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1705,11 +1748,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1723,7 +1766,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short256VectorTests::add); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::add); } static short SUB(short a, short b) { @@ -1731,7 +1774,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void SUBShort256VectorTests(IntFunction fa, IntFunction fb) { + static void SUBShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1744,7 +1787,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::SUB); + assertArraysEquals(r, a, b, ShortVector256Tests::SUB); } static short sub(short a, short b) { @@ -1752,7 +1795,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort256VectorTests(IntFunction fa, IntFunction fb) { + static void subShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1763,11 +1806,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::sub); + assertArraysEquals(r, a, b, ShortVector256Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void SUBShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1783,11 +1826,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::SUB); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1801,7 +1844,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short256VectorTests::sub); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::sub); } static short MUL(short a, short b) { @@ -1809,7 +1852,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MULShort256VectorTests(IntFunction fa, IntFunction fb) { + static void MULShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1822,7 +1865,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::MUL); + assertArraysEquals(r, a, b, ShortVector256Tests::MUL); } static short mul(short a, short b) { @@ -1830,7 +1873,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort256VectorTests(IntFunction fa, IntFunction fb) { + static void mulShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1841,11 +1884,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::mul); + assertArraysEquals(r, a, b, ShortVector256Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void MULShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1861,11 +1904,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::MUL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1879,7 +1922,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short256VectorTests::mul); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::mul); } static short DIV(short a, short b) { @@ -1887,7 +1930,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void DIVShort256VectorTests(IntFunction fa, IntFunction fb) { + static void DIVShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::DIV); + assertArraysEquals(r, a, b, ShortVector256Tests::DIV); } static short div(short a, short b) { @@ -1910,7 +1953,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort256VectorTests(IntFunction fa, IntFunction fb) { + static void divShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1925,11 +1968,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::div); + assertArraysEquals(r, a, b, ShortVector256Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void DIVShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1947,11 +1990,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::DIV); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1969,7 +2012,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::div); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::div); } static short FIRST_NONZERO(short a, short b) { @@ -1977,7 +2020,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void FIRST_NONZEROShort256VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1990,11 +2033,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ShortVector256Tests::FIRST_NONZERO); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void FIRST_NONZEROShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2010,7 +2053,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::FIRST_NONZERO); } static short AND(short a, short b) { @@ -2018,7 +2061,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ANDShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2031,7 +2074,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::AND); + assertArraysEquals(r, a, b, ShortVector256Tests::AND); } static short and(short a, short b) { @@ -2039,7 +2082,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort256VectorTests(IntFunction fa, IntFunction fb) { + static void andShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2050,11 +2093,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::and); + assertArraysEquals(r, a, b, ShortVector256Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2070,7 +2113,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::AND); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::AND); } static short AND_NOT(short a, short b) { @@ -2078,7 +2121,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void AND_NOTShort256VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2091,11 +2134,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ShortVector256Tests::AND_NOT); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void AND_NOTShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2111,7 +2154,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::AND_NOT); } static short OR(short a, short b) { @@ -2119,7 +2162,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ORShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2132,7 +2175,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::OR); + assertArraysEquals(r, a, b, ShortVector256Tests::OR); } static short or(short a, short b) { @@ -2140,7 +2183,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort256VectorTests(IntFunction fa, IntFunction fb) { + static void orShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2151,11 +2194,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::or); + assertArraysEquals(r, a, b, ShortVector256Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2171,7 +2214,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::OR); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::OR); } static short XOR(short a, short b) { @@ -2179,7 +2222,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void XORShort256VectorTests(IntFunction fa, IntFunction fb) { + static void XORShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2192,11 +2235,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::XOR); + assertArraysEquals(r, a, b, ShortVector256Tests::XOR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void XORShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2212,11 +2255,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::XOR); } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2269,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2243,11 +2286,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short256VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector256Tests::add); } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2257,11 +2300,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2274,11 +2317,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short256VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector256Tests::sub); } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2288,11 +2331,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2305,11 +2348,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short256VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector256Tests::mul); } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2321,11 +2364,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2340,11 +2383,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short256VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector256Tests::div); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2354,11 +2397,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2368,11 +2411,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2385,11 +2428,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short256VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector256Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2399,11 +2442,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2413,11 +2456,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2430,11 +2473,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short256VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector256Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2444,11 +2487,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ShortVector256Tests::OR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2461,11 +2504,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short256VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector256Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDShortVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2475,11 +2518,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ShortVector256Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort256VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDShortVector256TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2492,7 +2535,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short256VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector256Tests::ADD); } static short LSHL(short a, short b) { @@ -2500,7 +2543,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2513,11 +2556,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::LSHL); + assertArraysEquals(r, a, b, ShortVector256Tests::LSHL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2533,7 +2576,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::LSHL); } static short ASHR(short a, short b) { @@ -2541,7 +2584,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2554,11 +2597,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::ASHR); + assertArraysEquals(r, a, b, ShortVector256Tests::ASHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2574,7 +2617,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::ASHR); } static short LSHR(short a, short b) { @@ -2582,7 +2625,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort256VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2595,11 +2638,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::LSHR); + assertArraysEquals(r, a, b, ShortVector256Tests::LSHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2615,7 +2658,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::LSHR); } static short LSHL_unary(short a, short b) { @@ -2623,7 +2666,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLShortVector256TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2635,11 +2678,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ShortVector256Tests::LSHL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2654,7 +2697,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector256Tests::LSHL_unary); } static short LSHR_unary(short a, short b) { @@ -2662,7 +2705,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRShortVector256TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2674,11 +2717,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector256Tests::LSHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2693,7 +2736,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector256Tests::LSHR_unary); } static short ASHR_unary(short a, short b) { @@ -2701,7 +2744,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRShortVector256TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2713,11 +2756,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector256Tests::ASHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2732,7 +2775,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector256Tests::ASHR_unary); } static short ROR(short a, short b) { @@ -2740,7 +2783,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort256VectorTests(IntFunction fa, IntFunction fb) { + static void RORShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2753,11 +2796,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::ROR); + assertArraysEquals(r, a, b, ShortVector256Tests::ROR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2773,7 +2816,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::ROR); } static short ROL(short a, short b) { @@ -2781,7 +2824,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ROLShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2794,11 +2837,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::ROL); + assertArraysEquals(r, a, b, ShortVector256Tests::ROL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2814,7 +2857,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::ROL); } static short ROR_unary(short a, short b) { @@ -2822,7 +2865,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORShortVector256TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2834,11 +2877,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ShortVector256Tests::ROR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORShortVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2853,7 +2896,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector256Tests::ROR_unary); } static short ROL_unary(short a, short b) { @@ -2861,7 +2904,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort256VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLShortVector256TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2873,11 +2916,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ShortVector256Tests::ROL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort256VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector256TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2892,14 +2935,14 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short256VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector256Tests::ROL_unary); } static short LSHR_binary_const(short a) { return (short)(((a & 0xFFFF) >>> CONST_SHIFT)); } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHRShort256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRShortVector256TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2910,11 +2953,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ShortVector256Tests::LSHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHRShort256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRShortVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2928,7 +2971,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short256VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector256Tests::LSHR_binary_const); } static short LSHL_binary_const(short a) { @@ -2936,7 +2979,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHLShort256VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLShortVector256TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2947,11 +2990,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ShortVector256Tests::LSHL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHLShort256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLShortVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2965,7 +3008,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short256VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector256Tests::LSHL_binary_const); } static short ASHR_binary_const(short a) { @@ -2973,7 +3016,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ASHRShort256VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRShortVector256TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2984,11 +3027,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ShortVector256Tests::ASHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ASHRShort256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRShortVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3002,7 +3045,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short256VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector256Tests::ASHR_binary_const); } static short ROR_binary_const(short a) { @@ -3010,7 +3053,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void RORShort256VectorTestsScalarShiftConst(IntFunction fa) { + static void RORShortVector256TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3021,11 +3064,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ShortVector256Tests::ROR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void RORShort256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORShortVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3039,7 +3082,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short256VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector256Tests::ROR_binary_const); } static short ROL_binary_const(short a) { @@ -3047,7 +3090,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ROLShort256VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLShortVector256TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3058,11 +3101,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ShortVector256Tests::ROL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ROLShort256VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLShortVector256TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3076,14 +3119,14 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short256VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector256Tests::ROL_binary_const); } static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MINShort256VectorTestsWithMemOp(IntFunction fa) { + static void MINShortVector256TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3094,13 +3137,13 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short256VectorTests::MIN); + assertArraysEquals(r, a, (short)10, ShortVector256Tests::MIN); } static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void minShort256VectorTestsWithMemOp(IntFunction fa) { + static void minShortVector256TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3111,13 +3154,13 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short256VectorTests::min); + assertArraysEquals(r, a, (short)10, ShortVector256Tests::min); } static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINShort256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINShortVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3130,13 +3173,13 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short256VectorTests::MIN); + assertArraysEquals(r, a, (short)10, mask, ShortVector256Tests::MIN); } static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MAXShort256VectorTestsWithMemOp(IntFunction fa) { + static void MAXShortVector256TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short256VectorTests::MAX); + assertArraysEquals(r, a, (short)10, ShortVector256Tests::MAX); } static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void maxShort256VectorTestsWithMemOp(IntFunction fa) { + static void maxShortVector256TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short256VectorTests::max); + assertArraysEquals(r, a, (short)10, ShortVector256Tests::max); } static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXShort256VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXShortVector256TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,7 +3226,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short256VectorTests::MAX); + assertArraysEquals(r, a, (short)10, mask, ShortVector256Tests::MAX); } static short MIN(short a, short b) { @@ -3191,7 +3234,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort256VectorTests(IntFunction fa, IntFunction fb) { + static void MINShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3204,7 +3247,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::MIN); + assertArraysEquals(r, a, b, ShortVector256Tests::MIN); } static short min(short a, short b) { @@ -3212,7 +3255,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort256VectorTests(IntFunction fa, IntFunction fb) { + static void minShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3223,7 +3266,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::min); + assertArraysEquals(r, a, b, ShortVector256Tests::min); } static short MAX(short a, short b) { @@ -3231,7 +3274,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort256VectorTests(IntFunction fa, IntFunction fb) { + static void MAXShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3244,7 +3287,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::MAX); + assertArraysEquals(r, a, b, ShortVector256Tests::MAX); } static short max(short a, short b) { @@ -3252,7 +3295,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maxShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3263,7 +3306,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short256VectorTests::max); + assertArraysEquals(r, a, b, ShortVector256Tests::max); } static short UMIN(short a, short b) { @@ -3271,7 +3314,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMINShort256VectorTests(IntFunction fa, IntFunction fb) { + static void UMINShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3284,11 +3327,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::UMIN); + assertArraysEquals(r, a, b, ShortVector256Tests::UMIN); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMINShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3304,7 +3347,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::UMIN); } static short UMAX(short a, short b) { @@ -3312,7 +3355,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMAXShort256VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3325,11 +3368,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::UMAX); + assertArraysEquals(r, a, b, ShortVector256Tests::UMAX); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMAXShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3345,7 +3388,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::UMAX); } static short SADD(short a, short b) { @@ -3353,7 +3396,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SADDShort256VectorTests(IntFunction fa, IntFunction fb) { + static void SADDShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3366,11 +3409,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::SADD); + assertArraysEquals(r, a, b, ShortVector256Tests::SADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SADDShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3386,7 +3429,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::SADD); } static short SSUB(short a, short b) { @@ -3394,7 +3437,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SSUBShort256VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3407,11 +3450,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::SSUB); + assertArraysEquals(r, a, b, ShortVector256Tests::SSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SSUBShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3427,7 +3470,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::SSUB); } static short SUADD(short a, short b) { @@ -3435,7 +3478,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUADDShort256VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3448,11 +3491,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::SUADD); + assertArraysEquals(r, a, b, ShortVector256Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUADDShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3468,7 +3511,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::SUADD); } static short SUSUB(short a, short b) { @@ -3476,7 +3519,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUSUBShort256VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3489,11 +3532,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::SUSUB); + assertArraysEquals(r, a, b, ShortVector256Tests::SUSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUSUBShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3509,11 +3552,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::SUSUB); } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3566,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::MIN); } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3537,11 +3580,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::min); } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3551,11 +3594,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::MAX); } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3565,10 +3608,10 @@ public class Short256VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short256VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ShortVector256Tests::max); } @Test(dataProvider = "shortSaturatingBinaryOpAssocProvider") - static void SUADDAssocShort256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocShortVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -3585,11 +3628,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Short256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ShortVector256Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3610,7 +3653,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Short256VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ShortVector256Tests::SUADD); } static short ANDReduce(short[] a, int idx) { @@ -3632,7 +3675,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ANDReduceShort256VectorTests(IntFunction fa) { + static void ANDReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3648,7 +3691,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::ANDReduce, Short256VectorTests::ANDReduceAll); + ShortVector256Tests::ANDReduce, ShortVector256Tests::ANDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3656,20 +3699,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = AND_IDENTITY; - Assert.assertEquals((short) (id & id), id, + assertEquals((short) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id & x), x); - Assert.assertEquals((short) (x & id), x); + assertEquals((short) (id & x), x); + assertEquals((short) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id & x), x, + assertEquals((short) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x & id), x, + assertEquals((short) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3694,7 +3737,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ANDReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3712,7 +3755,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::ANDReduceMasked, Short256VectorTests::ANDReduceAllMasked); + ShortVector256Tests::ANDReduceMasked, ShortVector256Tests::ANDReduceAllMasked); } static short ORReduce(short[] a, int idx) { @@ -3734,7 +3777,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ORReduceShort256VectorTests(IntFunction fa) { + static void ORReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3750,7 +3793,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::ORReduce, Short256VectorTests::ORReduceAll); + ShortVector256Tests::ORReduce, ShortVector256Tests::ORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3758,20 +3801,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = OR_IDENTITY; - Assert.assertEquals((short) (id | id), id, + assertEquals((short) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id | x), x); - Assert.assertEquals((short) (x | id), x); + assertEquals((short) (id | x), x); + assertEquals((short) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id | x), x, + assertEquals((short) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x | id), x, + assertEquals((short) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3796,7 +3839,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ORReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3814,7 +3857,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::ORReduceMasked, Short256VectorTests::ORReduceAllMasked); + ShortVector256Tests::ORReduceMasked, ShortVector256Tests::ORReduceAllMasked); } static short XORReduce(short[] a, int idx) { @@ -3836,7 +3879,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void XORReduceShort256VectorTests(IntFunction fa) { + static void XORReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3852,7 +3895,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::XORReduce, Short256VectorTests::XORReduceAll); + ShortVector256Tests::XORReduce, ShortVector256Tests::XORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3860,20 +3903,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = XOR_IDENTITY; - Assert.assertEquals((short) (id ^ id), id, + assertEquals((short) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id ^ x), x); - Assert.assertEquals((short) (x ^ id), x); + assertEquals((short) (id ^ x), x); + assertEquals((short) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id ^ x), x, + assertEquals((short) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x ^ id), x, + assertEquals((short) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3898,7 +3941,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void XORReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3916,7 +3959,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::XORReduceMasked, Short256VectorTests::XORReduceAllMasked); + ShortVector256Tests::XORReduceMasked, ShortVector256Tests::XORReduceAllMasked); } static short ADDReduce(short[] a, int idx) { @@ -3938,7 +3981,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceShort256VectorTests(IntFunction fa) { + static void ADDReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3954,7 +3997,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::ADDReduce, Short256VectorTests::ADDReduceAll); + ShortVector256Tests::ADDReduce, ShortVector256Tests::ADDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3962,20 +4005,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = ADD_IDENTITY; - Assert.assertEquals((short) (id + id), id, + assertEquals((short) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id + x), x); - Assert.assertEquals((short) (x + id), x); + assertEquals((short) (id + x), x); + assertEquals((short) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id + x), x, + assertEquals((short) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x + id), x, + assertEquals((short) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4000,7 +4043,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4018,7 +4061,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::ADDReduceMasked, Short256VectorTests::ADDReduceAllMasked); + ShortVector256Tests::ADDReduceMasked, ShortVector256Tests::ADDReduceAllMasked); } static short MULReduce(short[] a, int idx) { @@ -4040,7 +4083,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MULReduceShort256VectorTests(IntFunction fa) { + static void MULReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4056,7 +4099,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::MULReduce, Short256VectorTests::MULReduceAll); + ShortVector256Tests::MULReduce, ShortVector256Tests::MULReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4064,20 +4107,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MUL_IDENTITY; - Assert.assertEquals((short) (id * id), id, + assertEquals((short) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id * x), x); - Assert.assertEquals((short) (x * id), x); + assertEquals((short) (id * x), x); + assertEquals((short) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id * x), x, + assertEquals((short) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x * id), x, + assertEquals((short) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4102,7 +4145,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MULReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4120,7 +4163,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::MULReduceMasked, Short256VectorTests::MULReduceAllMasked); + ShortVector256Tests::MULReduceMasked, ShortVector256Tests::MULReduceAllMasked); } static short MINReduce(short[] a, int idx) { @@ -4142,7 +4185,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MINReduceShort256VectorTests(IntFunction fa) { + static void MINReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4158,7 +4201,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::MINReduce, Short256VectorTests::MINReduceAll); + ShortVector256Tests::MINReduce, ShortVector256Tests::MINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4166,20 +4209,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MIN_IDENTITY; - Assert.assertEquals((short) Math.min(id, id), id, + assertEquals((short) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.min(id, x), x); - Assert.assertEquals((short) Math.min(x, id), x); + assertEquals((short) Math.min(id, x), x); + assertEquals((short) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.min(id, x), x, + assertEquals((short) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.min(x, id), x, + assertEquals((short) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4204,7 +4247,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4222,7 +4265,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::MINReduceMasked, Short256VectorTests::MINReduceAllMasked); + ShortVector256Tests::MINReduceMasked, ShortVector256Tests::MINReduceAllMasked); } static short MAXReduce(short[] a, int idx) { @@ -4244,7 +4287,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MAXReduceShort256VectorTests(IntFunction fa) { + static void MAXReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4260,7 +4303,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::MAXReduce, Short256VectorTests::MAXReduceAll); + ShortVector256Tests::MAXReduce, ShortVector256Tests::MAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4268,20 +4311,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MAX_IDENTITY; - Assert.assertEquals((short) Math.max(id, id), id, + assertEquals((short) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.max(id, x), x); - Assert.assertEquals((short) Math.max(x, id), x); + assertEquals((short) Math.max(id, x), x); + assertEquals((short) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.max(id, x), x, + assertEquals((short) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.max(x, id), x, + assertEquals((short) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4306,7 +4349,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4324,7 +4367,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::MAXReduceMasked, Short256VectorTests::MAXReduceAllMasked); + ShortVector256Tests::MAXReduceMasked, ShortVector256Tests::MAXReduceAllMasked); } static short UMINReduce(short[] a, int idx) { @@ -4346,7 +4389,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMINReduceShort256VectorTests(IntFunction fa) { + static void UMINReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4362,7 +4405,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::UMINReduce, Short256VectorTests::UMINReduceAll); + ShortVector256Tests::UMINReduce, ShortVector256Tests::UMINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4370,20 +4413,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMIN_IDENTITY; - Assert.assertEquals((short) VectorMath.minUnsigned(id, id), id, + assertEquals((short) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x); + assertEquals((short) VectorMath.minUnsigned(id, x), x); + assertEquals((short) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x, + assertEquals((short) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x, + assertEquals((short) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4408,7 +4451,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMINReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4426,7 +4469,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::UMINReduceMasked, Short256VectorTests::UMINReduceAllMasked); + ShortVector256Tests::UMINReduceMasked, ShortVector256Tests::UMINReduceAllMasked); } static short UMAXReduce(short[] a, int idx) { @@ -4448,7 +4491,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMAXReduceShort256VectorTests(IntFunction fa) { + static void UMAXReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4464,7 +4507,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::UMAXReduce, Short256VectorTests::UMAXReduceAll); + ShortVector256Tests::UMAXReduce, ShortVector256Tests::UMAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4472,20 +4515,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMAX_IDENTITY; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, id), id, + assertEquals((short) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x); + assertEquals((short) VectorMath.maxUnsigned(id, x), x); + assertEquals((short) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x, + assertEquals((short) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x, + assertEquals((short) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4510,7 +4553,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMAXReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4528,7 +4571,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::UMAXReduceMasked, Short256VectorTests::UMAXReduceAllMasked); + ShortVector256Tests::UMAXReduceMasked, ShortVector256Tests::UMAXReduceAllMasked); } static short FIRST_NONZEROReduce(short[] a, int idx) { @@ -4550,7 +4593,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void FIRST_NONZEROReduceShort256VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4566,7 +4609,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::FIRST_NONZEROReduce, Short256VectorTests::FIRST_NONZEROReduceAll); + ShortVector256Tests::FIRST_NONZEROReduce, ShortVector256Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4574,20 +4617,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4612,7 +4655,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void FIRST_NONZEROReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4630,7 +4673,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::FIRST_NONZEROReduceMasked, Short256VectorTests::FIRST_NONZEROReduceAllMasked); + ShortVector256Tests::FIRST_NONZEROReduceMasked, ShortVector256Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4643,7 +4686,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueShort256VectorTests(IntFunction fm) { + static void anyTrueShortVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4654,7 +4697,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short256VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector256Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4667,7 +4710,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueShort256VectorTests(IntFunction fm) { + static void allTrueShortVector256Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4678,7 +4721,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short256VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector256Tests::allTrue); } static short SUADDReduce(short[] a, int idx) { @@ -4700,7 +4743,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingUnaryOpProvider") - static void SUADDReduceShort256VectorTests(IntFunction fa) { + static void SUADDReduceShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4716,7 +4759,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short256VectorTests::SUADDReduce, Short256VectorTests::SUADDReduceAll); + ShortVector256Tests::SUADDReduce, ShortVector256Tests::SUADDReduceAll); } @Test(dataProvider = "shortSaturatingUnaryOpProvider") @@ -4724,20 +4767,20 @@ public class Short256VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = SUADD_IDENTITY; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4761,7 +4804,7 @@ public class Short256VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "shortSaturatingUnaryOpMaskProvider") - static void SUADDReduceShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4779,11 +4822,11 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::SUADDReduceMasked, Short256VectorTests::SUADDReduceAllMasked); + ShortVector256Tests::SUADDReduceMasked, ShortVector256Tests::SUADDReduceAllMasked); } @Test(dataProvider = "shortBinaryOpProvider") - static void withShort256VectorTests(IntFunction fa, IntFunction fb) { + static void withShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -4806,7 +4849,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_DEFAULTShort256VectorTests(IntFunction fa) { + static void IS_DEFAULTShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4816,14 +4859,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_DEFAULTMaskedShort256VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4836,7 +4879,7 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4847,7 +4890,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_NEGATIVEShort256VectorTests(IntFunction fa) { + static void IS_NEGATIVEShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4857,14 +4900,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_NEGATIVEMaskedShort256VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4877,14 +4920,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort256VectorTests(IntFunction fa, IntFunction fb) { + static void LTShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4896,14 +4939,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ltShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4915,14 +4958,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4938,14 +4981,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GTShort256VectorTests(IntFunction fa, IntFunction fb) { + static void GTShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4957,14 +5000,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GTShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4980,14 +5023,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort256VectorTests(IntFunction fa, IntFunction fb) { + static void EQShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4999,14 +5042,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort256VectorTests(IntFunction fa, IntFunction fb) { + static void eqShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5018,14 +5061,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5041,14 +5084,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void NEShort256VectorTests(IntFunction fa, IntFunction fb) { + static void NEShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5060,14 +5103,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void NEShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5083,14 +5126,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LEShort256VectorTests(IntFunction fa, IntFunction fb) { + static void LEShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5102,14 +5145,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LEShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5125,14 +5168,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GEShort256VectorTests(IntFunction fa, IntFunction fb) { + static void GEShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5144,14 +5187,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GEShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5167,14 +5210,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULTShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ULTShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5186,14 +5229,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULTShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5209,14 +5252,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGTShort256VectorTests(IntFunction fa, IntFunction fb) { + static void UGTShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5228,14 +5271,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGTShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5251,14 +5294,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULEShort256VectorTests(IntFunction fa, IntFunction fb) { + static void ULEShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5270,14 +5313,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULEShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5293,14 +5336,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGEShort256VectorTests(IntFunction fa, IntFunction fb) { + static void UGEShortVector256Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5312,14 +5355,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGEShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5335,14 +5378,14 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5372,13 +5415,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5388,13 +5431,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTShortVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5408,13 +5451,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5424,13 +5467,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5444,13 +5487,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5460,13 +5503,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort256VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQShortVector256TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5480,7 +5523,7 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); } } } @@ -5490,7 +5533,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort256VectorTests(IntFunction fa, IntFunction fb, + static void blendShortVector256Tests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5506,11 +5549,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short256VectorTests::blend); + assertArraysEquals(r, a, b, mask, ShortVector256Tests::blend); } @Test(dataProvider = "shortUnaryOpShuffleProvider") - static void RearrangeShort256VectorTests(IntFunction fa, + static void RearrangeShortVector256Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5527,7 +5570,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpShuffleMaskProvider") - static void RearrangeShort256VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeShortVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -5545,7 +5588,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void compressShort256VectorTests(IntFunction fa, + static void compressShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5563,7 +5606,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void expandShort256VectorTests(IntFunction fa, + static void expandShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5581,7 +5624,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void getShort256VectorTests(IntFunction fa) { + static void getShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5737,7 +5780,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastShort256VectorTests(IntFunction fa) { + static void BroadcastShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5751,7 +5794,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZeroShort256VectorTests(IntFunction fa) { + static void ZeroShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5761,7 +5804,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static short[] sliceUnary(short[] a, int origin, int idx) { @@ -5776,7 +5819,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void sliceUnaryShort256VectorTests(IntFunction fa) { + static void sliceUnaryShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5787,7 +5830,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short256VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ShortVector256Tests::sliceUnary); } static short[] sliceBinary(short[] a, short[] b, int origin, int idx) { @@ -5804,7 +5847,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void sliceBinaryShort256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryShortVector256TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5817,7 +5860,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Short256VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ShortVector256Tests::sliceBinary); } static short[] slice(short[] a, short[] b, int origin, boolean[] mask, int idx) { @@ -5834,7 +5877,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void sliceShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5851,7 +5894,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Short256VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ShortVector256Tests::slice); } static short[] unsliceUnary(short[] a, int origin, int idx) { @@ -5868,7 +5911,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void unsliceUnaryShort256VectorTests(IntFunction fa) { + static void unsliceUnaryShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5879,7 +5922,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short256VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ShortVector256Tests::unsliceUnary); } static short[] unsliceBinary(short[] a, short[] b, int origin, int part, int idx) { @@ -5905,7 +5948,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void unsliceBinaryShort256VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryShortVector256TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5919,7 +5962,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Short256VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ShortVector256Tests::unsliceBinary); } static short[] unslice(short[] a, short[] b, int origin, int part, boolean[] mask, int idx) { @@ -5959,7 +6002,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void unsliceShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5976,7 +6019,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Short256VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ShortVector256Tests::unslice); } static short BITWISE_BLEND(short a, short b, short c) { @@ -5988,7 +6031,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6003,11 +6046,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Short256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6020,11 +6063,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Short256VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ShortVector256Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort256VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector256TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6042,11 +6085,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Short256VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6057,11 +6100,11 @@ public class Short256VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6072,11 +6115,11 @@ public class Short256VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6087,11 +6130,11 @@ public class Short256VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short256VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ShortVector256Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort256VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector256TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6102,11 +6145,11 @@ public class Short256VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short256VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector256Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6121,11 +6164,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Short256VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort256VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector256TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Short256VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector256Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort256VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector256TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6170,11 +6213,11 @@ public class Short256VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short256VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector256Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort256VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector256TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6188,7 +6231,7 @@ public class Short256VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Short256VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortVector256Tests::BITWISE_BLEND); } static short NEG(short a) { @@ -6200,7 +6243,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NEGShort256VectorTests(IntFunction fa) { + static void NEGShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6211,11 +6254,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::NEG); + assertArraysEquals(r, a, ShortVector256Tests::NEG); } @Test(dataProvider = "shortUnaryOpProvider") - static void negShort256VectorTests(IntFunction fa) { + static void negShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6226,11 +6269,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::neg); + assertArraysEquals(r, a, ShortVector256Tests::neg); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NEGMaskedShort256VectorTests(IntFunction fa, + static void NEGMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6244,7 +6287,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::NEG); + assertArraysEquals(r, a, mask, ShortVector256Tests::NEG); } static short ABS(short a) { @@ -6256,7 +6299,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ABSShort256VectorTests(IntFunction fa) { + static void ABSShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6267,11 +6310,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::ABS); + assertArraysEquals(r, a, ShortVector256Tests::ABS); } @Test(dataProvider = "shortUnaryOpProvider") - static void absShort256VectorTests(IntFunction fa) { + static void absShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6282,11 +6325,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::abs); + assertArraysEquals(r, a, ShortVector256Tests::abs); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ABSMaskedShort256VectorTests(IntFunction fa, + static void ABSMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6300,7 +6343,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::ABS); + assertArraysEquals(r, a, mask, ShortVector256Tests::ABS); } static short NOT(short a) { @@ -6312,7 +6355,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NOTShort256VectorTests(IntFunction fa) { + static void NOTShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6323,11 +6366,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::NOT); + assertArraysEquals(r, a, ShortVector256Tests::NOT); } @Test(dataProvider = "shortUnaryOpProvider") - static void notShort256VectorTests(IntFunction fa) { + static void notShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6338,11 +6381,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::not); + assertArraysEquals(r, a, ShortVector256Tests::not); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NOTMaskedShort256VectorTests(IntFunction fa, + static void NOTMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6356,7 +6399,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::NOT); + assertArraysEquals(r, a, mask, ShortVector256Tests::NOT); } static short ZOMO(short a) { @@ -6364,7 +6407,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZOMOShort256VectorTests(IntFunction fa) { + static void ZOMOShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6375,11 +6418,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::ZOMO); + assertArraysEquals(r, a, ShortVector256Tests::ZOMO); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ZOMOMaskedShort256VectorTests(IntFunction fa, + static void ZOMOMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6393,7 +6436,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ShortVector256Tests::ZOMO); } static short BIT_COUNT(short a) { @@ -6401,7 +6444,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BIT_COUNTShort256VectorTests(IntFunction fa) { + static void BIT_COUNTShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6412,11 +6455,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ShortVector256Tests::BIT_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void BIT_COUNTMaskedShort256VectorTests(IntFunction fa, + static void BIT_COUNTMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6430,7 +6473,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ShortVector256Tests::BIT_COUNT); } static short TRAILING_ZEROS_COUNT(short a) { @@ -6438,7 +6481,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void TRAILING_ZEROS_COUNTShort256VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6449,11 +6492,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector256Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedShort256VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6467,7 +6510,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector256Tests::TRAILING_ZEROS_COUNT); } static short LEADING_ZEROS_COUNT(short a) { @@ -6475,7 +6518,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LEADING_ZEROS_COUNTShort256VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6486,11 +6529,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector256Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedShort256VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6504,7 +6547,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector256Tests::LEADING_ZEROS_COUNT); } static short REVERSE(short a) { @@ -6512,7 +6555,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSEShort256VectorTests(IntFunction fa) { + static void REVERSEShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6523,11 +6566,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::REVERSE); + assertArraysEquals(r, a, ShortVector256Tests::REVERSE); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSEMaskedShort256VectorTests(IntFunction fa, + static void REVERSEMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6541,7 +6584,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ShortVector256Tests::REVERSE); } static short REVERSE_BYTES(short a) { @@ -6549,7 +6592,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSE_BYTESShort256VectorTests(IntFunction fa) { + static void REVERSE_BYTESShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6560,11 +6603,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ShortVector256Tests::REVERSE_BYTES); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedShort256VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedShortVector256Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6578,7 +6621,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short256VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ShortVector256Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6586,7 +6629,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandShortVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6599,7 +6642,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::band); + assertArraysEquals(r, a, b, ShortVector256Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6607,7 +6650,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maskorShortVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6620,7 +6663,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::bor); + assertArraysEquals(r, a, b, ShortVector256Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6628,7 +6671,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorShortVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6641,7 +6684,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::bxor); + assertArraysEquals(r, a, b, ShortVector256Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6649,7 +6692,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotShortVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6662,7 +6705,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::bandNot); + assertArraysEquals(r, a, b, ShortVector256Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6670,7 +6713,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqShortVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6683,7 +6726,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short256VectorTests::beq); + assertArraysEquals(r, a, b, ShortVector256Tests::beq); } static boolean unot(boolean a) { @@ -6691,7 +6734,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotShort256VectorTests(IntFunction fa) { + static void masknotShortVector256Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6702,7 +6745,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short256VectorTests::unot); + assertArraysEquals(r, a, ShortVector256Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6711,15 +6754,15 @@ public class Short256VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongShort256VectorTests(IntFunction fa) { + static void maskFromToLongShortVector256Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6733,7 +6776,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort256VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltShortVector256TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6743,13 +6786,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort256VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqShortVector256TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6759,13 +6802,13 @@ public class Short256VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortUnaryOpProvider") - static void toIntArrayShort256VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayShortVector256TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6776,7 +6819,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toLongArrayShort256VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayShortVector256TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6787,7 +6830,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toDoubleArrayShort256VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayShortVector256TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6798,7 +6841,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toStringShort256VectorTestsSmokeTest(IntFunction fa) { + static void toStringShortVector256TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6811,7 +6854,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void hashCodeShort256VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeShortVector256TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6844,7 +6887,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceLongShort256VectorTests(IntFunction fa) { + static void ADDReduceLongShortVector256Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6860,7 +6903,7 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Short256VectorTests::ADDReduceLong, Short256VectorTests::ADDReduceAllLong); + ShortVector256Tests::ADDReduceLong, ShortVector256Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(short[] a, int idx, boolean[] mask) { @@ -6883,7 +6926,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceLongShort256VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongShortVector256TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6901,11 +6944,11 @@ public class Short256VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Short256VectorTests::ADDReduceLongMasked, Short256VectorTests::ADDReduceAllLongMasked); + ShortVector256Tests::ADDReduceLongMasked, ShortVector256Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastLongShort256VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongShortVector256TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -6916,7 +6959,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort256VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendShortVector256TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6930,12 +6973,12 @@ public class Short256VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Short256VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector256Tests::blend); } @Test(dataProvider = "shortUnaryOpSelectFromProvider") - static void SelectFromShort256VectorTests(IntFunction fa, + static void SelectFromShortVector256Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); short[] order = fs.apply(a.length, SPECIES.length()); @@ -6951,7 +6994,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorShort256VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorShortVector256Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] idx = fc.apply(SPECIES.length()); @@ -6969,7 +7012,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpSelectFromMaskProvider") - static void SelectFromShort256VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromShortVector256TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -6988,7 +7031,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousShort256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousShortVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6999,12 +7042,12 @@ public class Short256VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringShort256VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringShortVector256TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7018,7 +7061,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsShort256VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsShortVector256TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7027,12 +7070,12 @@ public class Short256VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsShort256VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsShortVector256Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7042,13 +7085,13 @@ public class Short256VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeShort256VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeShortVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7070,7 +7113,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountShort256VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountShortVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7081,7 +7124,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short256VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ShortVector256Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7095,7 +7138,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueShort256VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueShortVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7106,7 +7149,7 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short256VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ShortVector256Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7120,7 +7163,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueShort256VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueShortVector256TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7131,11 +7174,11 @@ public class Short256VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short256VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ShortVector256Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressShort256VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressShortVector256TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7145,7 +7188,7 @@ public class Short256VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7163,7 +7206,7 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeShort256VectorTestsSmokeTest(int offset) { + static void indexInRangeShortVector256TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7171,13 +7214,13 @@ public class Short256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongShort256VectorTestsSmokeTest(int offset) { + static void indexInRangeLongShortVector256TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7185,7 +7228,7 @@ public class Short256VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7204,36 +7247,36 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundShort256VectorTestsSmokeTest(int length) { + static void loopBoundShortVector256TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongShort256VectorTestsSmokeTest(int _length) { + static void loopBoundLongShortVector256TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeShort256VectorTestsSmokeTest() { + static void ElementSizeShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Short.SIZE); + assertEquals(elsize, Short.SIZE); } @Test - static void VectorShapeShort256VectorTestsSmokeTest() { + static void VectorShapeShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_256_BIT)); } @Test - static void ShapeWithLanesShort256VectorTestsSmokeTest() { + static void ShapeWithLanesShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(short.class); @@ -7241,32 +7284,32 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeShort256VectorTestsSmokeTest() { + static void ElementTypeShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementType() == short.class); } @Test - static void SpeciesElementSizeShort256VectorTestsSmokeTest() { + static void SpeciesElementSizeShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementSize() == Short.SIZE); } @Test - static void VectorTypeShort256VectorTestsSmokeTest() { + static void VectorTypeShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesShort256VectorTestsSmokeTest() { + static void WithLanesShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(short.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeShort256VectorTestsSmokeTest() { + static void WithShapeShortVector256TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7274,9 +7317,9 @@ public class Short256VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueShort256VectorTestsSmokeTest() { + static void MaskAllTrueShortVector256TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortVector512LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ShortVector512LoadStoreTests.java index 7a273986bef..74e485e3391 100644 --- a/test/jdk/jdk/incubator/vector/Short512VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector512LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Short512VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ShortVector512LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ShortVector512LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_512; @@ -61,14 +61,29 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(short[] r, short[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "shortProviderForIOOBE") @@ -1114,11 +1129,11 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -1129,11 +1144,11 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); } } @@ -1149,7 +1164,7 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(short[] r, short[] a, int[] indexMap) { @@ -1162,7 +1177,7 @@ public class Short512VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Short512VectorTests.java b/test/jdk/jdk/incubator/vector/ShortVector512Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Short512VectorTests.java rename to test/jdk/jdk/incubator/vector/ShortVector512Tests.java index 722f826f3e9..69dc6d8019f 100644 --- a/test/jdk/jdk/incubator/vector/Short512VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector512Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short512VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortVector512Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Short512VectorTests extends AbstractVectorTest { +public class ShortVector512Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_512; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(short actual, short expected, short delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(short actual, short expected, short delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final short CONST_SHIFT = Short.SIZE / 2; @@ -96,10 +139,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { short[] ref = f.apply(a[i]); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Short512VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Short512VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Short512VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Short512VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Short512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (short)0); + assertEquals(r[i + k], (short)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Short512VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (short)0); + assertEquals(r[i + j], (short)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Short512VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Short512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Short512VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Short512VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Short512VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(r, a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1577,7 +1620,7 @@ public class Short512VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ShortVector a = io.add((short)1); //[1,2] ShortVector b = a.neg(); //[-1,-2] short[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1592,19 +1635,19 @@ public class Short512VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ShortVector uab0 = zab0.rearrange(unz0,zab1); ShortVector uab1 = zab0.rearrange(unz1,zab1); short[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1619,7 +1662,7 @@ public class Short512VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1653,7 +1696,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ADDShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1666,7 +1709,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::ADD); + assertArraysEquals(r, a, b, ShortVector512Tests::ADD); } static short add(short a, short b) { @@ -1674,7 +1717,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort512VectorTests(IntFunction fa, IntFunction fb) { + static void addShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1685,11 +1728,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::add); + assertArraysEquals(r, a, b, ShortVector512Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1705,11 +1748,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1723,7 +1766,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short512VectorTests::add); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::add); } static short SUB(short a, short b) { @@ -1731,7 +1774,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void SUBShort512VectorTests(IntFunction fa, IntFunction fb) { + static void SUBShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1744,7 +1787,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::SUB); + assertArraysEquals(r, a, b, ShortVector512Tests::SUB); } static short sub(short a, short b) { @@ -1752,7 +1795,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort512VectorTests(IntFunction fa, IntFunction fb) { + static void subShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1763,11 +1806,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::sub); + assertArraysEquals(r, a, b, ShortVector512Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void SUBShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1783,11 +1826,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::SUB); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1801,7 +1844,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short512VectorTests::sub); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::sub); } static short MUL(short a, short b) { @@ -1809,7 +1852,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MULShort512VectorTests(IntFunction fa, IntFunction fb) { + static void MULShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1822,7 +1865,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::MUL); + assertArraysEquals(r, a, b, ShortVector512Tests::MUL); } static short mul(short a, short b) { @@ -1830,7 +1873,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort512VectorTests(IntFunction fa, IntFunction fb) { + static void mulShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1841,11 +1884,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::mul); + assertArraysEquals(r, a, b, ShortVector512Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void MULShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1861,11 +1904,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::MUL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1879,7 +1922,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short512VectorTests::mul); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::mul); } static short DIV(short a, short b) { @@ -1887,7 +1930,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void DIVShort512VectorTests(IntFunction fa, IntFunction fb) { + static void DIVShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::DIV); + assertArraysEquals(r, a, b, ShortVector512Tests::DIV); } static short div(short a, short b) { @@ -1910,7 +1953,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort512VectorTests(IntFunction fa, IntFunction fb) { + static void divShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1925,11 +1968,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::div); + assertArraysEquals(r, a, b, ShortVector512Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void DIVShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1947,11 +1990,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::DIV); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1969,7 +2012,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::div); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::div); } static short FIRST_NONZERO(short a, short b) { @@ -1977,7 +2020,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void FIRST_NONZEROShort512VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1990,11 +2033,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ShortVector512Tests::FIRST_NONZERO); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void FIRST_NONZEROShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2010,7 +2053,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::FIRST_NONZERO); } static short AND(short a, short b) { @@ -2018,7 +2061,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ANDShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2031,7 +2074,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::AND); + assertArraysEquals(r, a, b, ShortVector512Tests::AND); } static short and(short a, short b) { @@ -2039,7 +2082,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort512VectorTests(IntFunction fa, IntFunction fb) { + static void andShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2050,11 +2093,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::and); + assertArraysEquals(r, a, b, ShortVector512Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2070,7 +2113,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::AND); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::AND); } static short AND_NOT(short a, short b) { @@ -2078,7 +2121,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void AND_NOTShort512VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2091,11 +2134,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ShortVector512Tests::AND_NOT); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void AND_NOTShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2111,7 +2154,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::AND_NOT); } static short OR(short a, short b) { @@ -2119,7 +2162,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ORShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2132,7 +2175,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::OR); + assertArraysEquals(r, a, b, ShortVector512Tests::OR); } static short or(short a, short b) { @@ -2140,7 +2183,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort512VectorTests(IntFunction fa, IntFunction fb) { + static void orShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2151,11 +2194,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::or); + assertArraysEquals(r, a, b, ShortVector512Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2171,7 +2214,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::OR); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::OR); } static short XOR(short a, short b) { @@ -2179,7 +2222,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void XORShort512VectorTests(IntFunction fa, IntFunction fb) { + static void XORShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2192,11 +2235,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::XOR); + assertArraysEquals(r, a, b, ShortVector512Tests::XOR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void XORShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2212,11 +2255,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::XOR); } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2269,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2243,11 +2286,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector512Tests::add); } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2257,11 +2300,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2274,11 +2317,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector512Tests::sub); } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2288,11 +2331,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2305,11 +2348,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector512Tests::mul); } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2321,11 +2364,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2340,11 +2383,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector512Tests::div); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2354,11 +2397,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2368,11 +2411,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2385,11 +2428,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector512Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2399,11 +2442,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2413,11 +2456,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2430,11 +2473,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector512Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2444,11 +2487,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ShortVector512Tests::OR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2461,11 +2504,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short512VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector512Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDShortVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2475,11 +2518,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ShortVector512Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDShortVector512TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2492,7 +2535,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short512VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector512Tests::ADD); } static short LSHL(short a, short b) { @@ -2500,7 +2543,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2513,11 +2556,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::LSHL); + assertArraysEquals(r, a, b, ShortVector512Tests::LSHL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2533,7 +2576,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::LSHL); } static short ASHR(short a, short b) { @@ -2541,7 +2584,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2554,11 +2597,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::ASHR); + assertArraysEquals(r, a, b, ShortVector512Tests::ASHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2574,7 +2617,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::ASHR); } static short LSHR(short a, short b) { @@ -2582,7 +2625,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort512VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2595,11 +2638,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::LSHR); + assertArraysEquals(r, a, b, ShortVector512Tests::LSHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2615,7 +2658,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::LSHR); } static short LSHL_unary(short a, short b) { @@ -2623,7 +2666,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLShortVector512TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2635,11 +2678,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ShortVector512Tests::LSHL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2654,7 +2697,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector512Tests::LSHL_unary); } static short LSHR_unary(short a, short b) { @@ -2662,7 +2705,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRShortVector512TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2674,11 +2717,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector512Tests::LSHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2693,7 +2736,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector512Tests::LSHR_unary); } static short ASHR_unary(short a, short b) { @@ -2701,7 +2744,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRShortVector512TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2713,11 +2756,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector512Tests::ASHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2732,7 +2775,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector512Tests::ASHR_unary); } static short ROR(short a, short b) { @@ -2740,7 +2783,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort512VectorTests(IntFunction fa, IntFunction fb) { + static void RORShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2753,11 +2796,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::ROR); + assertArraysEquals(r, a, b, ShortVector512Tests::ROR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2773,7 +2816,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::ROR); } static short ROL(short a, short b) { @@ -2781,7 +2824,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ROLShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2794,11 +2837,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::ROL); + assertArraysEquals(r, a, b, ShortVector512Tests::ROL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2814,7 +2857,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::ROL); } static short ROR_unary(short a, short b) { @@ -2822,7 +2865,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORShortVector512TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2834,11 +2877,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ShortVector512Tests::ROR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORShortVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2853,7 +2896,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector512Tests::ROR_unary); } static short ROL_unary(short a, short b) { @@ -2861,7 +2904,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort512VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLShortVector512TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2873,11 +2916,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ShortVector512Tests::ROL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort512VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector512TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2892,14 +2935,14 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector512Tests::ROL_unary); } static short LSHR_binary_const(short a) { return (short)(((a & 0xFFFF) >>> CONST_SHIFT)); } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHRShort512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRShortVector512TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2910,11 +2953,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ShortVector512Tests::LSHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHRShort512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRShortVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2928,7 +2971,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short512VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector512Tests::LSHR_binary_const); } static short LSHL_binary_const(short a) { @@ -2936,7 +2979,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHLShort512VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLShortVector512TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2947,11 +2990,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ShortVector512Tests::LSHL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHLShort512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLShortVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2965,7 +3008,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short512VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector512Tests::LSHL_binary_const); } static short ASHR_binary_const(short a) { @@ -2973,7 +3016,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ASHRShort512VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRShortVector512TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2984,11 +3027,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ShortVector512Tests::ASHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ASHRShort512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRShortVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3002,7 +3045,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short512VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector512Tests::ASHR_binary_const); } static short ROR_binary_const(short a) { @@ -3010,7 +3053,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void RORShort512VectorTestsScalarShiftConst(IntFunction fa) { + static void RORShortVector512TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3021,11 +3064,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ShortVector512Tests::ROR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void RORShort512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORShortVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3039,7 +3082,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short512VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector512Tests::ROR_binary_const); } static short ROL_binary_const(short a) { @@ -3047,7 +3090,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ROLShort512VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLShortVector512TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3058,11 +3101,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ShortVector512Tests::ROL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ROLShort512VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLShortVector512TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3076,14 +3119,14 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short512VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector512Tests::ROL_binary_const); } static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MINShort512VectorTestsWithMemOp(IntFunction fa) { + static void MINShortVector512TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3094,13 +3137,13 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short512VectorTests::MIN); + assertArraysEquals(r, a, (short)10, ShortVector512Tests::MIN); } static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void minShort512VectorTestsWithMemOp(IntFunction fa) { + static void minShortVector512TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3111,13 +3154,13 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short512VectorTests::min); + assertArraysEquals(r, a, (short)10, ShortVector512Tests::min); } static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINShort512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINShortVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3130,13 +3173,13 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short512VectorTests::MIN); + assertArraysEquals(r, a, (short)10, mask, ShortVector512Tests::MIN); } static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MAXShort512VectorTestsWithMemOp(IntFunction fa) { + static void MAXShortVector512TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short512VectorTests::MAX); + assertArraysEquals(r, a, (short)10, ShortVector512Tests::MAX); } static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void maxShort512VectorTestsWithMemOp(IntFunction fa) { + static void maxShortVector512TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short512VectorTests::max); + assertArraysEquals(r, a, (short)10, ShortVector512Tests::max); } static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXShort512VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXShortVector512TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,7 +3226,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short512VectorTests::MAX); + assertArraysEquals(r, a, (short)10, mask, ShortVector512Tests::MAX); } static short MIN(short a, short b) { @@ -3191,7 +3234,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort512VectorTests(IntFunction fa, IntFunction fb) { + static void MINShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3204,7 +3247,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::MIN); + assertArraysEquals(r, a, b, ShortVector512Tests::MIN); } static short min(short a, short b) { @@ -3212,7 +3255,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort512VectorTests(IntFunction fa, IntFunction fb) { + static void minShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3223,7 +3266,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::min); + assertArraysEquals(r, a, b, ShortVector512Tests::min); } static short MAX(short a, short b) { @@ -3231,7 +3274,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort512VectorTests(IntFunction fa, IntFunction fb) { + static void MAXShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3244,7 +3287,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::MAX); + assertArraysEquals(r, a, b, ShortVector512Tests::MAX); } static short max(short a, short b) { @@ -3252,7 +3295,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maxShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3263,7 +3306,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short512VectorTests::max); + assertArraysEquals(r, a, b, ShortVector512Tests::max); } static short UMIN(short a, short b) { @@ -3271,7 +3314,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMINShort512VectorTests(IntFunction fa, IntFunction fb) { + static void UMINShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3284,11 +3327,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::UMIN); + assertArraysEquals(r, a, b, ShortVector512Tests::UMIN); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMINShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3304,7 +3347,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::UMIN); } static short UMAX(short a, short b) { @@ -3312,7 +3355,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMAXShort512VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3325,11 +3368,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::UMAX); + assertArraysEquals(r, a, b, ShortVector512Tests::UMAX); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMAXShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3345,7 +3388,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::UMAX); } static short SADD(short a, short b) { @@ -3353,7 +3396,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SADDShort512VectorTests(IntFunction fa, IntFunction fb) { + static void SADDShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3366,11 +3409,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::SADD); + assertArraysEquals(r, a, b, ShortVector512Tests::SADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SADDShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3386,7 +3429,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::SADD); } static short SSUB(short a, short b) { @@ -3394,7 +3437,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SSUBShort512VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3407,11 +3450,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::SSUB); + assertArraysEquals(r, a, b, ShortVector512Tests::SSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SSUBShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3427,7 +3470,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::SSUB); } static short SUADD(short a, short b) { @@ -3435,7 +3478,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUADDShort512VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3448,11 +3491,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::SUADD); + assertArraysEquals(r, a, b, ShortVector512Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUADDShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3468,7 +3511,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::SUADD); } static short SUSUB(short a, short b) { @@ -3476,7 +3519,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUSUBShort512VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3489,11 +3532,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::SUSUB); + assertArraysEquals(r, a, b, ShortVector512Tests::SUSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUSUBShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3509,11 +3552,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::SUSUB); } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3566,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::MIN); } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3537,11 +3580,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::min); } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3551,11 +3594,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::MAX); } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3565,10 +3608,10 @@ public class Short512VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short512VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ShortVector512Tests::max); } @Test(dataProvider = "shortSaturatingBinaryOpAssocProvider") - static void SUADDAssocShort512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocShortVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -3585,11 +3628,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Short512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ShortVector512Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3610,7 +3653,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Short512VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ShortVector512Tests::SUADD); } static short ANDReduce(short[] a, int idx) { @@ -3632,7 +3675,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ANDReduceShort512VectorTests(IntFunction fa) { + static void ANDReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3648,7 +3691,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::ANDReduce, Short512VectorTests::ANDReduceAll); + ShortVector512Tests::ANDReduce, ShortVector512Tests::ANDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3656,20 +3699,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = AND_IDENTITY; - Assert.assertEquals((short) (id & id), id, + assertEquals((short) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id & x), x); - Assert.assertEquals((short) (x & id), x); + assertEquals((short) (id & x), x); + assertEquals((short) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id & x), x, + assertEquals((short) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x & id), x, + assertEquals((short) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3694,7 +3737,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ANDReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3712,7 +3755,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::ANDReduceMasked, Short512VectorTests::ANDReduceAllMasked); + ShortVector512Tests::ANDReduceMasked, ShortVector512Tests::ANDReduceAllMasked); } static short ORReduce(short[] a, int idx) { @@ -3734,7 +3777,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ORReduceShort512VectorTests(IntFunction fa) { + static void ORReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3750,7 +3793,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::ORReduce, Short512VectorTests::ORReduceAll); + ShortVector512Tests::ORReduce, ShortVector512Tests::ORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3758,20 +3801,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = OR_IDENTITY; - Assert.assertEquals((short) (id | id), id, + assertEquals((short) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id | x), x); - Assert.assertEquals((short) (x | id), x); + assertEquals((short) (id | x), x); + assertEquals((short) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id | x), x, + assertEquals((short) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x | id), x, + assertEquals((short) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3796,7 +3839,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ORReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3814,7 +3857,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::ORReduceMasked, Short512VectorTests::ORReduceAllMasked); + ShortVector512Tests::ORReduceMasked, ShortVector512Tests::ORReduceAllMasked); } static short XORReduce(short[] a, int idx) { @@ -3836,7 +3879,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void XORReduceShort512VectorTests(IntFunction fa) { + static void XORReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3852,7 +3895,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::XORReduce, Short512VectorTests::XORReduceAll); + ShortVector512Tests::XORReduce, ShortVector512Tests::XORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3860,20 +3903,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = XOR_IDENTITY; - Assert.assertEquals((short) (id ^ id), id, + assertEquals((short) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id ^ x), x); - Assert.assertEquals((short) (x ^ id), x); + assertEquals((short) (id ^ x), x); + assertEquals((short) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id ^ x), x, + assertEquals((short) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x ^ id), x, + assertEquals((short) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3898,7 +3941,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void XORReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3916,7 +3959,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::XORReduceMasked, Short512VectorTests::XORReduceAllMasked); + ShortVector512Tests::XORReduceMasked, ShortVector512Tests::XORReduceAllMasked); } static short ADDReduce(short[] a, int idx) { @@ -3938,7 +3981,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceShort512VectorTests(IntFunction fa) { + static void ADDReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3954,7 +3997,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::ADDReduce, Short512VectorTests::ADDReduceAll); + ShortVector512Tests::ADDReduce, ShortVector512Tests::ADDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3962,20 +4005,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = ADD_IDENTITY; - Assert.assertEquals((short) (id + id), id, + assertEquals((short) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id + x), x); - Assert.assertEquals((short) (x + id), x); + assertEquals((short) (id + x), x); + assertEquals((short) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id + x), x, + assertEquals((short) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x + id), x, + assertEquals((short) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4000,7 +4043,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4018,7 +4061,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::ADDReduceMasked, Short512VectorTests::ADDReduceAllMasked); + ShortVector512Tests::ADDReduceMasked, ShortVector512Tests::ADDReduceAllMasked); } static short MULReduce(short[] a, int idx) { @@ -4040,7 +4083,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MULReduceShort512VectorTests(IntFunction fa) { + static void MULReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4056,7 +4099,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::MULReduce, Short512VectorTests::MULReduceAll); + ShortVector512Tests::MULReduce, ShortVector512Tests::MULReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4064,20 +4107,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MUL_IDENTITY; - Assert.assertEquals((short) (id * id), id, + assertEquals((short) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id * x), x); - Assert.assertEquals((short) (x * id), x); + assertEquals((short) (id * x), x); + assertEquals((short) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id * x), x, + assertEquals((short) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x * id), x, + assertEquals((short) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4102,7 +4145,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MULReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4120,7 +4163,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::MULReduceMasked, Short512VectorTests::MULReduceAllMasked); + ShortVector512Tests::MULReduceMasked, ShortVector512Tests::MULReduceAllMasked); } static short MINReduce(short[] a, int idx) { @@ -4142,7 +4185,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MINReduceShort512VectorTests(IntFunction fa) { + static void MINReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4158,7 +4201,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::MINReduce, Short512VectorTests::MINReduceAll); + ShortVector512Tests::MINReduce, ShortVector512Tests::MINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4166,20 +4209,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MIN_IDENTITY; - Assert.assertEquals((short) Math.min(id, id), id, + assertEquals((short) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.min(id, x), x); - Assert.assertEquals((short) Math.min(x, id), x); + assertEquals((short) Math.min(id, x), x); + assertEquals((short) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.min(id, x), x, + assertEquals((short) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.min(x, id), x, + assertEquals((short) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4204,7 +4247,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4222,7 +4265,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::MINReduceMasked, Short512VectorTests::MINReduceAllMasked); + ShortVector512Tests::MINReduceMasked, ShortVector512Tests::MINReduceAllMasked); } static short MAXReduce(short[] a, int idx) { @@ -4244,7 +4287,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MAXReduceShort512VectorTests(IntFunction fa) { + static void MAXReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4260,7 +4303,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::MAXReduce, Short512VectorTests::MAXReduceAll); + ShortVector512Tests::MAXReduce, ShortVector512Tests::MAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4268,20 +4311,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MAX_IDENTITY; - Assert.assertEquals((short) Math.max(id, id), id, + assertEquals((short) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.max(id, x), x); - Assert.assertEquals((short) Math.max(x, id), x); + assertEquals((short) Math.max(id, x), x); + assertEquals((short) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.max(id, x), x, + assertEquals((short) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.max(x, id), x, + assertEquals((short) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4306,7 +4349,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4324,7 +4367,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::MAXReduceMasked, Short512VectorTests::MAXReduceAllMasked); + ShortVector512Tests::MAXReduceMasked, ShortVector512Tests::MAXReduceAllMasked); } static short UMINReduce(short[] a, int idx) { @@ -4346,7 +4389,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMINReduceShort512VectorTests(IntFunction fa) { + static void UMINReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4362,7 +4405,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::UMINReduce, Short512VectorTests::UMINReduceAll); + ShortVector512Tests::UMINReduce, ShortVector512Tests::UMINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4370,20 +4413,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMIN_IDENTITY; - Assert.assertEquals((short) VectorMath.minUnsigned(id, id), id, + assertEquals((short) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x); + assertEquals((short) VectorMath.minUnsigned(id, x), x); + assertEquals((short) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x, + assertEquals((short) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x, + assertEquals((short) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4408,7 +4451,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMINReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4426,7 +4469,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::UMINReduceMasked, Short512VectorTests::UMINReduceAllMasked); + ShortVector512Tests::UMINReduceMasked, ShortVector512Tests::UMINReduceAllMasked); } static short UMAXReduce(short[] a, int idx) { @@ -4448,7 +4491,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMAXReduceShort512VectorTests(IntFunction fa) { + static void UMAXReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4464,7 +4507,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::UMAXReduce, Short512VectorTests::UMAXReduceAll); + ShortVector512Tests::UMAXReduce, ShortVector512Tests::UMAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4472,20 +4515,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMAX_IDENTITY; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, id), id, + assertEquals((short) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x); + assertEquals((short) VectorMath.maxUnsigned(id, x), x); + assertEquals((short) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x, + assertEquals((short) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x, + assertEquals((short) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4510,7 +4553,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMAXReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4528,7 +4571,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::UMAXReduceMasked, Short512VectorTests::UMAXReduceAllMasked); + ShortVector512Tests::UMAXReduceMasked, ShortVector512Tests::UMAXReduceAllMasked); } static short FIRST_NONZEROReduce(short[] a, int idx) { @@ -4550,7 +4593,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void FIRST_NONZEROReduceShort512VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4566,7 +4609,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::FIRST_NONZEROReduce, Short512VectorTests::FIRST_NONZEROReduceAll); + ShortVector512Tests::FIRST_NONZEROReduce, ShortVector512Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4574,20 +4617,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4612,7 +4655,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void FIRST_NONZEROReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4630,7 +4673,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::FIRST_NONZEROReduceMasked, Short512VectorTests::FIRST_NONZEROReduceAllMasked); + ShortVector512Tests::FIRST_NONZEROReduceMasked, ShortVector512Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4643,7 +4686,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueShort512VectorTests(IntFunction fm) { + static void anyTrueShortVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4654,7 +4697,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short512VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector512Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4667,7 +4710,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueShort512VectorTests(IntFunction fm) { + static void allTrueShortVector512Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4678,7 +4721,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short512VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector512Tests::allTrue); } static short SUADDReduce(short[] a, int idx) { @@ -4700,7 +4743,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingUnaryOpProvider") - static void SUADDReduceShort512VectorTests(IntFunction fa) { + static void SUADDReduceShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4716,7 +4759,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short512VectorTests::SUADDReduce, Short512VectorTests::SUADDReduceAll); + ShortVector512Tests::SUADDReduce, ShortVector512Tests::SUADDReduceAll); } @Test(dataProvider = "shortSaturatingUnaryOpProvider") @@ -4724,20 +4767,20 @@ public class Short512VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = SUADD_IDENTITY; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4761,7 +4804,7 @@ public class Short512VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "shortSaturatingUnaryOpMaskProvider") - static void SUADDReduceShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4779,11 +4822,11 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::SUADDReduceMasked, Short512VectorTests::SUADDReduceAllMasked); + ShortVector512Tests::SUADDReduceMasked, ShortVector512Tests::SUADDReduceAllMasked); } @Test(dataProvider = "shortBinaryOpProvider") - static void withShort512VectorTests(IntFunction fa, IntFunction fb) { + static void withShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -4806,7 +4849,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_DEFAULTShort512VectorTests(IntFunction fa) { + static void IS_DEFAULTShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4816,14 +4859,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_DEFAULTMaskedShort512VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4836,7 +4879,7 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4847,7 +4890,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_NEGATIVEShort512VectorTests(IntFunction fa) { + static void IS_NEGATIVEShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4857,14 +4900,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_NEGATIVEMaskedShort512VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4877,14 +4920,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort512VectorTests(IntFunction fa, IntFunction fb) { + static void LTShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4896,14 +4939,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ltShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4915,14 +4958,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4938,14 +4981,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GTShort512VectorTests(IntFunction fa, IntFunction fb) { + static void GTShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4957,14 +5000,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GTShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4980,14 +5023,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort512VectorTests(IntFunction fa, IntFunction fb) { + static void EQShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4999,14 +5042,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort512VectorTests(IntFunction fa, IntFunction fb) { + static void eqShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5018,14 +5061,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5041,14 +5084,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void NEShort512VectorTests(IntFunction fa, IntFunction fb) { + static void NEShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5060,14 +5103,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void NEShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5083,14 +5126,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LEShort512VectorTests(IntFunction fa, IntFunction fb) { + static void LEShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5102,14 +5145,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LEShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5125,14 +5168,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GEShort512VectorTests(IntFunction fa, IntFunction fb) { + static void GEShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5144,14 +5187,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GEShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5167,14 +5210,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULTShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ULTShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5186,14 +5229,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULTShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5209,14 +5252,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGTShort512VectorTests(IntFunction fa, IntFunction fb) { + static void UGTShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5228,14 +5271,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGTShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5251,14 +5294,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULEShort512VectorTests(IntFunction fa, IntFunction fb) { + static void ULEShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5270,14 +5313,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULEShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5293,14 +5336,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGEShort512VectorTests(IntFunction fa, IntFunction fb) { + static void UGEShortVector512Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5312,14 +5355,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGEShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5335,14 +5378,14 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5372,13 +5415,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5388,13 +5431,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTShortVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5408,13 +5451,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5424,13 +5467,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5444,13 +5487,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5460,13 +5503,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQShortVector512TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5480,7 +5523,7 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); } } } @@ -5490,7 +5533,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort512VectorTests(IntFunction fa, IntFunction fb, + static void blendShortVector512Tests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5506,11 +5549,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short512VectorTests::blend); + assertArraysEquals(r, a, b, mask, ShortVector512Tests::blend); } @Test(dataProvider = "shortUnaryOpShuffleProvider") - static void RearrangeShort512VectorTests(IntFunction fa, + static void RearrangeShortVector512Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5527,7 +5570,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpShuffleMaskProvider") - static void RearrangeShort512VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeShortVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -5545,7 +5588,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void compressShort512VectorTests(IntFunction fa, + static void compressShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5563,7 +5606,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void expandShort512VectorTests(IntFunction fa, + static void expandShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5581,7 +5624,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void getShort512VectorTests(IntFunction fa) { + static void getShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5737,7 +5780,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastShort512VectorTests(IntFunction fa) { + static void BroadcastShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5751,7 +5794,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZeroShort512VectorTests(IntFunction fa) { + static void ZeroShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5761,7 +5804,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static short[] sliceUnary(short[] a, int origin, int idx) { @@ -5776,7 +5819,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void sliceUnaryShort512VectorTests(IntFunction fa) { + static void sliceUnaryShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5787,7 +5830,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short512VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ShortVector512Tests::sliceUnary); } static short[] sliceBinary(short[] a, short[] b, int origin, int idx) { @@ -5804,7 +5847,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void sliceBinaryShort512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryShortVector512TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5817,7 +5860,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Short512VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ShortVector512Tests::sliceBinary); } static short[] slice(short[] a, short[] b, int origin, boolean[] mask, int idx) { @@ -5834,7 +5877,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void sliceShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5851,7 +5894,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Short512VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ShortVector512Tests::slice); } static short[] unsliceUnary(short[] a, int origin, int idx) { @@ -5868,7 +5911,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void unsliceUnaryShort512VectorTests(IntFunction fa) { + static void unsliceUnaryShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5879,7 +5922,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short512VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ShortVector512Tests::unsliceUnary); } static short[] unsliceBinary(short[] a, short[] b, int origin, int part, int idx) { @@ -5905,7 +5948,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void unsliceBinaryShort512VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryShortVector512TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5919,7 +5962,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Short512VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ShortVector512Tests::unsliceBinary); } static short[] unslice(short[] a, short[] b, int origin, int part, boolean[] mask, int idx) { @@ -5959,7 +6002,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void unsliceShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5976,7 +6019,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Short512VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ShortVector512Tests::unslice); } static short BITWISE_BLEND(short a, short b, short c) { @@ -5988,7 +6031,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6003,11 +6046,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6020,11 +6063,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ShortVector512Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort512VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector512TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6042,11 +6085,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6057,11 +6100,11 @@ public class Short512VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6072,11 +6115,11 @@ public class Short512VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6087,11 +6130,11 @@ public class Short512VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ShortVector512Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort512VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector512TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6102,11 +6145,11 @@ public class Short512VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector512Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6121,11 +6164,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort512VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector512TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector512Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort512VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector512TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6170,11 +6213,11 @@ public class Short512VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector512Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector512TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6188,7 +6231,7 @@ public class Short512VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortVector512Tests::BITWISE_BLEND); } static short NEG(short a) { @@ -6200,7 +6243,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NEGShort512VectorTests(IntFunction fa) { + static void NEGShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6211,11 +6254,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::NEG); + assertArraysEquals(r, a, ShortVector512Tests::NEG); } @Test(dataProvider = "shortUnaryOpProvider") - static void negShort512VectorTests(IntFunction fa) { + static void negShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6226,11 +6269,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::neg); + assertArraysEquals(r, a, ShortVector512Tests::neg); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NEGMaskedShort512VectorTests(IntFunction fa, + static void NEGMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6244,7 +6287,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::NEG); + assertArraysEquals(r, a, mask, ShortVector512Tests::NEG); } static short ABS(short a) { @@ -6256,7 +6299,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ABSShort512VectorTests(IntFunction fa) { + static void ABSShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6267,11 +6310,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::ABS); + assertArraysEquals(r, a, ShortVector512Tests::ABS); } @Test(dataProvider = "shortUnaryOpProvider") - static void absShort512VectorTests(IntFunction fa) { + static void absShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6282,11 +6325,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::abs); + assertArraysEquals(r, a, ShortVector512Tests::abs); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ABSMaskedShort512VectorTests(IntFunction fa, + static void ABSMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6300,7 +6343,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::ABS); + assertArraysEquals(r, a, mask, ShortVector512Tests::ABS); } static short NOT(short a) { @@ -6312,7 +6355,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NOTShort512VectorTests(IntFunction fa) { + static void NOTShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6323,11 +6366,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::NOT); + assertArraysEquals(r, a, ShortVector512Tests::NOT); } @Test(dataProvider = "shortUnaryOpProvider") - static void notShort512VectorTests(IntFunction fa) { + static void notShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6338,11 +6381,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::not); + assertArraysEquals(r, a, ShortVector512Tests::not); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NOTMaskedShort512VectorTests(IntFunction fa, + static void NOTMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6356,7 +6399,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::NOT); + assertArraysEquals(r, a, mask, ShortVector512Tests::NOT); } static short ZOMO(short a) { @@ -6364,7 +6407,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZOMOShort512VectorTests(IntFunction fa) { + static void ZOMOShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6375,11 +6418,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::ZOMO); + assertArraysEquals(r, a, ShortVector512Tests::ZOMO); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ZOMOMaskedShort512VectorTests(IntFunction fa, + static void ZOMOMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6393,7 +6436,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ShortVector512Tests::ZOMO); } static short BIT_COUNT(short a) { @@ -6401,7 +6444,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BIT_COUNTShort512VectorTests(IntFunction fa) { + static void BIT_COUNTShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6412,11 +6455,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ShortVector512Tests::BIT_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void BIT_COUNTMaskedShort512VectorTests(IntFunction fa, + static void BIT_COUNTMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6430,7 +6473,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ShortVector512Tests::BIT_COUNT); } static short TRAILING_ZEROS_COUNT(short a) { @@ -6438,7 +6481,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void TRAILING_ZEROS_COUNTShort512VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6449,11 +6492,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector512Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedShort512VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6467,7 +6510,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector512Tests::TRAILING_ZEROS_COUNT); } static short LEADING_ZEROS_COUNT(short a) { @@ -6475,7 +6518,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LEADING_ZEROS_COUNTShort512VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6486,11 +6529,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector512Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedShort512VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6504,7 +6547,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector512Tests::LEADING_ZEROS_COUNT); } static short REVERSE(short a) { @@ -6512,7 +6555,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSEShort512VectorTests(IntFunction fa) { + static void REVERSEShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6523,11 +6566,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::REVERSE); + assertArraysEquals(r, a, ShortVector512Tests::REVERSE); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSEMaskedShort512VectorTests(IntFunction fa, + static void REVERSEMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6541,7 +6584,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ShortVector512Tests::REVERSE); } static short REVERSE_BYTES(short a) { @@ -6549,7 +6592,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSE_BYTESShort512VectorTests(IntFunction fa) { + static void REVERSE_BYTESShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6560,11 +6603,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ShortVector512Tests::REVERSE_BYTES); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedShort512VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedShortVector512Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6578,7 +6621,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short512VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ShortVector512Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6586,7 +6629,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandShortVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6599,7 +6642,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::band); + assertArraysEquals(r, a, b, ShortVector512Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6607,7 +6650,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maskorShortVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6620,7 +6663,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::bor); + assertArraysEquals(r, a, b, ShortVector512Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6628,7 +6671,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorShortVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6641,7 +6684,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::bxor); + assertArraysEquals(r, a, b, ShortVector512Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6649,7 +6692,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotShortVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6662,7 +6705,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::bandNot); + assertArraysEquals(r, a, b, ShortVector512Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6670,7 +6713,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqShortVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6683,7 +6726,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short512VectorTests::beq); + assertArraysEquals(r, a, b, ShortVector512Tests::beq); } static boolean unot(boolean a) { @@ -6691,7 +6734,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotShort512VectorTests(IntFunction fa) { + static void masknotShortVector512Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6702,7 +6745,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short512VectorTests::unot); + assertArraysEquals(r, a, ShortVector512Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6711,15 +6754,15 @@ public class Short512VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongShort512VectorTests(IntFunction fa) { + static void maskFromToLongShortVector512Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6733,7 +6776,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort512VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltShortVector512TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6743,13 +6786,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqShortVector512TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6759,13 +6802,13 @@ public class Short512VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortUnaryOpProvider") - static void toIntArrayShort512VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayShortVector512TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6776,7 +6819,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toLongArrayShort512VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayShortVector512TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6787,7 +6830,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toDoubleArrayShort512VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayShortVector512TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6798,7 +6841,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toStringShort512VectorTestsSmokeTest(IntFunction fa) { + static void toStringShortVector512TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6811,7 +6854,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void hashCodeShort512VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeShortVector512TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6844,7 +6887,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceLongShort512VectorTests(IntFunction fa) { + static void ADDReduceLongShortVector512Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6860,7 +6903,7 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Short512VectorTests::ADDReduceLong, Short512VectorTests::ADDReduceAllLong); + ShortVector512Tests::ADDReduceLong, ShortVector512Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(short[] a, int idx, boolean[] mask) { @@ -6883,7 +6926,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceLongShort512VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongShortVector512TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6901,11 +6944,11 @@ public class Short512VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Short512VectorTests::ADDReduceLongMasked, Short512VectorTests::ADDReduceAllLongMasked); + ShortVector512Tests::ADDReduceLongMasked, ShortVector512Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastLongShort512VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongShortVector512TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -6916,7 +6959,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort512VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendShortVector512TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6930,12 +6973,12 @@ public class Short512VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Short512VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector512Tests::blend); } @Test(dataProvider = "shortUnaryOpSelectFromProvider") - static void SelectFromShort512VectorTests(IntFunction fa, + static void SelectFromShortVector512Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); short[] order = fs.apply(a.length, SPECIES.length()); @@ -6951,7 +6994,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorShort512VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorShortVector512Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] idx = fc.apply(SPECIES.length()); @@ -6969,7 +7012,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpSelectFromMaskProvider") - static void SelectFromShort512VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromShortVector512TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -6988,7 +7031,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousShort512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousShortVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6999,12 +7042,12 @@ public class Short512VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringShort512VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringShortVector512TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7018,7 +7061,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsShort512VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsShortVector512TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7027,12 +7070,12 @@ public class Short512VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsShort512VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsShortVector512Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7042,13 +7085,13 @@ public class Short512VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeShort512VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeShortVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7070,7 +7113,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountShort512VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountShortVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7081,7 +7124,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short512VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ShortVector512Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7095,7 +7138,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueShort512VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueShortVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7106,7 +7149,7 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short512VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ShortVector512Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7120,7 +7163,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueShort512VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueShortVector512TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7131,11 +7174,11 @@ public class Short512VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short512VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ShortVector512Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressShort512VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressShortVector512TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7145,7 +7188,7 @@ public class Short512VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7163,7 +7206,7 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeShort512VectorTestsSmokeTest(int offset) { + static void indexInRangeShortVector512TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7171,13 +7214,13 @@ public class Short512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongShort512VectorTestsSmokeTest(int offset) { + static void indexInRangeLongShortVector512TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7185,7 +7228,7 @@ public class Short512VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7204,36 +7247,36 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundShort512VectorTestsSmokeTest(int length) { + static void loopBoundShortVector512TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongShort512VectorTestsSmokeTest(int _length) { + static void loopBoundLongShortVector512TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeShort512VectorTestsSmokeTest() { + static void ElementSizeShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Short.SIZE); + assertEquals(elsize, Short.SIZE); } @Test - static void VectorShapeShort512VectorTestsSmokeTest() { + static void VectorShapeShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_512_BIT)); } @Test - static void ShapeWithLanesShort512VectorTestsSmokeTest() { + static void ShapeWithLanesShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(short.class); @@ -7241,32 +7284,32 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeShort512VectorTestsSmokeTest() { + static void ElementTypeShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementType() == short.class); } @Test - static void SpeciesElementSizeShort512VectorTestsSmokeTest() { + static void SpeciesElementSizeShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementSize() == Short.SIZE); } @Test - static void VectorTypeShort512VectorTestsSmokeTest() { + static void VectorTypeShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesShort512VectorTestsSmokeTest() { + static void WithLanesShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(short.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeShort512VectorTestsSmokeTest() { + static void WithShapeShortVector512TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7274,9 +7317,9 @@ public class Short512VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueShort512VectorTestsSmokeTest() { + static void MaskAllTrueShortVector512TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortVector64LoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ShortVector64LoadStoreTests.java index 952d71c80a6..d48c781886c 100644 --- a/test/jdk/jdk/incubator/vector/Short64VectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector64LoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation - * @run testng/othervm -XX:-TieredCompilation Short64VectorLoadStoreTests + * @run testng/othervm -XX:-TieredCompilation ShortVector64LoadStoreTests * */ @@ -50,7 +50,7 @@ import java.util.List; import java.util.function.*; @Test -public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ShortVector64LoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_64; @@ -61,14 +61,29 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 64); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(short[] r, short[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); } } @@ -322,7 +337,7 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "shortProviderForIOOBE") @@ -1114,11 +1129,11 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -1129,11 +1144,11 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); } } @@ -1149,7 +1164,7 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(short[] r, short[] a, int[] indexMap) { @@ -1162,7 +1177,7 @@ public class Short64VectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/Short64VectorTests.java b/test/jdk/jdk/incubator/vector/ShortVector64Tests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/Short64VectorTests.java rename to test/jdk/jdk/incubator/vector/ShortVector64Tests.java index 9ec8ac08789..dd9f7125853 100644 --- a/test/jdk/jdk/incubator/vector/Short64VectorTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVector64Tests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation Short64VectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortVector64Tests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class Short64VectorTests extends AbstractVectorTest { +public class ShortVector64Tests extends AbstractVectorTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_64; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(short actual, short expected, short delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(short actual, short expected, short delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + private static final short CONST_SHIFT = Short.SIZE / 2; @@ -96,10 +139,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -111,13 +154,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { short[] ref = f.apply(a[i]); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -127,10 +170,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -146,13 +189,13 @@ public class Short64VectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -168,13 +211,13 @@ public class Short64VectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -190,13 +233,13 @@ public class Short64VectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -212,13 +255,13 @@ public class Short64VectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -230,10 +273,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -245,10 +288,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -257,12 +300,12 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -273,20 +316,20 @@ public class Short64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (short)0); + assertEquals(r[i + k], (short)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -298,19 +341,19 @@ public class Short64VectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (short)0); + assertEquals(r[i + j], (short)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -326,11 +369,11 @@ public class Short64VectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -339,12 +382,12 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -354,17 +397,17 @@ public class Short64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -374,17 +417,17 @@ public class Short64VectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -398,10 +441,10 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -413,10 +456,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -428,10 +471,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -452,18 +495,18 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -478,18 +521,18 @@ public class Short64VectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -497,10 +540,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -508,10 +551,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -519,10 +562,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -531,10 +574,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -547,10 +590,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -562,10 +605,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -577,10 +620,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -595,10 +638,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -611,11 +654,11 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -629,11 +672,11 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -655,11 +698,11 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -673,11 +716,11 @@ public class Short64VectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -697,10 +740,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -712,10 +755,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -724,10 +767,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -737,10 +780,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -756,11 +799,11 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -777,11 +820,11 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -792,11 +835,11 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -813,11 +856,11 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -835,13 +878,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -862,13 +905,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -883,13 +926,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(r, a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -910,13 +953,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -930,13 +973,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -951,13 +994,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -972,13 +1015,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -994,13 +1037,13 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1013,10 +1056,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1026,10 +1069,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1037,10 +1080,10 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1577,7 +1620,7 @@ public class Short64VectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ShortVector a = io.add((short)1); //[1,2] ShortVector b = a.neg(); //[-1,-2] short[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1592,19 +1635,19 @@ public class Short64VectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ShortVector uab0 = zab0.rearrange(unz0,zab1); ShortVector uab1 = zab0.rearrange(unz1,zab1); short[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1619,7 +1662,7 @@ public class Short64VectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1653,7 +1696,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ADDShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1666,7 +1709,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::ADD); + assertArraysEquals(r, a, b, ShortVector64Tests::ADD); } static short add(short a, short b) { @@ -1674,7 +1717,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort64VectorTests(IntFunction fa, IntFunction fb) { + static void addShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1685,11 +1728,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::add); + assertArraysEquals(r, a, b, ShortVector64Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1705,11 +1748,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::ADD); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void addShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1723,7 +1766,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short64VectorTests::add); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::add); } static short SUB(short a, short b) { @@ -1731,7 +1774,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void SUBShort64VectorTests(IntFunction fa, IntFunction fb) { + static void SUBShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1744,7 +1787,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::SUB); + assertArraysEquals(r, a, b, ShortVector64Tests::SUB); } static short sub(short a, short b) { @@ -1752,7 +1795,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort64VectorTests(IntFunction fa, IntFunction fb) { + static void subShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1763,11 +1806,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::sub); + assertArraysEquals(r, a, b, ShortVector64Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void SUBShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1783,11 +1826,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::SUB); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::SUB); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void subShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1801,7 +1844,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short64VectorTests::sub); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::sub); } static short MUL(short a, short b) { @@ -1809,7 +1852,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MULShort64VectorTests(IntFunction fa, IntFunction fb) { + static void MULShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1822,7 +1865,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::MUL); + assertArraysEquals(r, a, b, ShortVector64Tests::MUL); } static short mul(short a, short b) { @@ -1830,7 +1873,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort64VectorTests(IntFunction fa, IntFunction fb) { + static void mulShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1841,11 +1884,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::mul); + assertArraysEquals(r, a, b, ShortVector64Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void MULShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1861,11 +1904,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::MUL); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::MUL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1879,7 +1922,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, Short64VectorTests::mul); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::mul); } static short DIV(short a, short b) { @@ -1887,7 +1930,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void DIVShort64VectorTests(IntFunction fa, IntFunction fb) { + static void DIVShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1902,7 +1945,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::DIV); + assertArraysEquals(r, a, b, ShortVector64Tests::DIV); } static short div(short a, short b) { @@ -1910,7 +1953,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort64VectorTests(IntFunction fa, IntFunction fb) { + static void divShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1925,11 +1968,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::div); + assertArraysEquals(r, a, b, ShortVector64Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void DIVShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1947,11 +1990,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::DIV); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::DIV); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void divShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1969,7 +2012,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::div); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::div); } static short FIRST_NONZERO(short a, short b) { @@ -1977,7 +2020,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void FIRST_NONZEROShort64VectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1990,11 +2033,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ShortVector64Tests::FIRST_NONZERO); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void FIRST_NONZEROShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2010,7 +2053,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::FIRST_NONZERO); } static short AND(short a, short b) { @@ -2018,7 +2061,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ANDShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2031,7 +2074,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::AND); + assertArraysEquals(r, a, b, ShortVector64Tests::AND); } static short and(short a, short b) { @@ -2039,7 +2082,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort64VectorTests(IntFunction fa, IntFunction fb) { + static void andShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2050,11 +2093,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::and); + assertArraysEquals(r, a, b, ShortVector64Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2070,7 +2113,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::AND); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::AND); } static short AND_NOT(short a, short b) { @@ -2078,7 +2121,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void AND_NOTShort64VectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2091,11 +2134,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, ShortVector64Tests::AND_NOT); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void AND_NOTShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2111,7 +2154,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::AND_NOT); } static short OR(short a, short b) { @@ -2119,7 +2162,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ORShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2132,7 +2175,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::OR); + assertArraysEquals(r, a, b, ShortVector64Tests::OR); } static short or(short a, short b) { @@ -2140,7 +2183,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort64VectorTests(IntFunction fa, IntFunction fb) { + static void orShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2151,11 +2194,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::or); + assertArraysEquals(r, a, b, ShortVector64Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2171,7 +2214,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::OR); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::OR); } static short XOR(short a, short b) { @@ -2179,7 +2222,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void XORShort64VectorTests(IntFunction fa, IntFunction fb) { + static void XORShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2192,11 +2235,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::XOR); + assertArraysEquals(r, a, b, ShortVector64Tests::XOR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void XORShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2212,11 +2255,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::XOR); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::XOR); } @Test(dataProvider = "shortBinaryOpProvider") - static void addShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2226,11 +2269,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2243,11 +2286,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short64VectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector64Tests::add); } @Test(dataProvider = "shortBinaryOpProvider") - static void subShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2257,11 +2300,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2274,11 +2317,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short64VectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector64Tests::sub); } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2288,11 +2331,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2305,11 +2348,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short64VectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector64Tests::mul); } @Test(dataProvider = "shortBinaryOpProvider") - static void divShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2321,11 +2364,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2340,11 +2383,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short64VectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector64Tests::div); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2354,11 +2397,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void orShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2368,11 +2411,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::or); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2385,11 +2428,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short64VectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector64Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2399,11 +2442,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void andShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2413,11 +2456,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::and); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2430,11 +2473,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, Short64VectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ShortVector64Tests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShort64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2444,11 +2487,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ShortVector64Tests::OR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShort64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2461,11 +2504,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short64VectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector64Tests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShort64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDShortVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2475,11 +2518,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, Short64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ShortVector64Tests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShort64VectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDShortVector64TestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2492,7 +2535,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, Short64VectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector64Tests::ADD); } static short LSHL(short a, short b) { @@ -2500,7 +2543,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHLShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2513,11 +2556,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::LSHL); + assertArraysEquals(r, a, b, ShortVector64Tests::LSHL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2533,7 +2576,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::LSHL); } static short ASHR(short a, short b) { @@ -2541,7 +2584,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ASHRShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2554,11 +2597,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::ASHR); + assertArraysEquals(r, a, b, ShortVector64Tests::ASHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2574,7 +2617,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::ASHR); } static short LSHR(short a, short b) { @@ -2582,7 +2625,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort64VectorTests(IntFunction fa, IntFunction fb) { + static void LSHRShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2595,11 +2638,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::LSHR); + assertArraysEquals(r, a, b, ShortVector64Tests::LSHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2615,7 +2658,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::LSHR); } static short LSHL_unary(short a, short b) { @@ -2623,7 +2666,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShort64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLShortVector64TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2635,11 +2678,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ShortVector64Tests::LSHL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShort64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2654,7 +2697,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector64Tests::LSHL_unary); } static short LSHR_unary(short a, short b) { @@ -2662,7 +2705,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShort64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRShortVector64TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2674,11 +2717,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector64Tests::LSHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShort64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2693,7 +2736,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector64Tests::LSHR_unary); } static short ASHR_unary(short a, short b) { @@ -2701,7 +2744,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShort64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRShortVector64TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2713,11 +2756,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ShortVector64Tests::ASHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShort64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2732,7 +2775,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector64Tests::ASHR_unary); } static short ROR(short a, short b) { @@ -2740,7 +2783,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort64VectorTests(IntFunction fa, IntFunction fb) { + static void RORShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2753,11 +2796,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::ROR); + assertArraysEquals(r, a, b, ShortVector64Tests::ROR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2773,7 +2816,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::ROR); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::ROR); } static short ROL(short a, short b) { @@ -2781,7 +2824,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ROLShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2794,11 +2837,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::ROL); + assertArraysEquals(r, a, b, ShortVector64Tests::ROL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2814,7 +2857,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::ROL); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::ROL); } static short ROR_unary(short a, short b) { @@ -2822,7 +2865,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShort64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORShortVector64TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2834,11 +2877,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ShortVector64Tests::ROR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShort64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORShortVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2853,7 +2896,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector64Tests::ROR_unary); } static short ROL_unary(short a, short b) { @@ -2861,7 +2904,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShort64VectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLShortVector64TestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2873,11 +2916,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, Short64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ShortVector64Tests::ROL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShort64VectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLShortVector64TestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2892,14 +2935,14 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, Short64VectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVector64Tests::ROL_unary); } static short LSHR_binary_const(short a) { return (short)(((a & 0xFFFF) >>> CONST_SHIFT)); } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHRShort64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRShortVector64TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2910,11 +2953,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ShortVector64Tests::LSHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHRShort64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRShortVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2928,7 +2971,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short64VectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector64Tests::LSHR_binary_const); } static short LSHL_binary_const(short a) { @@ -2936,7 +2979,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHLShort64VectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLShortVector64TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2947,11 +2990,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ShortVector64Tests::LSHL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHLShort64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLShortVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2965,7 +3008,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short64VectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector64Tests::LSHL_binary_const); } static short ASHR_binary_const(short a) { @@ -2973,7 +3016,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ASHRShort64VectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRShortVector64TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2984,11 +3027,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ShortVector64Tests::ASHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ASHRShort64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRShortVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3002,7 +3045,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short64VectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector64Tests::ASHR_binary_const); } static short ROR_binary_const(short a) { @@ -3010,7 +3053,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void RORShort64VectorTestsScalarShiftConst(IntFunction fa) { + static void RORShortVector64TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3021,11 +3064,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ShortVector64Tests::ROR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void RORShort64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORShortVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3039,7 +3082,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short64VectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector64Tests::ROR_binary_const); } static short ROL_binary_const(short a) { @@ -3047,7 +3090,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ROLShort64VectorTestsScalarShiftConst(IntFunction fa) { + static void ROLShortVector64TestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3058,11 +3101,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, Short64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ShortVector64Tests::ROL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ROLShort64VectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLShortVector64TestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3076,14 +3119,14 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, Short64VectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVector64Tests::ROL_binary_const); } static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MINShort64VectorTestsWithMemOp(IntFunction fa) { + static void MINShortVector64TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3094,13 +3137,13 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short64VectorTests::MIN); + assertArraysEquals(r, a, (short)10, ShortVector64Tests::MIN); } static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void minShort64VectorTestsWithMemOp(IntFunction fa) { + static void minShortVector64TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3111,13 +3154,13 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short64VectorTests::min); + assertArraysEquals(r, a, (short)10, ShortVector64Tests::min); } static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINShort64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINShortVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3130,13 +3173,13 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short64VectorTests::MIN); + assertArraysEquals(r, a, (short)10, mask, ShortVector64Tests::MIN); } static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MAXShort64VectorTestsWithMemOp(IntFunction fa) { + static void MAXShortVector64TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3147,13 +3190,13 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short64VectorTests::MAX); + assertArraysEquals(r, a, (short)10, ShortVector64Tests::MAX); } static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void maxShort64VectorTestsWithMemOp(IntFunction fa) { + static void maxShortVector64TestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3164,13 +3207,13 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, Short64VectorTests::max); + assertArraysEquals(r, a, (short)10, ShortVector64Tests::max); } static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXShort64VectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXShortVector64TestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3183,7 +3226,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, Short64VectorTests::MAX); + assertArraysEquals(r, a, (short)10, mask, ShortVector64Tests::MAX); } static short MIN(short a, short b) { @@ -3191,7 +3234,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort64VectorTests(IntFunction fa, IntFunction fb) { + static void MINShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3204,7 +3247,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::MIN); + assertArraysEquals(r, a, b, ShortVector64Tests::MIN); } static short min(short a, short b) { @@ -3212,7 +3255,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort64VectorTests(IntFunction fa, IntFunction fb) { + static void minShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3223,7 +3266,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::min); + assertArraysEquals(r, a, b, ShortVector64Tests::min); } static short MAX(short a, short b) { @@ -3231,7 +3274,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort64VectorTests(IntFunction fa, IntFunction fb) { + static void MAXShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3244,7 +3287,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::MAX); + assertArraysEquals(r, a, b, ShortVector64Tests::MAX); } static short max(short a, short b) { @@ -3252,7 +3295,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maxShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3263,7 +3306,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, Short64VectorTests::max); + assertArraysEquals(r, a, b, ShortVector64Tests::max); } static short UMIN(short a, short b) { @@ -3271,7 +3314,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMINShort64VectorTests(IntFunction fa, IntFunction fb) { + static void UMINShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3284,11 +3327,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::UMIN); + assertArraysEquals(r, a, b, ShortVector64Tests::UMIN); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMINShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3304,7 +3347,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::UMIN); } static short UMAX(short a, short b) { @@ -3312,7 +3355,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMAXShort64VectorTests(IntFunction fa, IntFunction fb) { + static void UMAXShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3325,11 +3368,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::UMAX); + assertArraysEquals(r, a, b, ShortVector64Tests::UMAX); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMAXShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3345,7 +3388,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::UMAX); } static short SADD(short a, short b) { @@ -3353,7 +3396,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SADDShort64VectorTests(IntFunction fa, IntFunction fb) { + static void SADDShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3366,11 +3409,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::SADD); + assertArraysEquals(r, a, b, ShortVector64Tests::SADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SADDShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3386,7 +3429,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::SADD); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::SADD); } static short SSUB(short a, short b) { @@ -3394,7 +3437,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SSUBShort64VectorTests(IntFunction fa, IntFunction fb) { + static void SSUBShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3407,11 +3450,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::SSUB); + assertArraysEquals(r, a, b, ShortVector64Tests::SSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SSUBShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3427,7 +3470,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::SSUB); } static short SUADD(short a, short b) { @@ -3435,7 +3478,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUADDShort64VectorTests(IntFunction fa, IntFunction fb) { + static void SUADDShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3448,11 +3491,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::SUADD); + assertArraysEquals(r, a, b, ShortVector64Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUADDShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3468,7 +3511,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::SUADD); } static short SUSUB(short a, short b) { @@ -3476,7 +3519,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUSUBShort64VectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3489,11 +3532,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::SUSUB); + assertArraysEquals(r, a, b, ShortVector64Tests::SUSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUSUBShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3509,11 +3552,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::SUSUB); } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3523,11 +3566,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::MIN); } @Test(dataProvider = "shortBinaryOpProvider") - static void minShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3537,11 +3580,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::min); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::min); } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3551,11 +3594,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::MAX); } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3565,10 +3608,10 @@ public class Short64VectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, Short64VectorTests::max); + assertBroadcastArraysEquals(r, a, b, ShortVector64Tests::max); } @Test(dataProvider = "shortSaturatingBinaryOpAssocProvider") - static void SUADDAssocShort64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocShortVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -3585,11 +3628,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, Short64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ShortVector64Tests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3610,7 +3653,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, Short64VectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ShortVector64Tests::SUADD); } static short ANDReduce(short[] a, int idx) { @@ -3632,7 +3675,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ANDReduceShort64VectorTests(IntFunction fa) { + static void ANDReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3648,7 +3691,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::ANDReduce, Short64VectorTests::ANDReduceAll); + ShortVector64Tests::ANDReduce, ShortVector64Tests::ANDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3656,20 +3699,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = AND_IDENTITY; - Assert.assertEquals((short) (id & id), id, + assertEquals((short) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id & x), x); - Assert.assertEquals((short) (x & id), x); + assertEquals((short) (id & x), x); + assertEquals((short) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id & x), x, + assertEquals((short) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x & id), x, + assertEquals((short) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3694,7 +3737,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ANDReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3712,7 +3755,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::ANDReduceMasked, Short64VectorTests::ANDReduceAllMasked); + ShortVector64Tests::ANDReduceMasked, ShortVector64Tests::ANDReduceAllMasked); } static short ORReduce(short[] a, int idx) { @@ -3734,7 +3777,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ORReduceShort64VectorTests(IntFunction fa) { + static void ORReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3750,7 +3793,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::ORReduce, Short64VectorTests::ORReduceAll); + ShortVector64Tests::ORReduce, ShortVector64Tests::ORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3758,20 +3801,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = OR_IDENTITY; - Assert.assertEquals((short) (id | id), id, + assertEquals((short) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id | x), x); - Assert.assertEquals((short) (x | id), x); + assertEquals((short) (id | x), x); + assertEquals((short) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id | x), x, + assertEquals((short) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x | id), x, + assertEquals((short) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3796,7 +3839,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ORReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3814,7 +3857,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::ORReduceMasked, Short64VectorTests::ORReduceAllMasked); + ShortVector64Tests::ORReduceMasked, ShortVector64Tests::ORReduceAllMasked); } static short XORReduce(short[] a, int idx) { @@ -3836,7 +3879,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void XORReduceShort64VectorTests(IntFunction fa) { + static void XORReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3852,7 +3895,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::XORReduce, Short64VectorTests::XORReduceAll); + ShortVector64Tests::XORReduce, ShortVector64Tests::XORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3860,20 +3903,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = XOR_IDENTITY; - Assert.assertEquals((short) (id ^ id), id, + assertEquals((short) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id ^ x), x); - Assert.assertEquals((short) (x ^ id), x); + assertEquals((short) (id ^ x), x); + assertEquals((short) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id ^ x), x, + assertEquals((short) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x ^ id), x, + assertEquals((short) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3898,7 +3941,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void XORReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3916,7 +3959,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::XORReduceMasked, Short64VectorTests::XORReduceAllMasked); + ShortVector64Tests::XORReduceMasked, ShortVector64Tests::XORReduceAllMasked); } static short ADDReduce(short[] a, int idx) { @@ -3938,7 +3981,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceShort64VectorTests(IntFunction fa) { + static void ADDReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3954,7 +3997,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::ADDReduce, Short64VectorTests::ADDReduceAll); + ShortVector64Tests::ADDReduce, ShortVector64Tests::ADDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3962,20 +4005,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = ADD_IDENTITY; - Assert.assertEquals((short) (id + id), id, + assertEquals((short) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id + x), x); - Assert.assertEquals((short) (x + id), x); + assertEquals((short) (id + x), x); + assertEquals((short) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id + x), x, + assertEquals((short) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x + id), x, + assertEquals((short) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4000,7 +4043,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4018,7 +4061,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::ADDReduceMasked, Short64VectorTests::ADDReduceAllMasked); + ShortVector64Tests::ADDReduceMasked, ShortVector64Tests::ADDReduceAllMasked); } static short MULReduce(short[] a, int idx) { @@ -4040,7 +4083,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MULReduceShort64VectorTests(IntFunction fa) { + static void MULReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4056,7 +4099,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::MULReduce, Short64VectorTests::MULReduceAll); + ShortVector64Tests::MULReduce, ShortVector64Tests::MULReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4064,20 +4107,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MUL_IDENTITY; - Assert.assertEquals((short) (id * id), id, + assertEquals((short) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id * x), x); - Assert.assertEquals((short) (x * id), x); + assertEquals((short) (id * x), x); + assertEquals((short) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id * x), x, + assertEquals((short) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x * id), x, + assertEquals((short) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4102,7 +4145,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MULReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4120,7 +4163,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::MULReduceMasked, Short64VectorTests::MULReduceAllMasked); + ShortVector64Tests::MULReduceMasked, ShortVector64Tests::MULReduceAllMasked); } static short MINReduce(short[] a, int idx) { @@ -4142,7 +4185,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MINReduceShort64VectorTests(IntFunction fa) { + static void MINReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4158,7 +4201,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::MINReduce, Short64VectorTests::MINReduceAll); + ShortVector64Tests::MINReduce, ShortVector64Tests::MINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4166,20 +4209,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MIN_IDENTITY; - Assert.assertEquals((short) Math.min(id, id), id, + assertEquals((short) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.min(id, x), x); - Assert.assertEquals((short) Math.min(x, id), x); + assertEquals((short) Math.min(id, x), x); + assertEquals((short) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.min(id, x), x, + assertEquals((short) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.min(x, id), x, + assertEquals((short) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4204,7 +4247,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4222,7 +4265,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::MINReduceMasked, Short64VectorTests::MINReduceAllMasked); + ShortVector64Tests::MINReduceMasked, ShortVector64Tests::MINReduceAllMasked); } static short MAXReduce(short[] a, int idx) { @@ -4244,7 +4287,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MAXReduceShort64VectorTests(IntFunction fa) { + static void MAXReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4260,7 +4303,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::MAXReduce, Short64VectorTests::MAXReduceAll); + ShortVector64Tests::MAXReduce, ShortVector64Tests::MAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4268,20 +4311,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MAX_IDENTITY; - Assert.assertEquals((short) Math.max(id, id), id, + assertEquals((short) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.max(id, x), x); - Assert.assertEquals((short) Math.max(x, id), x); + assertEquals((short) Math.max(id, x), x); + assertEquals((short) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.max(id, x), x, + assertEquals((short) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.max(x, id), x, + assertEquals((short) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4306,7 +4349,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4324,7 +4367,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::MAXReduceMasked, Short64VectorTests::MAXReduceAllMasked); + ShortVector64Tests::MAXReduceMasked, ShortVector64Tests::MAXReduceAllMasked); } static short UMINReduce(short[] a, int idx) { @@ -4346,7 +4389,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMINReduceShort64VectorTests(IntFunction fa) { + static void UMINReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4362,7 +4405,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::UMINReduce, Short64VectorTests::UMINReduceAll); + ShortVector64Tests::UMINReduce, ShortVector64Tests::UMINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4370,20 +4413,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMIN_IDENTITY; - Assert.assertEquals((short) VectorMath.minUnsigned(id, id), id, + assertEquals((short) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x); + assertEquals((short) VectorMath.minUnsigned(id, x), x); + assertEquals((short) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x, + assertEquals((short) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x, + assertEquals((short) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4408,7 +4451,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMINReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4426,7 +4469,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::UMINReduceMasked, Short64VectorTests::UMINReduceAllMasked); + ShortVector64Tests::UMINReduceMasked, ShortVector64Tests::UMINReduceAllMasked); } static short UMAXReduce(short[] a, int idx) { @@ -4448,7 +4491,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMAXReduceShort64VectorTests(IntFunction fa) { + static void UMAXReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4464,7 +4507,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::UMAXReduce, Short64VectorTests::UMAXReduceAll); + ShortVector64Tests::UMAXReduce, ShortVector64Tests::UMAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4472,20 +4515,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMAX_IDENTITY; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, id), id, + assertEquals((short) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x); + assertEquals((short) VectorMath.maxUnsigned(id, x), x); + assertEquals((short) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x, + assertEquals((short) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x, + assertEquals((short) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4510,7 +4553,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMAXReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4528,7 +4571,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::UMAXReduceMasked, Short64VectorTests::UMAXReduceAllMasked); + ShortVector64Tests::UMAXReduceMasked, ShortVector64Tests::UMAXReduceAllMasked); } static short FIRST_NONZEROReduce(short[] a, int idx) { @@ -4550,7 +4593,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void FIRST_NONZEROReduceShort64VectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4566,7 +4609,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::FIRST_NONZEROReduce, Short64VectorTests::FIRST_NONZEROReduceAll); + ShortVector64Tests::FIRST_NONZEROReduce, ShortVector64Tests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4574,20 +4617,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4612,7 +4655,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void FIRST_NONZEROReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4630,7 +4673,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::FIRST_NONZEROReduceMasked, Short64VectorTests::FIRST_NONZEROReduceAllMasked); + ShortVector64Tests::FIRST_NONZEROReduceMasked, ShortVector64Tests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4643,7 +4686,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueShort64VectorTests(IntFunction fm) { + static void anyTrueShortVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4654,7 +4697,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short64VectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector64Tests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4667,7 +4710,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueShort64VectorTests(IntFunction fm) { + static void allTrueShortVector64Tests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4678,7 +4721,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, Short64VectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ShortVector64Tests::allTrue); } static short SUADDReduce(short[] a, int idx) { @@ -4700,7 +4743,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingUnaryOpProvider") - static void SUADDReduceShort64VectorTests(IntFunction fa) { + static void SUADDReduceShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4716,7 +4759,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - Short64VectorTests::SUADDReduce, Short64VectorTests::SUADDReduceAll); + ShortVector64Tests::SUADDReduce, ShortVector64Tests::SUADDReduceAll); } @Test(dataProvider = "shortSaturatingUnaryOpProvider") @@ -4724,20 +4767,20 @@ public class Short64VectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = SUADD_IDENTITY; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4761,7 +4804,7 @@ public class Short64VectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "shortSaturatingUnaryOpMaskProvider") - static void SUADDReduceShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4779,11 +4822,11 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::SUADDReduceMasked, Short64VectorTests::SUADDReduceAllMasked); + ShortVector64Tests::SUADDReduceMasked, ShortVector64Tests::SUADDReduceAllMasked); } @Test(dataProvider = "shortBinaryOpProvider") - static void withShort64VectorTests(IntFunction fa, IntFunction fb) { + static void withShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -4806,7 +4849,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_DEFAULTShort64VectorTests(IntFunction fa) { + static void IS_DEFAULTShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4816,14 +4859,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_DEFAULTMaskedShort64VectorTests(IntFunction fa, + static void IS_DEFAULTMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4836,7 +4879,7 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4847,7 +4890,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_NEGATIVEShort64VectorTests(IntFunction fa) { + static void IS_NEGATIVEShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4857,14 +4900,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_NEGATIVEMaskedShort64VectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4877,14 +4920,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort64VectorTests(IntFunction fa, IntFunction fb) { + static void LTShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4896,14 +4939,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ltShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4915,14 +4958,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4938,14 +4981,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GTShort64VectorTests(IntFunction fa, IntFunction fb) { + static void GTShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4957,14 +5000,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GTShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4980,14 +5023,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort64VectorTests(IntFunction fa, IntFunction fb) { + static void EQShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4999,14 +5042,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort64VectorTests(IntFunction fa, IntFunction fb) { + static void eqShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5018,14 +5061,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5041,14 +5084,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void NEShort64VectorTests(IntFunction fa, IntFunction fb) { + static void NEShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5060,14 +5103,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void NEShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5083,14 +5126,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LEShort64VectorTests(IntFunction fa, IntFunction fb) { + static void LEShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5102,14 +5145,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LEShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5125,14 +5168,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GEShort64VectorTests(IntFunction fa, IntFunction fb) { + static void GEShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5144,14 +5187,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GEShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5167,14 +5210,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULTShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ULTShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5186,14 +5229,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULTShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5209,14 +5252,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGTShort64VectorTests(IntFunction fa, IntFunction fb) { + static void UGTShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5228,14 +5271,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGTShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5251,14 +5294,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULEShort64VectorTests(IntFunction fa, IntFunction fb) { + static void ULEShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5270,14 +5313,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULEShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5293,14 +5336,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGEShort64VectorTests(IntFunction fa, IntFunction fb) { + static void UGEShortVector64Tests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5312,14 +5355,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGEShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5335,14 +5378,14 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5352,13 +5395,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5372,13 +5415,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShort64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5388,13 +5431,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShort64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTShortVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5408,13 +5451,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5424,13 +5467,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5444,13 +5487,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShort64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5460,13 +5503,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShort64VectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQShortVector64TestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5480,7 +5523,7 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); } } } @@ -5490,7 +5533,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort64VectorTests(IntFunction fa, IntFunction fb, + static void blendShortVector64Tests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5506,11 +5549,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, Short64VectorTests::blend); + assertArraysEquals(r, a, b, mask, ShortVector64Tests::blend); } @Test(dataProvider = "shortUnaryOpShuffleProvider") - static void RearrangeShort64VectorTests(IntFunction fa, + static void RearrangeShortVector64Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5527,7 +5570,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpShuffleMaskProvider") - static void RearrangeShort64VectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeShortVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -5545,7 +5588,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void compressShort64VectorTests(IntFunction fa, + static void compressShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5563,7 +5606,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void expandShort64VectorTests(IntFunction fa, + static void expandShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5581,7 +5624,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void getShort64VectorTests(IntFunction fa) { + static void getShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5737,7 +5780,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastShort64VectorTests(IntFunction fa) { + static void BroadcastShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5751,7 +5794,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZeroShort64VectorTests(IntFunction fa) { + static void ZeroShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5761,7 +5804,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static short[] sliceUnary(short[] a, int origin, int idx) { @@ -5776,7 +5819,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void sliceUnaryShort64VectorTests(IntFunction fa) { + static void sliceUnaryShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5787,7 +5830,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short64VectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ShortVector64Tests::sliceUnary); } static short[] sliceBinary(short[] a, short[] b, int origin, int idx) { @@ -5804,7 +5847,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void sliceBinaryShort64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryShortVector64TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5817,7 +5860,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, Short64VectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ShortVector64Tests::sliceBinary); } static short[] slice(short[] a, short[] b, int origin, boolean[] mask, int idx) { @@ -5834,7 +5877,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void sliceShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5851,7 +5894,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, Short64VectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ShortVector64Tests::slice); } static short[] unsliceUnary(short[] a, int origin, int idx) { @@ -5868,7 +5911,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void unsliceUnaryShort64VectorTests(IntFunction fa) { + static void unsliceUnaryShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5879,7 +5922,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, Short64VectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ShortVector64Tests::unsliceUnary); } static short[] unsliceBinary(short[] a, short[] b, int origin, int part, int idx) { @@ -5905,7 +5948,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void unsliceBinaryShort64VectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryShortVector64TestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5919,7 +5962,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, Short64VectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ShortVector64Tests::unsliceBinary); } static short[] unslice(short[] a, short[] b, int origin, int part, boolean[] mask, int idx) { @@ -5959,7 +6002,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void unsliceShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5976,7 +6019,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, Short64VectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ShortVector64Tests::unslice); } static short BITWISE_BLEND(short a, short b, short c) { @@ -5988,7 +6031,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6003,11 +6046,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, Short64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6020,11 +6063,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, Short64VectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ShortVector64Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort64VectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector64TestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6042,11 +6085,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, Short64VectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6057,11 +6100,11 @@ public class Short64VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6072,11 +6115,11 @@ public class Short64VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6087,11 +6130,11 @@ public class Short64VectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, Short64VectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ShortVector64Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort64VectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector64TestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6102,11 +6145,11 @@ public class Short64VectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, Short64VectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVector64Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6121,11 +6164,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, Short64VectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort64VectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector64TestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6140,11 +6183,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, Short64VectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShort64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6155,11 +6198,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector64Tests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShort64VectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVector64TestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6170,11 +6213,11 @@ public class Short64VectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, Short64VectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVector64Tests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShort64VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVector64TestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6188,7 +6231,7 @@ public class Short64VectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Short64VectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortVector64Tests::BITWISE_BLEND); } static short NEG(short a) { @@ -6200,7 +6243,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NEGShort64VectorTests(IntFunction fa) { + static void NEGShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6211,11 +6254,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::NEG); + assertArraysEquals(r, a, ShortVector64Tests::NEG); } @Test(dataProvider = "shortUnaryOpProvider") - static void negShort64VectorTests(IntFunction fa) { + static void negShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6226,11 +6269,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::neg); + assertArraysEquals(r, a, ShortVector64Tests::neg); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NEGMaskedShort64VectorTests(IntFunction fa, + static void NEGMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6244,7 +6287,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::NEG); + assertArraysEquals(r, a, mask, ShortVector64Tests::NEG); } static short ABS(short a) { @@ -6256,7 +6299,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ABSShort64VectorTests(IntFunction fa) { + static void ABSShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6267,11 +6310,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::ABS); + assertArraysEquals(r, a, ShortVector64Tests::ABS); } @Test(dataProvider = "shortUnaryOpProvider") - static void absShort64VectorTests(IntFunction fa) { + static void absShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6282,11 +6325,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::abs); + assertArraysEquals(r, a, ShortVector64Tests::abs); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ABSMaskedShort64VectorTests(IntFunction fa, + static void ABSMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6300,7 +6343,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::ABS); + assertArraysEquals(r, a, mask, ShortVector64Tests::ABS); } static short NOT(short a) { @@ -6312,7 +6355,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NOTShort64VectorTests(IntFunction fa) { + static void NOTShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6323,11 +6366,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::NOT); + assertArraysEquals(r, a, ShortVector64Tests::NOT); } @Test(dataProvider = "shortUnaryOpProvider") - static void notShort64VectorTests(IntFunction fa) { + static void notShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6338,11 +6381,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::not); + assertArraysEquals(r, a, ShortVector64Tests::not); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NOTMaskedShort64VectorTests(IntFunction fa, + static void NOTMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6356,7 +6399,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::NOT); + assertArraysEquals(r, a, mask, ShortVector64Tests::NOT); } static short ZOMO(short a) { @@ -6364,7 +6407,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZOMOShort64VectorTests(IntFunction fa) { + static void ZOMOShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6375,11 +6418,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::ZOMO); + assertArraysEquals(r, a, ShortVector64Tests::ZOMO); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ZOMOMaskedShort64VectorTests(IntFunction fa, + static void ZOMOMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6393,7 +6436,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::ZOMO); + assertArraysEquals(r, a, mask, ShortVector64Tests::ZOMO); } static short BIT_COUNT(short a) { @@ -6401,7 +6444,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BIT_COUNTShort64VectorTests(IntFunction fa) { + static void BIT_COUNTShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6412,11 +6455,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, ShortVector64Tests::BIT_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void BIT_COUNTMaskedShort64VectorTests(IntFunction fa, + static void BIT_COUNTMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6430,7 +6473,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ShortVector64Tests::BIT_COUNT); } static short TRAILING_ZEROS_COUNT(short a) { @@ -6438,7 +6481,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void TRAILING_ZEROS_COUNTShort64VectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6449,11 +6492,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector64Tests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedShort64VectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6467,7 +6510,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector64Tests::TRAILING_ZEROS_COUNT); } static short LEADING_ZEROS_COUNT(short a) { @@ -6475,7 +6518,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LEADING_ZEROS_COUNTShort64VectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6486,11 +6529,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVector64Tests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedShort64VectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6504,7 +6547,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVector64Tests::LEADING_ZEROS_COUNT); } static short REVERSE(short a) { @@ -6512,7 +6555,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSEShort64VectorTests(IntFunction fa) { + static void REVERSEShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6523,11 +6566,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::REVERSE); + assertArraysEquals(r, a, ShortVector64Tests::REVERSE); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSEMaskedShort64VectorTests(IntFunction fa, + static void REVERSEMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6541,7 +6584,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::REVERSE); + assertArraysEquals(r, a, mask, ShortVector64Tests::REVERSE); } static short REVERSE_BYTES(short a) { @@ -6549,7 +6592,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSE_BYTESShort64VectorTests(IntFunction fa) { + static void REVERSE_BYTESShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6560,11 +6603,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ShortVector64Tests::REVERSE_BYTES); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedShort64VectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedShortVector64Tests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6578,7 +6621,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, Short64VectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ShortVector64Tests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6586,7 +6629,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandShortVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6599,7 +6642,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::band); + assertArraysEquals(r, a, b, ShortVector64Tests::band); } static boolean bor(boolean a, boolean b) { @@ -6607,7 +6650,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maskorShortVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6620,7 +6663,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::bor); + assertArraysEquals(r, a, b, ShortVector64Tests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6628,7 +6671,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maskxorShortVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6641,7 +6684,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::bxor); + assertArraysEquals(r, a, b, ShortVector64Tests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6649,7 +6692,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotShortVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6662,7 +6705,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::bandNot); + assertArraysEquals(r, a, b, ShortVector64Tests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6670,7 +6713,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maskeqShortVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6683,7 +6726,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, Short64VectorTests::beq); + assertArraysEquals(r, a, b, ShortVector64Tests::beq); } static boolean unot(boolean a) { @@ -6691,7 +6734,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotShort64VectorTests(IntFunction fa) { + static void masknotShortVector64Tests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6702,7 +6745,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, Short64VectorTests::unot); + assertArraysEquals(r, a, ShortVector64Tests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6711,15 +6754,15 @@ public class Short64VectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongShort64VectorTests(IntFunction fa) { + static void maskFromToLongShortVector64Tests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6733,7 +6776,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortCompareOpProvider") - static void ltShort64VectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltShortVector64TestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6743,13 +6786,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShort64VectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqShortVector64TestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6759,13 +6802,13 @@ public class Short64VectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortUnaryOpProvider") - static void toIntArrayShort64VectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayShortVector64TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6776,7 +6819,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toLongArrayShort64VectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayShortVector64TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6787,7 +6830,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toDoubleArrayShort64VectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayShortVector64TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6798,7 +6841,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toStringShort64VectorTestsSmokeTest(IntFunction fa) { + static void toStringShortVector64TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6811,7 +6854,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void hashCodeShort64VectorTestsSmokeTest(IntFunction fa) { + static void hashCodeShortVector64TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6844,7 +6887,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceLongShort64VectorTests(IntFunction fa) { + static void ADDReduceLongShortVector64Tests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6860,7 +6903,7 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - Short64VectorTests::ADDReduceLong, Short64VectorTests::ADDReduceAllLong); + ShortVector64Tests::ADDReduceLong, ShortVector64Tests::ADDReduceAllLong); } static long ADDReduceLongMasked(short[] a, int idx, boolean[] mask) { @@ -6883,7 +6926,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceLongShort64VectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongShortVector64TestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6901,11 +6944,11 @@ public class Short64VectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - Short64VectorTests::ADDReduceLongMasked, Short64VectorTests::ADDReduceAllLongMasked); + ShortVector64Tests::ADDReduceLongMasked, ShortVector64Tests::ADDReduceAllLongMasked); } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastLongShort64VectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongShortVector64TestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -6916,7 +6959,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShort64VectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendShortVector64TestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6930,12 +6973,12 @@ public class Short64VectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, Short64VectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVector64Tests::blend); } @Test(dataProvider = "shortUnaryOpSelectFromProvider") - static void SelectFromShort64VectorTests(IntFunction fa, + static void SelectFromShortVector64Tests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); short[] order = fs.apply(a.length, SPECIES.length()); @@ -6951,7 +6994,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorShort64VectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorShortVector64Tests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] idx = fc.apply(SPECIES.length()); @@ -6969,7 +7012,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpSelectFromMaskProvider") - static void SelectFromShort64VectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromShortVector64TestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -6988,7 +7031,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousShort64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousShortVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6999,12 +7042,12 @@ public class Short64VectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringShort64VectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringShortVector64TestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7018,7 +7061,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsShort64VectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsShortVector64TestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7027,12 +7070,12 @@ public class Short64VectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsShort64VectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsShortVector64Tests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7042,13 +7085,13 @@ public class Short64VectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeShort64VectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeShortVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7070,7 +7113,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountShort64VectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountShortVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7081,7 +7124,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short64VectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ShortVector64Tests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7095,7 +7138,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueShort64VectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueShortVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7106,7 +7149,7 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short64VectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ShortVector64Tests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7120,7 +7163,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueShort64VectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueShortVector64TestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7131,11 +7174,11 @@ public class Short64VectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, Short64VectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ShortVector64Tests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressShort64VectorTestsSmokeTest(IntFunction fa) { + static void maskCompressShortVector64TestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7145,7 +7188,7 @@ public class Short64VectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7163,7 +7206,7 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeShort64VectorTestsSmokeTest(int offset) { + static void indexInRangeShortVector64TestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7171,13 +7214,13 @@ public class Short64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongShort64VectorTestsSmokeTest(int offset) { + static void indexInRangeLongShortVector64TestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7185,7 +7228,7 @@ public class Short64VectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7204,36 +7247,36 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundShort64VectorTestsSmokeTest(int length) { + static void loopBoundShortVector64TestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongShort64VectorTestsSmokeTest(int _length) { + static void loopBoundLongShortVector64TestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeShort64VectorTestsSmokeTest() { + static void ElementSizeShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Short.SIZE); + assertEquals(elsize, Short.SIZE); } @Test - static void VectorShapeShort64VectorTestsSmokeTest() { + static void VectorShapeShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_64_BIT)); } @Test - static void ShapeWithLanesShort64VectorTestsSmokeTest() { + static void ShapeWithLanesShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(short.class); @@ -7241,32 +7284,32 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test - static void ElementTypeShort64VectorTestsSmokeTest() { + static void ElementTypeShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementType() == short.class); } @Test - static void SpeciesElementSizeShort64VectorTestsSmokeTest() { + static void SpeciesElementSizeShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementSize() == Short.SIZE); } @Test - static void VectorTypeShort64VectorTestsSmokeTest() { + static void VectorTypeShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesShort64VectorTestsSmokeTest() { + static void WithLanesShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(short.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeShort64VectorTestsSmokeTest() { + static void WithShapeShortVector64TestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7274,9 +7317,9 @@ public class Short64VectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueShort64VectorTestsSmokeTest() { + static void MaskAllTrueShortVector64TestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java b/test/jdk/jdk/incubator/vector/ShortVectorMaxLoadStoreTests.java similarity index 97% rename from test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java rename to test/jdk/jdk/incubator/vector/ShortVectorMaxLoadStoreTests.java index 91db367808a..24683f1e5d7 100644 --- a/test/jdk/jdk/incubator/vector/ShortMaxVectorLoadStoreTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVectorMaxLoadStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +28,7 @@ * @library /test/lib * @modules jdk.incubator.vector java.base/jdk.internal.vm.annotation * @run testng/othervm --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED - * -XX:-TieredCompilation ShortMaxVectorLoadStoreTests + * -XX:-TieredCompilation ShortVectorMaxLoadStoreTests * */ @@ -52,7 +52,7 @@ import java.util.List; import java.util.function.*; @Test -public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { +public class ShortVectorMaxLoadStoreTests extends AbstractVectorLoadStoreTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_MAX; @@ -68,14 +68,29 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / Max); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals(short[] r, short[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : (short) 0, "at index #" + i); } } @@ -329,7 +344,7 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "shortProviderForIOOBE") @@ -1121,11 +1136,11 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -1136,11 +1151,11 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: (short) 0, "at index #" + j); } } @@ -1156,7 +1171,7 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals(short[] r, short[] a, int[] indexMap) { @@ -1169,7 +1184,7 @@ public class ShortMaxVectorLoadStoreTests extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java b/test/jdk/jdk/incubator/vector/ShortVectorMaxTests.java similarity index 83% rename from test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java rename to test/jdk/jdk/incubator/vector/ShortVectorMaxTests.java index ad2efd3575d..65234fb3173 100644 --- a/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java +++ b/test/jdk/jdk/incubator/vector/ShortVectorMaxTests.java @@ -27,7 +27,7 @@ * * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortMaxVectorTests + * @run testng/othervm/timeout=300 -ea -esa -Xbatch -XX:-TieredCompilation ShortVectorMaxTests */ // -- This file was mechanically generated: Do not edit! -- // @@ -56,12 +56,55 @@ import java.util.stream.Collectors; import java.util.stream.Stream; @Test -public class ShortMaxVectorTests extends AbstractVectorTest { +public class ShortVectorMaxTests extends AbstractVectorTest { static final VectorSpecies SPECIES = ShortVector.SPECIES_MAX; static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals(short actual, short expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short actual, short expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(short actual, short expected, short delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals(short actual, short expected, short delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals(short [] actual, short [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(short [] actual, short [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static VectorShape getMaxBit() { return VectorShape.S_Max_BIT; @@ -102,10 +145,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -117,13 +160,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { short[] ref = f.apply(a[i]); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -133,10 +176,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -152,13 +195,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { FReductionOp f, FReductionAllOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -174,13 +217,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { FReductionMaskedOp f, FReductionAllMaskedOp fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -196,13 +239,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -218,13 +261,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } @@ -236,10 +279,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -251,10 +294,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -263,12 +306,12 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -279,20 +322,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], (short)0); + assertEquals(r[i + k], (short)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -304,19 +347,19 @@ public class ShortMaxVectorTests extends AbstractVectorTest { k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], (short)0); + assertEquals(r[i + j], (short)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], (short)0, "at index #" + idx); + assertEquals(r[idx], (short)0, "at index #" + idx); } } } @@ -332,11 +375,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -345,12 +388,12 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -360,17 +403,17 @@ public class ShortMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -380,17 +423,17 @@ public class ShortMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], (short)0); + assertEquals(r[i+j], (short)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], (short)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -404,10 +447,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -419,10 +462,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -434,10 +477,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -458,18 +501,18 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -484,18 +527,18 @@ public class ShortMaxVectorTests extends AbstractVectorTest { for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -503,10 +546,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -514,10 +557,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -525,10 +568,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -537,10 +580,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -553,10 +596,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -568,10 +611,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -583,10 +626,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -601,10 +644,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], (short)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -617,11 +660,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -635,11 +678,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -661,11 +704,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -679,11 +722,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -703,10 +746,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -718,10 +761,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -730,10 +773,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -743,10 +786,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -762,11 +805,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -783,11 +826,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -798,11 +841,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -819,11 +862,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -841,13 +884,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -868,13 +911,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -889,13 +932,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { short[] ref = f.apply(r, a, i, mask, b, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -916,13 +959,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -936,13 +979,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -957,13 +1000,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -978,13 +1021,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1000,13 +1043,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { short[] ref = f.apply(a, b, origin, part, mask, i); short[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1019,10 +1062,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1032,10 +1075,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1043,10 +1086,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1583,7 +1626,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Do some zipping and shuffling. ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); ShortVector a = io.add((short)1); //[1,2] ShortVector b = a.neg(); //[-1,-2] short[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1598,19 +1641,19 @@ public class ShortMaxVectorTests extends AbstractVectorTest { manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle unz1 = VectorShuffle.makeUnzip(SPECIES, 1); ShortVector uab0 = zab0.rearrange(unz0,zab1); ShortVector uab1 = zab0.rearrange(unz1,zab1); short[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { ShortVector io = (ShortVector) SPECIES.broadcast(0).addIndex(1); ShortVector io2 = (ShortVector) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -1625,7 +1668,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { @Test void viewAsIntegeralLanesTest() { Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); } @Test(expectedExceptions = UnsupportedOperationException.class) @@ -1659,7 +1702,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ADDShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1672,7 +1715,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::ADD); + assertArraysEquals(r, a, b, ShortVectorMaxTests::ADD); } static short add(short a, short b) { @@ -1680,7 +1723,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void addShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void addShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1691,11 +1734,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.add(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::add); + assertArraysEquals(r, a, b, ShortVectorMaxTests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ADDShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1711,11 +1754,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::ADD); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void addShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1729,7 +1772,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.add(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::add); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::add); } static short SUB(short a, short b) { @@ -1737,7 +1780,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void SUBShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUBShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1750,7 +1793,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::SUB); + assertArraysEquals(r, a, b, ShortVectorMaxTests::SUB); } static short sub(short a, short b) { @@ -1758,7 +1801,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void subShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void subShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1769,11 +1812,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.sub(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::sub); + assertArraysEquals(r, a, b, ShortVectorMaxTests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void SUBShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUBShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1789,11 +1832,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::SUB); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::SUB); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void subShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1807,7 +1850,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.sub(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::sub); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::sub); } static short MUL(short a, short b) { @@ -1815,7 +1858,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MULShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MULShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1828,7 +1871,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::MUL); + assertArraysEquals(r, a, b, ShortVectorMaxTests::MUL); } static short mul(short a, short b) { @@ -1836,7 +1879,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void mulShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1847,11 +1890,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.mul(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::mul); + assertArraysEquals(r, a, b, ShortVectorMaxTests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void MULShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void MULShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1867,11 +1910,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::MUL); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::MUL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void mulShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1885,7 +1928,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.mul(bv, vmask).intoArray(r, i); } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::mul); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::mul); } static short DIV(short a, short b) { @@ -1893,7 +1936,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void DIVShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void DIVShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1908,7 +1951,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::DIV); + assertArraysEquals(r, a, b, ShortVectorMaxTests::DIV); } static short div(short a, short b) { @@ -1916,7 +1959,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void divShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void divShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1931,11 +1974,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::div); + assertArraysEquals(r, a, b, ShortVectorMaxTests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void DIVShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void DIVShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1953,11 +1996,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::DIV); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::DIV); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void divShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -1975,7 +2018,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::div); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::div); } static short FIRST_NONZERO(short a, short b) { @@ -1983,7 +2026,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void FIRST_NONZEROShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void FIRST_NONZEROShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -1996,11 +2039,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, ShortVectorMaxTests::FIRST_NONZERO); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void FIRST_NONZEROShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void FIRST_NONZEROShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2016,7 +2059,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::FIRST_NONZERO); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::FIRST_NONZERO); } static short AND(short a, short b) { @@ -2024,7 +2067,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ANDShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2037,7 +2080,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::AND); + assertArraysEquals(r, a, b, ShortVectorMaxTests::AND); } static short and(short a, short b) { @@ -2045,7 +2088,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void andShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void andShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2056,11 +2099,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.and(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::and); + assertArraysEquals(r, a, b, ShortVectorMaxTests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ANDShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2076,7 +2119,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::AND); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::AND); } static short AND_NOT(short a, short b) { @@ -2084,7 +2127,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void AND_NOTShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void AND_NOTShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2097,11 +2140,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, ShortVectorMaxTests::AND_NOT); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void AND_NOTShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void AND_NOTShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2117,7 +2160,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::AND_NOT); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::AND_NOT); } static short OR(short a, short b) { @@ -2125,7 +2168,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ORShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2138,7 +2181,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::OR); + assertArraysEquals(r, a, b, ShortVectorMaxTests::OR); } static short or(short a, short b) { @@ -2146,7 +2189,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void orShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void orShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2157,11 +2200,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.or(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::or); + assertArraysEquals(r, a, b, ShortVectorMaxTests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ORShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2177,7 +2220,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::OR); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::OR); } static short XOR(short a, short b) { @@ -2185,7 +2228,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void XORShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void XORShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2198,11 +2241,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::XOR); + assertArraysEquals(r, a, b, ShortVectorMaxTests::XOR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void XORShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void XORShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2218,11 +2261,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::XOR); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::XOR); } @Test(dataProvider = "shortBinaryOpProvider") - static void addShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void addShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2232,11 +2275,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.add(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::add); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void addShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void addShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2249,11 +2292,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.add(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ShortMaxVectorTests::add); + assertBroadcastArraysEquals(r, a, b, mask, ShortVectorMaxTests::add); } @Test(dataProvider = "shortBinaryOpProvider") - static void subShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void subShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2263,11 +2306,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.sub(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::sub); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void subShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void subShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2280,11 +2323,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.sub(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ShortMaxVectorTests::sub); + assertBroadcastArraysEquals(r, a, b, mask, ShortVectorMaxTests::sub); } @Test(dataProvider = "shortBinaryOpProvider") - static void mulShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void mulShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2294,11 +2337,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.mul(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::mul); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void mulShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void mulShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2311,11 +2354,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.mul(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ShortMaxVectorTests::mul); + assertBroadcastArraysEquals(r, a, b, mask, ShortVectorMaxTests::mul); } @Test(dataProvider = "shortBinaryOpProvider") - static void divShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void divShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2327,11 +2370,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.div(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::div); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void divShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void divShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2346,11 +2389,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.div(b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ShortMaxVectorTests::div); + assertBroadcastArraysEquals(r, a, b, mask, ShortVectorMaxTests::div); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2360,11 +2403,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void orShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void orShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2374,11 +2417,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.or(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::or); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::or); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2391,11 +2434,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ShortMaxVectorTests::OR); + assertBroadcastArraysEquals(r, a, b, mask, ShortVectorMaxTests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ANDShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ANDShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2405,11 +2448,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void andShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void andShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2419,11 +2462,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.and(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::and); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::and); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ANDShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void ANDShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2436,11 +2479,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.AND, b[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, mask, ShortMaxVectorTests::AND); + assertBroadcastArraysEquals(r, a, b, mask, ShortVectorMaxTests::AND); } @Test(dataProvider = "shortBinaryOpProvider") - static void ORShortMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ORShortVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2450,11 +2493,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, ShortMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, ShortVectorMaxTests::OR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ORShortMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ORShortVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2467,11 +2510,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.OR, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, ShortMaxVectorTests::OR); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVectorMaxTests::OR); } @Test(dataProvider = "shortBinaryOpProvider") - static void ADDShortMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void ADDShortVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2481,11 +2524,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i]).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, ShortMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, ShortVectorMaxTests::ADD); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ADDShortMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, + static void ADDShortVectorMaxTestsBroadcastMaskedLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2498,7 +2541,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.ADD, (long)b[i], vmask).intoArray(r, i); } - assertBroadcastLongArraysEquals(r, a, b, mask, ShortMaxVectorTests::ADD); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVectorMaxTests::ADD); } static short LSHL(short a, short b) { @@ -2506,7 +2549,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHLShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2519,11 +2562,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, ShortVectorMaxTests::LSHL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2539,7 +2582,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::LSHL); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::LSHL); } static short ASHR(short a, short b) { @@ -2547,7 +2590,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ASHRShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2560,11 +2603,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, ShortVectorMaxTests::ASHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2580,7 +2623,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::ASHR); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::ASHR); } static short LSHR(short a, short b) { @@ -2588,7 +2631,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LSHRShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2601,11 +2644,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, ShortVectorMaxTests::LSHR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2621,7 +2664,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::LSHR); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::LSHR); } static short LSHL_unary(short a, short b) { @@ -2629,7 +2672,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHLShortMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHLShortVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2641,11 +2684,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, ShortVectorMaxTests::LSHL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHLShortMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHLShortVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2660,7 +2703,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::LSHL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVectorMaxTests::LSHL_unary); } static short LSHR_unary(short a, short b) { @@ -2668,7 +2711,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void LSHRShortMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void LSHRShortVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2680,11 +2723,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, ShortVectorMaxTests::LSHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void LSHRShortMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void LSHRShortVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2699,7 +2742,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::LSHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVectorMaxTests::LSHR_unary); } static short ASHR_unary(short a, short b) { @@ -2707,7 +2750,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ASHRShortMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ASHRShortVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2719,11 +2762,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, ShortVectorMaxTests::ASHR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ASHRShortMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ASHRShortVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2738,7 +2781,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::ASHR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVectorMaxTests::ASHR_unary); } static short ROR(short a, short b) { @@ -2746,7 +2789,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void RORShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2759,11 +2802,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::ROR); + assertArraysEquals(r, a, b, ShortVectorMaxTests::ROR); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void RORShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2779,7 +2822,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROR); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::ROR); } static short ROL(short a, short b) { @@ -2787,7 +2830,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ROLShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2800,11 +2843,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::ROL); + assertArraysEquals(r, a, b, ShortVectorMaxTests::ROL); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ROLShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2820,7 +2863,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROL); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::ROL); } static short ROR_unary(short a, short b) { @@ -2828,7 +2871,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void RORShortMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void RORShortVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2840,11 +2883,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, ShortVectorMaxTests::ROR_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void RORShortMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void RORShortVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2859,7 +2902,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROR_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVectorMaxTests::ROR_unary); } static short ROL_unary(short a, short b) { @@ -2867,7 +2910,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void ROLShortMaxVectorTestsScalarShift(IntFunction fa, IntFunction fb) { + static void ROLShortVectorMaxTestsScalarShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2879,11 +2922,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, ShortMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, ShortVectorMaxTests::ROL_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void ROLShortMaxVectorTestsScalarShiftMasked(IntFunction fa, IntFunction fb, + static void ROLShortVectorMaxTestsScalarShiftMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -2898,14 +2941,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftArraysEquals(r, a, b, mask, ShortMaxVectorTests::ROL_unary); + assertShiftArraysEquals(r, a, b, mask, ShortVectorMaxTests::ROL_unary); } static short LSHR_binary_const(short a) { return (short)(((a & 0xFFFF) >>> CONST_SHIFT)); } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHRShortMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHRShortVectorMaxTestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2916,11 +2959,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ShortMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, ShortVectorMaxTests::LSHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHRShortMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHRShortVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2934,7 +2977,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ShortMaxVectorTests::LSHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVectorMaxTests::LSHR_binary_const); } static short LSHL_binary_const(short a) { @@ -2942,7 +2985,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LSHLShortMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void LSHLShortVectorMaxTestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2953,11 +2996,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ShortMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, ShortVectorMaxTests::LSHL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LSHLShortMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void LSHLShortVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2971,7 +3014,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ShortMaxVectorTests::LSHL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVectorMaxTests::LSHL_binary_const); } static short ASHR_binary_const(short a) { @@ -2979,7 +3022,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ASHRShortMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ASHRShortVectorMaxTestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -2990,11 +3033,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ShortMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, ShortVectorMaxTests::ASHR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ASHRShortMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ASHRShortVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3008,7 +3051,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ShortMaxVectorTests::ASHR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVectorMaxTests::ASHR_binary_const); } static short ROR_binary_const(short a) { @@ -3016,7 +3059,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void RORShortMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void RORShortVectorMaxTestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3027,11 +3070,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ShortMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, ShortVectorMaxTests::ROR_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void RORShortMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void RORShortVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3045,7 +3088,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ShortMaxVectorTests::ROR_binary_const); + assertShiftConstEquals(r, a, mask, ShortVectorMaxTests::ROR_binary_const); } static short ROL_binary_const(short a) { @@ -3053,7 +3096,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ROLShortMaxVectorTestsScalarShiftConst(IntFunction fa) { + static void ROLShortVectorMaxTestsScalarShiftConst(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3064,11 +3107,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, ShortMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, ShortVectorMaxTests::ROL_binary_const); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ROLShortMaxVectorTestsScalarShiftMaskedConst(IntFunction fa, + static void ROLShortVectorMaxTestsScalarShiftMaskedConst(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3082,14 +3125,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertShiftConstEquals(r, a, mask, ShortMaxVectorTests::ROL_binary_const); + assertShiftConstEquals(r, a, mask, ShortVectorMaxTests::ROL_binary_const); } static ShortVector bv_MIN = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MINShortMaxVectorTestsWithMemOp(IntFunction fa) { + static void MINShortVectorMaxTestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3100,13 +3143,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, ShortMaxVectorTests::MIN); + assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::MIN); } static ShortVector bv_min = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void minShortMaxVectorTestsWithMemOp(IntFunction fa) { + static void minShortVectorMaxTestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3117,13 +3160,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, ShortMaxVectorTests::min); + assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::min); } static ShortVector bv_MIN_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINShortMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MINShortVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3136,13 +3179,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, ShortMaxVectorTests::MIN); + assertArraysEquals(r, a, (short)10, mask, ShortVectorMaxTests::MIN); } static ShortVector bv_MAX = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void MAXShortMaxVectorTestsWithMemOp(IntFunction fa) { + static void MAXShortVectorMaxTestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3153,13 +3196,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, ShortMaxVectorTests::MAX); + assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::MAX); } static ShortVector bv_max = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpProvider") - static void maxShortMaxVectorTestsWithMemOp(IntFunction fa) { + static void maxShortVectorMaxTestsWithMemOp(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3170,13 +3213,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, ShortMaxVectorTests::max); + assertArraysEquals(r, a, (short)10, ShortVectorMaxTests::max); } static ShortVector bv_MAX_M = ShortVector.broadcast(SPECIES, (short)10); @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXShortMaxVectorTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { + static void MAXShortVectorMaxTestsMaskedWithMemOp(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3189,7 +3232,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, (short)10, mask, ShortMaxVectorTests::MAX); + assertArraysEquals(r, a, (short)10, mask, ShortVectorMaxTests::MAX); } static short MIN(short a, short b) { @@ -3197,7 +3240,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MINShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3210,7 +3253,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::MIN); + assertArraysEquals(r, a, b, ShortVectorMaxTests::MIN); } static short min(short a, short b) { @@ -3218,7 +3261,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void minShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void minShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3229,7 +3272,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.min(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::min); + assertArraysEquals(r, a, b, ShortVectorMaxTests::min); } static short MAX(short a, short b) { @@ -3237,7 +3280,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void MAXShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3250,7 +3293,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::MAX); + assertArraysEquals(r, a, b, ShortVectorMaxTests::MAX); } static short max(short a, short b) { @@ -3258,7 +3301,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maxShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3269,7 +3312,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.max(bv).intoArray(r, i); } - assertArraysEquals(r, a, b, ShortMaxVectorTests::max); + assertArraysEquals(r, a, b, ShortVectorMaxTests::max); } static short UMIN(short a, short b) { @@ -3277,7 +3320,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMINShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMINShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3290,11 +3333,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, ShortVectorMaxTests::UMIN); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMINShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMINShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3310,7 +3353,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::UMIN); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::UMIN); } static short UMAX(short a, short b) { @@ -3318,7 +3361,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void UMAXShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UMAXShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3331,11 +3374,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, ShortVectorMaxTests::UMAX); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void UMAXShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UMAXShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3351,7 +3394,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::UMAX); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::UMAX); } static short SADD(short a, short b) { @@ -3359,7 +3402,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SADDShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SADDShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3372,11 +3415,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::SADD); + assertArraysEquals(r, a, b, ShortVectorMaxTests::SADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SADDShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SADDShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3392,7 +3435,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::SADD); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::SADD); } static short SSUB(short a, short b) { @@ -3400,7 +3443,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SSUBShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SSUBShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3413,11 +3456,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, ShortVectorMaxTests::SSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SSUBShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SSUBShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3433,7 +3476,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::SSUB); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::SSUB); } static short SUADD(short a, short b) { @@ -3441,7 +3484,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUADDShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUADDShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3454,11 +3497,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, ShortVectorMaxTests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUADDShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3474,7 +3517,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::SUADD); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::SUADD); } static short SUSUB(short a, short b) { @@ -3482,7 +3525,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingBinaryOpProvider") - static void SUSUBShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void SUSUBShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3495,11 +3538,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, ShortVectorMaxTests::SUSUB); } @Test(dataProvider = "shortSaturatingBinaryOpMaskProvider") - static void SUSUBShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUSUBShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3515,11 +3558,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::SUSUB); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::SUSUB); } @Test(dataProvider = "shortBinaryOpProvider") - static void MINShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MINShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3529,11 +3572,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MIN, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::MIN); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::MIN); } @Test(dataProvider = "shortBinaryOpProvider") - static void minShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void minShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3543,11 +3586,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.min(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::min); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::min); } @Test(dataProvider = "shortBinaryOpProvider") - static void MAXShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void MAXShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3557,11 +3600,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.MAX, b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::MAX); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::MAX); } @Test(dataProvider = "shortBinaryOpProvider") - static void maxShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void maxShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -3571,10 +3614,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.max(b[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, ShortMaxVectorTests::max); + assertBroadcastArraysEquals(r, a, b, ShortVectorMaxTests::max); } @Test(dataProvider = "shortSaturatingBinaryOpAssocProvider") - static void SUADDAssocShortMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SUADDAssocShortVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -3591,11 +3634,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, ShortMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, ShortVectorMaxTests::SUADD); } @Test(dataProvider = "shortSaturatingBinaryOpAssocMaskProvider") - static void SUADDAssocShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void SUADDAssocShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -3616,7 +3659,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ShortMaxVectorTests::SUADD); + assertArraysEqualsAssociative(rl, rr, a, b, c, mask, ShortVectorMaxTests::SUADD); } static short ANDReduce(short[] a, int idx) { @@ -3638,7 +3681,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ANDReduceShortMaxVectorTests(IntFunction fa) { + static void ANDReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3654,7 +3697,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::ANDReduce, ShortMaxVectorTests::ANDReduceAll); + ShortVectorMaxTests::ANDReduce, ShortVectorMaxTests::ANDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3662,20 +3705,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = AND_IDENTITY; - Assert.assertEquals((short) (id & id), id, + assertEquals((short) (id & id), id, "AND(AND_IDENTITY, AND_IDENTITY) != AND_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id & x), x); - Assert.assertEquals((short) (x & id), x); + assertEquals((short) (id & x), x); + assertEquals((short) (x & id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id & x), x, + assertEquals((short) (id & x), x, "AND(AND_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x & id), x, + assertEquals((short) (x & id), x, "AND(" + x + ", AND_IDENTITY) != " + x); } } @@ -3700,7 +3743,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ANDReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ANDReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3718,7 +3761,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::ANDReduceMasked, ShortMaxVectorTests::ANDReduceAllMasked); + ShortVectorMaxTests::ANDReduceMasked, ShortVectorMaxTests::ANDReduceAllMasked); } static short ORReduce(short[] a, int idx) { @@ -3740,7 +3783,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ORReduceShortMaxVectorTests(IntFunction fa) { + static void ORReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3756,7 +3799,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::ORReduce, ShortMaxVectorTests::ORReduceAll); + ShortVectorMaxTests::ORReduce, ShortVectorMaxTests::ORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3764,20 +3807,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = OR_IDENTITY; - Assert.assertEquals((short) (id | id), id, + assertEquals((short) (id | id), id, "OR(OR_IDENTITY, OR_IDENTITY) != OR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id | x), x); - Assert.assertEquals((short) (x | id), x); + assertEquals((short) (id | x), x); + assertEquals((short) (x | id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id | x), x, + assertEquals((short) (id | x), x, "OR(OR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x | id), x, + assertEquals((short) (x | id), x, "OR(" + x + ", OR_IDENTITY) != " + x); } } @@ -3802,7 +3845,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ORReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ORReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3820,7 +3863,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::ORReduceMasked, ShortMaxVectorTests::ORReduceAllMasked); + ShortVectorMaxTests::ORReduceMasked, ShortVectorMaxTests::ORReduceAllMasked); } static short XORReduce(short[] a, int idx) { @@ -3842,7 +3885,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void XORReduceShortMaxVectorTests(IntFunction fa) { + static void XORReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3858,7 +3901,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::XORReduce, ShortMaxVectorTests::XORReduceAll); + ShortVectorMaxTests::XORReduce, ShortVectorMaxTests::XORReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3866,20 +3909,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = XOR_IDENTITY; - Assert.assertEquals((short) (id ^ id), id, + assertEquals((short) (id ^ id), id, "XOR(XOR_IDENTITY, XOR_IDENTITY) != XOR_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id ^ x), x); - Assert.assertEquals((short) (x ^ id), x); + assertEquals((short) (id ^ x), x); + assertEquals((short) (x ^ id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id ^ x), x, + assertEquals((short) (id ^ x), x, "XOR(XOR_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x ^ id), x, + assertEquals((short) (x ^ id), x, "XOR(" + x + ", XOR_IDENTITY) != " + x); } } @@ -3904,7 +3947,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void XORReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void XORReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -3922,7 +3965,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::XORReduceMasked, ShortMaxVectorTests::XORReduceAllMasked); + ShortVectorMaxTests::XORReduceMasked, ShortVectorMaxTests::XORReduceAllMasked); } static short ADDReduce(short[] a, int idx) { @@ -3944,7 +3987,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceShortMaxVectorTests(IntFunction fa) { + static void ADDReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -3960,7 +4003,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::ADDReduce, ShortMaxVectorTests::ADDReduceAll); + ShortVectorMaxTests::ADDReduce, ShortVectorMaxTests::ADDReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -3968,20 +4011,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = ADD_IDENTITY; - Assert.assertEquals((short) (id + id), id, + assertEquals((short) (id + id), id, "ADD(ADD_IDENTITY, ADD_IDENTITY) != ADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id + x), x); - Assert.assertEquals((short) (x + id), x); + assertEquals((short) (id + x), x); + assertEquals((short) (x + id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id + x), x, + assertEquals((short) (id + x), x, "ADD(ADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x + id), x, + assertEquals((short) (x + id), x, "ADD(" + x + ", ADD_IDENTITY) != " + x); } } @@ -4006,7 +4049,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4024,7 +4067,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::ADDReduceMasked, ShortMaxVectorTests::ADDReduceAllMasked); + ShortVectorMaxTests::ADDReduceMasked, ShortVectorMaxTests::ADDReduceAllMasked); } static short MULReduce(short[] a, int idx) { @@ -4046,7 +4089,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MULReduceShortMaxVectorTests(IntFunction fa) { + static void MULReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4062,7 +4105,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::MULReduce, ShortMaxVectorTests::MULReduceAll); + ShortVectorMaxTests::MULReduce, ShortVectorMaxTests::MULReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4070,20 +4113,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MUL_IDENTITY; - Assert.assertEquals((short) (id * id), id, + assertEquals((short) (id * id), id, "MUL(MUL_IDENTITY, MUL_IDENTITY) != MUL_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) (id * x), x); - Assert.assertEquals((short) (x * id), x); + assertEquals((short) (id * x), x); + assertEquals((short) (x * id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) (id * x), x, + assertEquals((short) (id * x), x, "MUL(MUL_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) (x * id), x, + assertEquals((short) (x * id), x, "MUL(" + x + ", MUL_IDENTITY) != " + x); } } @@ -4108,7 +4151,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MULReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MULReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4126,7 +4169,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::MULReduceMasked, ShortMaxVectorTests::MULReduceAllMasked); + ShortVectorMaxTests::MULReduceMasked, ShortVectorMaxTests::MULReduceAllMasked); } static short MINReduce(short[] a, int idx) { @@ -4148,7 +4191,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MINReduceShortMaxVectorTests(IntFunction fa) { + static void MINReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4164,7 +4207,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::MINReduce, ShortMaxVectorTests::MINReduceAll); + ShortVectorMaxTests::MINReduce, ShortVectorMaxTests::MINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4172,20 +4215,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MIN_IDENTITY; - Assert.assertEquals((short) Math.min(id, id), id, + assertEquals((short) Math.min(id, id), id, "MIN(MIN_IDENTITY, MIN_IDENTITY) != MIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.min(id, x), x); - Assert.assertEquals((short) Math.min(x, id), x); + assertEquals((short) Math.min(id, x), x); + assertEquals((short) Math.min(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.min(id, x), x, + assertEquals((short) Math.min(id, x), x, "MIN(MIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.min(x, id), x, + assertEquals((short) Math.min(x, id), x, "MIN(" + x + ", MIN_IDENTITY) != " + x); } } @@ -4210,7 +4253,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MINReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MINReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4228,7 +4271,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::MINReduceMasked, ShortMaxVectorTests::MINReduceAllMasked); + ShortVectorMaxTests::MINReduceMasked, ShortVectorMaxTests::MINReduceAllMasked); } static short MAXReduce(short[] a, int idx) { @@ -4250,7 +4293,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void MAXReduceShortMaxVectorTests(IntFunction fa) { + static void MAXReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4266,7 +4309,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::MAXReduce, ShortMaxVectorTests::MAXReduceAll); + ShortVectorMaxTests::MAXReduce, ShortVectorMaxTests::MAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4274,20 +4317,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = MAX_IDENTITY; - Assert.assertEquals((short) Math.max(id, id), id, + assertEquals((short) Math.max(id, id), id, "MAX(MAX_IDENTITY, MAX_IDENTITY) != MAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) Math.max(id, x), x); - Assert.assertEquals((short) Math.max(x, id), x); + assertEquals((short) Math.max(id, x), x); + assertEquals((short) Math.max(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) Math.max(id, x), x, + assertEquals((short) Math.max(id, x), x, "MAX(MAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) Math.max(x, id), x, + assertEquals((short) Math.max(x, id), x, "MAX(" + x + ", MAX_IDENTITY) != " + x); } } @@ -4312,7 +4355,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void MAXReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void MAXReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4330,7 +4373,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::MAXReduceMasked, ShortMaxVectorTests::MAXReduceAllMasked); + ShortVectorMaxTests::MAXReduceMasked, ShortVectorMaxTests::MAXReduceAllMasked); } static short UMINReduce(short[] a, int idx) { @@ -4352,7 +4395,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMINReduceShortMaxVectorTests(IntFunction fa) { + static void UMINReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4368,7 +4411,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::UMINReduce, ShortMaxVectorTests::UMINReduceAll); + ShortVectorMaxTests::UMINReduce, ShortVectorMaxTests::UMINReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4376,20 +4419,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMIN_IDENTITY; - Assert.assertEquals((short) VectorMath.minUnsigned(id, id), id, + assertEquals((short) VectorMath.minUnsigned(id, id), id, "UMIN(UMIN_IDENTITY, UMIN_IDENTITY) != UMIN_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x); + assertEquals((short) VectorMath.minUnsigned(id, x), x); + assertEquals((short) VectorMath.minUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.minUnsigned(id, x), x, + assertEquals((short) VectorMath.minUnsigned(id, x), x, "UMIN(UMIN_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.minUnsigned(x, id), x, + assertEquals((short) VectorMath.minUnsigned(x, id), x, "UMIN(" + x + ", UMIN_IDENTITY) != " + x); } } @@ -4414,7 +4457,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMINReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMINReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4432,7 +4475,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::UMINReduceMasked, ShortMaxVectorTests::UMINReduceAllMasked); + ShortVectorMaxTests::UMINReduceMasked, ShortVectorMaxTests::UMINReduceAllMasked); } static short UMAXReduce(short[] a, int idx) { @@ -4454,7 +4497,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void UMAXReduceShortMaxVectorTests(IntFunction fa) { + static void UMAXReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4470,7 +4513,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::UMAXReduce, ShortMaxVectorTests::UMAXReduceAll); + ShortVectorMaxTests::UMAXReduce, ShortVectorMaxTests::UMAXReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4478,20 +4521,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = UMAX_IDENTITY; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, id), id, + assertEquals((short) VectorMath.maxUnsigned(id, id), id, "UMAX(UMAX_IDENTITY, UMAX_IDENTITY) != UMAX_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x); + assertEquals((short) VectorMath.maxUnsigned(id, x), x); + assertEquals((short) VectorMath.maxUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.maxUnsigned(id, x), x, + assertEquals((short) VectorMath.maxUnsigned(id, x), x, "UMAX(UMAX_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.maxUnsigned(x, id), x, + assertEquals((short) VectorMath.maxUnsigned(x, id), x, "UMAX(" + x + ", UMAX_IDENTITY) != " + x); } } @@ -4516,7 +4559,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void UMAXReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void UMAXReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4534,7 +4577,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::UMAXReduceMasked, ShortMaxVectorTests::UMAXReduceAllMasked); + ShortVectorMaxTests::UMAXReduceMasked, ShortVectorMaxTests::UMAXReduceAllMasked); } static short FIRST_NONZEROReduce(short[] a, int idx) { @@ -4556,7 +4599,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void FIRST_NONZEROReduceShortMaxVectorTests(IntFunction fa) { + static void FIRST_NONZEROReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4572,7 +4615,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::FIRST_NONZEROReduce, ShortMaxVectorTests::FIRST_NONZEROReduceAll); + ShortVectorMaxTests::FIRST_NONZEROReduce, ShortVectorMaxTests::FIRST_NONZEROReduceAll); } @Test(dataProvider = "shortUnaryOpProvider") @@ -4580,20 +4623,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = FIRST_NONZERO_IDENTITY; - Assert.assertEquals(firstNonZero(id, id), id, + assertEquals(firstNonZero(id, id), id, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, FIRST_NONZERO_IDENTITY) != FIRST_NONZERO_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(firstNonZero(id, x), x); - Assert.assertEquals(firstNonZero(x, id), x); + assertEquals(firstNonZero(id, x), x); + assertEquals(firstNonZero(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals(firstNonZero(id, x), x, + assertEquals(firstNonZero(id, x), x, "FIRST_NONZERO(FIRST_NONZERO_IDENTITY, " + x + ") != " + x); - Assert.assertEquals(firstNonZero(x, id), x, + assertEquals(firstNonZero(x, id), x, "FIRST_NONZERO(" + x + ", FIRST_NONZERO_IDENTITY) != " + x); } } @@ -4618,7 +4661,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void FIRST_NONZEROReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void FIRST_NONZEROReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4636,7 +4679,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::FIRST_NONZEROReduceMasked, ShortMaxVectorTests::FIRST_NONZEROReduceAllMasked); + ShortVectorMaxTests::FIRST_NONZEROReduceMasked, ShortVectorMaxTests::FIRST_NONZEROReduceAllMasked); } static boolean anyTrue(boolean[] a, int idx) { @@ -4649,7 +4692,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void anyTrueShortMaxVectorTests(IntFunction fm) { + static void anyTrueShortVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4660,7 +4703,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, ShortMaxVectorTests::anyTrue); + assertReductionBoolArraysEquals(r, mask, ShortVectorMaxTests::anyTrue); } static boolean allTrue(boolean[] a, int idx) { @@ -4673,7 +4716,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolUnaryOpProvider") - static void allTrueShortMaxVectorTests(IntFunction fm) { + static void allTrueShortVectorMaxTests(IntFunction fm) { boolean[] mask = fm.apply(SPECIES.length()); boolean[] r = fmr.apply(SPECIES.length()); @@ -4684,7 +4727,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertReductionBoolArraysEquals(r, mask, ShortMaxVectorTests::allTrue); + assertReductionBoolArraysEquals(r, mask, ShortVectorMaxTests::allTrue); } static short SUADDReduce(short[] a, int idx) { @@ -4706,7 +4749,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSaturatingUnaryOpProvider") - static void SUADDReduceShortMaxVectorTests(IntFunction fa) { + static void SUADDReduceShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -4722,7 +4765,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEquals(r, ra, a, - ShortMaxVectorTests::SUADDReduce, ShortMaxVectorTests::SUADDReduceAll); + ShortVectorMaxTests::SUADDReduce, ShortVectorMaxTests::SUADDReduceAll); } @Test(dataProvider = "shortSaturatingUnaryOpProvider") @@ -4730,20 +4773,20 @@ public class ShortMaxVectorTests extends AbstractVectorTest { short[] a = fa.apply(SPECIES.length()); short id = SUADD_IDENTITY; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, id), id, "SUADD(SUADD_IDENTITY, SUADD_IDENTITY) != SUADD_IDENTITY"); short x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x); + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x); } } catch (AssertionError e) { - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(id, x), x, "SUADD(SUADD_IDENTITY, " + x + ") != " + x); - Assert.assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, + assertEquals((short) VectorMath.addSaturatingUnsigned(x, id), x, "SUADD(" + x + ", SUADD_IDENTITY) != " + x); } } @@ -4767,7 +4810,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { return res; } @Test(dataProvider = "shortSaturatingUnaryOpMaskProvider") - static void SUADDReduceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void SUADDReduceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4785,11 +4828,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::SUADDReduceMasked, ShortMaxVectorTests::SUADDReduceAllMasked); + ShortVectorMaxTests::SUADDReduceMasked, ShortVectorMaxTests::SUADDReduceAllMasked); } @Test(dataProvider = "shortBinaryOpProvider") - static void withShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void withShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -4812,7 +4855,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_DEFAULTShortMaxVectorTests(IntFunction fa) { + static void IS_DEFAULTShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4822,14 +4865,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_DEFAULT(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_DEFAULTMaskedShortMaxVectorTests(IntFunction fa, + static void IS_DEFAULTMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4842,7 +4885,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j])); } } } @@ -4853,7 +4896,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTestOpProvider") - static void IS_NEGATIVEShortMaxVectorTests(IntFunction fa) { + static void IS_NEGATIVEShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -4863,14 +4906,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortTestOpMaskProvider") - static void IS_NEGATIVEMaskedShortMaxVectorTests(IntFunction fa, + static void IS_NEGATIVEMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -4883,14 +4926,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && testIS_NEGATIVE(a[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LTShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4902,14 +4945,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ltShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ltShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4921,14 +4964,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LTShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4944,14 +4987,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && lt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GTShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GTShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4963,14 +5006,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GTShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GTShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -4986,14 +5029,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && gt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void EQShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5005,14 +5048,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void eqShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5024,14 +5067,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void EQShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5047,14 +5090,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && eq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void NEShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void NEShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5066,14 +5109,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void NEShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void NEShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5089,14 +5132,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && neq(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LEShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void LEShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5108,14 +5151,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LEShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void LEShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5131,14 +5174,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && le(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void GEShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void GEShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5150,14 +5193,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void GEShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void GEShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5173,14 +5216,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULTShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULTShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5192,14 +5235,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULTShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULTShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5215,14 +5258,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ult(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGTShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGTShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5234,14 +5277,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGTShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGTShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5257,14 +5300,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ugt(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void ULEShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void ULEShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5276,14 +5319,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void ULEShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void ULEShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5299,14 +5342,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && ule(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void UGEShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void UGEShortVectorMaxTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5318,14 +5361,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void UGEShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void UGEShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5341,14 +5384,14 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && uge(a[i + j], b[i + j])); } } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5358,13 +5401,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void LTShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5378,13 +5421,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void LTShortMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void LTShortVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5394,13 +5437,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] < (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void LTShortMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void LTShortVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5414,13 +5457,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] < (short)((long)b[i]))); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5430,13 +5473,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, + static void EQShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5450,13 +5493,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == b[i])); } } } @Test(dataProvider = "shortCompareOpProvider") - static void EQShortMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { + static void EQShortVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5466,13 +5509,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] == (short)((long)b[i])); } } } @Test(dataProvider = "shortCompareOpMaskProvider") - static void EQShortMaxVectorTestsBroadcastLongMaskedSmokeTest(IntFunction fa, + static void EQShortVectorMaxTestsBroadcastLongMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5486,7 +5529,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] == (short)((long)b[i]))); } } } @@ -5496,7 +5539,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShortMaxVectorTests(IntFunction fa, IntFunction fb, + static void blendShortVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5512,11 +5555,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, mask, ShortMaxVectorTests::blend); + assertArraysEquals(r, a, b, mask, ShortVectorMaxTests::blend); } @Test(dataProvider = "shortUnaryOpShuffleProvider") - static void RearrangeShortMaxVectorTests(IntFunction fa, + static void RearrangeShortVectorMaxTests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); int[] order = fs.apply(a.length, SPECIES.length()); @@ -5533,7 +5576,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpShuffleMaskProvider") - static void RearrangeShortMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void RearrangeShortVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -5551,7 +5594,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void compressShortMaxVectorTests(IntFunction fa, + static void compressShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5569,7 +5612,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void expandShortMaxVectorTests(IntFunction fa, + static void expandShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5587,7 +5630,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void getShortMaxVectorTests(IntFunction fa) { + static void getShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -5743,7 +5786,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastShortMaxVectorTests(IntFunction fa) { + static void BroadcastShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5757,7 +5800,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZeroShortMaxVectorTests(IntFunction fa) { + static void ZeroShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5767,7 +5810,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - Assert.assertEquals(a, r); + assertEquals(a, r); } static short[] sliceUnary(short[] a, int origin, int idx) { @@ -5782,7 +5825,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void sliceUnaryShortMaxVectorTests(IntFunction fa) { + static void sliceUnaryShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5793,7 +5836,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, ShortMaxVectorTests::sliceUnary); + assertArraysEquals(r, a, origin, ShortVectorMaxTests::sliceUnary); } static short[] sliceBinary(short[] a, short[] b, int origin, int idx) { @@ -5810,7 +5853,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void sliceBinaryShortMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void sliceBinaryShortVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5823,7 +5866,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, ShortMaxVectorTests::sliceBinary); + assertArraysEquals(r, a, b, origin, ShortVectorMaxTests::sliceBinary); } static short[] slice(short[] a, short[] b, int origin, boolean[] mask, int idx) { @@ -5840,7 +5883,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void sliceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void sliceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5857,7 +5900,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, mask, ShortMaxVectorTests::slice); + assertArraysEquals(r, a, b, origin, mask, ShortVectorMaxTests::slice); } static short[] unsliceUnary(short[] a, int origin, int idx) { @@ -5874,7 +5917,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void unsliceUnaryShortMaxVectorTests(IntFunction fa) { + static void unsliceUnaryShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; int origin = RAND.nextInt(SPECIES.length()); @@ -5885,7 +5928,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, origin, ShortMaxVectorTests::unsliceUnary); + assertArraysEquals(r, a, origin, ShortVectorMaxTests::unsliceUnary); } static short[] unsliceBinary(short[] a, short[] b, int origin, int part, int idx) { @@ -5911,7 +5954,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpProvider") - static void unsliceBinaryShortMaxVectorTestsBinary(IntFunction fa, IntFunction fb) { + static void unsliceBinaryShortVectorMaxTestsBinary(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -5925,7 +5968,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, ShortMaxVectorTests::unsliceBinary); + assertArraysEquals(r, a, b, origin, part, ShortVectorMaxTests::unsliceBinary); } static short[] unslice(short[] a, short[] b, int origin, int part, boolean[] mask, int idx) { @@ -5965,7 +6008,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void unsliceShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void unsliceShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -5982,7 +6025,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, origin, part, mask, ShortMaxVectorTests::unslice); + assertArraysEquals(r, a, b, origin, part, mask, ShortVectorMaxTests::unslice); } static short BITWISE_BLEND(short a, short b, short c) { @@ -5994,7 +6037,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShortMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6009,11 +6052,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShortMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6026,11 +6069,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(bv, cv).intoArray(r, i); } - assertArraysEquals(r, a, b, c, ShortMaxVectorTests::bitwiseBlend); + assertArraysEquals(r, a, b, c, ShortVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShortMaxVectorTestsMasked(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVectorMaxTestsMasked(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6048,11 +6091,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND); + assertArraysEquals(r, a, b, c, mask, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6063,11 +6106,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShortMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6078,11 +6121,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6093,11 +6136,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { ShortVector bv = ShortVector.fromArray(SPECIES, b, i); av.bitwiseBlend(bv, c[i]).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::bitwiseBlend); + assertBroadcastArraysEquals(r, a, b, c, ShortVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShortMaxVectorTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVectorMaxTestsAltBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6108,11 +6151,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { ShortVector cv = ShortVector.fromArray(SPECIES, c, i); av.bitwiseBlend(b[i], cv).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::bitwiseBlend); + assertAltBroadcastArraysEquals(r, a, b, c, ShortVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6127,11 +6170,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, bv, c[i], vmask).intoArray(r, i); } - assertBroadcastArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND); + assertBroadcastArraysEquals(r, a, b, c, mask, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShortMaxVectorTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVectorMaxTestsAltBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6146,11 +6189,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv, vmask).intoArray(r, i); } - assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND); + assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void BITWISE_BLENDShortMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void BITWISE_BLENDShortVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6161,11 +6204,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVectorMaxTests::BITWISE_BLEND); } @Test(dataProvider = "shortTernaryOpProvider") - static void bitwiseBlendShortMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { + static void bitwiseBlendShortVectorMaxTestsDoubleBroadcastSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] c = fc.apply(SPECIES.length()); @@ -6176,11 +6219,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.bitwiseBlend(b[i], c[i]).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::bitwiseBlend); + assertDoubleBroadcastArraysEquals(r, a, b, c, ShortVectorMaxTests::bitwiseBlend); } @Test(dataProvider = "shortTernaryOpMaskProvider") - static void BITWISE_BLENDShortMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, + static void BITWISE_BLENDShortVectorMaxTestsDoubleBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb, IntFunction fc, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6194,7 +6237,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i], vmask).intoArray(r, i); } - assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND); + assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortVectorMaxTests::BITWISE_BLEND); } static short NEG(short a) { @@ -6206,7 +6249,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NEGShortMaxVectorTests(IntFunction fa) { + static void NEGShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6217,11 +6260,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::NEG); + assertArraysEquals(r, a, ShortVectorMaxTests::NEG); } @Test(dataProvider = "shortUnaryOpProvider") - static void negShortMaxVectorTests(IntFunction fa) { + static void negShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6232,11 +6275,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::neg); + assertArraysEquals(r, a, ShortVectorMaxTests::neg); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NEGMaskedShortMaxVectorTests(IntFunction fa, + static void NEGMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6250,7 +6293,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::NEG); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::NEG); } static short ABS(short a) { @@ -6262,7 +6305,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ABSShortMaxVectorTests(IntFunction fa) { + static void ABSShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6273,11 +6316,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::ABS); + assertArraysEquals(r, a, ShortVectorMaxTests::ABS); } @Test(dataProvider = "shortUnaryOpProvider") - static void absShortMaxVectorTests(IntFunction fa) { + static void absShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6288,11 +6331,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::abs); + assertArraysEquals(r, a, ShortVectorMaxTests::abs); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ABSMaskedShortMaxVectorTests(IntFunction fa, + static void ABSMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6306,7 +6349,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::ABS); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::ABS); } static short NOT(short a) { @@ -6318,7 +6361,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void NOTShortMaxVectorTests(IntFunction fa) { + static void NOTShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6329,11 +6372,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::NOT); + assertArraysEquals(r, a, ShortVectorMaxTests::NOT); } @Test(dataProvider = "shortUnaryOpProvider") - static void notShortMaxVectorTests(IntFunction fa) { + static void notShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6344,11 +6387,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::not); + assertArraysEquals(r, a, ShortVectorMaxTests::not); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void NOTMaskedShortMaxVectorTests(IntFunction fa, + static void NOTMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6362,7 +6405,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::NOT); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::NOT); } static short ZOMO(short a) { @@ -6370,7 +6413,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ZOMOShortMaxVectorTests(IntFunction fa) { + static void ZOMOShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6381,11 +6424,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::ZOMO); + assertArraysEquals(r, a, ShortVectorMaxTests::ZOMO); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ZOMOMaskedShortMaxVectorTests(IntFunction fa, + static void ZOMOMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6399,7 +6442,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::ZOMO); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::ZOMO); } static short BIT_COUNT(short a) { @@ -6407,7 +6450,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void BIT_COUNTShortMaxVectorTests(IntFunction fa) { + static void BIT_COUNTShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6418,11 +6461,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, ShortVectorMaxTests::BIT_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void BIT_COUNTMaskedShortMaxVectorTests(IntFunction fa, + static void BIT_COUNTMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6436,7 +6479,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::BIT_COUNT); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::BIT_COUNT); } static short TRAILING_ZEROS_COUNT(short a) { @@ -6444,7 +6487,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void TRAILING_ZEROS_COUNTShortMaxVectorTests(IntFunction fa) { + static void TRAILING_ZEROS_COUNTShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6455,11 +6498,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVectorMaxTests::TRAILING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void TRAILING_ZEROS_COUNTMaskedShortMaxVectorTests(IntFunction fa, + static void TRAILING_ZEROS_COUNTMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6473,7 +6516,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::TRAILING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::TRAILING_ZEROS_COUNT); } static short LEADING_ZEROS_COUNT(short a) { @@ -6481,7 +6524,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void LEADING_ZEROS_COUNTShortMaxVectorTests(IntFunction fa) { + static void LEADING_ZEROS_COUNTShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6492,11 +6535,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, ShortVectorMaxTests::LEADING_ZEROS_COUNT); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void LEADING_ZEROS_COUNTMaskedShortMaxVectorTests(IntFunction fa, + static void LEADING_ZEROS_COUNTMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6510,7 +6553,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::LEADING_ZEROS_COUNT); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::LEADING_ZEROS_COUNT); } static short REVERSE(short a) { @@ -6518,7 +6561,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSEShortMaxVectorTests(IntFunction fa) { + static void REVERSEShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6529,11 +6572,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::REVERSE); + assertArraysEquals(r, a, ShortVectorMaxTests::REVERSE); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSEMaskedShortMaxVectorTests(IntFunction fa, + static void REVERSEMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6547,7 +6590,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::REVERSE); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::REVERSE); } static short REVERSE_BYTES(short a) { @@ -6555,7 +6598,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void REVERSE_BYTESShortMaxVectorTests(IntFunction fa) { + static void REVERSE_BYTESShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6566,11 +6609,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, ShortVectorMaxTests::REVERSE_BYTES); } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void REVERSE_BYTESMaskedShortMaxVectorTests(IntFunction fa, + static void REVERSE_BYTESMaskedShortVectorMaxTests(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -6584,7 +6627,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, mask, ShortMaxVectorTests::REVERSE_BYTES); + assertArraysEquals(r, a, mask, ShortVectorMaxTests::REVERSE_BYTES); } static boolean band(boolean a, boolean b) { @@ -6592,7 +6635,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandShortVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6605,7 +6648,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::band); + assertArraysEquals(r, a, b, ShortVectorMaxTests::band); } static boolean bor(boolean a, boolean b) { @@ -6613,7 +6656,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskorShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskorShortVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6626,7 +6669,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::bor); + assertArraysEquals(r, a, b, ShortVectorMaxTests::bor); } static boolean bxor(boolean a, boolean b) { @@ -6634,7 +6677,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskxorShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskxorShortVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6647,7 +6690,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::bxor); + assertArraysEquals(r, a, b, ShortVectorMaxTests::bxor); } static boolean bandNot(boolean a, boolean b) { @@ -6655,7 +6698,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskandNotShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskandNotShortVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6668,7 +6711,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::bandNot); + assertArraysEquals(r, a, b, ShortVectorMaxTests::bandNot); } static boolean beq(boolean a, boolean b) { @@ -6676,7 +6719,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskeqShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskeqShortVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6689,7 +6732,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, b, ShortMaxVectorTests::beq); + assertArraysEquals(r, a, b, ShortVectorMaxTests::beq); } static boolean unot(boolean a) { @@ -6697,7 +6740,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "boolMaskUnaryOpProvider") - static void masknotShortMaxVectorTests(IntFunction fa) { + static void masknotShortVectorMaxTests(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); boolean[] r = new boolean[a.length]; @@ -6708,7 +6751,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertArraysEquals(r, a, ShortMaxVectorTests::unot); + assertArraysEquals(r, a, ShortVectorMaxTests::unot); } private static final long LONG_MASK_BITS = 0xFFFFFFFFFFFFFFFFL >>> (64 - SPECIES.length()); @@ -6717,15 +6760,15 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } @Test(dataProvider = "longMaskProvider") - static void maskFromToLongShortMaxVectorTests(IntFunction fa) { + static void maskFromToLongShortVectorMaxTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = new long[a.length]; @@ -6739,7 +6782,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortCompareOpProvider") - static void ltShortMaxVectorTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { + static void ltShortVectorMaxTestsBroadcastSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6749,13 +6792,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @Test(dataProvider = "shortCompareOpProvider") - static void eqShortMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { + static void eqShortVectorMaxTestsBroadcastMaskedSmokeTest(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6765,13 +6808,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @Test(dataProvider = "shortUnaryOpProvider") - static void toIntArrayShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void toIntArrayShortVectorMaxTestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6782,7 +6825,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toLongArrayShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void toLongArrayShortVectorMaxTestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6793,7 +6836,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toDoubleArrayShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void toDoubleArrayShortVectorMaxTestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6804,7 +6847,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void toStringShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void toStringShortVectorMaxTestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6817,7 +6860,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void hashCodeShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void hashCodeShortVectorMaxTestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -6850,7 +6893,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpProvider") - static void ADDReduceLongShortMaxVectorTests(IntFunction fa) { + static void ADDReduceLongShortVectorMaxTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); long ra = 0; @@ -6866,7 +6909,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionLongArraysEquals(r, ra, a, - ShortMaxVectorTests::ADDReduceLong, ShortMaxVectorTests::ADDReduceAllLong); + ShortVectorMaxTests::ADDReduceLong, ShortVectorMaxTests::ADDReduceAllLong); } static long ADDReduceLongMasked(short[] a, int idx, boolean[] mask) { @@ -6889,7 +6932,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpMaskProvider") - static void ADDReduceLongShortMaxVectorTestsMasked(IntFunction fa, IntFunction fm) { + static void ADDReduceLongShortVectorMaxTestsMasked(IntFunction fa, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); long[] r = lfr.apply(SPECIES.length()); boolean[] mask = fm.apply(SPECIES.length()); @@ -6907,11 +6950,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } assertReductionLongArraysEqualsMasked(r, ra, a, mask, - ShortMaxVectorTests::ADDReduceLongMasked, ShortMaxVectorTests::ADDReduceAllLongMasked); + ShortVectorMaxTests::ADDReduceLongMasked, ShortVectorMaxTests::ADDReduceAllLongMasked); } @Test(dataProvider = "shortUnaryOpProvider") - static void BroadcastLongShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void BroadcastLongShortVectorMaxTestsSmokeTest(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = new short[a.length]; @@ -6922,7 +6965,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void blendShortMaxVectorTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, + static void blendShortVectorMaxTestsBroadcastLongSmokeTest(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -6936,12 +6979,12 @@ public class ShortMaxVectorTests extends AbstractVectorTest { av.blend((long)b[i], vmask).intoArray(r, i); } } - assertBroadcastLongArraysEquals(r, a, b, mask, ShortMaxVectorTests::blend); + assertBroadcastLongArraysEquals(r, a, b, mask, ShortVectorMaxTests::blend); } @Test(dataProvider = "shortUnaryOpSelectFromProvider") - static void SelectFromShortMaxVectorTests(IntFunction fa, + static void SelectFromShortVectorMaxTests(IntFunction fa, BiFunction fs) { short[] a = fa.apply(SPECIES.length()); short[] order = fs.apply(a.length, SPECIES.length()); @@ -6957,7 +7000,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortSelectFromTwoVectorOpProvider") - static void SelectFromTwoVectorShortMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fc) { + static void SelectFromTwoVectorShortVectorMaxTests(IntFunction fa, IntFunction fb, IntFunction fc) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] idx = fc.apply(SPECIES.length()); @@ -6975,7 +7018,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shortUnaryOpSelectFromMaskProvider") - static void SelectFromShortMaxVectorTestsMaskedSmokeTest(IntFunction fa, + static void SelectFromShortVectorMaxTestsMaskedSmokeTest(IntFunction fa, BiFunction fs, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); @@ -6994,7 +7037,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleProvider") - static void shuffleMiscellaneousShortMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleMiscellaneousShortVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7005,12 +7048,12 @@ public class ShortMaxVectorTests extends AbstractVectorTest { int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @Test(dataProvider = "shuffleProvider") - static void shuffleToStringShortMaxVectorTestsSmokeTest(BiFunction fs) { + static void shuffleToStringShortVectorMaxTestsSmokeTest(BiFunction fs) { int[] a = fs.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7024,7 +7067,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "shuffleCompareOpProvider") - static void shuffleEqualsShortMaxVectorTestsSmokeTest(BiFunction fa, BiFunction fb) { + static void shuffleEqualsShortVectorMaxTestsSmokeTest(BiFunction fa, BiFunction fb) { int[] a = fa.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); int[] b = fb.apply(SPECIES.length() * BUFFER_REPS, SPECIES.length()); @@ -7033,12 +7076,12 @@ public class ShortMaxVectorTests extends AbstractVectorTest { var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @Test(dataProvider = "boolMaskBinaryOpProvider") - static void maskEqualsShortMaxVectorTests(IntFunction fa, IntFunction fb) { + static void maskEqualsShortVectorMaxTests(IntFunction fa, IntFunction fb) { boolean[] a = fa.apply(SPECIES.length()); boolean[] b = fb.apply(SPECIES.length()); @@ -7048,13 +7091,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @Test(dataProvider = "maskProvider") - static void maskHashCodeShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskHashCodeShortVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -7076,7 +7119,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskTrueCountShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskTrueCountShortVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7087,7 +7130,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, ShortMaxVectorTests::maskTrueCount); + assertMaskReductionArraysEquals(r, a, ShortVectorMaxTests::maskTrueCount); } static int maskLastTrue(boolean[] a, int idx) { @@ -7101,7 +7144,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskLastTrueShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskLastTrueShortVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7112,7 +7155,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, ShortMaxVectorTests::maskLastTrue); + assertMaskReductionArraysEquals(r, a, ShortVectorMaxTests::maskLastTrue); } static int maskFirstTrue(boolean[] a, int idx) { @@ -7126,7 +7169,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "maskProvider") - static void maskFirstTrueShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskFirstTrueShortVectorMaxTestsSmokeTest(IntFunction fa) { boolean[] a = fa.apply(SPECIES.length()); int[] r = new int[a.length]; @@ -7137,11 +7180,11 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } } - assertMaskReductionArraysEquals(r, a, ShortMaxVectorTests::maskFirstTrue); + assertMaskReductionArraysEquals(r, a, ShortVectorMaxTests::maskFirstTrue); } @Test(dataProvider = "maskProvider") - static void maskCompressShortMaxVectorTestsSmokeTest(IntFunction fa) { + static void maskCompressShortVectorMaxTestsSmokeTest(IntFunction fa) { int trueCount = 0; boolean[] a = fa.apply(SPECIES.length()); @@ -7151,7 +7194,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -7169,7 +7212,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "offsetProvider") - static void indexInRangeShortMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeShortVectorMaxTestsSmokeTest(int offset) { int limit = SPECIES.length() * BUFFER_REPS; for (int i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7177,13 +7220,13 @@ public class ShortMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @Test(dataProvider = "offsetProvider") - static void indexInRangeLongShortMaxVectorTestsSmokeTest(int offset) { + static void indexInRangeLongShortVectorMaxTestsSmokeTest(int offset) { long limit = SPECIES.length() * BUFFER_REPS; for (long i = 0; i < limit; i += SPECIES.length()) { var actualMask = SPECIES.indexInRange(i + offset, limit); @@ -7191,7 +7234,7 @@ public class ShortMaxVectorTests extends AbstractVectorTest { assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -7210,36 +7253,36 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test(dataProvider = "lengthProvider") - static void loopBoundShortMaxVectorTestsSmokeTest(int length) { + static void loopBoundShortVectorMaxTestsSmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") - static void loopBoundLongShortMaxVectorTestsSmokeTest(int _length) { + static void loopBoundLongShortVectorMaxTestsSmokeTest(int _length) { long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test - static void ElementSizeShortMaxVectorTestsSmokeTest() { + static void ElementSizeShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, Short.SIZE); + assertEquals(elsize, Short.SIZE); } @Test - static void VectorShapeShortMaxVectorTestsSmokeTest() { + static void VectorShapeShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); assert(vsh.equals(VectorShape.S_Max_BIT)); } @Test - static void ShapeWithLanesShortMaxVectorTestsSmokeTest() { + static void ShapeWithLanesShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = vsh.withLanes(short.class); @@ -7247,32 +7290,32 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test - static void ElementTypeShortMaxVectorTestsSmokeTest() { + static void ElementTypeShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementType() == short.class); } @Test - static void SpeciesElementSizeShortMaxVectorTestsSmokeTest() { + static void SpeciesElementSizeShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().elementSize() == Short.SIZE); } @Test - static void VectorTypeShortMaxVectorTestsSmokeTest() { + static void VectorTypeShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); assert(av.species().vectorType() == av.getClass()); } @Test - static void WithLanesShortMaxVectorTestsSmokeTest() { + static void WithLanesShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorSpecies species = av.species().withLanes(short.class); assert(species.equals(SPECIES)); } @Test - static void WithShapeShortMaxVectorTestsSmokeTest() { + static void WithShapeShortVectorMaxTestsSmokeTest() { ShortVector av = ShortVector.zero(SPECIES); VectorShape vsh = av.shape(); VectorSpecies species = av.species().withShape(vsh); @@ -7280,9 +7323,9 @@ public class ShortMaxVectorTests extends AbstractVectorTest { } @Test - static void MaskAllTrueShortMaxVectorTestsSmokeTest() { + static void MaskAllTrueShortVectorMaxTestsSmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } } diff --git a/test/jdk/jdk/incubator/vector/gen-tests.sh b/test/jdk/jdk/incubator/vector/gen-tests.sh index 8b87d9d9efb..8b5c4cac616 100644 --- a/test/jdk/jdk/incubator/vector/gen-tests.sh +++ b/test/jdk/jdk/incubator/vector/gen-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2026, 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,6 +64,7 @@ do MinValue=MIN_VALUE kind=BITWISE + fpkind=BITWISE bitstype=$type Bitstype=$Type @@ -99,6 +100,7 @@ do ;; float) kind=FP + fpkind=FP32 bitstype=int Bitstype=Int Boxbitstype=Integer @@ -108,6 +110,7 @@ do ;; double) kind=FP + fpkind=FP64 bitstype=long Bitstype=Long Boxbitstype=Long @@ -117,13 +120,12 @@ do ;; esac - args="$args -K$kind -K$Type -DBoxtype=$Boxtype -DWideboxtype=$Wideboxtype -DMaxValue=$MaxValue -DMinValue=$MinValue" + args="$args -K$kind -K$fpkind -K$Type -DBoxtype=$Boxtype -DWideboxtype=$Wideboxtype -DMaxValue=$MaxValue -DMinValue=$MinValue" args="$args -Dbitstype=$bitstype -DBitstype=$Bitstype -DBoxbitstype=$Boxbitstype" args="$args -Dfptype=$fptype -DFptype=$Fptype -DBoxfptype=$Boxfptype" abstractvectortype=${typeprefix}${Type}Vector abstractvectorteststype=${typeprefix}${Type}VectorTests - abstractbitsvectortype=${typeprefix}${Bitstype}Vector abstractfpvectortype=${typeprefix}${Fptype}Vector args="$args -Dabstractvectortype=$abstractvectortype -Dabstractvectorteststype=$abstractvectorteststype -Dabstractbitsvectortype=$abstractbitsvectortype -Dabstractfpvectortype=$abstractfpvectortype" @@ -133,12 +135,12 @@ do for bits in 64 128 256 512 Max do - vectortype=${typeprefix}${Type}${bits}Vector - vectorteststype=${typeprefix}${Type}${bits}VectorTests - vectorbenchtype=${typeprefix}${Type}${bits}Vector - masktype=${typeprefix}${Type}${bits}Mask - bitsvectortype=${typeprefix}${Bitstype}${bits}Vector - fpvectortype=${typeprefix}${Fptype}${bits}Vector + vectortype=${typeprefix}${Type}$Vector{bits} + vectorteststype=${typeprefix}${Type}Vector${bits}Tests + vectorbenchtype=${typeprefix}${Type}Vector${bits} + masktype=${typeprefix}${Type}$Mask{bits} + bitsvectortype=${typeprefix}${Bitstype}Vector${bits} + fpvectortype=${typeprefix}${Fptype}Vector${bits} shape=S${bits}Bit Shape=S_${bits}_BIT if [[ "${vectortype}" == "ByteMaxVector" ]]; then @@ -208,12 +210,12 @@ do # For each size for bits in 64 128 256 512 Max do - vectortype=${typeprefix}${Type}${bits}Vector - vectorteststype=${typeprefix}${Type}${bits}VectorLoadStoreTests - vectorbenchtype=${typeprefix}${Type}${bits}VectorLoadStore - masktype=${typeprefix}${Type}${bits}Mask - bitsvectortype=${typeprefix}${Bitstype}${bits}Vector - fpvectortype=${typeprefix}${Fptype}${bits}Vector + vectortype=${typeprefix}${Type}Vector${bits} + vectorteststype=${typeprefix}${Type}Vector${bits}LoadStoreTests + vectorbenchtype=${typeprefix}${Type}Vector${bits}LoadStore + masktype=${typeprefix}${Type}Mask${bits} + bitsvectortype=${typeprefix}${Bitstype}Vector${bits} + fpvectortype=${typeprefix}${Fptype}Vector${bits} shape=S${bits}Bit Shape=S_${bits}_BIT if [[ "${vectortype}" == "ByteMaxVector" ]]; then diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Broadcast.template b/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Broadcast.template index e3fcdf57e83..92e612e8184 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Broadcast.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Broadcast.template @@ -10,7 +10,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] [[TEST_OP]] b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] [[TEST_OP]] b[i]); } } } @@ -30,7 +30,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] [[TEST_OP]] b[i])); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] [[TEST_OP]] b[i])); } } } @@ -47,7 +47,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] [[TEST_OP]] ($type$)((long)b[i])); + assertEquals(mv.laneIsSet(j), a[i + j] [[TEST_OP]] ($type$)((long)b[i])); } } } @@ -67,7 +67,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] [[TEST_OP]] ($type$)((long)b[i]))); + assertEquals(mv.laneIsSet(j), mask[j] && (a[i + j] [[TEST_OP]] ($type$)((long)b[i]))); } } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Masked.template b/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Masked.template index b34658ffc4c..6620dc679b8 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Masked.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Compare-Masked.template @@ -16,7 +16,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), mask[j] && [[TEST_OP]](a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), mask[j] && [[TEST_OP]](a[i + j], b[i + j])); } } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Compare.template b/test/jdk/jdk/incubator/vector/templates/Unit-Compare.template index 47ddfaf4ab0..f3c7b52f70f 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Compare.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Compare.template @@ -12,7 +12,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), [[TEST_OP]](a[i + j], b[i + j])); + assertEquals(mv.laneIsSet(j), [[TEST_OP]](a[i + j], b[i + j])); } } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Mask-FromToLong.template b/test/jdk/jdk/incubator/vector/templates/Unit-Mask-FromToLong.template index 784ef5f81b9..3f8bd186ca4 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Mask-FromToLong.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Mask-FromToLong.template @@ -5,10 +5,10 @@ int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], a[i] & bits); + assertEquals(r[i], a[i] & bits); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); + assertEquals(r[i], a[i] & bits, "(" + a[i] + ") at index #" + i); } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template b/test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template index 460f7624f2c..8411565628d 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Miscellaneous.template @@ -10,7 +10,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] < b[i]); } } } @@ -26,7 +26,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); + assertEquals(mv.laneIsSet(j), a[i + j] == b[i]); } } } @@ -350,7 +350,7 @@ int subarr[] = Arrays.copyOfRange(a, i, i + SPECIES.length()); int expectedHash = Objects.hash(SPECIES, Arrays.hashCode(subarr)); Assert.assertTrue(hash == expectedHash, "at index " + i + ", hash should be = " + expectedHash + ", but is = " + hash); - Assert.assertEquals(length, SPECIES.length()); + assertEquals(length, SPECIES.length()); } } @@ -378,7 +378,7 @@ var bv = VectorShuffle.fromArray(SPECIES, b, i); boolean eq = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); + assertEquals(eq, Arrays.equals(a, i, to, b, i, to)); } } @@ -393,7 +393,7 @@ var bv = SPECIES.loadMask(b, i); boolean equals = av.equals(bv); int to = i + SPECIES.length(); - Assert.assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); + assertEquals(equals, Arrays.equals(a, i, to, b, i, to)); } } } @@ -496,7 +496,7 @@ trueCount = vmask.trueCount(); var rmask = vmask.compress(); for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(rmask.laneIsSet(j), j < trueCount); + assertEquals(rmask.laneIsSet(j), j < trueCount); } } } @@ -522,7 +522,7 @@ assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { int index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -536,7 +536,7 @@ assert(actualMask.equals(expectedMask)); for (int j = 0; j < SPECIES.length(); j++) { long index = i + j + offset; - Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); + assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit); } } } @@ -558,7 +558,7 @@ static void loopBound$vectorteststype$SmokeTest(int length) { int actualLoopBound = SPECIES.loopBound(length); int expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test(dataProvider = "lengthProvider") @@ -566,14 +566,14 @@ long length = _length; long actualLoopBound = SPECIES.loopBound(length); long expectedLoopBound = length - Math.floorMod(length, SPECIES.length()); - Assert.assertEquals(actualLoopBound, expectedLoopBound); + assertEquals(actualLoopBound, expectedLoopBound); } @Test static void ElementSize$vectorteststype$SmokeTest() { $abstractvectortype$ av = $abstractvectortype$.zero(SPECIES); int elsize = av.elementSize(); - Assert.assertEquals(elsize, $Wideboxtype$.SIZE); + assertEquals(elsize, $Wideboxtype$.SIZE); } @Test @@ -627,6 +627,6 @@ @Test static void MaskAllTrue$vectorteststype$SmokeTest() { for (int ic = 0; ic < INVOC_COUNT; ic++) { - Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); + assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length())); } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op-func.template b/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op-func.template index c797ad907fb..4be33efd57c 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op-func.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op-func.template @@ -11,20 +11,20 @@ $type$[] a = fa.apply(SPECIES.length()); $type$ id = [[TEST_INIT]]; - Assert.assertEquals([[TEST_OP]](id, id), id, + assertEquals([[TEST_OP]](id, id), id, "[[TEST]]([[TEST_INIT]], [[TEST_INIT]]) != [[TEST_INIT]]"); $type$ x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals([[TEST_OP]](id, x), x); - Assert.assertEquals([[TEST_OP]](x, id), x); + assertEquals([[TEST_OP]](id, x), x); + assertEquals([[TEST_OP]](x, id), x); } } catch (AssertionError e) { - Assert.assertEquals([[TEST_OP]](id, x), x, + assertEquals([[TEST_OP]](id, x), x, "[[TEST]]([[TEST_INIT]], " + x + ") != " + x); - Assert.assertEquals([[TEST_OP]](x, id), x, + assertEquals([[TEST_OP]](x, id), x, "[[TEST]](" + x + ", [[TEST_INIT]]) != " + x); } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op.template b/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op.template index f8438fa58c8..25ae3ba2f12 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Reduction-op.template @@ -15,20 +15,20 @@ $type$[] a = fa.apply(SPECIES.length()); $type$ id = [[TEST_INIT]]; - Assert.assertEquals(($type$) (id [[TEST_OP]] id), id, + assertEquals(($type$) (id [[TEST_OP]] id), id, "[[TEST]]([[TEST_INIT]], [[TEST_INIT]]) != [[TEST_INIT]]"); $type$ x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals(($type$) (id [[TEST_OP]] x), x); - Assert.assertEquals(($type$) (x [[TEST_OP]] id), x); + assertEquals(($type$) (id [[TEST_OP]] x), x); + assertEquals(($type$) (x [[TEST_OP]] id), x); } } catch (AssertionError e) { - Assert.assertEquals(($type$) (id [[TEST_OP]] x), x, + assertEquals(($type$) (id [[TEST_OP]] x), x, "[[TEST]]([[TEST_INIT]], " + x + ") != " + x); - Assert.assertEquals(($type$) (x [[TEST_OP]] id), x, + assertEquals(($type$) (x [[TEST_OP]] id), x, "[[TEST]](" + x + ", [[TEST_INIT]]) != " + x); } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-SaturatingReduction-op.template b/test/jdk/jdk/incubator/vector/templates/Unit-SaturatingReduction-op.template index d961a29e5c8..4769b67fe3e 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-SaturatingReduction-op.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-SaturatingReduction-op.template @@ -11,20 +11,20 @@ $type$[] a = fa.apply(SPECIES.length()); $type$ id = [[TEST_INIT]]; - Assert.assertEquals([[TEST_OP]](id, id), id, + assertEquals([[TEST_OP]](id, id), id, "[[TEST]]([[TEST_INIT]], [[TEST_INIT]]) != [[TEST_INIT]]"); $type$ x = 0; try { for (int i = 0; i < a.length; i++) { x = a[i]; - Assert.assertEquals([[TEST_OP]](id, x), x); - Assert.assertEquals([[TEST_OP]](x, id), x); + assertEquals([[TEST_OP]](id, x), x); + assertEquals([[TEST_OP]](x, id), x); } } catch (AssertionError e) { - Assert.assertEquals([[TEST_OP]](id, x), x, + assertEquals([[TEST_OP]](id, x), x, "[[TEST]]([[TEST_INIT]], " + x + ") != " + x); - Assert.assertEquals([[TEST_OP]](x, id), x, + assertEquals([[TEST_OP]](x, id), x, "[[TEST]](" + x + ", [[TEST_INIT]]) != " + x); } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Test.template b/test/jdk/jdk/incubator/vector/templates/Unit-Test.template index 080773ede1a..8af517cfe56 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Test.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Test.template @@ -14,7 +14,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), test[[TEST]](a[i + j])); + assertEquals(mv.laneIsSet(j), test[[TEST]](a[i + j])); } } } @@ -34,7 +34,7 @@ // Check results as part of computation. for (int j = 0; j < SPECIES.length(); j++) { - Assert.assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && test[[TEST]](a[i + j])); + assertEquals(mv.laneIsSet(j), vmask.laneIsSet(j) && test[[TEST]](a[i + j])); } } } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-Zero.template b/test/jdk/jdk/incubator/vector/templates/Unit-Zero.template index a277d66ae3e..a5b13c1ab00 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-Zero.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-Zero.template @@ -2,5 +2,5 @@ @Test(dataProvider = "$type$UnaryOpProvider") static void Zero$vectorteststype$(IntFunction<$type$[]> fa) { [[KERNEL]] - Assert.assertEquals(a, r); + assertEquals(a, r); } diff --git a/test/jdk/jdk/incubator/vector/templates/Unit-header.template b/test/jdk/jdk/incubator/vector/templates/Unit-header.template index e1ec6624022..00a7766492c 100644 --- a/test/jdk/jdk/incubator/vector/templates/Unit-header.template +++ b/test/jdk/jdk/incubator/vector/templates/Unit-header.template @@ -86,6 +86,53 @@ public class $vectorteststype$ extends AbstractVectorTest { #end[MaxBit] static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100); + static void assertEquals($type$ actual, $type$ expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals($type$ actual, $type$ expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertEquals($type$ actual, $type$ expected, $type$ delta) { + Assert.assertEquals(actual, expected, delta); + } + static void assertEquals($type$ actual, $type$ expected, $type$ delta, String msg) { + Assert.assertEquals(actual, expected, delta, msg); + } + static void assertEquals($type$ [] actual, $type$ [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals($type$ [] actual, $type$ [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } +#if[!long] + static void assertEquals(long actual, long expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(long actual, long expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } +#end[!long] + static void assertEquals(String actual, String expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(Object actual, Object expected) { + Assert.assertEquals(actual, expected); + } +#if[!FP64] + static void assertEquals(double actual, double expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(double actual, double expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } +#end[!FP64] + static void assertEquals(boolean actual, boolean expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals(boolean actual, boolean expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + #if[MaxBit] static VectorShape getMaxBit() { @@ -154,10 +201,10 @@ public class $vectorteststype$ extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]); } } @@ -169,13 +216,13 @@ public class $vectorteststype$ extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a[i])); } } catch (AssertionError e) { $type$[] ref = f.apply(a[i]); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -185,10 +232,10 @@ public class $vectorteststype$ extends AbstractVectorTest { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], mask[i % SPECIES.length()] ? f.apply(a[i]) : a[i], "at index #" + i + ", input = " + a[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -207,13 +254,13 @@ public class $vectorteststype$ extends AbstractVectorTest { #else[FP] int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } #end[FP] } @@ -224,13 +271,13 @@ public class $vectorteststype$ extends AbstractVectorTest { $type$ relativeErrorFactor) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); + assertEquals(rc, fa.apply(a), Math.ulp(rc) * relativeErrorFactor, "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), Math.ulp(r[i]) * relativeErrorFactor, "at index #" + i); } } #end[FP] @@ -250,13 +297,13 @@ public class $vectorteststype$ extends AbstractVectorTest { #else[FP] int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } #end[FP] } @@ -267,14 +314,14 @@ public class $vectorteststype$ extends AbstractVectorTest { $type$ relativeError) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), Math.abs(rc * relativeError), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), Math.abs(r[i] * relativeError), "at index #" + i); } } #end[FP] @@ -292,13 +339,13 @@ relativeError)); FReductionOpLong f, FReductionAllOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a)); + assertEquals(rc, fa.apply(a)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(rc, fa.apply(a), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -314,13 +361,13 @@ relativeError)); FReductionMaskedOpLong f, FReductionAllMaskedOpLong fa) { int i = 0; try { - Assert.assertEquals(rc, fa.apply(a, mask)); + assertEquals(rc, fa.apply(a, mask)); for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i, mask)); + assertEquals(r[i], f.apply(a, i, mask)); } } catch (AssertionError e) { - Assert.assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); - Assert.assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); + assertEquals(rc, fa.apply(a, mask), "Final result is incorrect!"); + assertEquals(r[i], f.apply(a, i, mask), "at index #" + i); } } #end[!Long] @@ -333,10 +380,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -348,10 +395,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(r[i], f.apply(a, i)); + assertEquals(r[i], f.apply(a, i)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a, i), "at index #" + i); + assertEquals(r[i], f.apply(a, i), "at index #" + i); } } @@ -360,12 +407,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]); } } @@ -376,20 +423,20 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + k], a[i + j]); + assertEquals(r[i + k], a[i + j]); k++; } } for (; k < vector_len; k++) { - Assert.assertEquals(r[i + k], ($type$)0); + assertEquals(r[i + k], ($type$)0); } } } catch (AssertionError e) { int idx = i + k; if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + j], "at index #" + idx); + assertEquals(r[idx], a[i + j], "at index #" + idx); } else { - Assert.assertEquals(r[idx], ($type$)0, "at index #" + idx); + assertEquals(r[idx], ($type$)0, "at index #" + idx); } } } @@ -401,19 +448,19 @@ relativeError)); k = 0; for (j = 0; j < vector_len; j++) { if (m[(i + j) % SPECIES.length()]) { - Assert.assertEquals(r[i + j], a[i + k]); + assertEquals(r[i + j], a[i + k]); k++; } else { - Assert.assertEquals(r[i + j], ($type$)0); + assertEquals(r[i + j], ($type$)0); } } } } catch (AssertionError e) { int idx = i + j; if (m[idx % SPECIES.length()]) { - Assert.assertEquals(r[idx], a[i + k], "at index #" + idx); + assertEquals(r[idx], a[i + k], "at index #" + idx); } else { - Assert.assertEquals(r[idx], ($type$)0, "at index #" + idx); + assertEquals(r[idx], ($type$)0, "at index #" + idx); } } } @@ -429,11 +476,11 @@ relativeError)); wrapped_index = Math.floorMod((int)order[idx], 2 * vector_len); is_exceptional_idx = wrapped_index >= vector_len; oidx = is_exceptional_idx ? (wrapped_index - vector_len) : wrapped_index; - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx])); } } } catch (AssertionError e) { - Assert.assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); + assertEquals(r[idx], (is_exceptional_idx ? b[i + oidx] : a[i + oidx]), "at index #" + idx + ", order = " + order[idx] + ", a = " + a[i + oidx] + ", b = " + b[i + oidx]); } } @@ -442,12 +489,12 @@ relativeError)); try { for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); } } } catch (AssertionError e) { int idx = i + j; - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]]); } } @@ -457,17 +504,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]]); + assertEquals(r[i+j], a[i+order[i+j]]); else - Assert.assertEquals(r[i+j], ($type$)0); + assertEquals(r[i+j], ($type$)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], ($type$)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], ($type$)0, "at index #" + idx + ", input = " + a[i+order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -477,17 +524,17 @@ relativeError)); for (; i < a.length; i += vector_len) { for (j = 0; j < vector_len; j++) { if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]]); + assertEquals(r[i+j], a[i+(int)order[i+j]]); else - Assert.assertEquals(r[i+j], ($type$)0); + assertEquals(r[i+j], ($type$)0); } } } catch (AssertionError e) { int idx = i + j; if (mask[j % SPECIES.length()]) - Assert.assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], a[i+(int)order[i+j]], "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); else - Assert.assertEquals(r[i+j], ($type$)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); + assertEquals(r[i+j], ($type$)0, "at index #" + idx + ", input = " + a[i+(int)order[i+j]] + ", mask = " + mask[j % SPECIES.length()]); } } @@ -501,10 +548,10 @@ relativeError)); try { for (i = 0; i < a.length; i++) { - Assert.assertEquals(r[i], a[i]); + assertEquals(r[i], a[i]); } } catch (AssertionError e) { - Assert.assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); + assertEquals(r[i], a[i], "at index #" + i + ", input = " + a[i]); } } @@ -516,10 +563,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i])); + assertEquals(r[i], f.apply(a[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i]), "(" + a[i] + ") at index #" + i); } } @@ -531,10 +578,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -555,18 +602,18 @@ relativeError)); try { for (; i < a.length; i++) { //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i])); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i]))); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i]), c[i]), "left associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i])), "right associative test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -581,18 +628,18 @@ relativeError)); for (; i < a.length; i++) { mask_bit = mask[i % SPECIES.length()]; //Left associative - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit)); //Right associative - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit)); //Results equal sanity check - Assert.assertEquals(rl[i], rr[i]); + assertEquals(rl[i], rr[i]); } } catch (AssertionError e) { - Assert.assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); - Assert.assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); + assertEquals(rl[i], f.apply(f.apply(a[i], b[i], mask_bit), c[i], mask_bit), "left associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rr[i], f.apply(a[i], f.apply(b[i], c[i], mask_bit), mask_bit), "right associative masked test at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask_bit); + assertEquals(rl[i], rr[i], "Result checks not equal at index #" + i + "leftRes = " + rl[i] + ", rightRes = " + rr[i]); } } @@ -600,10 +647,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i])); + assertEquals(r[i], f.apply(a[i], b[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b[i]), "(" + a[i] + ", " + b[i] + ") at index #" + i); } } @@ -611,10 +658,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b)); + assertEquals(r[i], f.apply(a[i], b)); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); + assertEquals(r[i], f.apply(a[i], b), "(" + a[i] + ", " + b + ") at index #" + i); } } @@ -622,10 +669,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()]), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -634,10 +681,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); + assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()]))); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()])), + assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()])), "(" + a[i] + ", " + b[(i / SPECIES.length()) * SPECIES.length()] + ") at index #" + i); } } @@ -650,10 +697,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -665,10 +712,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); + assertEquals(r[i], f.apply(a[i], b, mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b + ", mask = " + mask[i % SPECIES.length()]); } } @@ -680,10 +727,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -698,10 +745,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()]), + assertEquals(r[i], f.apply(a[i], ($type$)((long)b[(i / SPECIES.length()) * SPECIES.length()]), mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -714,11 +761,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j])); + assertEquals(r[i+j], f.apply(a[i+j], b[j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j], b[j]), "at index #" + i + ", " + j); } } @@ -732,11 +779,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], b[j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", input2 = " + b[j] + ", mask = " + mask[i]); } } @@ -758,11 +805,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j])); + assertEquals(r[i+j], f.apply(a[i+j])); } } } catch (AssertionError e) { - Assert.assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); + assertEquals(r[i+j], f.apply(a[i+j]), "at index #" + i + ", " + j); } } @@ -776,11 +823,11 @@ relativeError)); try { for (; j < a.length; j += SPECIES.length()) { for (i = 0; i < SPECIES.length(); i++) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i])); + assertEquals(r[i+j], f.apply(a[i+j], mask[i])); } } } catch (AssertionError err) { - Assert.assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); + assertEquals(r[i+j], f.apply(a[i+j], mask[i]), "at index #" + i + ", input1 = " + a[i+j] + ", mask = " + mask[i]); } } @@ -800,10 +847,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i])); + assertEquals(r[i], f.apply(a[i], b[i], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); + assertEquals(r[i], f.apply(a[i], b[i], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i]); } } @@ -815,10 +862,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + assertEquals(r[i], f.apply(a[i], b[i], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); } } @@ -827,10 +874,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); } @@ -840,10 +887,10 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i]); } @@ -859,11 +906,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[i], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[i] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + mask[i % SPECIES.length()]); @@ -880,11 +927,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[i], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[i] + ", mask = " + mask[i % SPECIES.length()]); @@ -895,11 +942,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()]); @@ -916,11 +963,11 @@ relativeError)); int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()])); } } catch (AssertionError err) { - Assert.assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], + assertEquals(r[i], f.apply(a[i], b[(i / SPECIES.length()) * SPECIES.length()], c[(i / SPECIES.length()) * SPECIES.length()], mask[i % SPECIES.length()]), "at index #" + i + ", input1 = " + a[i] + ", input2 = " + b[(i / SPECIES.length()) * SPECIES.length()] + ", input3 = " + c[(i / SPECIES.length()) * SPECIES.length()] + ", mask = " + @@ -1014,13 +1061,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, b, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, i, b, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -1041,13 +1088,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, i, mask, b, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, i, mask, b, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -1062,13 +1109,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(r, a, i, mask, b, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(r, a, i, mask, b, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + ", a: " + Arrays.toString(Arrays.copyOfRange(a, i, i+SPECIES.length())) + ", b: " @@ -1089,13 +1136,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, origin, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, origin, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i); } @@ -1109,13 +1156,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, b, origin, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1130,13 +1177,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, mask, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, b, origin, mask, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin); @@ -1151,13 +1198,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, b, origin, part, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1173,13 +1220,13 @@ relativeError)); int i = 0; try { for (; i < a.length; i += SPECIES.length()) { - Assert.assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), + assertEquals(Arrays.copyOfRange(r, i, i+SPECIES.length()), f.apply(a, b, origin, part, mask, i)); } } catch (AssertionError e) { $type$[] ref = f.apply(a, b, origin, part, mask, i); $type$[] res = Arrays.copyOfRange(r, i, i+SPECIES.length()); - Assert.assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + assertEquals(res, ref, "(ref: " + Arrays.toString(ref) + ", res: " + Arrays.toString(res) + "), at index #" + i + ", at origin #" + origin @@ -1229,10 +1276,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (int)(a[i+offs])); + assertEquals(r[i], (int)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (int)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } @@ -1279,10 +1326,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } #end[byte] @@ -1291,10 +1338,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (long)(a[i+offs])); + assertEquals(r[i], (long)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } #if[!Double] @@ -1303,10 +1350,10 @@ relativeError)); int i = 0; try { for (; i < r.length; i++) { - Assert.assertEquals(r[i], (double)(a[i+offs])); + assertEquals(r[i], (double)(a[i+offs])); } } catch (AssertionError e) { - Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); + assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]); } } #end[!Double] @@ -1958,7 +2005,7 @@ relativeError)); // Do some zipping and shuffling. $abstractvectortype$ io = ($abstractvectortype$) SPECIES.broadcast(0).addIndex(1); $abstractvectortype$ io2 = ($abstractvectortype$) VectorShuffle.iota(SPECIES,0,1,false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); $abstractvectortype$ a = io.add(($type$)1); //[1,2] $abstractvectortype$ b = a.neg(); //[-1,-2] $type$[] abValues = bothToArray(a,b); //[1,2,-1,-2] @@ -1973,19 +2020,19 @@ relativeError)); manual[i+0] = abValues[i/2]; manual[i+1] = abValues[a.length() + i/2]; } - Assert.assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); + assertEquals(Arrays.toString(zabValues), Arrays.toString(manual)); VectorShuffle<$Boxtype$> unz0 = VectorShuffle.makeUnzip(SPECIES, 0); VectorShuffle<$Boxtype$> unz1 = VectorShuffle.makeUnzip(SPECIES, 1); $abstractvectortype$ uab0 = zab0.rearrange(unz0,zab1); $abstractvectortype$ uab1 = zab0.rearrange(unz1,zab1); $type$[] abValues1 = bothToArray(uab0, uab1); - Assert.assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); + assertEquals(Arrays.toString(abValues), Arrays.toString(abValues1)); } static void iotaShuffle() { $abstractvectortype$ io = ($abstractvectortype$) SPECIES.broadcast(0).addIndex(1); $abstractvectortype$ io2 = ($abstractvectortype$) VectorShuffle.iota(SPECIES, 0 , 1, false).toVector(); - Assert.assertEquals(io, io2); + assertEquals(io, io2); } @Test @@ -2003,12 +2050,12 @@ relativeError)); Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); VectorSpecies asIntegralSpecies = asIntegral.species(); Assert.assertNotEquals(asIntegralSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asIntegralSpecies.length(), SPECIES.length()); - Assert.assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); + assertEquals(asIntegralSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asIntegralSpecies.length(), SPECIES.length()); + assertEquals(asIntegral.viewAsFloatingLanes().species(), SPECIES); #else[FP] Vector asIntegral = SPECIES.zero().viewAsIntegralLanes(); - Assert.assertEquals(asIntegral.species(), SPECIES); + assertEquals(asIntegral.species(), SPECIES); #end[FP] } #if[FP] @@ -2016,7 +2063,7 @@ relativeError)); @Test void viewAsFloatingLanesTest() { Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); - Assert.assertEquals(asFloating.species(), SPECIES); + assertEquals(asFloating.species(), SPECIES); } #else[FP] #if[byteOrShort] @@ -2032,9 +2079,9 @@ relativeError)); Vector asFloating = SPECIES.zero().viewAsFloatingLanes(); VectorSpecies asFloatingSpecies = asFloating.species(); Assert.assertNotEquals(asFloatingSpecies.elementType(), SPECIES.elementType()); - Assert.assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); - Assert.assertEquals(asFloatingSpecies.length(), SPECIES.length()); - Assert.assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); + assertEquals(asFloatingSpecies.vectorShape(), SPECIES.vectorShape()); + assertEquals(asFloatingSpecies.length(), SPECIES.length()); + assertEquals(asFloating.viewAsIntegralLanes().species(), SPECIES); } #end[byteOrShort] #end[FP] diff --git a/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template b/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template index a68103e1060..6779c78a490 100644 --- a/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template +++ b/test/jdk/jdk/incubator/vector/templates/X-LoadStoreTest.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 @@ -81,14 +81,29 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / $bits$); + static void assertEquals($type$ actual, $type$ expected) { + Assert.assertEquals(actual, expected); + } + + static void assertEquals($type$ actual, $type$ expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + + static void assertEquals($type$ [] actual, $type$ [] expected) { + Assert.assertEquals(actual, expected); + } + static void assertEquals($type$ [] actual, $type$ [] expected, String msg) { + Assert.assertEquals(actual, expected, msg); + } + static void assertArraysEquals($type$[] r, $type$[] a, boolean[] mask) { int i = 0; try { for (; i < a.length; i++) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : ($type$) 0); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : ($type$) 0); } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : ($type$) 0, "at index #" + i); + assertEquals(r[i], mask[i % SPECIES.length()] ? a[i] : ($type$) 0, "at index #" + i); } } @@ -342,7 +357,7 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { av.intoArray(r, i); } } - Assert.assertEquals(r, a); + assertEquals(r, a); } @Test(dataProvider = "$type$ProviderForIOOBE") @@ -1225,11 +1240,11 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], a[i + indexMap[j]]); + assertEquals(r[j], a[i + indexMap[j]]); } } } catch (AssertionError e) { - Assert.assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); + assertEquals(r[j], a[i + indexMap[j]], "at index #" + j); } } @@ -1240,11 +1255,11 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { for (; i < a.length; i += SPECIES.length()) { j = i; for (; j < i + SPECIES.length(); j++) { - Assert.assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: ($type$) 0); + assertEquals(r[j], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: ($type$) 0); } } } catch (AssertionError e) { - Assert.assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: ($type$) 0, "at index #" + j); + assertEquals(r[i], mask[j % SPECIES.length()] ? a[i + indexMap[j]]: ($type$) 0, "at index #" + j); } } @@ -1260,7 +1275,7 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } static void assertScatterArraysEquals($type$[] r, $type$[] a, int[] indexMap) { @@ -1273,7 +1288,7 @@ public class $vectorteststype$ extends AbstractVectorLoadStoreTest { } } - Assert.assertEquals(r, expected); + assertEquals(r, expected); } @DataProvider diff --git a/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java b/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java index 1234655f31a..960a4ca73d2 100644 --- a/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java +++ b/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2026, 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,6 +22,7 @@ */ package jdk.jfr.api.recording.misc; +import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; import jdk.jfr.RecordingState; import jdk.jfr.consumer.RecordedEvent; @@ -79,8 +80,14 @@ public class TestRecordingCopy { Asserts.assertEquals(stoppedCopy.getState(), RecordingState.STOPPED); assertCopy(stoppedCopy, original); - // Clean-up original.close(); + int beforeCount = FlightRecorder.getFlightRecorder().getRecordings().size(); + Recording closedCopy = original.copy(true); + Asserts.assertEquals(closedCopy.getState(), RecordingState.CLOSED); + int afterCount = FlightRecorder.getFlightRecorder().getRecordings().size(); + Asserts.assertEquals(beforeCount, afterCount); + + // Clean-up runningCopy.stop(); runningCopy.close(); stoppedCopy.close(); diff --git a/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java b/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java index b2f20450d0d..b6f96e9f244 100644 --- a/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java +++ b/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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 @@ -36,7 +36,8 @@ import jdk.test.lib.jfr.Events; * @requires vm.hasJFR & vm.gc.Z * @requires vm.flagless * @library /test/lib /test/jdk /test/hotspot/jtreg - * @run main/othervm -XX:+UseZGC -Xmx32M -Xlog:gc*:gc.log::filecount=0 jdk.jfr.event.gc.detailed.TestZAllocationStallEvent + * @run main/othervm -XX:+UseZGC -Xmx64M -Xlog:gc*:gc.log::filecount=0 + * jdk.jfr.event.gc.detailed.TestZAllocationStallEvent */ public class TestZAllocationStallEvent { @@ -47,7 +48,7 @@ public class TestZAllocationStallEvent { recording.start(); // Allocate many large objects quickly, to outrun the GC - for (int i = 0; i < 100; i++) { + for (int i = 0; i < 1000; i++) { blackHole(new byte[4 * 1024 * 1024]); } diff --git a/test/jdk/jdk/jfr/event/gc/detailed/TestZRelocationSetEvent.java b/test/jdk/jdk/jfr/event/gc/detailed/TestZRelocationSetEvent.java index e64d6f83ab8..6217de6e235 100644 --- a/test/jdk/jdk/jfr/event/gc/detailed/TestZRelocationSetEvent.java +++ b/test/jdk/jdk/jfr/event/gc/detailed/TestZRelocationSetEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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,6 @@ package jdk.jfr.event.gc.detailed; import java.util.List; -import static gc.testlibrary.Allocation.blackHole; import jdk.jfr.Recording; import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.EventNames; @@ -36,7 +35,7 @@ import jdk.test.lib.jfr.Events; * @requires vm.hasJFR & vm.gc.Z * @requires vm.flagless * @library /test/lib /test/jdk /test/hotspot/jtreg - * @run main/othervm -XX:+UseZGC -Xmx32M jdk.jfr.event.gc.detailed.TestZRelocationSetEvent + * @run main/othervm -XX:+UseZGC -Xmx64M jdk.jfr.event.gc.detailed.TestZRelocationSetEvent */ public class TestZRelocationSetEvent { diff --git a/test/jdk/jdk/nio/zipfs/EndOfCenValidation.java b/test/jdk/jdk/nio/zipfs/EndOfCenValidation.java new file mode 100644 index 00000000000..ed0bdbb52ea --- /dev/null +++ b/test/jdk/jdk/nio/zipfs/EndOfCenValidation.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2023, 2026, 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 + * @modules java.base/jdk.internal.util + * @summary Verify that ZipFileSystem rejects files with CEN sizes exceeding the implementation limit + * @library /test/lib + * @build jdk.test.lib.util.ZipUtils + * @run junit/othervm EndOfCenValidation + */ + +import jdk.internal.util.ArraysSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.zip.ZipException; + +import static jdk.test.lib.util.ZipUtils.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * This test augments {@link TestTooManyEntries}. It creates sparse ZIPs where + * the CEN size is inflated to the desired value. This helps this test run + * fast with much less resources. + * + * While the CEN in these files are zero-filled and the produced ZIPs are technically + * invalid, the CEN is never actually read by ZipFileSystem since it does + * 'End of central directory record' (END header) validation before reading the CEN. + */ +public class EndOfCenValidation { + + // Zip files produced by this test + static final Path CEN_TOO_LARGE_ZIP = Path.of("cen-size-too-large.zip"); + static final Path INVALID_CEN_SIZE = Path.of("invalid-zen-size.zip"); + static final Path BAD_CEN_OFFSET_ZIP = Path.of("bad-cen-offset.zip"); + static final Path BAD_ENTRY_COUNT_ZIP = Path.of("bad-entry-count.zip"); + + // Maximum allowed CEN size allowed by ZipFileSystem + static final int MAX_CEN_SIZE = ArraysSupport.SOFT_MAX_ARRAY_LENGTH; + + /** + * Delete big files after test, in case the file system did not support sparse files. + * @throws IOException if an error occurs + */ + @AfterEach + public void cleanup() throws IOException { + Files.deleteIfExists(CEN_TOO_LARGE_ZIP); + Files.deleteIfExists(INVALID_CEN_SIZE); + Files.deleteIfExists(BAD_CEN_OFFSET_ZIP); + Files.deleteIfExists(BAD_ENTRY_COUNT_ZIP); + } + + /** + * Validates that an 'End of central directory record' (END header) with a CEN + * length exceeding {@link #MAX_CEN_SIZE} limit is rejected + * @throws IOException if an error occurs + */ + @Test + public void shouldRejectTooLargeCenSize() throws IOException { + int size = MAX_CEN_SIZE + 1; + Path zip = zipWithModifiedEndRecord(size, true, 0, CEN_TOO_LARGE_ZIP); + verifyRejection(zip, INVALID_CEN_SIZE_TOO_LARGE); + } + + /** + * Validate that an 'End of central directory record' (END header) + * where the value of the CEN size field exceeds the position of + * the END header is rejected. + * @throws IOException if an error occurs + */ + @Test + public void shouldRejectInvalidCenSize() throws IOException { + int size = MAX_CEN_SIZE; + Path zip = zipWithModifiedEndRecord(size, false, 0, INVALID_CEN_SIZE); + verifyRejection(zip, INVALID_CEN_BAD_SIZE); + } + + /** + * Validate that an 'End of central directory record' (the END header) + * where the value of the CEN offset field is larger than the position + * of the END header minus the CEN size is rejected + * @throws IOException if an error occurs + */ + @Test + public void shouldRejectInvalidCenOffset() throws IOException { + int size = MAX_CEN_SIZE; + Path zip = zipWithModifiedEndRecord(size, true, 100, BAD_CEN_OFFSET_ZIP); + verifyRejection(zip, INVALID_CEN_BAD_OFFSET); + } + + /** + * Validate that a 'Zip64 End of Central Directory' record (the END header) + * where the value of the 'total entries' field is larger than what fits + * in the CEN size is rejected. + * + * @throws IOException if an error occurs + */ + @ParameterizedTest + @ValueSource(longs = { + -1, // Negative + Long.MIN_VALUE, // Very negative + 0x3B / 3L - 1, // Cannot fit in test ZIP's CEN + MAX_CEN_SIZE / 3 + 1, // Too large to allocate int[] entries array + Long.MAX_VALUE // Unreasonably large + }) + public void shouldRejectBadTotalEntries(long totalEntries) throws IOException { + Path zip = zip64WithModifiedTotalEntries(BAD_ENTRY_COUNT_ZIP, totalEntries); + verifyRejection(zip, INVALID_BAD_ENTRY_COUNT); + } + + /** + * Verify that ZipFileSystem.newFileSystem rejects the ZIP file with a ZipException + * with the given message + * @param zip ZIP file to open + * @param msg exception message to expect + */ + private static void verifyRejection(Path zip, String msg) { + ZipException ex = assertThrows(ZipException.class, () -> { + FileSystems.newFileSystem(zip); + }); + assertEquals(msg, ex.getMessage()); + } +} diff --git a/test/jdk/jdk/nio/zipfs/PathOps.java b/test/jdk/jdk/nio/zipfs/PathOps.java index 0fefd16fa0f..b976894a301 100644 --- a/test/jdk/jdk/nio/zipfs/PathOps.java +++ b/test/jdk/jdk/nio/zipfs/PathOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2026, 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,10 +30,10 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.ProviderMismatchException; -/** +/* * * @test - * @bug 8038500 8040059 8139956 8146754 8172921 8186142 + * @bug 8038500 8040059 8139956 8146754 8172921 8186142 8326487 * @summary Tests path operations for zip provider. * * @modules jdk.zipfs @@ -92,6 +92,10 @@ public class PathOps { check(result, Boolean.toString(expected)); } + void check(Object result, int expected) { + check(result, Integer.toString(expected)); + } + PathOps root(String expected) { out.println("check root"); checkPath(); @@ -113,6 +117,13 @@ public class PathOps { return this; } + PathOps nameCount(int expected) { + out.println("check nameCount"); + checkPath(); + check(path.getNameCount(), expected); + return this; + } + PathOps element(int index, String expected) { out.format("check element %d\n", index); checkPath(); @@ -284,7 +295,15 @@ public class PathOps { test("/") .root("/") .parent(null) - .name(null); + .name(null) + .nameCount(0); + + // empty name + test("") + .root(null) + .parent(null) + .name("") + .nameCount(1); // no root component test("a/b") diff --git a/test/jdk/sun/net/www/protocol/jar/JarURLConnectionCertsAndCodeSigners.java b/test/jdk/sun/net/www/protocol/jar/JarURLConnectionCertsAndCodeSigners.java new file mode 100644 index 00000000000..9b786938e10 --- /dev/null +++ b/test/jdk/sun/net/www/protocol/jar/JarURLConnectionCertsAndCodeSigners.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2026, 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.io.InputStream; +import java.io.OutputStream; +import java.net.JarURLConnection; +import java.net.URI; +import java.net.URLConnection; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.CodeSigner; +import java.security.KeyStore; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.jar.Attributes; +import java.util.jar.JarEntry; +import java.util.jar.JarOutputStream; +import java.util.jar.Manifest; +import java.util.zip.ZipFile; + +import jdk.security.jarsigner.JarSigner; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import sun.security.tools.keytool.CertAndKeyGen; +import sun.security.x509.X500Name; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; + +/* + * @test + * @bug 8378003 + * @summary Verify that JarURLConnection.getCertificates() and + * JarURLConnection.getJarEntry().getCodeSigners() returns the + * expected results for entries in a signed JAR file + * @modules java.base/sun.security.x509 + * java.base/sun.security.tools.keytool + * @run junit ${test.main.class} + */ +class JarURLConnectionCertsAndCodeSigners { + + private static final String JAR_ENTRY_NAME = "foo-bar"; + private static final String CERT_SUBJECT = "CN=duke"; + private static Path SIGNED_JAR; + + @BeforeAll + static void beforeAll() throws Exception { + final KeyStore.PrivateKeyEntry key = generatePrivateKey(); + SIGNED_JAR = createSignedJar(key); + } + + /* + * Verifies that JarURLConnection.getCertificates() returns the correct + * certificates for entries in a signed JAR file. + */ + @Test + void testCertificates() throws Exception { + final URI uri = new URI("jar:" + SIGNED_JAR.toUri() + "!/" + JAR_ENTRY_NAME); + System.err.println("running test against signed JAR entry: " + uri); + final URLConnection urlConn = uri.toURL().openConnection(); + assertInstanceOf(JarURLConnection.class, urlConn, "unexpected URLConnection type"); + final JarURLConnection jarURLConn = (JarURLConnection) urlConn; + try (InputStream is = jarURLConn.getInputStream()) { + is.readAllBytes(); + } + Certificate[] prevIterationCerts = null; + for (int i = 1; i <= 2; i++) { + final Certificate[] certs = jarURLConn.getCertificates(); + assertNotNull(certs, "null certificates for signed JAR entry: " + uri); + assertNotEquals(0, certs.length, "empty certificates for signed JAR entry: " + uri); + assertInstanceOf(X509Certificate.class, certs[0], "unexpected certificate type"); + final String subject = ((X509Certificate) certs[0]).getSubjectX500Principal().getName(); + assertEquals(CERT_SUBJECT, subject, "unexpected subject in certificate"); + if (i > 1) { + // verify that each call to getCertificates() returns + // a new instance of the array. + // intentional identity check + assertNotSame(prevIterationCerts, certs, "getCertificates() did not return" + + " a new array"); + } + prevIterationCerts = certs; + } + } + + /* + * Verifies that JarURLConnection.getJarEntry().getCodeSigners() returns the correct + * codesigners for entries in a signed JAR file. + */ + @Test + void testCodeSigners() throws Exception { + final URI uri = new URI("jar:" + SIGNED_JAR.toUri() + "!/" + JAR_ENTRY_NAME); + System.err.println("running test against signed JAR entry: " + uri); + final URLConnection urlConn = uri.toURL().openConnection(); + assertInstanceOf(JarURLConnection.class, urlConn, "unexpected URLConnection type"); + final JarURLConnection jarURLConn = (JarURLConnection) urlConn; + try (InputStream is = jarURLConn.getInputStream()) { + is.readAllBytes(); + } + CodeSigner[] prevIterationCodeSigners = null; + for (int i = 1; i <= 2; i++) { + final CodeSigner[] codeSigners = jarURLConn.getJarEntry().getCodeSigners(); + assertNotNull(codeSigners, "null codesigners for signed JAR entry: " + uri); + assertNotEquals(0, codeSigners.length, "empty codesigners for signed JAR entry: " + uri); + final List certs = codeSigners[0].getSignerCertPath().getCertificates(); + assertNotNull(certs, "null certificates from codesigner"); + assertNotEquals(0, certs.size(), "empty certificates from codesigner"); + assertInstanceOf(X509Certificate.class, certs.getFirst(), "unexpected certificate type"); + final String subject = ((X509Certificate) certs.getFirst()).getSubjectX500Principal().getName(); + assertEquals(CERT_SUBJECT, subject, "unexpected subject in certificate"); + if (i > 1) { + // verify that each call to getCodeSigners() returns + // a new instance of the array. + // intentional identity check + assertNotSame(prevIterationCodeSigners, codeSigners, "getCodeSigners() did not" + + " return a new array"); + } + prevIterationCodeSigners = codeSigners; + } + } + + private static KeyStore.PrivateKeyEntry generatePrivateKey() throws Exception { + final CertAndKeyGen gen = new CertAndKeyGen("RSA", "SHA256withRSA"); + gen.generate(1048); // Small key size makes test run faster + final long oneDay = TimeUnit.DAYS.toSeconds(1); + final Certificate cert = gen.getSelfCertificate(new X500Name(CERT_SUBJECT), oneDay); + return new KeyStore.PrivateKeyEntry(gen.getPrivateKey(), new Certificate[]{cert}); + } + + private static Path createSignedJar(final KeyStore.PrivateKeyEntry privateKey) + throws Exception { + + // first create a unsigned JAR + final Path unsignedJar = Path.of("test-8377985-unsigned.jar"); + final Manifest manifest = new Manifest(); + final Attributes mainAttributes = manifest.getMainAttributes(); + mainAttributes.putValue("Manifest-Version", "1.0"); + try (OutputStream os = Files.newOutputStream(unsignedJar); + JarOutputStream jaros = new JarOutputStream(os, manifest)) { + jaros.putNextEntry(new JarEntry(JAR_ENTRY_NAME)); + jaros.write(new byte[]{0x42}); + jaros.closeEntry(); + } + + // use a JarSigner to sign the JAR + final JarSigner signer = new JarSigner.Builder(privateKey) + .signerName("abcdef") + .digestAlgorithm("SHA-256") + .signatureAlgorithm("SHA256withRSA") + .build(); + + final Path signedJar = Path.of("test-8377985-signed.jar"); + try (ZipFile zip = new ZipFile(unsignedJar.toFile()); + OutputStream out = Files.newOutputStream(signedJar)) { + signer.sign(zip, out); + } + return signedJar; + } +} diff --git a/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java b/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java index ebd2c1c3436..4c9ab1faf81 100644 --- a/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java +++ b/test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6687725 + * @bug 6687725 8365883 * @summary Test internal PKCS5Padding impl with various error conditions. * @author Valerie Peng * @library /test/lib .. @@ -35,6 +35,7 @@ import java.security.AlgorithmParameters; import java.security.NoSuchAlgorithmException; import java.security.Provider; import java.security.Security; +import java.util.Arrays; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; @@ -80,7 +81,7 @@ public class TestPKCS5PaddingError extends PKCS11Test { private void doTest(final Provider p) throws Exception { try { - byte[] plainText = new byte[200]; + byte[] plainText = "testtexttesttext".getBytes(); // 16 bytes text for (CI currTest : TEST_LIST) { System.out.println("===" + currTest.transformation + "==="); @@ -88,14 +89,16 @@ public class TestPKCS5PaddingError extends PKCS11Test { KeyGenerator kg = KeyGenerator.getInstance(currTest.keyAlgo, p); SecretKey key = kg.generateKey(); - Cipher c1 = Cipher.getInstance(currTest.transformation, + // Encrypting without padding to guarantee bad padding + // exception when decrypting + Cipher c1 = Cipher.getInstance(currTest.transformation + .replace("/PKCS5Padding", "/NoPadding"), sunJCEProvider); c1.init(Cipher.ENCRYPT_MODE, key); byte[] cipherText = c1.doFinal(plainText); AlgorithmParameters params = c1.getParameters(); Cipher c2 = Cipher.getInstance(currTest.transformation, p); c2.init(Cipher.DECRYPT_MODE, key, params); - c2.doFinal(cipherText); // 1st test: wrong output length // NOTE: Skip NSS since it reports CKR_DEVICE_ERROR when the @@ -118,9 +121,17 @@ public class TestPKCS5PaddingError extends PKCS11Test { // 2nd test: wrong padding value try { System.out.println("Testing with wrong padding bytes"); - cipherText[cipherText.length - 1]++; - c2.doFinal(cipherText); - System.out.println("WARNING: Expected BPE NOT thrown"); + byte[] result = c2.doFinal(cipherText); + + final String errorDescription = + "Decrypted text " + Arrays.toString(result); + if (Arrays.equals(result, plainText)) { + System.out.println("WARNING: initial text and " + + "decoded text are the same"); + } + System.out.println(errorDescription); + throw new RuntimeException( + "Expected BPE NOT thrown \n" + errorDescription); } catch (BadPaddingException bpe) { // expected } catch (Exception ex) { diff --git a/test/jdk/sun/security/provider/KeyStore/DKSTest.java b/test/jdk/sun/security/provider/KeyStore/DKSTest.java index 9c35a1c1dd9..ee655f5a2a6 100644 --- a/test/jdk/sun/security/provider/KeyStore/DKSTest.java +++ b/test/jdk/sun/security/provider/KeyStore/DKSTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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,19 +23,30 @@ /* * @test - * @bug 8007755 + * @bug 8007755 8374808 * @library /test/lib * @summary Support the logical grouping of keystores */ -import java.io.*; -import java.net.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URI; import java.nio.file.Paths; -import java.security.*; +import java.security.DomainLoadStoreParameter; import java.security.KeyStore; -import java.security.cert.*; +import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; -import java.util.*; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; @@ -205,17 +216,26 @@ public class DKSTest { new KeyStore.TrustedCertificateEntry(cert), null); } - private static void checkEntries(KeyStore keystore, int expected) + private static void checkEntries(KeyStore keystore, int expectedCount) throws Exception { - int i = 0; + int currCount = 0; for (String alias : Collections.list(keystore.aliases())) { System.out.print("."); - i++; + currCount++; + + // check creation date and instant + if(!keystore.getCreationDate(alias).equals( + Date.from(keystore.getCreationInstant(alias))) + ){ + throw new RuntimeException( + "Creation Date is not the same as Instant timestamp"); + } } System.out.println(); - if (expected != i) { + // Check if current count is expected + if (expectedCount != currCount) { throw new Exception("Error: unexpected entry count in keystore: " + - "loaded=" + i + ", expected=" + expected); + "loaded=" + currCount + ", expected=" + expectedCount); } } diff --git a/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java b/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java index 5a704ef4d1f..9c813c46bdc 100644 --- a/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java +++ b/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java @@ -111,7 +111,7 @@ public class SSLEngineKeyLimit extends SSLContextTemplate { System.setProperty("test.java.opts", System.getProperty("test.java.opts") + " -Dtest.src=" + System.getProperty("test.src") + " -Dtest.jdk=" + System.getProperty("test.jdk") + - " -Djavax.net.debug=ssl,handshake" + + " -Djavax.net.debug=ssl" + " -Djava.security.properties=" + f.getName()); System.out.println("test.java.opts: " + diff --git a/test/jdk/sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java b/test/jdk/sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java index f32d0e381a6..59becf3b664 100644 --- a/test/jdk/sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java +++ b/test/jdk/sun/security/ssl/SSLLogger/DebugPropertyValuesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 8350582 8340312 8369995 8372004 + * @bug 8350582 8340312 8369995 8044609 8372004 8371333 * @library /test/lib /javax/net/ssl/templates * @summary Correct the parsing of the ssl value in javax.net.debug * @run junit DebugPropertyValuesTest @@ -58,30 +58,31 @@ public class DebugPropertyValuesTest extends SSLSocketTemplate { debugMessages.put("handshake", List.of("Produced ClientHello handshake message", "supported_versions")); + debugMessages.put("handshake-expand", + List.of("\"logger\".*: \"javax.net.ssl\",", + "\"specifics\" : \\[", + "\"message\".*: \"Produced ClientHello handshake message")); debugMessages.put("keymanager", List.of("Choosing key:")); debugMessages.put("packet", List.of("Raw write")); debugMessages.put("plaintext", List.of("Plaintext before ENCRYPTION")); debugMessages.put("record", List.of("handshake, length =", "WRITE:")); - debugMessages.put("session", List.of("Session initialized:")); - debugMessages.put("sslctx", - List.of("trigger seeding of SecureRandom")); - debugMessages.put("ssl", List.of("jdk.tls.keyLimits:")); - debugMessages.put("trustmanager", - List.of("adding as trusted certificates")); - debugMessages.put("verbose", - List.of("Ignore unsupported cipher suite:")); - debugMessages.put("handshake-expand", - List.of("\"logger\".*: \"javax.net.ssl\",", - "\"specifics\" : \\[", - "\"message\".*: \"Produced ClientHello handshake message")); debugMessages.put("record-expand", List.of("\"logger\".*: \"javax.net.ssl\",", - "\"specifics\" : \\[", "\"message\".*: \"READ: TLSv1.2 application_data")); + debugMessages.put("session", List.of("Session initialized:")); + debugMessages.put("ssl", List.of("jdk.tls.keyLimits:")); + debugMessages.put("sslctx", + List.of("trigger seeding of SecureRandom", + // Available list should finish with this style + "TLS_EMPTY_RENEGOTIATION_INFO_SCSV]", + "Ignore disabled cipher suites for protocols: " + + "\\[TLSv1.3, TLSv1.2\\]")); + debugMessages.put("trustmanager", + List.of("adding as trusted certificates")); debugMessages.put("help", - List.of("print the help messages", - "debugging can be widened with:")); + List.of("print this help message and exit", + "verbose handshake message printing")); debugMessages.put("java.security.debug", List.of("properties\\[.*\\|main\\|.*" + DATE_REGEX + ".*\\]:", "certpath\\[.*\\|main\\|.*" + DATE_REGEX + ".*\\]:")); @@ -111,78 +112,64 @@ public class DebugPropertyValuesTest extends SSLSocketTemplate { Arguments.of(List.of("-Djavax.net.debug=all"), List.of("handshake", "keymanager", "packet", "plaintext", "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")), + "sslctx", "trustmanager")), // ssl should print most details except verbose details Arguments.of(List.of("-Djavax.net.debug=ssl"), List.of("handshake", "keymanager", "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")), + "sslctx", "trustmanager")), // allow expand option for more verbose output Arguments.of( List.of("-Djavax.net.debug=ssl,handshake,expand"), - List.of("handshake", "handshake-expand", - "keymanager", "record", "session", - "record-expand", "ssl", "sslctx", - "trustmanager", "verbose")), + List.of("handshake", "handshake-expand", "ssl")), // filtering on record option, with expand Arguments.of(List.of("-Djavax.net.debug=ssl:record,expand"), - List.of("handshake", "handshake-expand", - "keymanager", "record", "record-expand", - "session", "ssl", "sslctx", "trustmanager", - "verbose")), + List.of("record", "record-expand", "ssl")), + // reverse the input params of last example. should be same result + Arguments.of(List.of("-Djavax.net.debug=expand,record:ssl"), + List.of("record", "record-expand", "ssl")), // this test is equivalent to ssl:record mode Arguments.of(List.of("-Djavax.net.debug=ssl,record"), - List.of("handshake", "keymanager", "record", - "session", "ssl", "sslctx", - "trustmanager", "verbose")), + List.of("record", "ssl")), // example of test where no "ssl" value is passed // handshake debugging with verbose mode - // only verbose gets printed. Needs fixing (JDK-8044609) + // No debug logs should be printed Arguments.of(List.of("-Djavax.net.debug=handshake:verbose"), - List.of("verbose")), + List.of()), // another example of test where no "ssl" value is passed Arguments.of(List.of("-Djavax.net.debug=record"), - List.of("record")), + List.of()), // ignore bad sub-option. treat like "ssl" Arguments.of(List.of("-Djavax.net.debug=ssl,typo"), List.of("handshake", "keymanager", "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")), + "sslctx", "trustmanager")), // ssltypo contains "ssl". Treat like "ssl" Arguments.of(List.of("-Djavax.net.debug=ssltypo"), List.of("handshake", "keymanager", "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")), + "sslctx", "trustmanager")), // plaintext is valid for record option - Arguments.of( - List.of("-Djavax.net.debug=ssl:record:plaintext"), - List.of("handshake", "keymanager", "plaintext", - "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")), + Arguments.of(List.of("-Djavax.net.debug=ssl:record:plaintext"), + List.of("plaintext", "record", "ssl")), Arguments.of(List.of("-Djavax.net.debug=ssl:trustmanager"), - List.of("handshake", "keymanager", "record", - "session", "ssl", "sslctx", "trustmanager", - "verbose")), + List.of("ssl", "trustmanager")), Arguments.of(List.of("-Djavax.net.debug=ssl:sslctx"), - List.of("handshake", "keymanager", "record", - "session", "ssl", "sslctx", "trustmanager", - "verbose")), + List.of("ssl", "sslctx")), // help message test. Should exit without running test Arguments.of(List.of("-Djavax.net.debug=help"), List.of("help")), // add in javax.net.debug sanity test Arguments.of(List.of("-Djavax.net.debug=ssl:trustmanager", "-Djava.security.debug=all"), - List.of("handshake", "java.security.debug", - "keymanager", "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")), + List.of("java.security.debug", "ssl", "trustmanager")), // empty invokes System.Logger use Arguments.of(List.of("-Djavax.net.debug", "-Djava.util.logging.config.file=" + LOG_FILE), List.of("handshake", "javax.net.debug.logger", "keymanager", "packet", "plaintext", "record", "session", "ssl", - "sslctx", "trustmanager", "verbose")) + "sslctx", "trustmanager")) ); } @@ -196,11 +183,23 @@ public class DebugPropertyValuesTest extends SSLSocketTemplate { OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(args); outputAnalyzer.shouldHaveExitValue(0); for (String s : debugMessages.keySet()) { - for (String output : debugMessages.get(s)) { - if (expected.contains(s)) { + List patterns = debugMessages.get(s); + if (expected.contains(s)) { + for (String output : patterns) { outputAnalyzer.shouldMatch(output); - } else { - outputAnalyzer.shouldNotMatch(output); + } + } else { + // some debug messages overlap with each other. Only fail if + // all the messages in the list were unexpected + boolean allUnexpected = true; + for (String output : patterns) { + if (!outputAnalyzer.contains(output)) { + allUnexpected = false; + break; + } + } + if (allUnexpected) { + throw new AssertionError("Unexpected output for key: " + s); } } } diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/MultiNSTNoSessionCreation.java b/test/jdk/sun/security/ssl/SSLSessionImpl/MultiNSTNoSessionCreation.java index a851a5d72bb..646db0b68e6 100644 --- a/test/jdk/sun/security/ssl/SSLSessionImpl/MultiNSTNoSessionCreation.java +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/MultiNSTNoSessionCreation.java @@ -54,7 +54,7 @@ public class MultiNSTNoSessionCreation { " -Dtest.src=" + System.getProperty("test.src") + " -Dtest.jdk=" + System.getProperty("test.jdk") + " -Dtest.root=" + System.getProperty("test.root") + - " -Djavax.net.debug=ssl,handshake " + params); + " -Djavax.net.debug=ssl " + params); System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java index 2784875d426..d9ac85c4897 100644 --- a/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java @@ -181,7 +181,7 @@ public class ResumptionUpdateBoundValues extends SSLContextTemplate { System.setProperty("test.java.opts", System.getProperty("test.java.opts") + " -Dtest.src=" + System.getProperty("test.src") + " -Dtest.jdk=" + System.getProperty("test.jdk") + - " -Djavax.net.debug=ssl,handshake"); + " -Djavax.net.debug=ssl"); System.out.println("test.java.opts: " + System.getProperty("test.java.opts")); diff --git a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java index 7ce4d97a7a2..6c45505d9f6 100644 --- a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java +++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java @@ -127,7 +127,7 @@ public class SSLSocketKeyLimit { System.setProperty("test.java.opts", System.getProperty("test.java.opts") + " -Dtest.src=" + System.getProperty("test.src") + " -Dtest.jdk=" + System.getProperty("test.jdk") + - " -Djavax.net.debug=ssl,handshake" + + " -Djavax.net.debug=ssl" + " -Djava.security.properties=" + f.getName()); System.out.println("test.java.opts: " + diff --git a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketReset.java b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketReset.java index 6b0f365edc7..64779facd26 100644 --- a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketReset.java +++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketReset.java @@ -21,16 +21,14 @@ * questions. */ -// -// Please run in othervm mode. SunJSSE does not support dynamic system -// properties, no way to re-use system properties in samevm/agentvm mode. -// - /* * @test * @bug 8268965 * @summary Socket reset issue for TLS socket close - * @run main/othervm -Djdk.net.usePlainSocketImpl=true SSLSocketReset + * @comment The test uses SSLContext.getDefault(), so we use othervm to prevent + * usage of unexpected default SSLContext that might be set by some + * other test + * @run main/othervm SSLSocketReset */ import javax.net.ssl.*; diff --git a/test/jdk/sun/tools/jstack/DeadlockDetectionTest.java b/test/jdk/sun/tools/jstack/DeadlockDetectionTest.java index 80eda6fc091..d743485373e 100644 --- a/test/jdk/sun/tools/jstack/DeadlockDetectionTest.java +++ b/test/jdk/sun/tools/jstack/DeadlockDetectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -76,10 +76,8 @@ public class DeadlockDetectionTest { } try { - String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData"); - theApp = new LingeredAppWithDeadlock(); - LingeredApp.startApp(theApp, vmArgs); + LingeredApp.startApp(theApp, "-XX:+UsePerfData"); OutputAnalyzer output = jstack(Long.toString(theApp.getPid())); System.out.println(output.getOutput()); diff --git a/test/jdk/tools/jimage/JImageBadFileTest.java b/test/jdk/tools/jimage/JImageBadFileTest.java new file mode 100644 index 00000000000..d25c994b265 --- /dev/null +++ b/test/jdk/tools/jimage/JImageBadFileTest.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2026, 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.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.IntBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.function.Consumer; + +import jdk.test.lib.Utils; + +import static java.nio.file.StandardOpenOption.READ; +import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; +import static java.util.regex.Pattern.quote; + +/* + * @test + * @summary Tests to verify behavior for "invalid" jimage files + * @library /test/lib + * @modules jdk.jlink/jdk.tools.jimage + * @build jdk.test.lib.Asserts + * @run main JImageBadFileTest + */ +public class JImageBadFileTest extends JImageCliTest { + // src/java.base/share/native/libjimage/imageFile.hpp + // + // 31 -------- bits -------- 0 + // IDX +-------------------------+ + // 0 | Magic (0xCAFEDADA) | + // +------------+------------+ + // 1 | Major Vers | Minor Vers | + // +------------+------------+ + // 2 | Flags | + // +-------------------------+ + // 3 | Resource Count | + // +-------------------------+ + // 4 | Table Length | + // +-------------------------+ + // 5 | Attributes Size | + // +-------------------------+ + // 6 | Strings Size | + // +-------------------------+ + private static final int HEADER_SIZE_BYTES = 7 * 4; + + /** + * Helper to copy the default jimage file for the runtime under test and + * allow it to be corrupted in various ways. + * + * @param label label for the temporary file (arbitrary debug name) + * @param maxLen maximum number of bytes to copy (-1 to copy all) + * @param headerFn function which may corrupt specific header values + * @return the path of a temporary jimage file in the test directory containing + * the possibly corrupted jimage file (caller should delete) + */ + private Path writeModifiedJimage(String label, int maxLen, Consumer headerFn) + throws IOException { + int remaining = maxLen >= 0 ? maxLen : Integer.MAX_VALUE; + Path dst = Utils.createTempFile("modules-" + label, ""); + try (InputStream rest = Files.newInputStream(Path.of(getImagePath()), READ); + OutputStream out = Files.newOutputStream(dst, TRUNCATE_EXISTING)) { + ByteBuffer bytes = ByteBuffer.wrap(rest.readNBytes(HEADER_SIZE_BYTES)); + bytes.order(ByteOrder.nativeOrder()); + headerFn.accept(bytes.asIntBuffer()); + int headerSize = Math.min(remaining, HEADER_SIZE_BYTES); + out.write(bytes.array(), 0, headerSize); + remaining -= headerSize; + if (remaining > 0) { + byte[] block = new byte[8192]; + do { + int copySize = Math.min(remaining, block.length); + out.write(block, 0, rest.readNBytes(block, 0, copySize)); + remaining -= copySize; + } while (rest.available() > 0 && remaining > 0); + } + return dst.toAbsolutePath(); + } + } + + public void testBadMagicNumber() throws IOException { + // Flip some bits in the magic number. + Path tempJimage = writeModifiedJimage("bad_magic", -1, b -> b.put(0, b.get(1) ^ 0x1010)); + JImageResult result = jimage("info", tempJimage.toString()); + result.assertShowsError(); + assertMatches(quote("Unable to open"), result.output); + assertMatches(quote("is not an image file"), result.output); + } + + public void testMismatchedVersion() throws IOException { + // Add one to minor version (lowest bits). + Path tempJimage = writeModifiedJimage("bad_version", -1, b -> b.put(1, b.get(1) + 1)); + JImageResult result = jimage("info", tempJimage.toString()); + result.assertShowsError(); + assertMatches(quote("Unable to open"), result.output); + assertMatches(quote("/bin/jimage"), result.output); + assertMatches(quote("not the correct version"), result.output); + assertMatches("Major: \\d+", result.output); + assertMatches("Minor: \\d+", result.output); + } + + public void testTruncatedHeader() throws IOException { + // Copy less than the header. + Path tempJimage = writeModifiedJimage("truncated_header", HEADER_SIZE_BYTES - 4, b -> {}); + JImageResult result = jimage("info", tempJimage.toString()); + result.assertShowsError(); + assertMatches(quote("Unable to open"), result.output); + assertMatches(quote("is not an image file"), result.output); + } + + public void testTruncatedData() throws IOException { + // Copy more than the header, but definitely less than the whole file. + Path tempJimage = writeModifiedJimage("truncated_data", HEADER_SIZE_BYTES + 1024, b -> {}); + JImageResult result = jimage("info", tempJimage.toString()); + result.assertShowsError(); + assertMatches(quote("Unable to open"), result.output); + assertMatches("image file \".*\" is corrupted", result.output); + } + + public void testGoodFileCopy() throws IOException { + // Self test that the file copying isn't itself corrupting anything. + Path tempJimage = writeModifiedJimage("good_file", -1, b -> {}); + jimage("info", tempJimage.toString()).assertSuccess(); + } + + public static void main(String[] args) throws Throwable { + new JImageBadFileTest().runTests(); + } +} diff --git a/test/jdk/tools/jpackage/TEST.properties b/test/jdk/tools/jpackage/TEST.properties index 19eda305364..5cc4aa7a1b9 100644 --- a/test/jdk/tools/jpackage/TEST.properties +++ b/test/jdk/tools/jpackage/TEST.properties @@ -13,7 +13,7 @@ maxOutputSize = 2000000 # Run jpackage tests on windows platform sequentially. # Having "share" directory in the list affects tests on other platforms. # The better option would be: -# if (platfrom == windowws) { +# if (platfrom == windows) { # exclusiveAccess.dirs=share windows # } # but conditionals are not supported by jtreg configuration files. @@ -29,4 +29,6 @@ modules = \ jdk.jpackage/jdk.jpackage.internal.util.function \ jdk.jpackage/jdk.jpackage.internal.resources:+open \ java.base/jdk.internal.util \ + java.base/sun.security.util \ + java.base/sun.security.x509 \ jdk.jlink/jdk.tools.jlink.internal diff --git a/test/jdk/tools/jpackage/helpers-test/jdk/jpackage/test/MacHelperTest.java b/test/jdk/tools/jpackage/helpers-test/jdk/jpackage/test/MacHelperTest.java index 5d14f021eaf..b8f7bfd456e 100644 --- a/test/jdk/tools/jpackage/helpers-test/jdk/jpackage/test/MacHelperTest.java +++ b/test/jdk/tools/jpackage/helpers-test/jdk/jpackage/test/MacHelperTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,14 +31,20 @@ import java.io.UncheckedIOException; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Stream; import jdk.jpackage.internal.util.PListReader; import jdk.jpackage.internal.util.XmlUtils; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import org.w3c.dom.Node; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -public class MacHelperTest { +public class MacHelperTest extends JUnitAdapter { @Test public void test_flatMapPList() { @@ -105,6 +111,18 @@ public class MacHelperTest { ), props); } + @ParameterizedTest + @MethodSource + public void test_appImageSigned(SignedTestSpec spec) { + spec.test(MacHelper::appImageSigned); + } + + @ParameterizedTest + @MethodSource + public void test_nativePackageSigned(SignedTestSpec spec) { + spec.test(MacHelper::nativePackageSigned); + } + private static String createPListXml(String ...xml) { final List content = new ArrayList<>(); content.add(""); @@ -125,4 +143,126 @@ public class MacHelperTest { throw new RuntimeException(ex); } } + + private static Stream test_appImageSigned() { + + List data = new ArrayList<>(); + + for (var signingIdentityOption : List.of( + List.of(), + List.of("--mac-signing-key-user-name", "foo"), + List.of("--mac-app-image-sign-identity", "foo"), + List.of("--mac-installer-sign-identity", "foo"), + List.of("--mac-installer-sign-identity", "foo", "--mac-app-image-sign-identity", "bar") + )) { + for (var type : List.of(PackageType.IMAGE, PackageType.MAC_DMG, PackageType.MAC_PKG)) { + for (var withMacSign : List.of(true, false)) { + if (signingIdentityOption.contains("--mac-installer-sign-identity") && type != PackageType.MAC_PKG) { + continue; + } + + var builder = SignedTestSpec.build().type(type).cmdline(signingIdentityOption); + if (withMacSign) { + builder.cmdline("--mac-sign"); + if (Stream.of( + "--mac-signing-key-user-name", + "--mac-app-image-sign-identity" + ).anyMatch(signingIdentityOption::contains) || signingIdentityOption.isEmpty()) { + builder.signed(); + } + } + + data.add(builder); + } + } + } + + return data.stream().map(SignedTestSpec.Builder::create); + } + + private static Stream test_nativePackageSigned() { + + List data = new ArrayList<>(); + + for (var signingIdentityOption : List.of( + List.of(), + List.of("--mac-signing-key-user-name", "foo"), + List.of("--mac-app-image-sign-identity", "foo"), + List.of("--mac-installer-sign-identity", "foo"), + List.of("--mac-installer-sign-identity", "foo", "--mac-app-image-sign-identity", "bar") + )) { + for (var type : List.of(PackageType.MAC_DMG, PackageType.MAC_PKG)) { + for (var withMacSign : List.of(true, false)) { + if (signingIdentityOption.contains("--mac-installer-sign-identity") && type != PackageType.MAC_PKG) { + continue; + } + + var builder = SignedTestSpec.build().type(type).cmdline(signingIdentityOption); + if (withMacSign) { + builder.cmdline("--mac-sign"); + if (type == PackageType.MAC_PKG && (Stream.of( + "--mac-signing-key-user-name", + "--mac-installer-sign-identity" + ).anyMatch(signingIdentityOption::contains) || signingIdentityOption.isEmpty())) { + builder.signed(); + } + } + + data.add(builder); + } + } + } + + return data.stream().map(SignedTestSpec.Builder::create); + } + + private record SignedTestSpec(boolean expectedSigned, PackageType type, List cmdline) { + + SignedTestSpec { + Objects.requireNonNull(type); + cmdline.forEach(Objects::requireNonNull); + } + + void test(Function func) { + var actualSigned = func.apply((new JPackageCommand().addArguments(cmdline).setPackageType(type))); + assertEquals(expectedSigned, actualSigned); + } + + static Builder build() { + return new Builder(); + } + + static final class Builder { + + SignedTestSpec create() { + return new SignedTestSpec( + expectedSigned, + Optional.ofNullable(type).orElse(PackageType.IMAGE), + cmdline); + } + + Builder signed() { + expectedSigned = true; + return this; + } + + Builder type(PackageType v) { + type = v; + return this; + } + + Builder cmdline(String... args) { + return cmdline(List.of(args)); + } + + Builder cmdline(List v) { + cmdline.addAll(v); + return this; + } + + private boolean expectedSigned; + private PackageType type; + private List cmdline = new ArrayList<>(); + } + } } diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FailedCommandErrorValidator.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FailedCommandErrorValidator.java index ab644c36a5c..f082e079dd6 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FailedCommandErrorValidator.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FailedCommandErrorValidator.java @@ -38,7 +38,7 @@ public final class FailedCommandErrorValidator { this.cmdlinePattern = Objects.requireNonNull(cmdlinePattern); } - public TKit.TextStreamVerifier.Group createGroup() { + public JPackageOutputValidator create() { var asPredicate = cmdlinePattern.asPredicate(); var errorMessage = exitCode().map(v -> { @@ -49,9 +49,9 @@ public final class FailedCommandErrorValidator { var errorMessageWithPrefix = JPackageCommand.makeError(errorMessage).getValue(); - var group = TKit.TextStreamVerifier.group(); + var validator = new JPackageOutputValidator().stderr(); - group.add(TKit.assertTextStream(cmdlinePattern.pattern()).predicate(line -> { + validator.add(TKit.assertTextStream(cmdlinePattern.pattern()).predicate(line -> { if (line.startsWith(errorMessageWithPrefix)) { line = line.substring(errorMessageWithPrefix.length()); return asPredicate.test(line); @@ -60,28 +60,24 @@ public final class FailedCommandErrorValidator { } })); - group.add(TKit.assertTextStream( - JPackageStringBundle.MAIN.cannedFormattedString("message.failed-command-output-header").getValue() - ).predicate(String::equals)); + validator.expectMatchingStrings(JPackageStringBundle.MAIN.cannedFormattedString("message.failed-command-output-header")); - outputVerifier().ifPresent(group::add); + outputValidator().ifPresent(validator::add); - return group; + return validator; } public void applyTo(JPackageCommand cmd) { - cmd.validateOutput(createGroup().create()); + create().applyTo(cmd); } - public FailedCommandErrorValidator validator(TKit.TextStreamVerifier.Group v) { + public FailedCommandErrorValidator validator(JPackageOutputValidator v) { outputValidator = v; return this; } public FailedCommandErrorValidator validator(List validators) { - var group = TKit.TextStreamVerifier.group(); - validators.forEach(group::add); - return validator(group); + return validator(new JPackageOutputValidator().add(validators)); } public FailedCommandErrorValidator validators(TKit.TextStreamVerifier... validators) { @@ -105,11 +101,11 @@ public final class FailedCommandErrorValidator { return Optional.ofNullable(exitCode); } - private Optional outputVerifier() { + private Optional outputValidator() { return Optional.ofNullable(outputValidator); } private final Pattern cmdlinePattern; - private TKit.TextStreamVerifier.Group outputValidator; + private JPackageOutputValidator outputValidator; private Integer exitCode; } diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java index 8c7526be9f9..251d95a1089 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java @@ -98,7 +98,7 @@ public class JPackageCommand extends CommandArguments { verifyActions = new Actions(cmd.verifyActions); standardAsserts = cmd.standardAsserts; readOnlyPathAsserts = cmd.readOnlyPathAsserts; - outputValidators = cmd.outputValidators; + validators = cmd.validators; executeInDirectory = cmd.executeInDirectory; winMsiLogFile = cmd.winMsiLogFile; unpackedPackageDirectory = cmd.unpackedPackageDirectory; @@ -895,19 +895,20 @@ public class JPackageCommand extends CommandArguments { return removeOldOutputBundle; } - public JPackageCommand validateOutput(TKit.TextStreamVerifier validator) { - return validateOutput(validator::apply); - } - - public JPackageCommand validateOutput(Consumer> validator) { - Objects.requireNonNull(validator); - saveConsoleOutput(true); - outputValidators.add(validator); + public JPackageCommand validateOut(TKit.TextStreamVerifier validator) { + new JPackageOutputValidator().add(validator).applyTo(this); return this; } - public JPackageCommand validateOutput(TKit.TextStreamVerifier.Group group) { - group.tryCreate().ifPresent(this::validateOutput); + public JPackageCommand validateErr(TKit.TextStreamVerifier validator) { + new JPackageOutputValidator().stderr().add(validator).applyTo(this); + return this; + } + + public JPackageCommand validateResult(Consumer validator) { + Objects.requireNonNull(validator); + saveConsoleOutput(true); + validators.add(validator); return this; } @@ -916,7 +917,7 @@ public class JPackageCommand extends CommandArguments { public String value(JPackageCommand cmd); } - public static Object cannedArgument(Function supplier, String label) { + public static CannedArgument cannedArgument(Function supplier, String label) { Objects.requireNonNull(supplier); Objects.requireNonNull(label); return new CannedArgument() { @@ -936,10 +937,18 @@ public class JPackageCommand extends CommandArguments { return v.addPrefix("message.error-header"); } + public static CannedFormattedString makeError(String key, Object ... args) { + return makeError(JPackageStringBundle.MAIN.cannedFormattedString(key, args)); + } + public static CannedFormattedString makeAdvice(CannedFormattedString v) { return v.addPrefix("message.advice-header"); } + public static CannedFormattedString makeAdvice(String key, Object ... args) { + return makeAdvice(JPackageStringBundle.MAIN.cannedFormattedString(key, args)); + } + public String getValue(CannedFormattedString str) { return new CannedFormattedString(str.formatter(), str.key(), Stream.of(str.args()).map(arg -> { if (arg instanceof CannedArgument cannedArg) { @@ -950,13 +959,13 @@ public class JPackageCommand extends CommandArguments { }).toArray()).getValue(); } - public JPackageCommand validateOutput(CannedFormattedString... str) { - // Will look up the given errors in the order they are specified. - validateOutput(Stream.of(str).map(this::getValue) - .map(TKit::assertTextStream) - .reduce(TKit.TextStreamVerifier.group(), - TKit.TextStreamVerifier.Group::add, - TKit.TextStreamVerifier.Group::add)); + public JPackageCommand validateOut(CannedFormattedString... strings) { + new JPackageOutputValidator().expectMatchingStrings(strings).applyTo(this); + return this; + } + + public JPackageCommand validateErr(CannedFormattedString... strings) { + new JPackageOutputValidator().stderr().expectMatchingStrings(strings).applyTo(this); return this; } @@ -1055,8 +1064,8 @@ public class JPackageCommand extends CommandArguments { ConfigFilesStasher.INSTANCE.accept(this); } - for (final var outputValidator: outputValidators) { - outputValidator.accept(result.getOutput().iterator()); + for (final var validator: validators) { + validator.accept(result); } if (result.getExitCode() == 0 && expectedExitCode.isPresent()) { @@ -1179,14 +1188,13 @@ public class JPackageCommand extends CommandArguments { Function> create() { return cmd -> { - if (enable != null && !enable.test(cmd)) { + if (!cmd.hasArgument(argName) || (enable != null && !enable.test(cmd))) { return List.of(); } else { final List> dirs; if (multiple) { dirs = Stream.of(cmd.getAllArgumentValues(argName)) - .map(Builder::tokenizeValue) - .flatMap(x -> x) + .flatMap(Builder::tokenizeValue) .map(Builder::toExistingFile).toList(); } else { dirs = Optional.ofNullable(cmd.getArgumentValue(argName)) @@ -1197,11 +1205,11 @@ public class JPackageCommand extends CommandArguments { .map(cmd::getArgumentValue) .filter(Objects::nonNull) .map(Builder::toExistingFile) - .filter(Optional::isPresent).map(Optional::orElseThrow) + .flatMap(Optional::stream) .collect(toSet()); return dirs.stream() - .filter(Optional::isPresent).map(Optional::orElseThrow) + .flatMap(Optional::stream) .filter(Predicate.not(mutablePaths::contains)) .toList(); } @@ -1284,7 +1292,7 @@ public class JPackageCommand extends CommandArguments { } }), MAC_BUNDLE_UNSIGNED_SIGNATURE(cmd -> { - if (TKit.isOSX() && !MacHelper.appImageSigned(cmd)) { + if (TKit.isOSX()) { MacHelper.verifyUnsignedBundleSignature(cmd); } }), @@ -1308,7 +1316,14 @@ public class JPackageCommand extends CommandArguments { }), PREDEFINED_APP_IMAGE_COPY(cmd -> { Optional.ofNullable(cmd.getArgumentValue("--app-image")).filter(_ -> { - return !TKit.isOSX() || !MacHelper.signPredefinedAppImage(cmd); + if (!TKit.isOSX() || !cmd.hasArgument("--mac-sign")) { + return true; + } else { + var signAppImage = MacHelper.signPredefinedAppImage(cmd) + || MacHelper.hasAppImageSignIdentity(cmd) + || MacHelper.isSignWithoutSignIdentity(cmd); + return !signAppImage; + } }).filter(_ -> { // Don't examine the contents of the output app image if this is Linux package installing in the "/usr" subtree. return Optional.ofNullable(cmd.onLinuxPackageInstallDir(null, _ -> false)).orElse(true); @@ -1656,10 +1671,6 @@ public class JPackageCommand extends CommandArguments { }).collect(Collectors.joining(" ")); } - public static Stream stripTimestamps(Stream stream) { - return stream.map(JPackageCommand::stripTimestamp); - } - public static String stripTimestamp(String str) { final var m = TIMESTAMP_REGEXP.matcher(str); if (m.find()) { @@ -1836,7 +1847,7 @@ public class JPackageCommand extends CommandArguments { private Path unpackedPackageDirectory; private Set readOnlyPathAsserts = Set.of(ReadOnlyPathAssert.values()); private Set standardAsserts = Set.of(StandardAssert.values()); - private List>> outputValidators = new ArrayList<>(); + private List> validators = new ArrayList<>(); private enum DefaultToolProviderKey { VALUE diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageOutputValidator.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageOutputValidator.java new file mode 100644 index 00000000000..c5c9c018b6a --- /dev/null +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageOutputValidator.java @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2026, 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 jdk.jpackage.test; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Stream; +import jdk.jpackage.internal.util.function.ExceptionBox; + +/** + * Validates a stream (stderr or stdout) in jpackage console output. + */ +public final class JPackageOutputValidator { + + public JPackageOutputValidator() { + } + + public JPackageOutputValidator(JPackageOutputValidator other) { + stdout = other.stdout; + match = other.match; + matchTimestamps = other.matchTimestamps; + stripTimestamps = other.stripTimestamps; + validators.addAll(other.validators); + } + + JPackageOutputValidator copy() { + return new JPackageOutputValidator(this); + } + + /** + * Configures this validator to validate stdout. + * @return this + */ + public JPackageOutputValidator stdout() { + stdout = true; + return this; + } + + /** + * Configures this validator to validate stderr. + * @return this + */ + public JPackageOutputValidator stderr() { + stdout = false; + return this; + } + + /** + * Configures the mode of this validator. Similar to how a regexp pattern can be + * configured for matching or finding. + * + * @param v {@code true} if the entire stream should match the criteria of this + * validator, and {@code false} if the stream may contain additional + * content + * @return this + */ + public JPackageOutputValidator match(boolean v) { + match = v; + return this; + } + + /** + * A shorthand for {@code match(true)}. + * @see #match(boolean) + * @return this + */ + public JPackageOutputValidator match() { + return match(true); + } + + /** + * A shorthand for {@code match(false)}. + * @see #match(boolean) + * @return this + */ + public JPackageOutputValidator find() { + return match(false); + } + + /** + * Configures this validator to filter out lines without a timestamp in the + * stream to be validated. + * + * @return this + */ + public JPackageOutputValidator matchTimestamps() { + matchTimestamps = true; + return this; + } + + /** + * Configures this validator to strip the leading timestamp from lines the + * stream to be validated. + *

    + * If the stream contains lines without timestampts, the validation will fail. + *

    + * Use {@link #matchTimestamps()) to filter out lines without timestamps and + * prevent validation failure. + * + * @return this + */ + public JPackageOutputValidator stripTimestamps() { + stripTimestamps = true; + return this; + } + + public void applyTo(JPackageCommand cmd) { + toResultConsumer(cmd).ifPresent(cmd::validateResult); + } + + public void applyTo(JPackageCommand cmd, Executor.Result result) { + Objects.requireNonNull(result); + toResultConsumer(cmd).ifPresent(validator -> { + validator.accept(result); + }); + } + + public JPackageOutputValidator add(List validators) { + this.validators.addAll(validators); + return this; + } + + public JPackageOutputValidator add(TKit.TextStreamVerifier... validators) { + return add(List.of(validators)); + } + + public JPackageOutputValidator validateEndOfStream() { + validators.add(EndOfStreamValidator.INSTANCE); + return this; + } + + public JPackageOutputValidator expectMatchingStrings(List strings) { + return expectMatchingStrings(strings.toArray(CannedFormattedString[]::new)); + } + + public JPackageOutputValidator expectMatchingStrings(CannedFormattedString... strings) { + validators.add(strings); + return this; + } + + public JPackageOutputValidator add(JPackageOutputValidator other) { + validators.addAll(other.validators); + return this; + } + + public JPackageOutputValidator compose(JPackageOutputValidator other) { + if (stdout != other.stdout) { + throw new IllegalArgumentException(); + } + if (match != other.match) { + throw new IllegalArgumentException(); + } + if (matchTimestamps != other.matchTimestamps) { + throw new IllegalArgumentException(); + } + if (stripTimestamps != other.stripTimestamps) { + throw new IllegalArgumentException(); + } + return add(other); + } + + private Optional> toResultConsumer(JPackageCommand cmd) { + return toStringIteratorConsumer(cmd).map(validator -> { + return toResultConsumer(validator, stdout, match, label()); + }); + } + + private Optional>> toStringIteratorConsumer(JPackageCommand cmd) { + Objects.requireNonNull(cmd); + + var consumers = validators.stream().map(v -> { + return toStringIteratorConsumer(cmd, v); + }).flatMap(Optional::stream); + + if (match && (validators.isEmpty() || !(validators.getLast() instanceof EndOfStreamValidator))) { + consumers = Stream.concat(consumers, Stream.of(TKit.assertEndOfTextStream(label()))); + } + + return consumers.reduce(Consumer::andThen).map(validator -> { + + if (stripTimestamps) { + validator = stripTimestamps(validator, label()); + } + + if (matchTimestamps) { + validator = matchTimestamps(validator, label()); + } + + return validator; + }); + } + + @SuppressWarnings("unchecked") + private Optional>> toStringIteratorConsumer(JPackageCommand cmd, Object validator) { + Objects.requireNonNull(cmd); + switch (validator) { + case TKit.TextStreamVerifier tv -> { + return Optional.of(decorate(tv.copy().label(label()))); + } + case CannedFormattedString[] strings -> { + // Will look up the given strings in the order they are specified. + return Stream.of(strings) + .map(cmd::getValue) + .map(TKit::assertTextStream) + .map(v -> { + return v.predicate(String::equals).label(label()); + }) + .map(this::decorate).reduce(Consumer::andThen); + } + case EndOfStreamValidator eos -> { + return Optional.of(TKit.assertEndOfTextStream(label())); + } + default -> { + throw ExceptionBox.reachedUnreachable(); + } + } + } + + private String label() { + return stdout ? "'stdout'" : "'stderr'"; + } + + private Consumer> decorate(TKit.TextStreamVerifier validator) { + if (match) { + return new OneLineFeeder(validator::apply); + } else { + return validator::apply; + } + } + + private static Consumer toResultConsumer( + Consumer> validator, boolean stdout, boolean match, String label) { + Objects.requireNonNull(validator); + Objects.requireNonNull(label); + + return result -> { + List content; + if (stdout) { + content = result.stdout(); + } else { + content = result.stderr(); + } + + if (match) { + TKit.trace(String.format("Checking %s for exact match against defined validators...", label)); + } + + validator.accept(content.iterator()); + + }; + } + + private static Consumer> stripTimestamps(Consumer> consumer, String label) { + Objects.requireNonNull(consumer); + Objects.requireNonNull(label); + return it -> { + Objects.requireNonNull(it); + TKit.trace(String.format("Strip timestamps in %s...", label)); + consumer.accept(new Iterator() { + + @Override + public boolean hasNext() { + return it.hasNext(); + } + + @Override + public String next() { + var str = it.next(); + var strippedStr = JPackageCommand.stripTimestamp(str); + if (str.length() == strippedStr.length()) { + throw new IllegalArgumentException(String.format("String [%s] doesn't have a timestamp", str)); + } else { + return strippedStr; + } + } + + }); + TKit.trace("Done"); + }; + } + + private static Consumer> matchTimestamps(Consumer> consumer, String label) { + Objects.requireNonNull(consumer); + Objects.requireNonNull(label); + return it -> { + Objects.requireNonNull(it); + TKit.trace(String.format("Match lines with timestamps in %s...", label)); + consumer.accept(new FilteringIterator<>(it, JPackageCommand::withTimestamp)); + TKit.trace("Done"); + }; + } + + private enum EndOfStreamValidator { + INSTANCE + } + + private static final class FilteringIterator implements Iterator { + + public FilteringIterator(Iterator it, Predicate predicate) { + this.it = Objects.requireNonNull(it); + this.predicate = Objects.requireNonNull(predicate); + } + + @Override + public boolean hasNext() { + while (!nextReady && it.hasNext()) { + var v = it.next(); + if (predicate.test(v)) { + next = v; + nextReady = true; + } + } + return nextReady; + } + + @Override + public T next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + nextReady = false; + return next; + } + + @Override + public void remove() { + it.remove(); + } + + private final Iterator it; + private final Predicate predicate; + private T next; + private boolean nextReady; + } + + private record OneLineFeeder(Consumer> consumer) implements Consumer> { + OneLineFeeder { + Objects.requireNonNull(consumer); + } + + @Override + public void accept(Iterator it) { + consumer.accept(List.of(it.next()).iterator()); + } + } + + boolean stdout = true; + boolean match; + boolean matchTimestamps; + boolean stripTimestamps; + private final List validators = new ArrayList<>(); +} diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java index 1191cd02221..1372058d440 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java @@ -76,6 +76,7 @@ import jdk.jpackage.internal.util.RetryExecutor; import jdk.jpackage.internal.util.XmlUtils; import jdk.jpackage.internal.util.function.ThrowingConsumer; import jdk.jpackage.internal.util.function.ThrowingSupplier; +import jdk.jpackage.test.MacSign.CertificateHash; import jdk.jpackage.test.MacSign.CertificateRequest; import jdk.jpackage.test.MacSign.CertificateType; import jdk.jpackage.test.MacSign.ResolvedKeychain; @@ -259,10 +260,7 @@ public final class MacHelper { * predefined app image in place and {@code false} otherwise. */ public static boolean signPredefinedAppImage(JPackageCommand cmd) { - Objects.requireNonNull(cmd); - if (!TKit.isOSX()) { - throw new UnsupportedOperationException(); - } + cmd.verifyIsOfType(PackageType.MAC_DMG, PackageType.MAC_PKG, PackageType.IMAGE); return cmd.hasArgument("--mac-sign") && cmd.hasArgument("--app-image") && cmd.isImagePackageType(); } @@ -279,10 +277,7 @@ public final class MacHelper { * otherwise. */ public static boolean appImageSigned(JPackageCommand cmd) { - Objects.requireNonNull(cmd); - if (!TKit.isOSX()) { - throw new UnsupportedOperationException(); - } + cmd.verifyIsOfType(PackageType.MAC_DMG, PackageType.MAC_PKG, PackageType.IMAGE); var runtimeImageBundle = Optional.ofNullable(cmd.getArgumentValue("--runtime-image")).map(Path::of).flatMap(MacBundle::fromPath); var appImage = Optional.ofNullable(cmd.getArgumentValue("--app-image")).map(Path::of); @@ -291,23 +286,102 @@ public final class MacHelper { // If the predefined runtime is a signed bundle, bundled image should be signed too. return true; } else if (appImage.map(MacHelper::isBundleSigned).orElse(false)) { - // The external app image is signed, so the app image is signed too. + // The predefined app image is signed, so the app image is signed too. return true; } - if (!cmd.isImagePackageType() && appImage.isPresent()) { - // Building a ".pkg" or a ".dmg" bundle from the predefined app image. - // The predefined app image is unsigned, so the app image bundled - // in the output native package will be unsigned too - // (even if the ".pkg" file may be signed itself, and we never sign ".dmg" files). - return false; - } - if (!cmd.hasArgument("--mac-sign")) { return false; + } else { + return isSignWithoutSignIdentity(cmd) || hasAppImageSignIdentity(cmd); } + } - return (cmd.hasArgument("--mac-signing-key-user-name") || cmd.hasArgument("--mac-app-image-sign-identity")); + /** + * Returns {@code true} if the given jpackage command line is configured such + * that the native package it will produce will be signed. + * + * @param cmd the jpackage command to examine + * @return {@code true} if the given jpackage command line is configured such + * the native package it will produce will be signed and {@code false} + * otherwise. + */ + public static boolean nativePackageSigned(JPackageCommand cmd) { + cmd.verifyIsOfType(PackageType.MAC); + + switch (cmd.packageType()) { + case MAC_DMG -> { + return false; + } + case MAC_PKG -> { + if (!cmd.hasArgument("--mac-sign")) { + return false; + } else { + return isSignWithoutSignIdentity(cmd) || hasPkgInstallerSignIdentity(cmd); + } + } + default -> { + throw new IllegalStateException(); + } + } + } + + /** + * Returns {@code true} if the given jpackage command line has app image signing + * identity option. The command line must have "--mac-sign" option. + * + * @param cmd the jpackage command to examine + * @return {@code true} if the given jpackage command line has app image signing + * identity option and {@code false} otherwise. + */ + public static boolean hasAppImageSignIdentity(JPackageCommand cmd) { + cmd.verifyIsOfType(PackageType.MAC_DMG, PackageType.MAC_PKG, PackageType.IMAGE); + if (!cmd.hasArgument("--mac-sign")) { + throw new IllegalArgumentException(); + } + return Stream.of( + "--mac-signing-key-user-name", + "--mac-app-image-sign-identity" + ).anyMatch(cmd::hasArgument); + } + + /** + * Returns {@code true} if the given jpackage command line has PKG installer signing + * identity option. The command line must have "--mac-sign" option. + * + * @param cmd the jpackage command to examine + * @return {@code true} if the given jpackage command line has PKG installer signing + * identity option and {@code false} otherwise. + */ + public static boolean hasPkgInstallerSignIdentity(JPackageCommand cmd) { + cmd.verifyIsOfType(PackageType.MAC_PKG); + if (!cmd.hasArgument("--mac-sign")) { + throw new IllegalArgumentException(); + } + return Stream.of( + "--mac-signing-key-user-name", + "--mac-installer-sign-identity" + ).anyMatch(cmd::hasArgument); + } + + /** + * Returns {@code true} if the given jpackage command line doesn't have signing + * identity options. The command line must have "--mac-sign" option. + * + * @param cmd the jpackage command to examine + * @return {@code true} if the given jpackage command line doesn't have signing + * identity options and {@code false} otherwise. + */ + public static boolean isSignWithoutSignIdentity(JPackageCommand cmd) { + cmd.verifyIsOfType(PackageType.MAC_DMG, PackageType.MAC_PKG, PackageType.IMAGE); + if (!cmd.hasArgument("--mac-sign")) { + throw new IllegalArgumentException(); + } + return Stream.of( + "--mac-signing-key-user-name", + "--mac-app-image-sign-identity", + "--mac-installer-sign-identity" + ).noneMatch(cmd::hasArgument); } public static void writeFaPListFragment(JPackageCommand cmd, XMLStreamWriter xml) { @@ -702,6 +776,14 @@ public final class MacHelper { MacSign.CertificateType.CODE_SIGN, Name.KEY_IDENTITY_APP_IMAGE, MacSign.CertificateType.INSTALLER, Name.KEY_IDENTITY_INSTALLER)), + /** + * "--mac-installer-sign-identity" or "--mac-app-image-sign-identity" option + * with the SHA1 of a signing certificate + */ + SIGN_KEY_IDENTITY_SHA1(Map.of( + MacSign.CertificateType.CODE_SIGN, Name.KEY_IDENTITY_APP_IMAGE, + MacSign.CertificateType.INSTALLER, Name.KEY_IDENTITY_INSTALLER)), + /** * "--mac-app-image-sign-identity" regardless of the type of signing identity * (for signing app image or .pkg installer). @@ -714,6 +796,12 @@ public final class MacHelper { */ SIGN_KEY_IDENTITY_INSTALLER(Name.KEY_IDENTITY_INSTALLER), + /** + * No explicit option specifying signing identity. jpackage will pick one from + * the specified keychain. + */ + SIGN_KEY_IMPLICIT, + ; Type(Map optionNameMap) { @@ -736,11 +824,24 @@ public final class MacHelper { return optionNameMapper.apply(Objects.requireNonNull(certType)); } + public boolean passThrough() { + return Stream.of(MacSign.CertificateType.values()) + .map(this::mapOptionName) + .flatMap(Optional::stream) + .map(Name::passThrough) + .distinct() + .reduce((_, _) -> { + throw new IllegalStateException(); + }).orElse(false); + } + public static Type[] defaultValues() { return new Type[] { SIGN_KEY_USER_SHORT_NAME, SIGN_KEY_USER_FULL_NAME, - SIGN_KEY_IDENTITY + SIGN_KEY_IDENTITY, + SIGN_KEY_IDENTITY_SHA1, + SIGN_KEY_IMPLICIT }; } @@ -751,7 +852,7 @@ public final class MacHelper { public String toString() { var sb = new StringBuilder(); sb.append('{'); - applyTo((optionName, _) -> { + type.mapOptionName(certRequest.type()).ifPresent(optionName -> { sb.append(optionName); switch (type) { case SIGN_KEY_USER_FULL_NAME -> { @@ -762,6 +863,9 @@ public final class MacHelper { sb.append("=").append(ENQUOTER.applyTo(optionValue)); }); } + case SIGN_KEY_IDENTITY_SHA1 -> { + sb.append("/sha1"); + } default -> { // NOP } @@ -787,12 +891,16 @@ public final class MacHelper { } public List asCmdlineArgs() { - String[] args = new String[2]; - applyTo((optionName, optionValue) -> { - args[0] = optionName; - args[1] = optionValue; - }); - return List.of(args); + if (type == Type.SIGN_KEY_IMPLICIT) { + return List.of(); + } else { + String[] args = new String[2]; + applyTo((optionName, optionValue) -> { + args[0] = optionName; + args[1] = optionValue; + }); + return List.of(args); + } } public Optional passThrough() { @@ -817,6 +925,9 @@ public final class MacHelper { case SIGN_KEY_USER_SHORT_NAME -> { return certRequest.shortName(); } + case SIGN_KEY_IDENTITY_SHA1 -> { + return CertificateHash.of(certRequest.cert()).toString(); + } default -> { throw new IllegalStateException(); } @@ -960,18 +1071,21 @@ public final class MacHelper { } static void verifyUnsignedBundleSignature(JPackageCommand cmd) { - if (!cmd.isImagePackageType()) { + + if (!cmd.isImagePackageType() && !nativePackageSigned(cmd)) { MacSignVerify.assertUnsigned(cmd.outputBundle()); } - final Path bundleRoot; - if (cmd.isImagePackageType()) { - bundleRoot = cmd.outputBundle(); - } else { - bundleRoot = cmd.pathToUnpackedPackageFile(cmd.appInstallationDirectory()); - } + if (!appImageSigned(cmd)) { + final Path bundleRoot; + if (cmd.isImagePackageType()) { + bundleRoot = cmd.outputBundle(); + } else { + bundleRoot = cmd.pathToUnpackedPackageFile(cmd.appInstallationDirectory()); + } - MacSignVerify.assertAdhocSigned(bundleRoot); + MacSignVerify.assertAdhocSigned(bundleRoot); + } } static PackageHandlers createDmgPackageHandlers() { diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSign.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSign.java index 3bbbf436300..20f7ac41eef 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSign.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSign.java @@ -63,9 +63,11 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; +import java.util.function.Supplier; import java.util.stream.Stream; import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; +import jdk.jpackage.internal.util.MemoizingSupplier; import jdk.jpackage.internal.util.function.ExceptionBox; import jdk.jpackage.internal.util.function.ThrowingConsumer; import jdk.jpackage.internal.util.function.ThrowingSupplier; @@ -280,8 +282,15 @@ public final class MacSign { return sb.toString(); } + public static Builder build() { + return new Builder(); + } + public static final class Builder { + private Builder() { + } + public Builder name(String v) { keychainBuilder.name(v); return this; @@ -306,8 +315,8 @@ public final class MacSign { return new KeychainWithCertsSpec(keychain, List.copyOf(certs)); } - private Keychain.Builder keychainBuilder = new Keychain.Builder(); - private List certs = new ArrayList<>(); + private final Keychain.Builder keychainBuilder = Keychain.build(); + private final List certs = new ArrayList<>(); } } @@ -326,8 +335,15 @@ public final class MacSign { } } + public static Builder build() { + return new Builder(); + } + public static final class Builder { + private Builder() { + } + public Builder name(String v) { name = v; return this; @@ -599,12 +615,7 @@ public final class MacSign { @Override public String toString() { - final var sb = new StringBuilder(); - sb.append(frame("BEGIN " + label)); - sb.append(ENCODER.encodeToString(data)); - sb.append("\n"); - sb.append(frame("END " + label)); - return sb.toString(); + return PemDataFormatter.format(label, data); } static PemData of(X509Certificate cert) { @@ -619,6 +630,21 @@ public final class MacSign { throw new UncheckedIOException(ex); } } + } + + private final class PemDataFormatter { + + static String format(String label, byte[] data) { + Objects.requireNonNull(label); + Objects.requireNonNull(data); + + final var sb = new StringBuilder(); + sb.append(frame("BEGIN " + label)); + sb.append(ENCODER.encodeToString(data)); + sb.append("\n"); + sb.append(frame("END " + label)); + return sb.toString(); + } private static String frame(String str) { return String.format("-----%s-----\n", Objects.requireNonNull(str)); @@ -627,6 +653,11 @@ public final class MacSign { private static final Base64.Encoder ENCODER = Base64.getMimeEncoder(64, "\n".getBytes()); } + public static String formatX509Certificate(X509Certificate cert) { + Objects.requireNonNull(cert); + return PemDataFormatter.format("CERTIFICATE", toSupplier(cert::getEncoded).get()); + } + public enum DigestAlgorithm { SHA1(20, () -> MessageDigest.getInstance("SHA-1")), SHA256(32, () -> MessageDigest.getInstance("SHA-256")); @@ -712,7 +743,7 @@ public final class MacSign { } public enum StandardCertificateNamePrefix { - CODE_SIGND("Developer ID Application: "), + CODE_SIGN("Developer ID Application: "), INSTALLER("Developer ID Installer: "); StandardCertificateNamePrefix(String value) { @@ -773,8 +804,15 @@ public final class MacSign { return COMPARATOR.compare(this, o); } + public static Builder build() { + return new Builder(); + } + public static final class Builder { + private Builder() { + } + public Builder userName(String v) { userName = v; return this; @@ -825,7 +863,7 @@ public final class MacSign { return Optional.ofNullable(subjectCommonName).orElseGet(() -> { switch (type) { case CODE_SIGN -> { - return StandardCertificateNamePrefix.CODE_SIGND.value() + validatedUserName(); + return StandardCertificateNamePrefix.CODE_SIGN.value() + validatedUserName(); } case INSTALLER -> { return StandardCertificateNamePrefix.INSTALLER.value() + validatedUserName(); @@ -1068,6 +1106,15 @@ public final class MacSign { return !missingKeychain && !missingCertificates && !invalidCertificates; } + /** + * Creates an empty keychain with unique name in the work directory of the current test. + */ + public static Keychain createEmptyKeychain() { + return Keychain.build() + .name(TKit.createUniquePath(TKit.workDir().resolve("empty.keychain")).toAbsolutePath().toString()) + .create().create(); + } + public static Keychain.UsageBuilder withKeychains(KeychainWithCertsSpec... keychains) { return withKeychains(Stream.of(keychains).map(KeychainWithCertsSpec::keychain).toArray(Keychain[]::new)); } @@ -1100,9 +1147,14 @@ public final class MacSign { public static void withKeychain(Consumer consumer, Consumer mutator, ResolvedKeychain keychain) { Objects.requireNonNull(consumer); - withKeychains(() -> { + Objects.requireNonNull(mutator); + if (keychain.isMock()) { consumer.accept(keychain); - }, mutator, keychain.spec().keychain()); + } else { + withKeychains(() -> { + consumer.accept(keychain); + }, mutator, keychain.spec().keychain()); + } } public static void withKeychain(Consumer consumer, ResolvedKeychain keychain) { @@ -1111,7 +1163,15 @@ public final class MacSign { public static final class ResolvedKeychain { public ResolvedKeychain(KeychainWithCertsSpec spec) { + isMock = false; this.spec = Objects.requireNonNull(spec); + certMapSupplier = MemoizingSupplier.runOnce(() -> { + return MacSign.mapCertificateRequests(spec); + }); + } + + public static ResolvedKeychain createMock(String name, Map certs) { + return new ResolvedKeychain(name, certs); } public KeychainWithCertsSpec spec() { @@ -1122,15 +1182,30 @@ public final class MacSign { return spec.keychain().name(); } - public Map mapCertificateRequests() { - if (certMap == null) { - synchronized (this) { - if (certMap == null) { - certMap = MacSign.mapCertificateRequests(spec); - } - } + public boolean isMock() { + return isMock; + } + + public ResolvedKeychain toMock(Map signEnv) { + if (isMock) { + throw new UnsupportedOperationException("Already a mock"); } - return certMap; + + var comm = Comm.compare(Set.copyOf(spec.certificateRequests()), signEnv.keySet()); + if (!comm.unique1().isEmpty()) { + throw new IllegalArgumentException(String.format( + "Signing environment missing %s certificate request mappings in [%s] keychain", + comm.unique1(), name())); + } + + var certs = new HashMap<>(signEnv); + certs.keySet().retainAll(comm.common()); + + return createMock(name(), certs); + } + + public Map mapCertificateRequests() { + return certMapSupplier.get(); } public Function asCertificateResolver() { @@ -1145,8 +1220,23 @@ public final class MacSign { }; } + private ResolvedKeychain(String name, Map certs) { + + var keychainBuilder = KeychainWithCertsSpec.build().name(Objects.requireNonNull(name)); + certs.keySet().forEach(keychainBuilder::addCert); + + var certsCopy = Map.copyOf(Objects.requireNonNull(certs)); + + isMock = true; + spec = keychainBuilder.create(); + certMapSupplier = MemoizingSupplier.runOnce(() -> { + return certsCopy; + }); + } + + private final boolean isMock; private final KeychainWithCertsSpec spec; - private volatile Map certMap; + private final Supplier> certMapSupplier; } private static Map mapCertificateRequests(KeychainWithCertsSpec spec) { diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSignVerify.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSignVerify.java index ddf899d603c..01c510070be 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSignVerify.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacSignVerify.java @@ -28,10 +28,13 @@ import java.nio.file.Path; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.HexFormat; +import java.util.Iterator; import java.util.List; import java.util.Objects; import java.util.Optional; +import java.util.function.Consumer; import java.util.regex.Pattern; +import java.util.stream.Stream; import jdk.jpackage.internal.util.PListReader; import jdk.jpackage.test.MacHelper.ResolvableCertificateRequest; import jdk.jpackage.test.MacSign.CertificateHash; @@ -211,10 +214,13 @@ public final class MacSignVerify { exec.addArguments("--verify", "--deep", "--strict", "--verbose=2", path.toString()); final var result = exec.saveOutput().executeWithoutExitCodeCheck(); if (result.getExitCode() == 0) { - TKit.TextStreamVerifier.group() - .add(TKit.assertTextStream(": valid on disk").predicate(String::endsWith)) - .add(TKit.assertTextStream(": satisfies its Designated Requirement").predicate(String::endsWith)) - .create().accept(result.getOutput().iterator()); + Stream.of( + ": valid on disk", + ": satisfies its Designated Requirement" + ).map(TKit::assertTextStream).map(v -> { + Consumer> consumer = v.predicate(String::endsWith)::apply; + return consumer; + }).reduce(Consumer::andThen).orElseThrow().accept(result.getOutput().iterator()); } else if (!sudo && result.getOutput().stream().findFirst().filter(str -> { // By some reason /usr/bin/codesign command fails for some installed bundles. // It is known to fail for some AppContentTest test cases and all FileAssociationsTest test cases. diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PathDeletionPreventer.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PathDeletionPreventer.java new file mode 100644 index 00000000000..d16b63d9c69 --- /dev/null +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PathDeletionPreventer.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2026, 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 jdk.jpackage.test; + +import java.io.Closeable; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.channels.FileLock; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.util.Objects; +import java.util.Set; +import java.util.function.Supplier; +import jdk.internal.util.OperatingSystem; +import jdk.jpackage.internal.util.SetBuilder; + +/** + * Path deletion preventer. Encapsulates platform-specifics of how to make a + * file or a directory non-deletable. + *

    + * Implementation should be sufficient to make {@code Files#delete(Path)} + * applied to the path protected from deletion throw. + */ +public sealed interface PathDeletionPreventer { + + enum Implementation { + /** + * Uses Java file lock to prevent deletion of a file. + * Works on Windows. Doesn't work on Linux and macOS. + */ + FILE_CHANNEL_LOCK, + + /** + * Removes write permission from a non-empty directory to prevent its deletion. + * Works on Linux and macOS. Doesn't work on Windows. + */ + READ_ONLY_NON_EMPTY_DIRECTORY, + ; + } + + Implementation implementation(); + + Closeable preventPathDeletion(Path path) throws IOException; + + enum FileChannelLockPathDeletionPreventer implements PathDeletionPreventer { + INSTANCE; + + @Override + public Implementation implementation() { + return Implementation.FILE_CHANNEL_LOCK; + } + + @Override + public Closeable preventPathDeletion(Path path) throws IOException { + return new UndeletablePath(path); + } + + private static final class UndeletablePath implements Closeable { + + UndeletablePath(Path file) throws IOException { + var fos = new FileOutputStream(Objects.requireNonNull(file).toFile()); + boolean lockCreated = false; + try { + this.lock = fos.getChannel().lock(); + this.fos = fos; + lockCreated = true; + } finally { + if (!lockCreated) { + fos.close(); + } + } + } + + @Override + public void close() throws IOException { + try { + lock.close(); + } finally { + fos.close(); + } + } + + private final FileOutputStream fos; + private final FileLock lock; + } + } + + enum ReadOnlyDirectoryPathDeletionPreventer implements PathDeletionPreventer { + INSTANCE; + + @Override + public Implementation implementation() { + return Implementation.READ_ONLY_NON_EMPTY_DIRECTORY; + } + + @Override + public Closeable preventPathDeletion(Path path) throws IOException { + return new UndeletablePath(path); + } + + private static final class UndeletablePath implements Closeable { + + UndeletablePath(Path dir) throws IOException { + this.dir = Objects.requireNonNull(dir); + + // Deliberately don't use Files#createDirectories() as don't want to create missing directories. + try { + Files.createDirectory(dir); + Files.createFile(dir.resolve("empty")); + } catch (FileAlreadyExistsException ex) { + } + + perms = Files.getPosixFilePermissions(dir); + if (perms.contains(PosixFilePermission.OWNER_WRITE)) { + Files.setPosixFilePermissions(dir, SetBuilder.build() + .add(perms) + .remove(PosixFilePermission.OWNER_WRITE) + .emptyAllowed(true) + .create()); + } + } + + @Override + public void close() throws IOException { + if (perms.contains(PosixFilePermission.OWNER_WRITE)) { + Files.setPosixFilePermissions(dir, perms); + } + } + + private final Path dir; + private final Set perms; + } + } + + static final PathDeletionPreventer DEFAULT = new Supplier() { + + @Override + public PathDeletionPreventer get() { + switch (OperatingSystem.current()) { + case WINDOWS -> { + return FileChannelLockPathDeletionPreventer.INSTANCE; + } + default -> { + return ReadOnlyDirectoryPathDeletionPreventer.INSTANCE; + } + } + } + + }.get(); +} diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java index 7666d1e5167..88d11d75f45 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java @@ -1093,7 +1093,6 @@ public final class TKit { label = other.label; negate = other.negate; createException = other.createException; - anotherVerifier = other.anotherVerifier; value = other.value; } @@ -1178,74 +1177,12 @@ public final class TKit { } } } - - if (anotherVerifier != null) { - anotherVerifier.accept(lineIt); - } - } - - public static TextStreamVerifier.Group group() { - return new TextStreamVerifier.Group(); - } - - public static final class Group { - public Group add(TextStreamVerifier verifier) { - if (verifier.anotherVerifier != null) { - throw new IllegalArgumentException(); - } - verifiers.add(verifier); - return this; - } - - public Group add(Group other) { - verifiers.addAll(other.verifiers); - return this; - } - - public Group mutate(Consumer mutator) { - mutator.accept(this); - return this; - } - - public boolean isEmpty() { - return verifiers.isEmpty(); - } - - public Optional>> tryCreate() { - if (isEmpty()) { - return Optional.empty(); - } else { - return Optional.of(create()); - } - } - - public Consumer> create() { - if (verifiers.isEmpty()) { - throw new IllegalStateException(); - } - - if (verifiers.size() == 1) { - return verifiers.getFirst()::apply; - } - - final var head = new TextStreamVerifier(verifiers.getFirst()); - var prev = head; - for (var verifier : verifiers.subList(1, verifiers.size())) { - verifier = new TextStreamVerifier(verifier); - prev.anotherVerifier = verifier::apply; - prev = verifier; - } - return head::apply; - } - - private final List verifiers = new ArrayList<>(); } private BiPredicate predicate; private String label; private boolean negate; private Supplier createException; - private Consumer> anotherVerifier; private final String value; } @@ -1257,11 +1194,12 @@ public final class TKit { return new TextStreamVerifier(what); } - public static Consumer> assertEndOfTextStream() { + public static Consumer> assertEndOfTextStream(String label) { + Objects.requireNonNull(label); return it -> { var tail = new ArrayList(); it.forEachRemaining(tail::add); - assertStringListEquals(List.of(), tail, "Check the end of the output"); + assertStringListEquals(List.of(), tail, String.format("Check the end of %s", label)); }; } diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/CommandAction.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/CommandAction.java index d9ab38e006a..c4899a5376f 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/CommandAction.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/CommandAction.java @@ -60,6 +60,36 @@ public interface CommandAction { public MockIllegalStateException unexpectedArguments() { return new MockIllegalStateException(String.format("Unexpected arguments: %s", args)); } + + public Context shift(int count) { + if (count < 0) { + throw new IllegalArgumentException(); + } else if (count == 0) { + return this; + } else { + return new Context(out, err, args.subList(Integer.min(count, args.size()), args.size())); + } + } + + public Context shift() { + return shift(1); + } + + public void printlnOut(Object obj) { + out.println(obj); + } + + public void printlnOut(String str) { + out.println(str); + } + + public void printlnErr(Object obj) { + err.println(obj); + } + + public void printlnErr(String str) { + err.println(str); + } } /** diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/MockIllegalStateException.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/MockIllegalStateException.java index 1817587364a..4656e1d4f7b 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/MockIllegalStateException.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/mock/MockIllegalStateException.java @@ -22,13 +22,15 @@ */ package jdk.jpackage.test.mock; +import java.util.Objects; + /** * Indicates command mock internal error. */ public final class MockIllegalStateException extends IllegalStateException { public MockIllegalStateException(String msg) { - super(msg); + super(Objects.requireNonNull(msg)); } private static final long serialVersionUID = 1L; diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/JPackageMockUtils.java similarity index 76% rename from test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java rename to test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/JPackageMockUtils.java index e88077a6c9d..604bcd0711f 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/JPackageMockUtils.java @@ -21,18 +21,27 @@ * questions. */ -package jdk.jpackage.internal; +package jdk.jpackage.test.stdmock; +import static jdk.jpackage.internal.util.MemoizingSupplier.runOnce; import static jdk.jpackage.internal.util.function.ThrowingSupplier.toSupplier; import java.io.PrintWriter; +import java.lang.reflect.Constructor; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; +import java.util.function.Supplier; import java.util.function.UnaryOperator; import java.util.spi.ToolProvider; +import java.util.stream.Collectors; import jdk.internal.util.OperatingSystem; +import jdk.jpackage.internal.Executor; +import jdk.jpackage.internal.ExecutorFactory; +import jdk.jpackage.internal.Globals; +import jdk.jpackage.internal.ObjectFactory; import jdk.jpackage.internal.cli.CliBundlingEnvironment; import jdk.jpackage.internal.cli.Main; import jdk.jpackage.internal.util.function.ExceptionBox; @@ -41,11 +50,11 @@ import jdk.jpackage.test.mock.ToolProviderCommandMock; import jdk.jpackage.test.mock.VerbatimCommandMock; /** - * Bridges "jdk.jpackage.internal" and "jdk.jpackage.test.mock" packages. + * Utilities to create jpackage mock. */ -public final class MockUtils { +public final class JPackageMockUtils { - private MockUtils() { + private JPackageMockUtils() { } public static JPackageToolProviderBuilder buildJPackage() { @@ -58,30 +67,23 @@ public final class MockUtils { return createJPackageToolProvider(os(), createObjectFactory()); } - public Consumer createGlobalsMutator() { - var objectFactory = createObjectFactory(); - return globals -> { - globals.objectFactory(objectFactory); - }; - } - public void applyToGlobals() { - createGlobalsMutator().accept(Globals.instance()); + Globals.instance().objectFactory(createObjectFactory()); } - ExecutorFactory createExecutorFactory() { - var commandMocksExecutorFactory = Optional.ofNullable(script).map(MockUtils::withCommandMocks).map(mapper -> { + public ExecutorFactory createExecutorFactory() { + var commandMocksExecutorFactory = Optional.ofNullable(script).map(JPackageMockUtils::withCommandMocks).map(mapper -> { return mapper.apply(ExecutorFactory.DEFAULT); }).orElse(ExecutorFactory.DEFAULT); - var recordingExecutorFactory = Optional.ofNullable(listener).map(MockUtils::withCommandListener).map(mapper -> { + var recordingExecutorFactory = Optional.ofNullable(listener).map(JPackageMockUtils::withCommandListener).map(mapper -> { return mapper.apply(commandMocksExecutorFactory); }).orElse(commandMocksExecutorFactory); return recordingExecutorFactory; } - ObjectFactory createObjectFactory() { + public ObjectFactory createObjectFactory() { var executorFactory = createExecutorFactory(); if (executorFactory == ExecutorFactory.DEFAULT) { return ObjectFactory.DEFAULT; @@ -125,6 +127,31 @@ public final class MockUtils { return createJPackageToolProvider(OperatingSystem.current(), script); } + public static Map> availableBundlingEnvironments() { + return Map.ofEntries( + Map.entry(OperatingSystem.WINDOWS, "WinBundlingEnvironment"), + Map.entry(OperatingSystem.LINUX, "LinuxBundlingEnvironment"), + Map.entry(OperatingSystem.MACOS, "MacBundlingEnvironment") + ).entrySet().stream().map(e -> { + Constructor ctor; + try { + ctor = Class.forName("jdk.jpackage.internal." + e.getValue()).getConstructor(); + } catch (NoSuchMethodException | SecurityException ex) { + throw ExceptionBox.toUnchecked(ex); + } catch (ClassNotFoundException ex) { + return Optional.>>empty(); + } + return Optional.of(Map.entry(e.getKey(), toSupplier(() -> { + return (CliBundlingEnvironment)ctor.newInstance(); + }))); + }).flatMap(Optional::stream).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } + + public static CliBundlingEnvironment createBundlingEnvironment(OperatingSystem os) { + Objects.requireNonNull(os); + return Objects.requireNonNull(availableBundlingEnvironments().get(os)).get(); + } + private static UnaryOperator withCommandListener(Consumer> listener) { Objects.requireNonNull(listener); return executorFactory -> { @@ -180,39 +207,11 @@ public final class MockUtils { }; } - public static CliBundlingEnvironment createBundlingEnvironment(OperatingSystem os) { - Objects.requireNonNull(os); - - String bundlingEnvironmentClassName; - switch (os) { - case WINDOWS -> { - bundlingEnvironmentClassName = "WinBundlingEnvironment"; - } - case LINUX -> { - bundlingEnvironmentClassName = "LinuxBundlingEnvironment"; - } - case MACOS -> { - bundlingEnvironmentClassName = "MacBundlingEnvironment"; - } - default -> { - throw new IllegalArgumentException(); - } - } - - return toSupplier(() -> { - var ctor = Class.forName(String.join(".", - DefaultBundlingEnvironment.class.getPackageName(), - bundlingEnvironmentClassName - )).getConstructor(); - return (CliBundlingEnvironment)ctor.newInstance(); - }).get(); - } - - static ToolProvider createJPackageToolProvider(OperatingSystem os, ObjectFactory of) { + private static ToolProvider createJPackageToolProvider(OperatingSystem os, ObjectFactory of) { Objects.requireNonNull(os); Objects.requireNonNull(of); - var impl = new Main.Provider(DefaultBundlingEnvironment.runOnce(() -> { + var impl = new Main.Provider(runOnce(() -> { return createBundlingEnvironment(os); })); diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/MacSecurityMock.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/MacSecurityMock.java new file mode 100644 index 00000000000..fe9a67f1889 --- /dev/null +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/MacSecurityMock.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2026, 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 jdk.jpackage.test.stdmock; + +import java.nio.file.Path; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import jdk.jpackage.test.MacSign; +import jdk.jpackage.test.MacSign.CertificateRequest; +import jdk.jpackage.test.MacSign.ResolvedKeychain; +import jdk.jpackage.test.mock.CommandAction; +import jdk.jpackage.test.mock.MockIllegalStateException; + +/** + * Mocks /usr/bin/security command. + */ +final class MacSecurityMock implements CommandAction { + + MacSecurityMock(MacSignMockUtils.SignEnv signEnv) { + Objects.requireNonNull(signEnv); + + var keychains = signEnv.keychains(); + + var stdUserKeychains = Stream.of(StandardKeychain.values()).map(StandardKeychain::keychainName).filter(name -> { + // Add standard keychain unless it is defined in the signing environment. + return keychains.stream().noneMatch(keychain -> { + return keychain.name().equals(name); + }); + }).map(name -> { + // Assume the standard keychain is empty. + return ResolvedKeychain.createMock(name, Map.of()); + }); + + allKnownKeychains = Stream.of( + stdUserKeychains, + keychains.stream() + ).flatMap(x -> x).collect(Collectors.toUnmodifiableMap(ResolvedKeychain::name, x -> x)); + + currentKeychains.addAll(Stream.of(StandardKeychain.values()) + .map(StandardKeychain::keychainName) + .map(allKnownKeychains::get) + .map(Objects::requireNonNull).toList()); + } + + @Override + public Optional run(Context context) { + switch (context.args().getFirst()) { + case "list-keychains" -> { + listKeychains(context.shift()); + return Optional.of(0); + } + case "find-certificate" -> { + findCertificate(context.shift()); + return Optional.of(0); + } + default -> { + throw context.unexpectedArguments(); + } + } + } + + private void listKeychains(Context context) { + if (context.args().getFirst().equals("-s")) { + currentKeychains.clear(); + currentKeychains.addAll(context.shift().args().stream().map(name -> { + return Optional.ofNullable(allKnownKeychains.get(name)).orElseThrow(() -> { + throw new MockIllegalStateException(String.format("Unknown keychain name: %s", name)); + }); + }).toList()); + } else if (context.args().isEmpty()) { + currentKeychains.stream().map(keychain -> { + return String.format(" \"%s\"", keychain.name()); + }).forEach(context::printlnOut); + } else { + throw context.unexpectedArguments(); + } + } + + private void findCertificate(Context context) { + + var args = new ArrayList<>(context.args()); + for (var mandatoryArg : List.of("-p", "-a")) { + if (!args.remove(mandatoryArg)) { + throw context.unexpectedArguments(); + } + } + + var certNameFilter = context.findOptionValue("-c").map(certNameSubstr -> { + + // Remove option name and its value. + var idx = args.indexOf("-c"); + args.remove(idx); + args.remove(idx); + + Predicate> pred = e -> { + return e.getKey().name().contains(certNameSubstr); + }; + return pred; + }); + + Stream keychains; + if (args.isEmpty()) { + keychains = currentKeychains.stream(); + } else { + // Remaining arguments must be keychain names. + keychains = args.stream().map(keychainName -> { + return Optional.ofNullable(allKnownKeychains.get(keychainName)).orElseThrow(() -> { + throw new MockIllegalStateException(String.format("Unknown keychain name: %s", keychainName)); + }); + }); + } + + var certStream = keychains.flatMap(keychain -> { + return keychain.mapCertificateRequests().entrySet().stream(); + }); + + if (certNameFilter.isPresent()) { + certStream = certStream.filter(certNameFilter.get()); + } + + certStream.map(Map.Entry::getValue).map(MacSign::formatX509Certificate).forEach(formattedCert -> { + context.out().print(formattedCert); + }); + } + + // Keep the order of the items as the corresponding keychains appear + // in the output of the "/usr/bin/security list-keychains" command. + private enum StandardKeychain { + USER_KEYCHAIN { + @Override + String keychainName() { + return Path.of(System.getProperty("user.home")).resolve("Library/Keychains/login.keychain-db").toString(); + } + }, + SYSTEM_KEYCHAIN { + @Override + String keychainName() { + return "/Library/Keychains/System.keychain"; + } + }, + ; + + abstract String keychainName(); + } + + private final List currentKeychains = new ArrayList(); + private final Map allKnownKeychains; +} diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/MacSignMockUtils.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/MacSignMockUtils.java new file mode 100644 index 00000000000..164261a6000 --- /dev/null +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/stdmock/MacSignMockUtils.java @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2026, 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 jdk.jpackage.test.stdmock; + +import static jdk.jpackage.internal.util.function.ExceptionBox.toUnchecked; +import static jdk.jpackage.internal.util.function.ThrowingFunction.toFunction; +import static jdk.jpackage.internal.util.function.ThrowingRunnable.toRunnable; +import static jdk.jpackage.internal.util.function.ThrowingSupplier.toSupplier; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +import jdk.jpackage.internal.util.function.ExceptionBox; +import jdk.jpackage.test.MacSign.CertificateRequest; +import jdk.jpackage.test.MacSign.KeychainWithCertsSpec; +import jdk.jpackage.test.MacSign.ResolvedKeychain; +import jdk.jpackage.test.mock.CommandActionSpec; +import jdk.jpackage.test.mock.CommandActionSpecs; +import jdk.jpackage.test.mock.CommandMockSpec; + + +/** + * Utilities to create macOS signing tool mocks. + */ +public final class MacSignMockUtils { + + private MacSignMockUtils() { + } + + public static Map resolveCertificateRequests( + Collection certificateRequests) { + Objects.requireNonNull(certificateRequests); + + var caKeys = createKeyPair(); + + Function resolver = toFunction(certRequest -> { + var builder = new CertificateBuilder() + .setSubjectName("CN=" + certRequest.name()) + .setPublicKey(caKeys.getPublic()) + .setSerialNumber(BigInteger.ONE) + .addSubjectKeyIdExt(caKeys.getPublic()) + .addAuthorityKeyIdExt(caKeys.getPublic()); + + Instant from; + Instant to; + if (certRequest.expired()) { + from = LocalDate.now().minusDays(10).atStartOfDay(ZoneId.systemDefault()).toInstant(); + to = from.plus(Duration.ofDays(1)); + } else { + from = LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant(); + to = from.plus(Duration.ofDays(certRequest.days())); + } + builder.setValidity(Date.from(from), Date.from(to)); + + return builder.build(null, caKeys.getPrivate()); + }); + + return certificateRequests.stream() + .distinct() + .collect(Collectors.toUnmodifiableMap(x -> x, resolver)); + } + + public static Map resolveCertificateRequests( + CertificateRequest... certificateRequests) { + return resolveCertificateRequests(List.of(certificateRequests)); + } + + public static final class SignEnv { + + public SignEnv(List spec) { + Objects.requireNonNull(spec); + + spec.stream().map(keychain -> { + return keychain.keychain().name(); + }).collect(Collectors.toMap(x -> x, x -> x, (a, b) -> { + throw new IllegalArgumentException(String.format("Multiple keychains with the same name: %s", a)); + })); + + this.spec = List.copyOf(spec); + this.env = resolveCertificateRequests( + spec.stream().map(KeychainWithCertsSpec::certificateRequests).flatMap(Collection::stream).toList()); + } + + public SignEnv(KeychainWithCertsSpec... spec) { + this(List.of(spec)); + } + + public List keychains() { + return spec.stream().map(ResolvedKeychain::new).map(keychain -> { + return keychain.toMock(env); + }).toList(); + } + + public Map env() { + return env; + } + + private final Map env; + private final List spec; + } + + public static CommandMockSpec securityMock(SignEnv signEnv) { + var action = CommandActionSpec.create("/usr/bin/security", new MacSecurityMock(signEnv)); + return new CommandMockSpec(action.description(), CommandActionSpecs.build().action(action).create()); + } + + private static KeyPair createKeyPair() { + try { + var kpg = KeyPairGenerator.getInstance("RSA"); + return kpg.generateKeyPair(); + } catch (NoSuchAlgorithmException ex) { + throw ExceptionBox.toUnchecked(ex); + } + } + + // + // Reflection proxy for jdk.test.lib.security.CertificateBuilder class. + // + // Can't use it directly because it is impossible to cherry-pick this class from the JDK test lib in JUnit tests due to limitations of jtreg. + // + // Shared jpackage JUnit tests don't require "jdk.jpackage.test.stdmock", but they depend on "jdk.jpackage.test" package. + // Source code for these two packages resides in the same directory tree, so jtreg will pull in classes from both packages for the jpackage JUnit tests. + // Static dependency on jdk.test.lib.security.CertificateBuilder class will force pulling in the entire JDK test lib, because of jtreg limitations. + // + // Use dynamic dependency as a workaround. Tests that require jdk.test.lib.security.CertificateBuilder class, should have + // + // /* + // * ... + // * @library /test/lib + // * @build jdk.test.lib.security.CertificateBuilder + // */ + // + // in their declarations. They also should have + // + // --add-exports java.base/sun.security.x509=ALL-UNNAMED + // --add-exports java.base/sun.security.util=ALL-UNNAMED + // + // on javac and java command lines. + // + private static final class CertificateBuilder { + + CertificateBuilder() { + instance = toSupplier(ctor::newInstance).get(); + } + + CertificateBuilder setSubjectName(String v) { + toRunnable(() -> { + setSubjectName.invoke(instance, v); + }).run(); + return this; + } + + CertificateBuilder setPublicKey(PublicKey v) { + toRunnable(() -> { + setPublicKey.invoke(instance, v); + }).run(); + return this; + } + + CertificateBuilder setSerialNumber(BigInteger v) { + toRunnable(() -> { + setSerialNumber.invoke(instance, v); + }).run(); + return this; + } + + CertificateBuilder addSubjectKeyIdExt(PublicKey v) { + toRunnable(() -> { + addSubjectKeyIdExt.invoke(instance, v); + }).run(); + return this; + } + + CertificateBuilder addAuthorityKeyIdExt(PublicKey v) { + toRunnable(() -> { + addAuthorityKeyIdExt.invoke(instance, v); + }).run(); + return this; + } + + CertificateBuilder setValidity(Date from, Date to) { + toRunnable(() -> { + setValidity.invoke(instance, from, to); + }).run(); + return this; + } + + X509Certificate build(X509Certificate issuerCert, PrivateKey issuerKey) throws IOException, CertificateException { + try { + return (X509Certificate)toSupplier(() -> { + return build.invoke(instance, issuerCert, issuerKey); + }).get(); + } catch (ExceptionBox box) { + switch (ExceptionBox.unbox(box)) { + case IOException ex -> { + throw ex; + } + case CertificateException ex -> { + throw ex; + } + default -> { + throw box; + } + } + } + } + + private final Object instance; + + private static final Constructor ctor; + private static final Method setSubjectName; + private static final Method setPublicKey; + private static final Method setSerialNumber; + private static final Method addSubjectKeyIdExt; + private static final Method addAuthorityKeyIdExt; + private static final Method setValidity; + private static final Method build; + + static { + try { + var certificateBuilderClass = Class.forName("jdk.test.lib.security.CertificateBuilder"); + + ctor = certificateBuilderClass.getConstructor(); + + setSubjectName = certificateBuilderClass.getMethod("setSubjectName", String.class); + + setPublicKey = certificateBuilderClass.getMethod("setPublicKey", PublicKey.class); + + setSerialNumber = certificateBuilderClass.getMethod("setSerialNumber", BigInteger.class); + + addSubjectKeyIdExt = certificateBuilderClass.getMethod("addSubjectKeyIdExt", PublicKey.class); + + addAuthorityKeyIdExt = certificateBuilderClass.getMethod("addAuthorityKeyIdExt", PublicKey.class); + + setValidity = certificateBuilderClass.getMethod("setValidity", Date.class, Date.class); + + build = certificateBuilderClass.getMethod("build", X509Certificate.class, PrivateKey.class); + + } catch (ClassNotFoundException | NoSuchMethodException | SecurityException ex) { + throw toUnchecked(ex); + } + } + } +} diff --git a/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxPackageArchTest.java b/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxPackageArchTest.java index baf03a32142..d1332fc59e5 100644 --- a/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxPackageArchTest.java +++ b/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxPackageArchTest.java @@ -37,6 +37,7 @@ import jdk.jpackage.test.mock.CommandActionSpecs; import jdk.jpackage.test.mock.CommandMockExit; import jdk.jpackage.test.mock.CommandMockSpec; import jdk.jpackage.test.mock.Script; +import jdk.jpackage.test.stdmock.JPackageMockUtils; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -137,7 +138,7 @@ public class LinuxPackageArchTest { Globals.main(() -> { - MockUtils.buildJPackage().script(script).applyToGlobals(); + JPackageMockUtils.buildJPackage().script(script).applyToGlobals(); Result arch = LinuxPackageArch.create(pkgType); diff --git a/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxSystemEnvironmentTest.java b/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxSystemEnvironmentTest.java index 8ff958491b1..5104dd1b252 100644 --- a/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxSystemEnvironmentTest.java +++ b/test/jdk/tools/jpackage/junit/linux/jdk.jpackage/jdk/jpackage/internal/LinuxSystemEnvironmentTest.java @@ -34,6 +34,7 @@ import jdk.jpackage.test.mock.CommandActionSpecs; import jdk.jpackage.test.mock.CommandMockExit; import jdk.jpackage.test.mock.CommandMockSpec; import jdk.jpackage.test.mock.Script; +import jdk.jpackage.test.stdmock.JPackageMockUtils; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -86,7 +87,7 @@ public class LinuxSystemEnvironmentTest { Globals.main(() -> { - MockUtils.buildJPackage().script(script).applyToGlobals(); + JPackageMockUtils.buildJPackage().script(script).applyToGlobals(); var actual = LinuxSystemEnvironment.detectNativePackageType(); diff --git a/test/jdk/tools/jpackage/junit/linux/junit.java b/test/jdk/tools/jpackage/junit/linux/junit.java index 0fd337c812c..ba06cb30db7 100644 --- a/test/jdk/tools/jpackage/junit/linux/junit.java +++ b/test/jdk/tools/jpackage/junit/linux/junit.java @@ -36,9 +36,9 @@ * @requires (os.family == "linux") * @library /test/jdk/tools/jpackage/helpers * @build jdk.jpackage.test.mock.* + * @build jdk.jpackage.test.stdmock.* * @compile/module=jdk.jpackage -Xlint:all -Werror * jdk/jpackage/internal/LinuxSystemEnvironmentTest.java - * ../../share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java * @run junit jdk.jpackage/jdk.jpackage.internal.LinuxSystemEnvironmentTest */ @@ -57,8 +57,8 @@ * @requires (os.family == "linux") * @library /test/jdk/tools/jpackage/helpers * @build jdk.jpackage.test.mock.* + * @build jdk.jpackage.test.stdmock.* * @compile/module=jdk.jpackage -Xlint:all -Werror * jdk/jpackage/internal/LinuxPackageArchTest.java - * ../../share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java * @run junit jdk.jpackage/jdk.jpackage.internal.LinuxPackageArchTest */ diff --git a/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgPackagerTest.java b/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgPackagerTest.java index e5da383142a..0e4893c8a06 100644 --- a/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgPackagerTest.java +++ b/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgPackagerTest.java @@ -56,6 +56,7 @@ import jdk.jpackage.test.mock.CommandMockSpec; import jdk.jpackage.test.mock.MockIllegalStateException; import jdk.jpackage.test.mock.ScriptSpec; import jdk.jpackage.test.mock.ScriptSpecInDir; +import jdk.jpackage.test.stdmock.JPackageMockUtils; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -240,7 +241,7 @@ public class MacDmgPackagerTest { var script = dir(Objects.requireNonNull(workDir)).create(); - ExecutorFactory executorFactory = MockUtils.buildJPackage() + ExecutorFactory executorFactory = JPackageMockUtils.buildJPackage() .script(script).listener(System.out::println).createExecutorFactory(); var objectFactory = ObjectFactory.build() @@ -406,14 +407,14 @@ public class MacDmgPackagerTest { } } - private final static BiConsumer> EXPAND_PATH = (path, sink) -> { + private static final BiConsumer> EXPAND_PATH = (path, sink) -> { do { sink.accept(path); path = path.getParent(); } while (path != null); }; - private final static List DMG_ICON_FILES = Stream.of( + private static final List DMG_ICON_FILES = Stream.of( ".VolumeIcon.icns", ".background/background.tiff" ).map(Path::of).collect(Collectors.toUnmodifiableList()); diff --git a/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgSystemEnvironmentTest.java b/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgSystemEnvironmentTest.java index de2b07e86a6..8e892106cb4 100644 --- a/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgSystemEnvironmentTest.java +++ b/test/jdk/tools/jpackage/junit/macosx/jdk.jpackage/jdk/jpackage/internal/MacDmgSystemEnvironmentTest.java @@ -32,11 +32,11 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; -import jdk.jpackage.internal.util.RetryExecutor; import jdk.jpackage.test.mock.CommandActionSpecs; import jdk.jpackage.test.mock.CommandMockExit; import jdk.jpackage.test.mock.CommandMockSpec; import jdk.jpackage.test.mock.Script; +import jdk.jpackage.test.stdmock.JPackageMockUtils; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -143,7 +143,7 @@ public class MacDmgSystemEnvironmentTest { }).createSequence(); Globals.main(() -> { - MockUtils.buildJPackage().script(script).applyToGlobals(); + JPackageMockUtils.buildJPackage().script(script).applyToGlobals(); var actual = MacDmgSystemEnvironment.findSetFileUtility(); diff --git a/test/jdk/tools/jpackage/junit/macosx/junit.java b/test/jdk/tools/jpackage/junit/macosx/junit.java index c7fd2bc5f8d..2253211add0 100644 --- a/test/jdk/tools/jpackage/junit/macosx/junit.java +++ b/test/jdk/tools/jpackage/junit/macosx/junit.java @@ -36,9 +36,9 @@ * @requires (os.family == "mac") * @library /test/jdk/tools/jpackage/helpers * @build jdk.jpackage.test.mock.* + * @build jdk.jpackage.test.stdmock.* * @compile/module=jdk.jpackage -Xlint:all -Werror * jdk/jpackage/internal/MacDmgSystemEnvironmentTest.java - * ../../share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java * @run junit jdk.jpackage/jdk.jpackage.internal.MacDmgSystemEnvironmentTest */ @@ -47,8 +47,8 @@ * @requires (os.family == "mac") * @library /test/jdk/tools/jpackage/helpers * @build jdk.jpackage.test.mock.* + * @build jdk.jpackage.test.stdmock.* * @compile/module=jdk.jpackage -Xlint:all -Werror * jdk/jpackage/internal/MacDmgPackagerTest.java - * ../../share/jdk.jpackage/jdk/jpackage/internal/MockUtils.java * @run junit jdk.jpackage/jdk.jpackage.internal.MacDmgPackagerTest */ diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/DefaultBundlingEnvironmentTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/DefaultBundlingEnvironmentTest.java index 709f0f8413b..ac05f5e2b69 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/DefaultBundlingEnvironmentTest.java +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/DefaultBundlingEnvironmentTest.java @@ -54,6 +54,7 @@ import jdk.jpackage.test.mock.CommandActionSpecs; import jdk.jpackage.test.mock.CommandMock; import jdk.jpackage.test.mock.CommandMockExit; import jdk.jpackage.test.mock.Script; +import jdk.jpackage.test.stdmock.JPackageMockUtils; import org.junit.jupiter.api.Test; @@ -96,7 +97,7 @@ public class DefaultBundlingEnvironmentTest extends JUnitAdapter { var script = createMockScript(op); - ToolProvider jpackage = MockUtils.buildJPackage() + ToolProvider jpackage = JPackageMockUtils.buildJPackage() .os(op.os()) .script(script) .listener(executedCommands::add).create(); diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/TempDirectoryTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/TempDirectoryTest.java new file mode 100644 index 00000000000..221e7d9f433 --- /dev/null +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/TempDirectoryTest.java @@ -0,0 +1,570 @@ +/* + * Copyright (c) 2026, 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 jdk.jpackage.internal; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrowsExactly; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringReader; +import java.io.StringWriter; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Stream; +import jdk.internal.util.OperatingSystem; +import jdk.jpackage.internal.cli.Options; +import jdk.jpackage.internal.cli.StandardOption; +import jdk.jpackage.internal.util.FileUtils; +import jdk.jpackage.internal.util.RetryExecutor; +import jdk.jpackage.internal.util.function.ThrowingFunction; +import jdk.jpackage.internal.util.function.ThrowingSupplier; +import jdk.jpackage.test.PathDeletionPreventer; +import jdk.jpackage.test.PathDeletionPreventer.ReadOnlyDirectoryPathDeletionPreventer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.MethodSource; + +public class TempDirectoryTest { + + @Test + void test_directory_use(@TempDir Path tempDirPath) throws IOException { + try (var tempDir = new TempDirectory(Optional.of(tempDirPath), RetryExecutorFactory.DEFAULT)) { + assertEquals(tempDir.path(), tempDirPath); + assertFalse(tempDir.deleteOnClose()); + + var cmdline = Options.of(Map.of()); + assertSame(cmdline, tempDir.map(cmdline)); + } + + assertTrue(Files.isDirectory(tempDirPath)); + } + + @Test + void test_directory_new() throws IOException { + var tempDir = new TempDirectory(Optional.empty(), RetryExecutorFactory.DEFAULT); + try (tempDir) { + assertTrue(Files.isDirectory(tempDir.path())); + assertTrue(tempDir.deleteOnClose()); + + var cmdline = Options.of(Map.of()); + var mappedCmdline = tempDir.map(cmdline); + assertEquals(tempDir.path(), StandardOption.TEMP_ROOT.getFrom(mappedCmdline)); + } + + assertFalse(Files.isDirectory(tempDir.path())); + } + + @SuppressWarnings("try") + @ParameterizedTest + @MethodSource + void test_close(CloseType closeType, @TempDir Path root) { + Globals.main(ThrowingSupplier.toSupplier(() -> { + test_close_impl(closeType, root); + return 0; + })); + } + + @ParameterizedTest + @MethodSource + void test_DirectoryListing_listFilesAndEmptyDirectories( + ListFilesAndEmptyDirectoriesTestSpec test, @TempDir Path root) throws IOException { + test.run(root); + } + + @Test + void test_DirectoryListing_listFilesAndEmptyDirectories_negative(@TempDir Path root) throws IOException { + assertThrowsExactly(IllegalArgumentException.class, () -> { + TempDirectory.DirectoryListing.listFilesAndEmptyDirectories(root, -1); + }); + } + + @ParameterizedTest + @CsvSource({"100", "101", "1", "0"}) + void test_DirectoryListing_listFilesAndEmptyDirectories_nonexistent(int limit, @TempDir Path root) throws IOException { + + var path = root.resolve("foo"); + + var listing = TempDirectory.DirectoryListing.listFilesAndEmptyDirectories(path, limit); + assertTrue(listing.complete()); + + List expected; + if (limit == 0) { + expected = List.of(); + } else { + expected = List.of(path); + } + assertEquals(expected, listing.paths()); + } + + private static Stream test_close() { + switch (PathDeletionPreventer.DEFAULT.implementation()) { + case READ_ONLY_NON_EMPTY_DIRECTORY -> { + return Stream.of(CloseType.values()); + } + default -> { + return Stream.of(CloseType.values()) + .filter(Predicate.not(Set.of( + CloseType.FAIL_NO_LEFTOVER_FILES, + CloseType.FAIL_NO_LEFTOVER_FILES_VERBOSE)::contains)); + } + } + } + + @SuppressWarnings({ "try" }) + private void test_close_impl(CloseType closeType, Path root) throws IOException { + var logSink = new StringWriter(); + var logPrintWriter = new PrintWriter(logSink, true); + Globals.instance().loggerOutputStreams(logPrintWriter, logPrintWriter); + if (closeType.isVerbose()) { + Globals.instance().loggerVerbose(); + } + + final var workDir = root.resolve("workdir"); + Files.createDirectories(workDir); + + final Path leftoverPath; + final TempDirectory tempDir; + + switch (closeType) { + case FAIL_NO_LEFTOVER_FILES_VERBOSE, FAIL_NO_LEFTOVER_FILES -> { + leftoverPath = workDir; + tempDir = new TempDirectory(workDir, true, new RetryExecutorFactory() { + @Override + public RetryExecutor retryExecutor(Class exceptionType) { + return new RetryExecutor(exceptionType).setSleepFunction(_ -> {}); + } + }); + + // Lock the parent directory of the work directory and don't create any files in the work directory. + // This should trigger the error message about the failure to delete the empty work directory. + try (var lockWorkDir = ReadOnlyDirectoryPathDeletionPreventer.INSTANCE.preventPathDeletion(workDir.getParent())) { + tempDir.close(); + } + } + default -> { + Files.createFile(workDir.resolve("b")); + + final var lockedPath = workDir.resolve("a"); + switch (PathDeletionPreventer.DEFAULT.implementation()) { + case FILE_CHANNEL_LOCK -> { + Files.createFile(lockedPath); + leftoverPath = lockedPath; + } + case READ_ONLY_NON_EMPTY_DIRECTORY -> { + Files.createDirectories(lockedPath); + leftoverPath = lockedPath.resolve("a"); + Files.createFile(leftoverPath); + } + default -> { + throw new AssertionError(); + } + } + + tempDir = new TempDirectory(workDir, true, new RetryExecutorFactory() { + @Override + public RetryExecutor retryExecutor(Class exceptionType) { + var config = new RetryExecutorMock.Config(lockedPath, closeType.isSuccess()); + return new RetryExecutorMock<>(exceptionType, config); + } + }); + + tempDir.close(); + } + } + + logPrintWriter.flush(); + var logMessages = new BufferedReader(new StringReader(logSink.toString())).lines().toList(); + + assertTrue(Files.isDirectory(root)); + + if (closeType.isSuccess()) { + assertFalse(Files.exists(tempDir.path())); + assertEquals(List.of(), logMessages); + } else { + assertTrue(Files.isDirectory(tempDir.path())); + assertTrue(Files.exists(leftoverPath)); + assertFalse(Files.exists(tempDir.path().resolve("b"))); + + String errMessage; + switch (closeType) { + case FAIL_SOME_LEFTOVER_FILES_VERBOSE, FAIL_SOME_LEFTOVER_FILES -> { + errMessage = "warning.tempdir.cleanup-file-failed"; + } + case FAIL_NO_LEFTOVER_FILES_VERBOSE, FAIL_NO_LEFTOVER_FILES -> { + errMessage = "warning.tempdir.cleanup-failed"; + } + default -> { + throw new AssertionError(); + } + } + assertEquals(List.of(I18N.format(errMessage, leftoverPath)), logMessages.subList(0, 1)); + + if (closeType.isVerbose()) { + // Check the log contains a stacktrace + assertNotEquals(1, logMessages.size()); + } + FileUtils.deleteRecursive(tempDir.path()); + } + } + + private static Collection test_DirectoryListing_listFilesAndEmptyDirectories() { + + var testCases = new ArrayList(); + + Supplier builder = ListFilesAndEmptyDirectoriesTestSpec::build; + + Stream.of( + builder.get().dirs("").complete(), + builder.get().dirs("").limit(0), + builder.get().dirs("foo").complete(), + builder.get().dirs("foo").limit(0), + builder.get().dirs("foo").limit(1).complete(), + builder.get().dirs("foo").limit(2).complete(), + builder.get().dirs("a/b/c").files("foo").files("b/b", "b/c").complete(), + builder.get().dirs("a/b/c").files("foo").files("b/b", "b/c").limit(4).complete(), + builder.get().dirs("a/b/c").files("foo").files("b/b", "b/c").limit(3) + ).map(ListFilesAndEmptyDirectoriesTestSpec.Builder::create).forEach(testCases::add); + + if (!OperatingSystem.isWindows()) { + Stream.of( + // A directory with the sibling symlink pointing to this directory + builder.get().dirs("foo").symlink("foo-symlink", "foo").complete(), + // A file with the sibling symlink pointing to this file + builder.get().symlink("foo-symlink", "foo").files("foo").complete(), + // A dangling symlink + builder.get().nonexistent("foo/bar/buz").symlink("dangling-symlink", "foo/bar/buz").complete() + ).map(ListFilesAndEmptyDirectoriesTestSpec.Builder::create).forEach(testCases::add); + } + + return testCases; + } + + enum CloseType { + SUCCEED, + FAIL_SOME_LEFTOVER_FILES, + FAIL_SOME_LEFTOVER_FILES_VERBOSE, + FAIL_NO_LEFTOVER_FILES, + FAIL_NO_LEFTOVER_FILES_VERBOSE, + ; + + boolean isSuccess() { + return this == SUCCEED; + } + + boolean isVerbose() { + return name().endsWith("_VERBOSE"); + } + } + + private static final class RetryExecutorMock extends RetryExecutor { + + RetryExecutorMock(Class exceptionType, Config config) { + super(exceptionType); + setSleepFunction(_ -> {}); + this.config = Objects.requireNonNull(config); + } + + @SuppressWarnings({ "try", "unchecked" }) + @Override + public RetryExecutor setExecutable(ThrowingFunction>, T, E> v) { + return super.setExecutable(context -> { + if (context.isLastAttempt() && config.unlockOnLastAttempt()) { + return v.apply(context); + } else { + try (var lock = PathDeletionPreventer.DEFAULT.preventPathDeletion(config.lockedPath())) { + return v.apply(context); + } catch (IOException ex) { + if (exceptionType().isInstance(ex)) { + throw (E)ex; + } else { + throw new AssertionError(); + } + } + } + }); + }; + + private final Config config; + + record Config(Path lockedPath, boolean unlockOnLastAttempt) { + Config { + Objects.requireNonNull(lockedPath); + } + } + } + + sealed interface FileSpec extends Comparable { + Path path(); + Path create(Path root) throws IOException; + public default int compareTo(FileSpec other) { + return path().compareTo(other.path()); + } + + static File file(Path path) { + return new File(path); + } + + static Directory dir(Path path) { + return new Directory(path); + } + + static Nonexistent nonexistent(Path path) { + return new Nonexistent(path); + } + + static Symlink symlink(Path path, FileSpec target) { + return new Symlink(path, target); + } + }; + + record File(Path path) implements FileSpec { + File { + path = normalizePath(path); + if (path.getNameCount() == 0) { + throw new IllegalArgumentException(); + } + } + + @Override + public Path create(Path root) throws IOException { + var resolvedPath = root.resolve(path); + if (!Files.isRegularFile(resolvedPath)) { + Files.createDirectories(resolvedPath.getParent()); + Files.createFile(resolvedPath); + } + return resolvedPath; + } + + @Override + public String toString() { + return String.format("f:%s", path); + } + } + + record Nonexistent(Path path) implements FileSpec { + Nonexistent { + path = normalizePath(path); + if (path.getNameCount() == 0) { + throw new IllegalArgumentException(); + } + } + + @Override + public Path create(Path root) throws IOException { + return root.resolve(path); + } + + @Override + public String toString() { + return String.format("x:%s", path); + } + } + + record Symlink(Path path, FileSpec target) implements FileSpec { + Symlink { + path = normalizePath(path); + if (path.getNameCount() == 0) { + throw new IllegalArgumentException(); + } + Objects.requireNonNull(target); + } + + @Override + public Path create(Path root) throws IOException { + var resolvedPath = root.resolve(path); + var targetPath = target.create(root); + Files.createDirectories(resolvedPath.getParent()); + return Files.createSymbolicLink(resolvedPath, targetPath); + } + + @Override + public String toString() { + return String.format("s:%s->%s", path, target); + } + } + + record Directory(Path path) implements FileSpec { + Directory { + path = normalizePath(path); + } + + @Override + public Path create(Path root) throws IOException { + return Files.createDirectories(root.resolve(path)); + } + + @Override + public String toString() { + return String.format("d:%s", path); + } + } + + private static Path normalizePath(Path path) { + path = path.normalize(); + if (path.isAbsolute()) { + throw new IllegalArgumentException(); + } + return path; + } + + private record ListFilesAndEmptyDirectoriesTestSpec(Set input, int limit, boolean complete) { + + ListFilesAndEmptyDirectoriesTestSpec { + Objects.requireNonNull(input); + + if (!(input instanceof SortedSet)) { + input = new TreeSet<>(input); + } + } + + static Builder build() { + return new Builder(); + } + + static final class Builder { + + ListFilesAndEmptyDirectoriesTestSpec create() { + return new ListFilesAndEmptyDirectoriesTestSpec(Set.copyOf(input), limit, complete); + } + + Builder files(String... paths) { + Stream.of(paths).map(Path::of).map(FileSpec::file).forEach(input::add); + return this; + } + + Builder dirs(String... paths) { + Stream.of(paths).map(Path::of).map(FileSpec::dir).forEach(input::add); + return this; + } + + Builder nonexistent(String... paths) { + Stream.of(paths).map(Path::of).map(FileSpec::nonexistent).forEach(input::add); + return this; + } + + Builder symlink(String path, String target) { + Objects.requireNonNull(target); + + var targetSpec = input.stream().filter(v -> { + return v.path().equals(Path.of(target)); + }).findFirst(); + + if (targetSpec.isEmpty()) { + var v = FileSpec.file(Path.of(target)); + input.add(v); + targetSpec = Optional.ofNullable(v); + } + + input.add(FileSpec.symlink(Path.of(path), targetSpec.get())); + + return this; + } + + Builder limit(int v) { + limit = v; + return this; + } + + Builder complete(boolean v) { + complete = v; + return this; + } + + Builder complete() { + return complete(true); + } + + private final Set input = new HashSet<>(); + private int limit = Integer.MAX_VALUE; + private boolean complete; + } + + void run(Path root) throws IOException { + for (var v : input) { + v.create(root); + } + + for (var v : input) { + Predicate validator; + switch (v) { + case File _ -> { + validator = Files::isRegularFile; + } + case Directory _ -> { + validator = Files::isDirectory; + } + case Symlink _ -> { + validator = Files::isSymbolicLink; + } + case Nonexistent _ -> { + validator = Predicate.not(Files::exists); + } + } + assertTrue(validator.test(root.resolve(v.path()))); + } + + var listing = TempDirectory.DirectoryListing.listFilesAndEmptyDirectories(root, limit); + assertEquals(complete, listing.complete()); + + if (complete) { + var actual = listing.paths().stream().peek(p -> { + assertTrue(p.startsWith(root)); + }).map(root::relativize).sorted().toList(); + var expected = input.stream() + .filter(Predicate.not(Nonexistent.class::isInstance)) + .map(FileSpec::path) + .sorted() + .toList(); + assertEquals(expected, actual); + } else { + assertEquals(limit, listing.paths().size()); + } + } + + @Override + public String toString() { + return String.format("%s; limit=%d; complete=%s", input, limit, complete); + } + } +} diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/MainTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/MainTest.java index 46de970a829..1c06d592006 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/MainTest.java +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/MainTest.java @@ -38,24 +38,26 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.function.BiFunction; +import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.Supplier; import java.util.function.UnaryOperator; import java.util.spi.ToolProvider; import java.util.stream.Collectors; import java.util.stream.Stream; import jdk.internal.util.OperatingSystem; import jdk.jpackage.internal.Globals; -import jdk.jpackage.internal.MockUtils; import jdk.jpackage.internal.model.ConfigException; import jdk.jpackage.internal.model.ExecutableAttributesWithCapturedOutput; import jdk.jpackage.internal.model.JPackageException; +import jdk.jpackage.internal.model.SelfContainedException; import jdk.jpackage.internal.util.CommandOutputControl; import jdk.jpackage.internal.util.CommandOutputControl.UnexpectedExitCodeException; import jdk.jpackage.internal.util.CommandOutputControl.UnexpectedResultException; +import jdk.jpackage.internal.util.IdentityWrapper; import jdk.jpackage.internal.util.function.ExceptionBox; import jdk.jpackage.test.Annotations; import jdk.jpackage.test.JPackageCommand; @@ -64,6 +66,7 @@ import jdk.jpackage.test.TKit; import jdk.jpackage.test.mock.CommandActionSpecs; import jdk.jpackage.test.mock.Script; import jdk.jpackage.test.mock.VerbatimCommandMock; +import jdk.jpackage.test.stdmock.JPackageMockUtils; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; @@ -121,9 +124,8 @@ public class MainTest extends JUnitAdapter { var jpackageToolProviderMock = new ToolProvider() { @Override public int run(PrintWriter out, PrintWriter err, String... args) { - var globalsMutator = MockUtils.buildJPackage().script(script).createGlobalsMutator(); - return Globals.main(() -> { - globalsMutator.accept(Globals.instance()); + return Globals.main(() -> { + JPackageMockUtils.buildJPackage().script(script).applyToGlobals(); var result = ExecutionResult.create(args); @@ -181,112 +183,157 @@ public class MainTest extends JUnitAdapter { ).map(TestSpec.Builder::create).toList(); } - private static List test_ErrorReporter() { - var data = new ArrayList(); - + var testCases = new ArrayList(); for (var verbose : List.of(true, false)) { - for (var makeCause : List.>of( - ex -> ex, - // UncheckedIOException - ex -> { - if (ex instanceof IOException ioex) { - return new UncheckedIOException(ioex); - } else { - return null; - } - }, - // ExceptionBox - ex -> { - var rex = ExceptionBox.toUnchecked(ex); - if (rex != ex) { - return rex; - } else { - return null; - } - } - )) { - for (var expect : List.of( - Map.entry(new IOException("I/O error"), true), - Map.entry(new NullPointerException(), true), - Map.entry(new JPackageException("Kaput!"), false), - Map.entry(new ConfigException("It is broken", "Fix it!"), false), - Map.entry(new ConfigException("It is broken. No advice how to fix it", (String)null), false), - Map.entry(new Utils.ParseException("Malformed command line"), false), - Map.entry(new StandardOption.AddLauncherIllegalArgumentException("Malformed value of --add-launcher option"), false) - )) { - var cause = makeCause.apply(expect.getKey()); - if (cause == null) { - continue; - } - - var expectedOutput = new ArrayList(); - if (expect.getValue()) { - // An alien exception. - expectedOutput.add(ExceptionFormatter.STACK_TRACE); - expectedOutput.add(ExceptionFormatter.TO_STRING); - } else { - if (verbose) { - expectedOutput.add(ExceptionFormatter.STACK_TRACE); - } - if (expect.getKey() instanceof ConfigException cex) { - if (cex.getAdvice() != null) { - expectedOutput.add(ExceptionFormatter.MESSAGE_WITH_ADVICE); - } else { - expectedOutput.add(ExceptionFormatter.GET_MESSAGE); - } - } else { - expectedOutput.add(ExceptionFormatter.GET_MESSAGE); - } - } - - data.add(new ErrorReporterTestSpec(cause, expect.getKey(), verbose, expectedOutput)); - } - } - - var execAttrs = new CommandOutputControl.ProcessAttributes(Optional.of(12345L), List.of("foo", "--bar")); - for (var makeCause : List.>of( - ex -> ex, - ExceptionBox::toUnchecked - )) { - - for (var expect : List.of( - Map.entry( - augmentResultWithOutput( - CommandOutputControl.Result.build().exitCode(135).execAttrs(execAttrs).create(), - "The quick brown fox\njumps over the lazy dog" - ).unexpected("Kaput!"), - ExceptionFormatter.FAILED_COMMAND_UNEXPECTED_OUTPUT_MESSAGE - ), - Map.entry( - new UnexpectedExitCodeException(augmentResultWithOutput( - CommandOutputControl.Result.build().exitCode(135).create(), - "The quick brown fox\njumps" - )), - ExceptionFormatter.FAILED_COMMAND_UNEXPECTED_EXIT_CODE_MESSAGE - ), - Map.entry( - augmentResultWithOutput( - CommandOutputControl.Result.build().create(), - "The quick brown fox\njumps" - ).unexpected("Timed out!"), - ExceptionFormatter.FAILED_COMMAND_TIMEDOUT_MESSAGE - ) - )) { - var cause = makeCause.apply(expect.getKey()); - var expectedOutput = new ArrayList(); - if (verbose) { - expectedOutput.add(ExceptionFormatter.STACK_TRACE); - } - expectedOutput.add(expect.getValue()); - expectedOutput.add(ExceptionFormatter.FAILED_COMMAND_OUTPUT); - data.add(new ErrorReporterTestSpec(cause, expect.getKey(), verbose, expectedOutput)); - } - } - + test_ErrorReporter_Exception(verbose, testCases::add); + test_ErrorReporter_UnexpectedResultException(verbose, testCases::add); + test_ErrorReporter_suppressedExceptions(verbose, testCases::add); } - return data; + return testCases; + } + + private static void test_ErrorReporter_Exception(boolean verbose, Consumer sink) { + + for (var makeCause : List.>of( + ex -> ex, + // UncheckedIOException + ex -> { + if (ex instanceof IOException ioex) { + return new UncheckedIOException(ioex); + } else { + return null; + } + }, + // ExceptionBox + ex -> { + var rex = ExceptionBox.toUnchecked(ex); + if (rex != ex) { + return rex; + } else { + return null; + } + } + )) { + for (var expect : List.of( + new IOException("I/O error"), + new NullPointerException(), + new JPackageException("Kaput!"), + new ConfigException("It is broken", "Fix it!"), + new ConfigException("It is broken. No advice how to fix it", (String)null), + new Utils.ParseException("Malformed command line"), + new StandardOption.AddLauncherIllegalArgumentException("Malformed value of --add-launcher option") + )) { + var cause = makeCause.apply(expect); + if (cause == null) { + continue; + } + + var expectedOutput = new ArrayList(); + ErrorReporterTestSpec.expectExceptionFormatters(expect, verbose, expectedOutput::add); + sink.accept(ErrorReporterTestSpec.create(cause, expect, verbose, expectedOutput)); + } + } + } + + private static void test_ErrorReporter_UnexpectedResultException(boolean verbose, Consumer sink) { + + var execAttrs = new CommandOutputControl.ProcessAttributes(Optional.of(12345L), List.of("foo", "--bar")); + + for (var makeCause : List.>of( + ex -> ex, + ExceptionBox::toUnchecked + )) { + + for (var expect : List.of( + augmentResultWithOutput( + CommandOutputControl.Result.build().exitCode(135).execAttrs(execAttrs).create(), + "The quick brown fox\njumps over the lazy dog" + ).unexpected("Kaput!"), + new UnexpectedExitCodeException(augmentResultWithOutput( + CommandOutputControl.Result.build().exitCode(135).create(), + "The quick brown fox\njumps" + )), + augmentResultWithOutput( + CommandOutputControl.Result.build().create(), + "The quick brown fox\njumps" + ).unexpected("Timed out!") + )) { + var cause = makeCause.apply(expect); + var expectedOutput = new ArrayList(); + ErrorReporterTestSpec.expectExceptionFormatters(expect, verbose, expectedOutput::add); + sink.accept(ErrorReporterTestSpec.create(cause, expect, verbose, expectedOutput)); + } + } + } + + private static Exception suppressException(Exception main, Exception suppressed) { + Objects.requireNonNull(main); + Objects.requireNonNull(suppressed); + + try (var autoCloseable = new AutoCloseable() { + + @Override + public void close() throws Exception { + throw suppressed; + }}) { + + throw main; + } catch (Exception ex) { + return ex; + } + } + + private static void test_ErrorReporter_suppressedExceptions(boolean verbose, Consumer sink) { + + var execAttrs = new CommandOutputControl.ProcessAttributes(Optional.of(567L), List.of("foo", "--bar")); + + Supplier createUnexpectedResultException = () -> { + return augmentResultWithOutput( + CommandOutputControl.Result.build().exitCode(7).execAttrs(execAttrs).create(), + "The quick brown fox\njumps over the lazy dog" + ).unexpected("Alas"); + }; + + for (var makeCause : List.>of( + ex -> ex, + ex -> { + var rex = ExceptionBox.toUnchecked(ex); + if (rex != ex) { + return rex; + } else { + return null; + } + } + )) { + + for (var exceptions : List.of( + List.of(new JPackageException("Kaput!"), new JPackageException("Suppressed kaput")), + List.of(new Exception("Kaput!"), new JPackageException("Suppressed kaput")), + List.of(new Exception("Kaput!"), new Exception("Suppressed kaput")), + List.of(new Exception("Kaput!"), ExceptionBox.toUnchecked(new Exception("Suppressed kaput"))), + List.of(createUnexpectedResultException.get(), new Exception("Suppressed kaput")), + List.of(new Exception("Alas!"), createUnexpectedResultException.get()), + List.of(new JPackageException("Alas!"), createUnexpectedResultException.get()) + )) { + var main = exceptions.getFirst(); + var suppressed = exceptions.getLast(); + + var cause = makeCause.apply(suppressException(main, suppressed)); + + if (cause == null) { + continue; + } + + var expectedOutput = new ArrayList(); + + ErrorReporterTestSpec.expectOutputFragments(ExceptionBox.unbox(suppressed), verbose, expectedOutput::add); + ErrorReporterTestSpec.expectOutputFragments(main, verbose, expectedOutput::add); + + sink.accept(new ErrorReporterTestSpec(cause, verbose, expectedOutput)); + } + } } @@ -452,6 +499,19 @@ public class MainTest extends JUnitAdapter { } + private record FormattedException(ExceptionFormatter formatter, Exception exception) { + + FormattedException { + Objects.requireNonNull(formatter); + Objects.requireNonNull(exception); + } + + String format() { + return formatter.format(exception); + } + } + + private enum ExceptionFormatter { GET_MESSAGE(errorMessage(Exception::getMessage)), MESSAGE_WITH_ADVICE(ex -> { @@ -497,6 +557,10 @@ public class MainTest extends JUnitAdapter { return formatter.apply(v); } + FormattedException bind(Exception v) { + return new FormattedException(this, v); + } + private static Function errorMessage(Function formatter) { Objects.requireNonNull(formatter); return ex -> { @@ -545,29 +609,99 @@ public class MainTest extends JUnitAdapter { } - record ErrorReporterTestSpec(Exception cause, Exception expect, boolean verbose, List expectOutput) { + record ErrorReporterTestSpec(Exception cause, boolean verbose, List expectOutput) { ErrorReporterTestSpec { Objects.requireNonNull(cause); - Objects.requireNonNull(expect); Objects.requireNonNull(expectOutput); + if (expectOutput.isEmpty()) { + throw new IllegalArgumentException(); + } } - ErrorReporterTestSpec(Exception cause, boolean verbose, List expectOutput) { - this(cause, cause, verbose, expectOutput); + static ErrorReporterTestSpec create( + Exception cause, boolean verbose, List expectOutput) { + return create(cause, cause, verbose, expectOutput); + } + + static ErrorReporterTestSpec create( + Exception cause, Exception expect, boolean verbose, List expectOutput) { + Objects.requireNonNull(cause); + Objects.requireNonNull(expect); + return new ErrorReporterTestSpec(cause, verbose, expectOutput.stream().map(formatter -> { + return new FormattedException(formatter, expect); + }).toList()); + } + + static void expectExceptionFormatters(Exception ex, boolean verbose, Consumer sink) { + Objects.requireNonNull(ex); + Objects.requireNonNull(sink); + + final var isSelfContained = (ex.getClass().getAnnotation(SelfContainedException.class) != null); + + if (verbose || !(isSelfContained || ex instanceof UnexpectedResultException)) { + sink.accept(ExceptionFormatter.STACK_TRACE); + } + + switch (ex) { + case ConfigException cex -> { + if (cex.getAdvice() != null) { + sink.accept(ExceptionFormatter.MESSAGE_WITH_ADVICE); + } else { + sink.accept(ExceptionFormatter.GET_MESSAGE); + } + } + case UnexpectedResultException urex -> { + if (urex instanceof UnexpectedExitCodeException) { + sink.accept(ExceptionFormatter.FAILED_COMMAND_UNEXPECTED_EXIT_CODE_MESSAGE); + } else if (urex.getResult().exitCode().isPresent()) { + sink.accept(ExceptionFormatter.FAILED_COMMAND_UNEXPECTED_OUTPUT_MESSAGE); + } else { + sink.accept(ExceptionFormatter.FAILED_COMMAND_TIMEDOUT_MESSAGE); + } + sink.accept(ExceptionFormatter.FAILED_COMMAND_OUTPUT); + } + default -> { + if (isSelfContained) { + sink.accept(ExceptionFormatter.GET_MESSAGE); + } else { + sink.accept(ExceptionFormatter.TO_STRING); + } + } + } + } + + static void expectOutputFragments(Exception ex, boolean verbose, Consumer sink) { + Objects.requireNonNull(sink); + expectExceptionFormatters(ex, verbose, formatter -> { + sink.accept(formatter.bind(ex)); + }); } @Override public String toString() { var tokens = new ArrayList(); - if (cause == expect) { + var expect = expectOutput.stream() + .map(FormattedException::exception) + .map(IdentityWrapper::new) + .distinct() + .toList(); + + if (expect.size() == 1 && expect.getFirst().value() == cause) { tokens.add(cause.toString()); } else { - tokens.add(String.format("[%s] => [%s]", cause, expect)); + tokens.add(String.format("[%s] => %s", cause, expect.stream().map(IdentityWrapper::value).toList())); } - tokens.add(expectOutput.stream().map(Enum::name).collect(Collectors.joining("+"))); + if (expect.size() == 1) { + tokens.add(expectOutput.stream().map(FormattedException::formatter).map(Enum::name).collect(Collectors.joining("+"))); + } else { + tokens.add(expectOutput.stream().map(fragment -> { + var idx = expect.indexOf(IdentityWrapper.wrapIdentity(fragment.exception())); + return String.format("%s@%d", fragment.formatter(), idx); + }).collect(Collectors.joining("+"))); + } if (verbose) { tokens.add("verbose"); @@ -587,9 +721,7 @@ public class MainTest extends JUnitAdapter { }, verbose).reportError(cause); } - var expected = expectOutput.stream().map(formatter -> { - return formatter.format(expect); - }).collect(Collectors.joining("")); + var expected = expectOutput.stream().map(FormattedException::format).collect(Collectors.joining("")); assertEquals(expected, sink.toString()); } diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.excludes b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.excludes index 07757211927..0b98c051238 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.excludes +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.excludes @@ -1,12 +1,15 @@ ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, 0.2]; errors=[message.error-header+[message.version-string-first-number-not-zero], message.advice-header+[error.invalid-cfbundle-version.advice]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, 1.2.3.4]; errors=[message.error-header+[message.version-string-too-many-components], message.advice-header+[error.invalid-cfbundle-version.advice]]) +ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, 1.]; errors=[message.error-header+[error.version-string-zero-length-component, 1.], message.advice-header+[error.invalid-cfbundle-version.advice]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, 1.]; errors=[message.error-header+[error.version-string-zero-length-component, 1.]]) +ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, 1.b.3]; errors=[message.error-header+[error.version-string-invalid-component, 1.b.3, b.3], message.advice-header+[error.invalid-cfbundle-version.advice]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, 1.b.3]; errors=[message.error-header+[error.version-string-invalid-component, 1.b.3, b.3]]) +ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, ]; errors=[message.error-header+[error.version-string-empty], message.advice-header+[error.invalid-cfbundle-version.advice]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--app-version, ]; errors=[message.error-header+[error.version-string-empty]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--jlink-options, --add-modules]; errors=[message.error-header+[error.blocked.option, --add-modules]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--jlink-options, --module-path]; errors=[message.error-header+[error.blocked.option, --module-path]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--jlink-options, --output]; errors=[message.error-header+[error.blocked.option, --output]]) -ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--main-jar, non-existent.jar]; errors=[message.error-header+[error.main-jar-does-not-exist, non-existent.jar]]) +ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--main-jar, non-existent.jar]; find; errors=[message.error-header+[error.main-jar-does-not-exist, non-existent.jar]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--runtime-image, @@EMPTY_DIR@@]; errors=[message.error-header+[error.invalid-runtime-image-missing-file, @@EMPTY_DIR@@, lib/**/libjli.dylib]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--runtime-image, @@INVALID_MAC_RUNTIME_BUNDLE@@]; errors=[message.error-header+[error.invalid-runtime-image-missing-file, @@INVALID_MAC_RUNTIME_BUNDLE@@, Contents/Home/lib/**/libjli.dylib]]) ErrorTest.test(IMAGE; app-desc=Hello; args-add=[--runtime-image, @@INVALID_MAC_RUNTIME_IMAGE@@]; errors=[message.error-header+[error.invalid-runtime-image-missing-file, @@INVALID_MAC_RUNTIME_IMAGE@@, lib/**/libjli.dylib]]) @@ -15,7 +18,7 @@ ErrorTest.test(IMAGE; args-add=[--module, com.foo.bar, --runtime-image, @@JAVA_H ErrorTest.test(IMAGE; args-add=[--module, java.base, --runtime-image, @@JAVA_HOME@@]; errors=[message.error-header+[ERR_NoMainClass]]) ErrorTest.test(LINUX_DEB; app-desc=Hello; args-add=[--linux-package-name, #]; errors=[message.error-header+[error.deb-invalid-value-for-package-name, #], message.advice-header+[error.deb-invalid-value-for-package-name.advice]]) ErrorTest.test(LINUX_RPM; app-desc=Hello; args-add=[--linux-package-name, #]; errors=[message.error-header+[error.rpm-invalid-value-for-package-name, #], message.advice-header+[error.rpm-invalid-value-for-package-name.advice]]) -ErrorTest.test(MAC_PKG; app-desc=Hello; args-add=[--mac-package-identifier, #1]; errors=[message.error-header+[message.invalid-identifier, #1]]) +ErrorTest.test(MAC_PKG; app-desc=Hello; args-add=[--mac-package-identifier, #1]; errors=[message.error-header+[message.invalid-identifier, #1], message.advice-header+[message.invalid-identifier.advice]]) ErrorTest.test(NATIVE; app-desc=Hello; args-add=[--mac-app-store, --runtime-image, @@JAVA_HOME@@]; errors=[message.error-header+[error.invalid-runtime-image-bin-dir, @@JAVA_HOME@@], message.advice-header+[error.invalid-runtime-image-bin-dir.advice, --mac-app-store]]) ErrorTest.test(NATIVE; app-desc=Hello; args-add=[--runtime-image, @@EMPTY_DIR@@]; errors=[message.error-header+[error.invalid-runtime-image-missing-file, @@EMPTY_DIR@@, lib/**/libjli.dylib]]) ErrorTest.test(NATIVE; app-desc=Hello; args-add=[--runtime-image, @@INVALID_MAC_RUNTIME_BUNDLE@@]; errors=[message.error-header+[error.invalid-runtime-image-missing-file, @@INVALID_MAC_RUNTIME_BUNDLE@@, Contents/Home/lib/**/libjli.dylib]]) @@ -36,6 +39,16 @@ ErrorTest.test(WIN_MSI; app-desc=Hello; args-add=[--app-version, 1234]; errors=[ ErrorTest.test(WIN_MSI; app-desc=Hello; args-add=[--app-version, 256.1]; errors=[message.error-header+[error.msi-product-version-major-out-of-range, 256.1], message.advice-header+[error.version-string-wrong-format.advice]]) ErrorTest.test(WIN_MSI; app-desc=Hello; args-add=[--launcher-as-service]; errors=[message.error-header+[error.missing-service-installer], message.advice-header+[error.missing-service-installer.advice]]) ErrorTest.test(args-add=[@foo]; errors=[message.error-header+[ERR_CannotParseOptions, foo]]) +ErrorTest.testMacSignWithoutIdentity(IMAGE; app-desc=Hello; args-add=[--mac-sign, --mac-signing-keychain, @@EMPTY_KEYCHAIN@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, EMPTY_KEYCHAIN]]) +ErrorTest.testMacSignWithoutIdentity(IMAGE; args-add=[--app-image, @@APP_IMAGE_WITH_SHORT_NAME@@, --mac-sign, --mac-signing-keychain, @@EMPTY_KEYCHAIN@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, EMPTY_KEYCHAIN]]) +ErrorTest.testMacSignWithoutIdentity(MAC_DMG; app-desc=Hello; args-add=[--mac-sign, --mac-signing-keychain, @@EMPTY_KEYCHAIN@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, EMPTY_KEYCHAIN]]) +ErrorTest.testMacSignWithoutIdentity(MAC_DMG; args-add=[--app-image, @@APP_IMAGE_WITH_SHORT_NAME@@, --mac-sign, --mac-signing-keychain, @@EMPTY_KEYCHAIN@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, EMPTY_KEYCHAIN]]) +ErrorTest.testMacSignWithoutIdentity(MAC_PKG; app-desc=Hello; args-add=[--mac-sign, --mac-signing-keychain, @@EMPTY_KEYCHAIN@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, EMPTY_KEYCHAIN], message.error-header+[error.cert.not.found, INSTALLER, EMPTY_KEYCHAIN]]) +ErrorTest.testMacSignWithoutIdentity(MAC_PKG; app-desc=Hello; args-add=[--mac-sign, --mac-signing-keychain, @@KEYCHAIN_WITH_APP_IMAGE_CERT@@]; args-del=[--name]; errors=[message.error-header+[error.cert.not.found, INSTALLER, KEYCHAIN_WITH_APP_IMAGE_CERT]]) +ErrorTest.testMacSignWithoutIdentity(MAC_PKG; app-desc=Hello; args-add=[--mac-sign, --mac-signing-keychain, @@KEYCHAIN_WITH_PKG_CERT@@]; args-del=[--name]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, KEYCHAIN_WITH_PKG_CERT]]) +ErrorTest.testMacSignWithoutIdentity(MAC_PKG; args-add=[--app-image, @@APP_IMAGE_WITH_SHORT_NAME@@, --mac-sign, --mac-signing-keychain, @@EMPTY_KEYCHAIN@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, EMPTY_KEYCHAIN], message.error-header+[error.cert.not.found, INSTALLER, EMPTY_KEYCHAIN]]) +ErrorTest.testMacSignWithoutIdentity(MAC_PKG; args-add=[--mac-sign, --mac-signing-keychain, @@KEYCHAIN_WITH_APP_IMAGE_CERT@@, --app-image, @@APP_IMAGE_WITH_SHORT_NAME@@]; errors=[message.error-header+[error.cert.not.found, INSTALLER, KEYCHAIN_WITH_APP_IMAGE_CERT]]) +ErrorTest.testMacSignWithoutIdentity(MAC_PKG; args-add=[--mac-sign, --mac-signing-keychain, @@KEYCHAIN_WITH_PKG_CERT@@, --app-image, @@APP_IMAGE_WITH_SHORT_NAME@@]; errors=[message.error-header+[error.cert.not.found, CODE_SIGN, KEYCHAIN_WITH_PKG_CERT]]) ErrorTest.testMacSigningIdentityValidation(IMAGE, --mac-app-image-sign-identity, true) ErrorTest.testMacSigningIdentityValidation(IMAGE, --mac-signing-key-user-name, false) ErrorTest.testMacSigningIdentityValidation(MAC_DMG, --mac-app-image-sign-identity, true) diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.java index 9826f0e9069..9976a71ef3f 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.java +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/OptionsValidationFailTest.java @@ -99,7 +99,7 @@ public class OptionsValidationFailTest { var errorReporter = new Main.ErrorReporter(ex -> { ex.printStackTrace(err); - }, out::append); + }, err::println, false); return parse(args).peekErrors(errors -> { final var firstErr = errors.stream().findFirst().orElseThrow(); diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/ValidatorTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/ValidatorTest.java index d8d69027f77..9b8babbfdda 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/ValidatorTest.java +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/cli/ValidatorTest.java @@ -32,11 +32,13 @@ import static org.junit.jupiter.api.Assertions.assertThrowsExactly; import java.util.ArrayList; import java.util.List; +import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Supplier; +import java.util.function.UnaryOperator; import java.util.stream.Stream; -import jdk.jpackage.internal.cli.TestUtils.TestException; import jdk.jpackage.internal.cli.TestUtils.RecordingValidator; +import jdk.jpackage.internal.cli.TestUtils.TestException; import jdk.jpackage.internal.cli.Validator.ParsedValue; import jdk.jpackage.internal.cli.Validator.ValidatingConsumerException; import jdk.jpackage.internal.cli.Validator.ValidatorException; @@ -44,6 +46,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; public class ValidatorTest { @@ -187,42 +190,60 @@ public class ValidatorTest { assertNotSame(builder.predicate(), copy.predicate()); } - @Test - public void test_and() { + @ParameterizedTest + @ValueSource(booleans = {true, false}) + public void test_and(boolean greedy) { Function, List> validate = validator -> { return validator.validate(OptionName.of("a"), ParsedValue.create("str", StringToken.of("str"))); }; + BinaryOperator> composer = (a, b) -> { + if (greedy) { + return a.andGreedy(b); + } else { + return a.andLazy(b); + } + }; + + UnaryOperator> exceptionFilter; + if (greedy) { + exceptionFilter = v -> v; + } else { + exceptionFilter = v -> { + return List.of(v.getFirst()); + }; + } + var pass = new RecordingValidator<>(Validator.build().predicate(_ -> true).create()); var foo = failingValidator("foo"); var bar = failingValidator("bar"); var buz = failingValidator("buz"); - assertExceptionListEquals(List.of( + assertExceptionListEquals(exceptionFilter.apply(List.of( new TestException("foo"), new TestException("bar"), new TestException("buz") - ), validate.apply(foo.and(bar).and(pass).and(buz))); - assertEquals(1, pass.counter()); + )), validate.apply(Stream.of(foo, bar, pass, buz).reduce(composer).orElseThrow())); + assertEquals(greedy ? 1 : 0, pass.counter()); pass.resetCounter(); - assertExceptionListEquals(List.of( + assertExceptionListEquals(exceptionFilter.apply(List.of( new TestException("bar"), new TestException("buz"), new TestException("foo") - ), validate.apply(pass.and(bar).and(buz).and(foo))); + )), validate.apply(Stream.of(pass, bar, buz, foo).reduce(composer).orElseThrow())); assertEquals(1, pass.counter()); - assertExceptionListEquals(List.of( + assertExceptionListEquals(exceptionFilter.apply(List.of( new TestException("foo"), new TestException("foo") - ), validate.apply(foo.and(foo))); + )), validate.apply(composer.apply(foo, foo))); pass.resetCounter(); assertExceptionListEquals(List.of( - ), validate.apply(pass.and(pass))); + ), validate.apply(composer.apply(pass, pass))); assertEquals(2, pass.counter()); } diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/CommandOutputControlTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/CommandOutputControlTest.java index d71cf7c4d41..b179f32447f 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/CommandOutputControlTest.java +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/CommandOutputControlTest.java @@ -458,7 +458,7 @@ public class CommandOutputControlTest { processDestroyer.get().join(); } - @DisabledOnOs(value = OS.MAC, disabledReason = "Closing a stream doesn't consistently cause a trouble as it should") + @DisabledOnOs(value = {OS.MAC, OS.LINUX}, disabledReason = "Closing a stream doesn't consistently cause a trouble as expected") @ParameterizedTest @EnumSource(OutputStreams.class) public void test_close_streams(OutputStreams action) throws InterruptedException, IOException { diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/MemoizingSupplierTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/MemoizingSupplierTest.java new file mode 100644 index 00000000000..654071359cb --- /dev/null +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/MemoizingSupplierTest.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2026, 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 jdk.jpackage.internal.util; + +import static jdk.jpackage.internal.util.function.ThrowingRunnable.toRunnable; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrowsExactly; + +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executors; +import java.util.function.Supplier; +import java.util.stream.IntStream; +import org.junit.jupiter.api.Test; + + +class MemoizingSupplierTest { + + @Test + void test() { + var supplier = count(() -> "foo"); + var runOnceSupplier = MemoizingSupplier.runOnce(supplier); + + assertEquals(0, supplier.counter()); + + assertEquals("foo", runOnceSupplier.get()); + assertEquals("foo", runOnceSupplier.get()); + + assertEquals(1, supplier.counter()); + } + + @Test + void test_null() { + CountingSupplier supplier = count(() -> null); + var runOnceSupplier = MemoizingSupplier.runOnce(supplier); + + assertEquals(0, supplier.counter()); + + assertEquals(null, runOnceSupplier.get()); + assertEquals(null, runOnceSupplier.get()); + + assertEquals(1, supplier.counter()); + } + + @Test + void test_throws_Exception() { + CountingSupplier supplier = count(() -> { + throw new IllegalStateException("Kaput!"); + }); + var runOnceSupplier = MemoizingSupplier.runOnce(supplier); + + assertEquals(0, supplier.counter()); + + assertThrowsExactly(IllegalStateException.class, () -> { + runOnceSupplier.get(); + }); + + assertThrowsExactly(IllegalStateException.class, () -> { + runOnceSupplier.get(); + }); + + assertEquals(1, supplier.counter()); + } + + @Test + void test_throws_Error() { + CountingSupplier supplier = count(() -> { + throw new Error("Grand kaput!"); + }); + var runOnceSupplier = MemoizingSupplier.runOnce(supplier); + + assertEquals(0, supplier.counter()); + + assertThrowsExactly(Error.class, () -> { + runOnceSupplier.get(); + }); + + assertThrowsExactly(Error.class, () -> { + runOnceSupplier.get(); + }); + + assertEquals(1, supplier.counter()); + } + + @Test + void testAsync() throws InterruptedException { + var supplier = count(() -> "foo"); + var runOnceSupplier = MemoizingSupplier.runOnce(supplier); + + final var supplierCount = 100; + final var supplierExecutor = Executors.newVirtualThreadPerTaskExecutor(); + + // Schedule invoking "runOnceSupplier.get()" in a separate virtual threads. + // Start and suspend threads, waiting until all scheduled threads have started. + // After all scheduled threads start, resume them. + // This should result in multiple simultaneous "runOnceSupplier.get()" calls. + + var readyLatch = new CountDownLatch(supplierCount); + var startLatch = new CountDownLatch(1); + + var futures = IntStream.range(0, supplierCount).mapToObj(_ -> { + return CompletableFuture.runAsync(toRunnable(() -> { + readyLatch.countDown(); + startLatch.await(); + runOnceSupplier.get(); + + }), supplierExecutor); + }).toList(); + + readyLatch.await(); + startLatch.countDown(); + + CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new)).join(); + + assertEquals(1, supplier.counter()); + } + + private static CountingSupplier count(Supplier supplier) { + return new CountingSupplier<>(supplier); + } + + private static final class CountingSupplier implements Supplier { + + CountingSupplier(Supplier impl) { + this.impl = Objects.requireNonNull(impl); + } + + @Override + public T get() { + counter++; + return impl.get(); + } + + int counter() { + return counter; + } + + private int counter; + private final Supplier impl; + } +} diff --git a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/function/ExceptionBoxTest.java b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/function/ExceptionBoxTest.java index c3ef239b02d..d7a6f0e714d 100644 --- a/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/function/ExceptionBoxTest.java +++ b/test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/internal/util/function/ExceptionBoxTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,13 +31,19 @@ import static org.junit.jupiter.api.Assertions.assertThrowsExactly; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; import java.util.function.UnaryOperator; +import jdk.jpackage.internal.util.IdentityWrapper; import jdk.jpackage.internal.util.Slot; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.MethodSource; public class ExceptionBoxTest { @@ -190,6 +196,16 @@ public class ExceptionBoxTest { } } + @ParameterizedTest + @MethodSource + void test_visitUnboxedExceptionsRecursively(Throwable t, List expect) { + var actual = new ArrayList(); + ExceptionBox.visitUnboxedExceptionsRecursively(t, actual::add); + assertEquals( + expect.stream().map(IdentityWrapper::new).toList(), + actual.stream().map(IdentityWrapper::new).toList()); + } + public enum InvocationTargetExceptionType { CHECKED("throwIOException", t -> { return t.getCause(); @@ -224,13 +240,74 @@ public class ExceptionBoxTest { throw new Error("Kaput!"); } - private static void assertToUnchecked(Exception cause, boolean asis) { - Class expectedType; - if (asis) { - expectedType = cause.getClass(); - } else { - expectedType = ExceptionBox.class; + private static Collection test_visitUnboxedExceptionsRecursively() { + + var testCases = new ArrayList(); + + testCases.addAll(test_visitUnboxedExceptionsRecursively_example()); + + var t = new Exception("A"); + for (var box : List.>of( + ex -> ex, + ExceptionBox::toUnchecked, + InvocationTargetException::new + )) { + testCases.add(Arguments.of(box.apply(t), List.of(t))); } + + // The cause is not traversed. + var exWithCause = new Exception("B", t); + testCases.add(Arguments.of(exWithCause, List.of(exWithCause))); + + var exWithSuppressed = new Exception("C"); + exWithSuppressed.addSuppressed(t); + exWithSuppressed.addSuppressed(ExceptionBox.toUnchecked(t)); + exWithSuppressed.addSuppressed(exWithCause); + exWithSuppressed.addSuppressed(new InvocationTargetException(exWithCause)); + var exWithSuppressedExpect = List.of(t, t, exWithCause, exWithCause, exWithSuppressed); + testCases.add(Arguments.of(exWithSuppressed, exWithSuppressedExpect)); + + for (var box : List.>of( + ExceptionBox::toUnchecked, + InvocationTargetException::new + )) { + // Suppressed exceptions added to ExceptionBox and InvocationTargetException are omitted. + var exWithSuppressedBoxed = box.apply(exWithSuppressed); + exWithSuppressedBoxed.addSuppressed(exWithSuppressed); + testCases.add(Arguments.of(exWithSuppressedBoxed, exWithSuppressedExpect)); + } + + var exWithSuppressed2 = new Exception("D"); + exWithSuppressed2.addSuppressed(t); + exWithSuppressed2.addSuppressed(exWithSuppressed); + exWithSuppressed2.addSuppressed(ExceptionBox.toUnchecked(exWithSuppressed)); + + var exWithSuppressed2Expect = new ArrayList(); + exWithSuppressed2Expect.add(t); + exWithSuppressed2Expect.addAll(exWithSuppressedExpect); + exWithSuppressed2Expect.addAll(exWithSuppressedExpect); + exWithSuppressed2Expect.add(exWithSuppressed2); + testCases.add(Arguments.of(exWithSuppressed2, exWithSuppressed2Expect)); + + return testCases; + } + + private static Collection test_visitUnboxedExceptionsRecursively_example() { + + var a = new Exception("A"); + var b = new Exception("B"); + var c = new Exception("C"); + var d = new Exception("D"); + + a.addSuppressed(b); + a.addSuppressed(c); + + b.addSuppressed(d); + + return List.of(Arguments.of(a, List.of(d, b, c, a))); + } + + private static void assertToUnchecked(Exception cause, boolean asis) { var unchecked = ExceptionBox.toUnchecked(cause); if (asis) { assertSame(cause, unchecked); diff --git a/test/jdk/tools/jpackage/linux/LinuxResourceTest.java b/test/jdk/tools/jpackage/linux/LinuxResourceTest.java index 8371dc01e43..b82706fc2c2 100644 --- a/test/jdk/tools/jpackage/linux/LinuxResourceTest.java +++ b/test/jdk/tools/jpackage/linux/LinuxResourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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,7 +28,9 @@ import java.nio.file.Path; import java.util.List; import java.util.Objects; import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.CannedFormattedString; import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.JPackageOutputValidator; import jdk.jpackage.test.LinuxHelper; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.PackageType; @@ -67,22 +69,26 @@ public class LinuxResourceTest { final var arhProp = property("Architecture", "bar"); TKit.createTextFile(controlFile, List.of( - packageProp.format(), - verProp.format(), - "Section: APPLICATION_SECTION", - "Maintainer: APPLICATION_MAINTAINER", - "Priority: optional", - arhProp.format(), - "Provides: dont-install-me", - "Description: APPLICATION_DESCRIPTION", - "Installed-Size: APPLICATION_INSTALLED_SIZE", - "Depends: PACKAGE_DEFAULT_DEPENDENCIES" + packageProp.format(), + verProp.format(), + "Section: APPLICATION_SECTION", + "Maintainer: APPLICATION_MAINTAINER", + "Priority: optional", + arhProp.format(), + "Provides: dont-install-me", + "Description: APPLICATION_DESCRIPTION", + "Installed-Size: APPLICATION_INSTALLED_SIZE", + "Depends: PACKAGE_DEFAULT_DEPENDENCIES" )); - cmd.validateOutput(MAIN.cannedFormattedString( - "message.using-custom-resource", - String.format("[%s]", MAIN.cannedFormattedString("resource.deb-control-file").getValue()), - controlFile.getFileName())); + new JPackageOutputValidator() + .expectMatchingStrings(MAIN.cannedFormattedString( + "message.using-custom-resource", + String.format("[%s]", MAIN.cannedFormattedString("resource.deb-control-file").getValue()), + controlFile.getFileName())) + .matchTimestamps() + .stripTimestamps() + .applyTo(cmd); packageProp.expectedValue(LinuxHelper.getPackageName(cmd)).token("APPLICATION_PACKAGE").resourceDirFile(controlFile).validateOutput(cmd); verProp.expectedValue(cmd.version()).token("APPLICATION_VERSION_WITH_RELEASE").resourceDirFile(controlFile).validateOutput(cmd); @@ -98,30 +104,34 @@ public class LinuxResourceTest { final var releaseProp = property("Release", "R2"); TKit.createTextFile(specFile, List.of( - packageProp.format(), - verProp.format(), - releaseProp.format(), - "Summary: APPLICATION_SUMMARY", - "License: APPLICATION_LICENSE_TYPE", - "Prefix: %{dirname:APPLICATION_DIRECTORY}", - "Provides: dont-install-me", - "%define _build_id_links none", - "%description", - "APPLICATION_DESCRIPTION", - "%prep", - "%build", - "%install", - "rm -rf %{buildroot}", - "install -d -m 755 %{buildroot}APPLICATION_DIRECTORY", - "cp -r %{_sourcedir}APPLICATION_DIRECTORY/* %{buildroot}APPLICATION_DIRECTORY", - "%files", - "APPLICATION_DIRECTORY" + packageProp.format(), + verProp.format(), + releaseProp.format(), + "Summary: APPLICATION_SUMMARY", + "License: APPLICATION_LICENSE_TYPE", + "Prefix: %{dirname:APPLICATION_DIRECTORY}", + "Provides: dont-install-me", + "%define _build_id_links none", + "%description", + "APPLICATION_DESCRIPTION", + "%prep", + "%build", + "%install", + "rm -rf %{buildroot}", + "install -d -m 755 %{buildroot}APPLICATION_DIRECTORY", + "cp -r %{_sourcedir}APPLICATION_DIRECTORY/* %{buildroot}APPLICATION_DIRECTORY", + "%files", + "APPLICATION_DIRECTORY" )); - cmd.validateOutput(MAIN.cannedFormattedString( - "message.using-custom-resource", - String.format("[%s]", MAIN.cannedFormattedString("resource.rpm-spec-file").getValue()), - specFile.getFileName())); + new JPackageOutputValidator() + .expectMatchingStrings(MAIN.cannedFormattedString( + "message.using-custom-resource", + String.format("[%s]", MAIN.cannedFormattedString("resource.rpm-spec-file").getValue()), + specFile.getFileName())) + .matchTimestamps() + .stripTimestamps() + .applyTo(cmd); packageProp.expectedValue(LinuxHelper.getPackageName(cmd)).token("APPLICATION_PACKAGE").resourceDirFile(specFile).validateOutput(cmd); verProp.expectedValue(cmd.version()).token("APPLICATION_VERSION").resourceDirFile(specFile).validateOutput(cmd); @@ -171,9 +181,15 @@ public class LinuxResourceTest { Objects.requireNonNull(resourceDirFile); final var customResourcePath = customResourcePath(); - cmd.validateOutput( - MAIN.cannedFormattedString("error.unexpected-package-property", name, expectedValue, customValue, customResourcePath), - MAIN.cannedFormattedString("error.unexpected-package-property.advice", token, customValue, name, customResourcePath)); + + new JPackageOutputValidator() + .expectMatchingStrings( + MAIN.cannedFormattedString("error.unexpected-package-property", name, expectedValue, customValue, customResourcePath), + MAIN.cannedFormattedString("error.unexpected-package-property.advice", token, customValue, name, customResourcePath) + ) + .matchTimestamps() + .stripTimestamps() + .applyTo(cmd); } private Path customResourcePath() { diff --git a/test/jdk/tools/jpackage/macosx/MacSignTest.java b/test/jdk/tools/jpackage/macosx/MacSignTest.java index 0be494ea469..dbb78d2416c 100644 --- a/test/jdk/tools/jpackage/macosx/MacSignTest.java +++ b/test/jdk/tools/jpackage/macosx/MacSignTest.java @@ -22,24 +22,26 @@ */ import static jdk.jpackage.test.MacHelper.SignKeyOption.Type.SIGN_KEY_IDENTITY; -import static jdk.jpackage.test.MacHelper.SignKeyOption.Type.SIGN_KEY_IDENTITY_APP_IMAGE; import static jdk.jpackage.test.MacHelper.SignKeyOption.Type.SIGN_KEY_USER_FULL_NAME; import static jdk.jpackage.test.MacHelper.SignKeyOption.Type.SIGN_KEY_USER_SHORT_NAME; import java.io.IOException; import java.nio.file.Files; import java.util.Collection; +import java.util.Comparator; import java.util.List; +import java.util.Objects; import java.util.function.Function; import java.util.function.Predicate; import java.util.regex.Pattern; import java.util.stream.Stream; +import jdk.jpackage.internal.util.function.ExceptionBox; import jdk.jpackage.test.Annotations.Parameter; import jdk.jpackage.test.Annotations.ParameterSupplier; import jdk.jpackage.test.Annotations.Test; -import jdk.jpackage.test.CannedFormattedString; import jdk.jpackage.test.FailedCommandErrorValidator; import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.JPackageOutputValidator; import jdk.jpackage.test.JPackageStringBundle; import jdk.jpackage.test.MacHelper; import jdk.jpackage.test.MacHelper.NamedCertificateRequestSupplier; @@ -47,7 +49,6 @@ import jdk.jpackage.test.MacHelper.ResolvableCertificateRequest; import jdk.jpackage.test.MacHelper.SignKeyOption; import jdk.jpackage.test.MacHelper.SignKeyOptionWithKeychain; import jdk.jpackage.test.MacSign; -import jdk.jpackage.test.MacSign.CertificateType; import jdk.jpackage.test.MacSignVerify; import jdk.jpackage.test.PackageType; import jdk.jpackage.test.TKit; @@ -75,16 +76,16 @@ public class MacSignTest { Files.createDirectory(appContent); Files.createFile(appContent.resolve("file")); - final var group = TKit.TextStreamVerifier.group(); + final var validator = new JPackageOutputValidator().stderr(); - group.add(TKit.assertTextStream(JPackageStringBundle.MAIN.cannedFormattedString( - "message.codesign.failed.reason.app.content").getValue()).predicate(String::equals)); + validator.expectMatchingStrings(JPackageStringBundle.MAIN.cannedFormattedString( + "message.codesign.failed.reason.app.content")); final var xcodeWarning = TKit.assertTextStream(JPackageStringBundle.MAIN.cannedFormattedString( "message.codesign.failed.reason.xcode.tools").getValue()).predicate(String::equals); if (!MacHelper.isXcodeDevToolsInstalled()) { - group.add(xcodeWarning); + validator.add(xcodeWarning); } var keychain = SigningBase.StandardKeychain.MAIN.keychain(); @@ -94,11 +95,7 @@ public class MacSignTest { SigningBase.StandardCertificateRequest.CODESIGN, keychain); - new FailedCommandErrorValidator(Pattern.compile(String.format( - "/usr/bin/codesign -s %s -vvvv --timestamp --options runtime --prefix \\S+ --keychain %s --entitlements \\S+ \\S+", - Pattern.quote(String.format("'%s'", signingKeyOption.certRequest().name())), - Pattern.quote(keychain.name()) - ))).exitCode(1).createGroup().mutate(group::add); + validator.add(buildSignCommandErrorValidator(signingKeyOption).create()); MacSign.withKeychain(_ -> { @@ -107,14 +104,14 @@ public class MacSignTest { // This is not a fatal error, just a warning. // To make jpackage fail, specify bad additional content. JPackageCommand.helloAppImage() - .ignoreDefaultVerbose(true) - .validateOutput(group.create()) + .mutate(MacSignTest::init) + .mutate(validator::applyTo) .addArguments("--app-content", appContent) .mutate(signingKeyOption::addTo) .mutate(cmd -> { if (MacHelper.isXcodeDevToolsInstalled()) { // Check there is no warning about missing xcode command line developer tools. - cmd.validateOutput(xcodeWarning.copy().negate()); + cmd.validateErr(xcodeWarning.copy().negate()); } }).execute(1); @@ -136,16 +133,13 @@ public class MacSignTest { MacSign.withKeychain(keychain -> { // Build a matcher for jpackage's failed command output. - var errorValidator = new FailedCommandErrorValidator(Pattern.compile(String.format( - "/usr/bin/codesign -s %s -vvvv --timestamp --options runtime --prefix \\S+ --keychain %s", - Pattern.quote(String.format("'%s'", signingKeyOption.certRequest().name())), - Pattern.quote(keychain.name()) - ))).exitCode(1).output(String.format("%s: no identity found", signingKeyOption.certRequest().name())).createGroup(); + var errorValidator = buildSignCommandErrorValidator(signingKeyOption, keychain) + .output(String.format("%s: no identity found", signingKeyOption.certRequest().name())) + .create(); JPackageCommand.helloAppImage() - .setFakeRuntime() - .ignoreDefaultVerbose(true) - .validateOutput(errorValidator.create()) + .mutate(MacSignTest::init) + .mutate(errorValidator::applyTo) .mutate(signingKeyOption::addTo) .mutate(MacHelper.useKeychain(keychain)) .execute(1); @@ -157,9 +151,12 @@ public class MacSignTest { @Parameter({"IMAGE", "EXPIRED_SIGNING_KEY_USER_NAME"}) @Parameter({"MAC_DMG", "EXPIRED_SIGNING_KEY_USER_NAME"}) @Parameter({"MAC_PKG", "EXPIRED_SIGNING_KEY_USER_NAME", "EXPIRED_SIGNING_KEY_USER_NAME_PKG"}) + @Parameter({"MAC_PKG", "EXPIRED_SIGNING_KEY_USER_NAME_PKG", "EXPIRED_SIGNING_KEY_USER_NAME"}) @Parameter({"IMAGE", "EXPIRED_SIGN_IDENTITY"}) @Parameter({"MAC_DMG", "EXPIRED_SIGN_IDENTITY"}) + + // Test that jpackage doesn't print duplicated error messages. @Parameter({"MAC_PKG", "EXPIRED_SIGN_IDENTITY"}) @Parameter({"IMAGE", "EXPIRED_CODESIGN_SIGN_IDENTITY"}) @@ -168,16 +165,41 @@ public class MacSignTest { @Parameter({"MAC_PKG", "GOOD_CODESIGN_SIGN_IDENTITY", "EXPIRED_PKG_SIGN_IDENTITY"}) @Parameter({"MAC_PKG", "EXPIRED_CODESIGN_SIGN_IDENTITY", "GOOD_PKG_SIGN_IDENTITY"}) - public static void testExpiredCertificate(PackageType type, SignOption... options) { + public static void testExpiredCertificate(PackageType type, SignOption... optionIds) { + + var options = Stream.of(optionIds).map(SignOption::option).toList(); + + var badOptions = options.stream().filter(option -> { + return option.certRequest().expired(); + }).toList(); MacSign.withKeychain(keychain -> { + final var cmd = MacHelper.useKeychain(JPackageCommand.helloAppImage(), keychain) - .ignoreDefaultVerbose(true) - .addArguments(Stream.of(options).map(SignOption::args).flatMap(List::stream).toList()) + .mutate(MacSignTest::init) + .addArguments(options.stream().map(SignKeyOption::asCmdlineArgs).flatMap(List::stream).toList()) .setPackageType(type); - SignOption.configureOutputValidation(cmd, Stream.of(options).filter(SignOption::expired).toList(), opt -> { - return JPackageStringBundle.MAIN.cannedFormattedString("error.certificate.expired", opt.identityName()); + configureOutputValidation(cmd, expectFailures(badOptions), opt -> { + if (!opt.passThrough().orElse(false)) { + return expectConfigurationError("error.certificate.outside-validity-period", opt.certRequest().name()); + } else { + var builder = buildSignCommandErrorValidator(opt, keychain); + switch (opt.optionName().orElseThrow()) { + case KEY_IDENTITY_APP_IMAGE, KEY_USER_NAME -> { + builder.output(String.format("%s: no identity found", opt.certRequest().name())); + } + case KEY_IDENTITY_INSTALLER -> { + var regexp = Pattern.compile(String.format( + "^productbuild: error: Cannot write product to \\S+ \\(Could not find appropriate signing identity for “%s” in keychain at “%s”\\.\\)", + Pattern.quote(opt.certRequest().name()), + Pattern.quote(keychain.name()) + )); + builder.validators(TKit.assertTextStream(regexp)); + } + } + return builder.create(); + } }).execute(1); }, MacSign.Keychain.UsageBuilder::addToSearchList, SigningBase.StandardKeychain.EXPIRED.keychain()); } @@ -185,30 +207,58 @@ public class MacSignTest { @Test @Parameter({"IMAGE", "GOOD_SIGNING_KEY_USER_NAME"}) @Parameter({"MAC_DMG", "GOOD_SIGNING_KEY_USER_NAME"}) + @Parameter({"MAC_PKG", "GOOD_SIGNING_KEY_USER_NAME", "GOOD_SIGNING_KEY_USER_NAME_PKG"}) @Parameter({"MAC_PKG", "GOOD_SIGNING_KEY_USER_NAME_PKG", "GOOD_SIGNING_KEY_USER_NAME"}) @Parameter({"IMAGE", "GOOD_CODESIGN_SIGN_IDENTITY"}) @Parameter({"MAC_PKG", "GOOD_CODESIGN_SIGN_IDENTITY", "GOOD_PKG_SIGN_IDENTITY"}) @Parameter({"MAC_PKG", "GOOD_PKG_SIGN_IDENTITY"}) - public static void testMultipleCertificates(PackageType type, SignOption... options) { + public static void testMultipleCertificates(PackageType type, SignOption... optionIds) { + + var options = Stream.of(optionIds).map(SignOption::option).toList(); MacSign.withKeychain(keychain -> { + final var cmd = MacHelper.useKeychain(JPackageCommand.helloAppImage(), keychain) - .ignoreDefaultVerbose(true) - .addArguments(Stream.of(options).map(SignOption::args).flatMap(List::stream).toList()) + .mutate(MacSignTest::init) + .addArguments(options.stream().map(SignKeyOption::asCmdlineArgs).flatMap(List::stream).toList()) .setPackageType(type); - Predicate filter = opt -> { - if (type == PackageType.MAC_PKG && options.length > 1) { - // Only the first error will be reported and it should always be - // for the app image signing, not for the PKG signing. - return opt.identityType() == CertificateType.CODE_SIGN; - } else { - return true; - } - }; + if (List.of(optionIds).equals(List.of(SignOption.GOOD_PKG_SIGN_IDENTITY))) { + /** + * Normally, if multiple signing identities share the same name, signing should + * fail. However, in pass-through signing, when jpackage passes signing + * identities without validation to signing commands, signing a .pkg installer + * with a name matching two signing identities succeeds. + */ + new JPackageOutputValidator().stdout() + .expectMatchingStrings(JPackageStringBundle.MAIN.cannedFormattedString("warning.unsigned.app.image", "pkg")) + .validateEndOfStream() + .applyTo(cmd); - SignOption.configureOutputValidation(cmd, Stream.of(options).filter(filter).toList(), opt -> { - return JPackageStringBundle.MAIN.cannedFormattedString("error.multiple.certs.found", opt.identityName(), keychain.name()); + cmd.execute(); + return; + } + + configureOutputValidation(cmd, expectFailures(options), opt -> { + if (!opt.passThrough().orElse(false)) { + return expectConfigurationError("error.multiple.certs.found", opt.certRequest().name(), keychain.name()); + } else { + var builder = buildSignCommandErrorValidator(opt, keychain); + switch (opt.optionName().orElseThrow()) { + case KEY_IDENTITY_APP_IMAGE, KEY_USER_NAME -> { + builder.output(String.format("%s: ambiguous", opt.certRequest().name())); + } + case KEY_IDENTITY_INSTALLER -> { + var regexp = Pattern.compile(String.format( + "^productbuild: error: Cannot write product to \\S+ \\(Could not find appropriate signing identity for “%s” in keychain at “%s”\\.\\)", + Pattern.quote(opt.certRequest().name()), + Pattern.quote(keychain.name()) + )); + builder.validators(TKit.assertTextStream(regexp)); + } + } + return builder.create(); + } }).execute(1); }, MacSign.Keychain.UsageBuilder::addToSearchList, SigningBase.StandardKeychain.DUPLICATE.keychain()); } @@ -262,7 +312,7 @@ public class MacSignTest { GOOD_SIGNING_KEY_USER_NAME(SIGN_KEY_USER_SHORT_NAME, SigningBase.StandardCertificateRequest.CODESIGN), GOOD_SIGNING_KEY_USER_NAME_PKG(SIGN_KEY_USER_SHORT_NAME, SigningBase.StandardCertificateRequest.PKG), GOOD_CODESIGN_SIGN_IDENTITY(SIGN_KEY_IDENTITY, SigningBase.StandardCertificateRequest.CODESIGN), - GOOD_PKG_SIGN_IDENTITY(SIGN_KEY_IDENTITY_APP_IMAGE, SigningBase.StandardCertificateRequest.PKG); + GOOD_PKG_SIGN_IDENTITY(SIGN_KEY_IDENTITY, SigningBase.StandardCertificateRequest.PKG); SignOption(SignKeyOption.Type optionType, NamedCertificateRequestSupplier certRequestSupplier) { this.option = new SignKeyOption(optionType, new ResolvableCertificateRequest(certRequestSupplier.certRequest(), _ -> { @@ -270,44 +320,106 @@ public class MacSignTest { }, certRequestSupplier.name())); } - boolean passThrough() { - return option.type().mapOptionName(option.certRequest().type()).orElseThrow().passThrough(); - } - - boolean expired() { - return option.certRequest().expired(); - } - - String identityName() { - return option.certRequest().name(); - } - - CertificateType identityType() { - return option.certRequest().type(); - } - - List args() { - return option.asCmdlineArgs(); - } - - static JPackageCommand configureOutputValidation(JPackageCommand cmd, List options, - Function conv) { - options.stream().filter(SignOption::passThrough) - .map(conv) - .map(CannedFormattedString::getValue) - .map(TKit::assertTextStream) - .map(TKit.TextStreamVerifier::negate) - .forEach(cmd::validateOutput); - - options.stream().filter(Predicate.not(SignOption::passThrough)) - .map(conv) - .map(CannedFormattedString::getValue) - .map(TKit::assertTextStream) - .forEach(cmd::validateOutput); - - return cmd; + SignKeyOption option() { + return option; } private final SignKeyOption option; } + + private static JPackageCommand configureOutputValidation(JPackageCommand cmd, Stream options, + Function conv) { + + // Validate jpackage's output matches expected output. + + var outputValidator = new JPackageOutputValidator().stderr(); + + options.sorted(Comparator.comparing(option -> { + return option.certRequest().type(); + })).map(conv).forEach(outputValidator::add); + + outputValidator.validateEndOfStream().applyTo(cmd); + + return cmd; + } + + private static Stream expectFailures(Collection options) { + + if (!options.stream().map(option -> { + return option.passThrough().orElse(false); + }).distinct().reduce((x, y) -> { + throw new IllegalArgumentException(); + }).get()) { + // No pass-through signing options. + // This means jpackage will validate them at the configuration phase and report all detected errors. + return options.stream(); + } + + // Pass-through signing options. + // jpackage will not validate them and will report only one error at the packaging phase. + + Function> filterType = type -> { + return option -> { + return option.certRequest().type() == type; + }; + }; + + var appImageSignOption = options.stream() + .filter(filterType.apply(MacSign.CertificateType.CODE_SIGN)).findFirst(); + var pkgSignOption = options.stream() + .filter(filterType.apply(MacSign.CertificateType.INSTALLER)).findFirst(); + + if (appImageSignOption.isPresent() && pkgSignOption.isPresent()) { + return options.stream().filter(option -> { + return appImageSignOption.get() == option; + }); + } else { + return options.stream(); + } + } + + private static JPackageOutputValidator expectConfigurationError(String key, Object ... args) { + return new JPackageOutputValidator().expectMatchingStrings(JPackageCommand.makeError(key, args)).stderr(); + } + + private static FailedCommandErrorValidator buildSignCommandErrorValidator(SignKeyOptionWithKeychain option) { + return buildSignCommandErrorValidator(option.signKeyOption(), option.keychain()); + } + + private static FailedCommandErrorValidator buildSignCommandErrorValidator(SignKeyOption option, MacSign.ResolvedKeychain keychain) { + + Objects.requireNonNull(option); + Objects.requireNonNull(keychain); + + String cmdlinePatternFormat; + String signIdentity; + + switch (option.optionName().orElseThrow()) { + case KEY_IDENTITY_APP_IMAGE, KEY_USER_NAME -> { + cmdlinePatternFormat = "^/usr/bin/codesign -s %s -vvvv --timestamp --options runtime --prefix \\S+ --keychain %s"; + if (option.passThrough().orElse(false)) { + signIdentity = String.format("'%s'", option.asCmdlineArgs().getLast()); + } else { + signIdentity = MacSign.CertificateHash.of(option.certRequest().cert()).toString(); + } + } + case KEY_IDENTITY_INSTALLER -> { + cmdlinePatternFormat = "^/usr/bin/productbuild --resources \\S+ --sign %s --keychain %s"; + signIdentity = String.format("'%s'", option.asCmdlineArgs().getLast()); + } + default -> { + throw ExceptionBox.reachedUnreachable(); + } + } + + return new FailedCommandErrorValidator(Pattern.compile(String.format( + cmdlinePatternFormat, + Pattern.quote(signIdentity), + Pattern.quote(keychain.name()) + ))).exitCode(1); + } + + private static void init(JPackageCommand cmd) { + cmd.setFakeRuntime().ignoreDefaultVerbose(true); + } } diff --git a/test/jdk/tools/jpackage/macosx/PkgScriptsTest.java b/test/jdk/tools/jpackage/macosx/PkgScriptsTest.java index 9ee85ae5245..5b2a8b63020 100644 --- a/test/jdk/tools/jpackage/macosx/PkgScriptsTest.java +++ b/test/jdk/tools/jpackage/macosx/PkgScriptsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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.util.stream.Stream; import jdk.jpackage.test.Annotations.ParameterSupplier; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.JPackageOutputValidator; import jdk.jpackage.test.JPackageStringBundle; import jdk.jpackage.test.MacHelper; import jdk.jpackage.test.PackageTest; @@ -94,7 +95,13 @@ public class PkgScriptsTest { "message.no-default-resource", String.format("[%s]", role.resourceCategory()), role.scriptName()); - }).forEach(cmd::validateOutput); + }).forEach(str -> { + new JPackageOutputValidator() + .expectMatchingStrings(str) + .matchTimestamps() + .stripTimestamps() + .applyTo(cmd); + }); }).addInstallVerifier(cmd -> { customScripts.forEach(customScript -> { customScript.verify(cmd); diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java index 0f299cb5a24..3a257a425b6 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java @@ -82,10 +82,17 @@ public class SigningAppImageTest { SigningBase.StandardCertificateRequest.CODESIGN_UNICODE )) { for (var signIdentityType : SignKeyOption.Type.defaultValues()) { - data.add(new SignKeyOptionWithKeychain( - signIdentityType, - certRequest, - SigningBase.StandardKeychain.MAIN.keychain())); + SigningBase.StandardKeychain keychain; + if (signIdentityType == SignKeyOption.Type.SIGN_KEY_IMPLICIT) { + keychain = SigningBase.StandardKeychain.SINGLE; + if (!keychain.contains(certRequest)) { + continue; + } + } else { + keychain = SigningBase.StandardKeychain.MAIN; + } + + data.add(new SignKeyOptionWithKeychain(signIdentityType, certRequest, keychain.keychain())); } } diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java index 2c7ae205e69..a6d94b59bd9 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java @@ -93,6 +93,11 @@ public class SigningAppImageTwoStepsTest { return new TestSpec(Optional.ofNullable(signAppImage), sign); } + Builder keychain(SigningBase.StandardKeychain v) { + keychain = Objects.requireNonNull(v); + return this; + } + Builder certRequest(SigningBase.StandardCertificateRequest v) { certRequest = Objects.requireNonNull(v); return this; @@ -117,9 +122,10 @@ public class SigningAppImageTwoStepsTest { return new SignKeyOptionWithKeychain( signIdentityType, certRequest, - SigningBase.StandardKeychain.MAIN.keychain()); + keychain.keychain()); } + private SigningBase.StandardKeychain keychain = SigningBase.StandardKeychain.MAIN; private SigningBase.StandardCertificateRequest certRequest = SigningBase.StandardCertificateRequest.CODESIGN; private SignKeyOption.Type signIdentityType = SignKeyOption.Type.SIGN_KEY_IDENTITY; @@ -144,18 +150,26 @@ public class SigningAppImageTwoStepsTest { }, signOption.keychain()); }, appImageCmd::execute); - var cmd = new JPackageCommand() - .setPackageType(PackageType.IMAGE) - .addArguments("--app-image", appImageCmd.outputBundle()) - .mutate(sign::addTo); + MacSign.withKeychain(keychain -> { + var cmd = new JPackageCommand() + .setPackageType(PackageType.IMAGE) + .addArguments("--app-image", appImageCmd.outputBundle()) + .mutate(sign::addTo); - cmd.executeAndAssertHelloAppImageCreated(); - MacSignVerify.verifyAppImageSigned(cmd, sign.certRequest()); + cmd.executeAndAssertHelloAppImageCreated(); + MacSignVerify.verifyAppImageSigned(cmd, sign.certRequest()); + }, sign.keychain()); } } public static Collection test() { + var signIdentityTypes = List.of( + SignKeyOption.Type.SIGN_KEY_USER_SHORT_NAME, + SignKeyOption.Type.SIGN_KEY_IDENTITY_APP_IMAGE, + SignKeyOption.Type.SIGN_KEY_IMPLICIT + ); + List data = new ArrayList<>(); for (var appImageSign : withAndWithout(SignKeyOption.Type.SIGN_KEY_IDENTITY)) { @@ -167,9 +181,12 @@ public class SigningAppImageTwoStepsTest { .certRequest(SigningBase.StandardCertificateRequest.CODESIGN_ACME_TECH_LTD) .signAppImage(); }); - for (var signIdentityType : SignKeyOption.Type.defaultValues()) { + for (var signIdentityType : signIdentityTypes) { builder.signIdentityType(signIdentityType) .certRequest(SigningBase.StandardCertificateRequest.CODESIGN); + if (signIdentityType == SignKeyOption.Type.SIGN_KEY_IMPLICIT) { + builder.keychain(SigningBase.StandardKeychain.SINGLE); + } data.add(builder.sign().create()); } } diff --git a/test/jdk/tools/jpackage/macosx/SigningBase.java b/test/jdk/tools/jpackage/macosx/SigningBase.java index 5f4367e6096..e7e2d7e44cf 100644 --- a/test/jdk/tools/jpackage/macosx/SigningBase.java +++ b/test/jdk/tools/jpackage/macosx/SigningBase.java @@ -38,7 +38,7 @@ import jdk.jpackage.test.TKit; * @test * @summary Setup the environment for jpackage macos signing tests. * Creates required keychains and signing identities. - * Does NOT run any jpackag tests. + * Does NOT run any jpackage tests. * @library /test/jdk/tools/jpackage/helpers * @build jdk.jpackage.test.* * @compile -Xlint:all -Werror SigningBase.java @@ -51,7 +51,7 @@ import jdk.jpackage.test.TKit; * @test * @summary Tear down the environment for jpackage macos signing tests. * Deletes required keychains and signing identities. - * Does NOT run any jpackag tests. + * Does NOT run any jpackage tests. * @library /test/jdk/tools/jpackage/helpers * @build jdk.jpackage.test.* * @compile -Xlint:all -Werror SigningBase.java @@ -83,7 +83,7 @@ public class SigningBase { } private static CertificateRequest.Builder cert() { - return new CertificateRequest.Builder(); + return CertificateRequest.build(); } private final CertificateRequest spec; @@ -118,6 +118,12 @@ public class SigningBase { StandardCertificateRequest.PKG, StandardCertificateRequest.CODESIGN_COPY, StandardCertificateRequest.PKG_COPY), + /** + * A keychain with a single certificate for each role. + */ + SINGLE("jpackagerTest-single.keychain", + StandardCertificateRequest.CODESIGN, + StandardCertificateRequest.PKG), ; StandardKeychain(String keychainName, StandardCertificateRequest... certs) { @@ -145,7 +151,7 @@ public class SigningBase { } private static KeychainWithCertsSpec.Builder keychain(String name) { - return new KeychainWithCertsSpec.Builder().name(name); + return KeychainWithCertsSpec.build().name(name); } private static List signingEnv() { @@ -164,13 +170,13 @@ public class SigningBase { } public static void verifySignTestEnvReady() { - if (!Inner.SIGN_ENV_READY) { + if (!SignEnvReady.VALUE) { TKit.throwSkippedException(new IllegalStateException("Misconfigured signing test environment")); } } - private final class Inner { - private static final boolean SIGN_ENV_READY = MacSign.isDeployed(StandardKeychain.signingEnv()); + private final class SignEnvReady { + static final boolean VALUE = MacSign.isDeployed(StandardKeychain.signingEnv()); } private static final String NAME_ASCII = "jpackage.openjdk.java.net"; diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java index 8a93ce5f749..d1c17fb61cd 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java @@ -94,7 +94,7 @@ public class SigningPackageTest { } public static Collection test() { - return TestSpec.testCases(true).stream().map(v -> { + return TestSpec.testCases().stream().map(v -> { return new Object[] {v}; }).toList(); } @@ -126,7 +126,10 @@ public class SigningPackageTest { } if (appImageSignOption.isEmpty()) { - if (packageSignOption.get().type() != SignKeyOption.Type.SIGN_KEY_IDENTITY) { + if (!List.of( + SignKeyOption.Type.SIGN_KEY_IDENTITY, + SignKeyOption.Type.SIGN_KEY_IDENTITY_SHA1 + ).contains(packageSignOption.get().type())) { // They request to sign the .pkg installer without // the "--mac-installer-sign-identity" option, // but didn't specify a signing option for the packaged app image. @@ -204,15 +207,61 @@ public class SigningPackageTest { } MacSign.ResolvedKeychain keychain() { - return SigningBase.StandardKeychain.MAIN.keychain(); + return chooseKeychain(Stream.of( + appImageSignOption.stream(), + packageSignOption.stream() + ).flatMap(x -> x).map(SignKeyOption::type).findFirst().orElseThrow()).keychain(); } - static List testCases(boolean withUnicode) { + /** + * Types of test cases to skip. + */ + enum SkipTestCases { + /** + * Skip test cases with signing identities/key names with symbols outside of the + * ASCII codepage. + */ + SKIP_UNICODE, + /** + * Skip test cases in which the value of the "--mac-signing-key-user-name" + * option is the full signing identity name. + */ + SKIP_SIGN_KEY_USER_FULL_NAME, + /** + * Skip test cases in which the value of the "--mac-installer-sign-identity" or + * "--mac-app-image-sign-identity" option is the SHA1 digest of the signing + * certificate. + */ + SKIP_SIGN_KEY_IDENTITY_SHA1, + ; + } + + static List minimalTestCases() { + return testCases(SkipTestCases.values()); + } + + static List testCases(SkipTestCases... skipTestCases) { + + final var skipTestCasesAsSet = Set.of(skipTestCases); + + final var signIdentityTypes = Stream.of(SignKeyOption.Type.defaultValues()).filter(v -> { + switch (v) { + case SIGN_KEY_USER_FULL_NAME -> { + return !skipTestCasesAsSet.contains(SkipTestCases.SKIP_SIGN_KEY_USER_FULL_NAME); + } + case SIGN_KEY_IDENTITY_SHA1 -> { + return !skipTestCasesAsSet.contains(SkipTestCases.SKIP_SIGN_KEY_IDENTITY_SHA1); + } + default -> { + return true; + } + } + }).toList(); List data = new ArrayList<>(); List> certRequestGroups; - if (withUnicode) { + if (!skipTestCasesAsSet.contains(SkipTestCases.SKIP_UNICODE)) { certRequestGroups = List.of( List.of(SigningBase.StandardCertificateRequest.CODESIGN, SigningBase.StandardCertificateRequest.PKG), List.of(SigningBase.StandardCertificateRequest.CODESIGN_UNICODE, SigningBase.StandardCertificateRequest.PKG_UNICODE) @@ -224,19 +273,33 @@ public class SigningPackageTest { } for (var certRequests : certRequestGroups) { - for (var signIdentityType : SignKeyOption.Type.defaultValues()) { - var keychain = SigningBase.StandardKeychain.MAIN.keychain(); + for (var signIdentityType : signIdentityTypes) { + if (signIdentityType == SignKeyOption.Type.SIGN_KEY_IMPLICIT + && !SigningBase.StandardKeychain.SINGLE.contains(certRequests.getFirst())) { + // Skip invalid test case: the keychain for testing signing without + // an explicitly specified signing key option doesn't have this signing key. + break; + } + + if (signIdentityType.passThrough() && !certRequests.contains(SigningBase.StandardCertificateRequest.CODESIGN)) { + // Using a pass-through signing option. + // Doesn't make sense to waste time on testing it with multiple certificates. + // Skip the test cases using non "default" certificate. + break; + } + + var keychain = chooseKeychain(signIdentityType).keychain(); var appImageSignKeyOption = new SignKeyOption(signIdentityType, certRequests.getFirst(), keychain); var pkgSignKeyOption = new SignKeyOption(signIdentityType, certRequests.getLast(), keychain); switch (signIdentityType) { - case SIGN_KEY_IDENTITY -> { + case SIGN_KEY_IDENTITY, SIGN_KEY_IDENTITY_SHA1 -> { // Use "--mac-installer-sign-identity" and "--mac-app-image-sign-identity" signing options. // They allows to sign the packaged app image and the installer (.pkg) separately. data.add(new TestSpec(Optional.of(appImageSignKeyOption), Optional.empty(), PackageType.MAC)); data.add(new TestSpec(Optional.empty(), Optional.of(pkgSignKeyOption), PackageType.MAC_PKG)); } - case SIGN_KEY_USER_SHORT_NAME -> { + case SIGN_KEY_USER_SHORT_NAME, SIGN_KEY_IMPLICIT -> { // Use "--mac-signing-key-user-name" signing option with short user name or implicit signing option. // It signs both the packaged app image and the installer (.pkg). // Thus, if the installer is not signed, it can be used only with .dmg packaging. @@ -263,5 +326,13 @@ public class SigningPackageTest { return data; } + + private static SigningBase.StandardKeychain chooseKeychain(SignKeyOption.Type signIdentityType) { + if (signIdentityType == SignKeyOption.Type.SIGN_KEY_IMPLICIT) { + return SigningBase.StandardKeychain.SINGLE; + } else { + return SigningBase.StandardKeychain.MAIN; + } + } } } diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java index 70ec0e600de..d0de9c8c704 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java @@ -108,7 +108,7 @@ public class SigningPackageTwoStepTest { appImageSignOption = Optional.empty(); } - for (var signPackage : SigningPackageTest.TestSpec.testCases(false)) { + for (var signPackage : SigningPackageTest.TestSpec.minimalTestCases()) { data.add(new TwoStepsTestSpec(appImageSignOption, signPackage)); } } @@ -212,9 +212,9 @@ public class SigningPackageTwoStepTest { } } - expected.ifPresent(cmd::validateOutput); + expected.ifPresent(cmd::validateOut); unexpected.forEach(str -> { - cmd.validateOutput(TKit.assertTextStream(cmd.getValue(str)).negate()); + cmd.validateOut(TKit.assertTextStream(cmd.getValue(str)).negate()); }); } } diff --git a/test/jdk/tools/jpackage/macosx/SigningRuntimeImagePackageTest.java b/test/jdk/tools/jpackage/macosx/SigningRuntimeImagePackageTest.java index 604399ebd7a..54021aa2a0b 100644 --- a/test/jdk/tools/jpackage/macosx/SigningRuntimeImagePackageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningRuntimeImagePackageTest.java @@ -125,7 +125,7 @@ public class SigningRuntimeImagePackageTest { runtimeSignOption = Optional.empty(); } - for (var signPackage : SigningPackageTest.TestSpec.testCases(false)) { + for (var signPackage : SigningPackageTest.TestSpec.minimalTestCases()) { data.add(new RuntimeTestSpec(runtimeSignOption, runtimeType, signPackage)); } } diff --git a/test/jdk/tools/jpackage/share/AppContentTest.java b/test/jdk/tools/jpackage/share/AppContentTest.java index e275fae262c..46f5286e48a 100644 --- a/test/jdk/tools/jpackage/share/AppContentTest.java +++ b/test/jdk/tools/jpackage/share/AppContentTest.java @@ -102,7 +102,7 @@ public class AppContentTest { JPackageCommand.helloAppImage() .addArguments("--app-content", appContentValue) .setFakeRuntime() - .validateOutput(expectedWarning) + .validateOut(expectedWarning) .executeIgnoreExitCode(); } diff --git a/test/jdk/tools/jpackage/share/AppImagePackageTest.java b/test/jdk/tools/jpackage/share/AppImagePackageTest.java index ce2300c92d1..e91b3113816 100644 --- a/test/jdk/tools/jpackage/share/AppImagePackageTest.java +++ b/test/jdk/tools/jpackage/share/AppImagePackageTest.java @@ -173,7 +173,7 @@ public class AppImagePackageTest { final var appImageDir = appImageCmd.outputBundle(); - final var expectedError = JPackageStringBundle.MAIN.cannedFormattedString( + final var expectedError = JPackageCommand.makeError( "error.invalid-app-image-file", AppImageFile.getPathInAppImage(Path.of("")), appImageDir); configureBadAppImage(appImageDir, expectedError).addRunOnceInitializer(() -> { @@ -204,7 +204,7 @@ public class AppImagePackageTest { } private static PackageTest configureBadAppImage(Path appImageDir) { - return configureBadAppImage(appImageDir, JPackageStringBundle.MAIN.cannedFormattedString( + return configureBadAppImage(appImageDir, JPackageCommand.makeError( "error.missing-app-image-file", AppImageFile.getPathInAppImage(Path.of("")), appImageDir)); } @@ -212,7 +212,7 @@ public class AppImagePackageTest { return new PackageTest().addInitializer(cmd -> { cmd.usePredefinedAppImage(appImageDir); cmd.ignoreDefaultVerbose(true); // no "--verbose" option - cmd.validateOutput(expectedError); + cmd.validateErr(expectedError); }).setExpectedExitCode(1); } diff --git a/test/jdk/tools/jpackage/share/BasicTest.java b/test/jdk/tools/jpackage/share/BasicTest.java index 977b7c7c057..7ea3f578116 100644 --- a/test/jdk/tools/jpackage/share/BasicTest.java +++ b/test/jdk/tools/jpackage/share/BasicTest.java @@ -47,6 +47,7 @@ import jdk.jpackage.test.ConfigurationTarget; import jdk.jpackage.test.Executor; import jdk.jpackage.test.HelloApp; import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.JPackageOutputValidator; import jdk.jpackage.test.JPackageStringBundle; import jdk.jpackage.test.JavaAppDesc; import jdk.jpackage.test.JavaTool; @@ -241,7 +242,11 @@ public final class BasicTest { JPackageStringBundle.MAIN.cannedFormattedString("message.package-created")); } - cmd.validateOutput(verboseContent.toArray(CannedFormattedString[]::new)); + new JPackageOutputValidator() + .expectMatchingStrings(verboseContent.toArray(CannedFormattedString[]::new)) + .matchTimestamps() + .stripTimestamps() + .applyTo(cmd); }); target.cmd().ifPresent(JPackageCommand::execute); @@ -264,12 +269,9 @@ public final class BasicTest { cmd.addArgument("--verbose"); } - cmd.validateOutput(Stream.of( - List.of("error.no-main-class-with-main-jar", "hello.jar"), - List.of("error.no-main-class-with-main-jar.advice", "hello.jar") - ).map(args -> { - return JPackageStringBundle.MAIN.cannedFormattedString(args.getFirst(), args.subList(1, args.size()).toArray()); - }).toArray(CannedFormattedString[]::new)); + cmd.validateErr( + JPackageCommand.makeError("error.no-main-class-with-main-jar", "hello.jar"), + JPackageCommand.makeAdvice("error.no-main-class-with-main-jar.advice", "hello.jar")); cmd.execute(1); } @@ -429,7 +431,7 @@ public final class BasicTest { if (TestTempType.TEMPDIR_NOT_EMPTY.equals(type)) { pkgTest.setExpectedExitCode(1).addInitializer(cmd -> { - cmd.validateOutput(JPackageStringBundle.MAIN.cannedFormattedString( + cmd.validateErr(JPackageCommand.makeError( "error.parameter-not-empty-directory", cmd.getArgumentValue("--temp"), "--temp")); }).addBundleVerifier(cmd -> { // Check jpackage didn't use the supplied directory. diff --git a/test/jdk/tools/jpackage/share/ErrorTest.java b/test/jdk/tools/jpackage/share/ErrorTest.java index f31ac42dea0..2133823381c 100644 --- a/test/jdk/tools/jpackage/share/ErrorTest.java +++ b/test/jdk/tools/jpackage/share/ErrorTest.java @@ -26,7 +26,7 @@ import static java.util.stream.Collectors.toMap; import static jdk.internal.util.OperatingSystem.LINUX; import static jdk.internal.util.OperatingSystem.MACOS; import static jdk.internal.util.OperatingSystem.WINDOWS; -import static jdk.jpackage.internal.util.function.ThrowingFunction.toFunction; +import static jdk.jpackage.internal.util.function.ThrowingSupplier.toSupplier; import static jdk.jpackage.test.JPackageCommand.makeAdvice; import static jdk.jpackage.test.JPackageCommand.makeError; @@ -43,7 +43,9 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.function.UnaryOperator; import java.util.regex.Pattern; +import java.util.stream.IntStream; import java.util.stream.Stream; +import jdk.internal.util.OperatingSystem; import jdk.jpackage.internal.util.TokenReplace; import jdk.jpackage.test.Annotations.Parameter; import jdk.jpackage.test.Annotations.ParameterSupplier; @@ -51,15 +53,28 @@ import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.CannedArgument; import jdk.jpackage.test.CannedFormattedString; import jdk.jpackage.test.JPackageCommand; -import jdk.jpackage.test.JPackageStringBundle; +import jdk.jpackage.test.JPackageOutputValidator; +import jdk.jpackage.test.MacSign; +import jdk.jpackage.test.MacSign.CertificateRequest; +import jdk.jpackage.test.MacSign.CertificateType; +import jdk.jpackage.test.MacSign.KeychainWithCertsSpec; +import jdk.jpackage.test.MacSign.ResolvedKeychain; +import jdk.jpackage.test.MacSign.StandardCertificateNamePrefix; import jdk.jpackage.test.PackageType; import jdk.jpackage.test.TKit; +import jdk.jpackage.test.mock.Script; +import jdk.jpackage.test.mock.VerbatimCommandMock; +import jdk.jpackage.test.stdmock.JPackageMockUtils; +import jdk.jpackage.test.stdmock.MacSignMockUtils; /* * @test * @summary Test jpackage output for erroneous input * @library /test/jdk/tools/jpackage/helpers + * @library /test/lib * @build jdk.jpackage.test.* + * @build jdk.jpackage.test.stdmock.* + * @build jdk.test.lib.security.CertificateBuilder * @compile -Xlint:all -Werror ErrorTest.java * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=ErrorTest @@ -70,7 +85,10 @@ import jdk.jpackage.test.TKit; * @test * @summary Test jpackage output for erroneous input * @library /test/jdk/tools/jpackage/helpers + * @library /test/lib * @build jdk.jpackage.test.* + * @build jdk.jpackage.test.stdmock.* + * @build jdk.test.lib.security.CertificateBuilder * @compile -Xlint:all -Werror ErrorTest.java * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=ErrorTest @@ -80,10 +98,10 @@ import jdk.jpackage.test.TKit; public final class ErrorTest { enum Token { - JAVA_HOME(cmd -> { + JAVA_HOME(() -> { return System.getProperty("java.home"); }), - APP_IMAGE(cmd -> { + APP_IMAGE(() -> { final var appImageRoot = TKit.createTempDirectory("appimage"); final var appImageCmd = JPackageCommand.helloAppImage() @@ -91,28 +109,44 @@ public final class ErrorTest { appImageCmd.execute(); - return appImageCmd.outputBundle().toString(); + return appImageCmd.outputBundle(); }), - INVALID_MAC_RUNTIME_BUNDLE(toFunction(cmd -> { + APP_IMAGE_WITH_SHORT_NAME(() -> { + final var appImageRoot = TKit.createTempDirectory("appimage"); + + final var appImageCmd = JPackageCommand.helloAppImage() + .setFakeRuntime().setArgumentValue("--dest", appImageRoot); + + // Let jpackage pick the name from the main class (Hello). It qualifies as the "short" name. + appImageCmd.removeArgumentWithValue("--name"); + + appImageCmd.execute(); + + return appImageCmd.outputBundle(); + }), + INVALID_MAC_RUNTIME_BUNDLE(toSupplier(() -> { // Has "Contents/MacOS/libjli.dylib", but missing "Contents/Home/lib/libjli.dylib". final Path root = TKit.createTempDirectory("mac-invalid-runtime-bundle"); Files.createDirectories(root.resolve("Contents/Home")); Files.createFile(root.resolve("Contents/Info.plist")); Files.createDirectories(root.resolve("Contents/MacOS")); Files.createFile(root.resolve("Contents/MacOS/libjli.dylib")); - return root.toString(); + return root; })), - INVALID_MAC_RUNTIME_IMAGE(toFunction(cmd -> { + INVALID_MAC_RUNTIME_IMAGE(toSupplier(() -> { // Has some files in the "lib" subdirectory, but doesn't have the "lib/libjli.dylib" file. final Path root = TKit.createTempDirectory("mac-invalid-runtime-image"); Files.createDirectories(root.resolve("lib")); Files.createFile(root.resolve("lib/foo")); - return root.toString(); + return root; })), - EMPTY_DIR(toFunction(cmd -> { + EMPTY_DIR(() -> { return TKit.createTempDirectory("empty-dir"); - })), + }), ADD_LAUNCHER_PROPERTY_FILE, + EMPTY_KEYCHAIN, + KEYCHAIN_WITH_APP_IMAGE_CERT, + KEYCHAIN_WITH_PKG_CERT, ; private Token() { @@ -123,6 +157,12 @@ public final class ErrorTest { this.valueSupplier = Optional.of(valueSupplier); } + private Token(Supplier valueSupplier) { + this(_ -> { + return valueSupplier.get(); + }); + } + String token() { return makeToken(name()); } @@ -202,11 +242,35 @@ public final class ErrorTest { private static final Optional NATIVE_TYPE = defaultNativeType(); } - public record TestSpec(Optional type, Optional appDesc, List addArgs, - List removeArgs, List expectedMessages) { + public record TestSpec( + Optional type, + Optional appDesc, + List addArgs, + List removeArgs, + List expectedMessages, + boolean match) { static final class Builder { + Builder() { + type = new PackageTypeSpec(PackageType.IMAGE); + appDesc = DEFAULT_APP_DESC; + match = true; + } + + Builder(Builder other) { + type = other.type; + appDesc = other.appDesc; + match = other.match; + addArgs.addAll(other.addArgs); + removeArgs.addAll(other.removeArgs); + expectedMessages.addAll(other.expectedMessages); + } + + Builder copy() { + return new Builder(this); + } + Builder type(PackageType v) { type = Optional.ofNullable(v).map(PackageTypeSpec::new).orElse(null); return this; @@ -230,6 +294,19 @@ public final class ErrorTest { return appDesc(null); } + Builder match(boolean v) { + match = v; + return this; + } + + Builder match() { + return match(true); + } + + Builder find() { + return match(false); + } + Builder setAddArgs(List v) { addArgs.clear(); addArgs.addAll(v); @@ -269,7 +346,8 @@ public final class ErrorTest { } Builder setMessages(List v) { - expectedMessages = v; + expectedMessages.clear(); + expectedMessages.addAll(v); return this; } @@ -287,11 +365,11 @@ public final class ErrorTest { } Builder error(String key, Object ... args) { - return messages(makeError(JPackageStringBundle.MAIN.cannedFormattedString(key, args))); + return messages(makeError(key, args)); } Builder advice(String key, Object ... args) { - return messages(makeAdvice(JPackageStringBundle.MAIN.cannedFormattedString(key, args))); + return messages(makeAdvice(key, args)); } Builder invalidTypeArg(String arg, String... otherArgs) { @@ -304,15 +382,21 @@ public final class ErrorTest { } TestSpec create() { - return new TestSpec(Optional.ofNullable(type), Optional.ofNullable(appDesc), - List.copyOf(addArgs), List.copyOf(removeArgs), List.copyOf(expectedMessages)); + return new TestSpec( + Optional.ofNullable(type), + Optional.ofNullable(appDesc), + List.copyOf(addArgs), + List.copyOf(removeArgs), + List.copyOf(expectedMessages), + match); } - private PackageTypeSpec type = new PackageTypeSpec(PackageType.IMAGE); - private String appDesc = DEFAULT_APP_DESC; - private List addArgs = new ArrayList<>(); - private List removeArgs = new ArrayList<>(); - private List expectedMessages = new ArrayList<>(); + private PackageTypeSpec type; + private String appDesc; + private boolean match; + private final List addArgs = new ArrayList<>(); + private final List removeArgs = new ArrayList<>(); + private final List expectedMessages = new ArrayList<>(); } public TestSpec { @@ -360,12 +444,29 @@ public final class ErrorTest { cmd.clearArguments().addArguments(newArgs); } - defaultInit(cmd, expectedMessages); - cmd.execute(1); + // Disable default logic adding `--verbose` option + // to jpackage command line. + // It will affect jpackage error messages if the command line is malformed. + cmd.ignoreDefaultVerbose(true); + + // Ignore external runtime as it will interfere + // with jpackage arguments in this test. + cmd.ignoreDefaultRuntime(true); + + var validator = new JPackageOutputValidator().stderr().expectMatchingStrings(expectedMessages).match(match); + if (match) { + new JPackageOutputValidator().stdout().validateEndOfStream().applyTo(cmd); + } + + cmd.mutate(validator::applyTo).execute(1); } TestSpec mapExpectedMessages(UnaryOperator mapper) { - return new TestSpec(type, appDesc, addArgs, removeArgs, expectedMessages.stream().map(mapper).toList()); + return new TestSpec(type, appDesc, addArgs, removeArgs, expectedMessages.stream().map(mapper).toList(), match); + } + + TestSpec copyWithExpectedMessages(List expectedMessages) { + return new TestSpec(type, appDesc, addArgs, removeArgs, expectedMessages, match); } @Override @@ -383,6 +484,9 @@ public final class ErrorTest { if (!removeArgs.isEmpty()) { sb.append("args-del=").append(removeArgs).append("; "); } + if (!match) { + sb.append("find; "); + } sb.append("errors=").append(expectedMessages); return sb.toString(); } @@ -408,7 +512,7 @@ public final class ErrorTest { .error("error.no-main-class-with-main-jar", "hello.jar") .advice("error.no-main-class-with-main-jar.advice", "hello.jar"), // non-existent main jar - testSpec().addArgs("--main-jar", "non-existent.jar") + testSpec().addArgs("--main-jar", "non-existent.jar").find() .error("error.main-jar-does-not-exist", "non-existent.jar"), // non-existent runtime testSpec().addArgs("--runtime-image", "non-existent.runtime") @@ -448,7 +552,7 @@ public final class ErrorTest { createMutuallyExclusive( new ArgumentGroup("--module", "foo.bar"), new ArgumentGroup("--main-jar", "foo.jar") - ).map(TestSpec.Builder::noAppDesc).map(TestSpec.Builder::create).forEach(testCases::add); + ).map(TestSpec.Builder::noAppDesc).map(TestSpec.Builder::find).map(TestSpec.Builder::create).forEach(testCases::add); // forbidden jlink options testCases.addAll(Stream.of("--output", "--add-modules", "--module-path").map(opt -> { @@ -493,13 +597,18 @@ public final class ErrorTest { } public static Collection invalidAppVersion() { - return fromTestSpecBuilders(Stream.of( + return toTestArgs(Stream.of( // Invalid app version. Just cover all different error messages. // Extensive testing of invalid version strings is done in DottedVersionTest unit test. testSpec().addArgs("--app-version", "").error("error.version-string-empty"), testSpec().addArgs("--app-version", "1.").error("error.version-string-zero-length-component", "1."), testSpec().addArgs("--app-version", "1.b.3").error("error.version-string-invalid-component", "1.b.3", "b.3") - )); + ).map(builder -> { + if (TKit.isOSX()) { + builder.advice("error.invalid-cfbundle-version.advice"); + }; + return builder; + })); } @Test @@ -531,11 +640,14 @@ public final class ErrorTest { argsStream = Stream.concat(argsStream, Stream.of(List.of("--win-console"))); } - return fromTestSpecBuilders(argsStream.map(args -> { - return testSpec().noAppDesc().nativeType() + return toTestArgs(argsStream.map(args -> { + var builder = testSpec().noAppDesc().nativeType() .addArgs("--runtime-image", Token.JAVA_HOME.token()) - .addArgs(args) - .error("ERR_NoInstallerEntryPoint", args.getFirst()); + .addArgs(args); + if (args.contains("--add-modules")) { + builder.error("ERR_MutuallyExclusiveOptions", "--runtime-image", "--add-modules"); + } + return builder.error("ERR_NoInstallerEntryPoint", args.getFirst()); })); } @@ -556,7 +668,7 @@ public final class ErrorTest { } public static Collection testAdditionLaunchers() { - return fromTestSpecBuilders(Stream.of( + return toTestArgs(Stream.of( testSpec().addArgs("--add-launcher", Token.ADD_LAUNCHER_PROPERTY_FILE.token()) .error("error.parameter-add-launcher-malformed", Token.ADD_LAUNCHER_PROPERTY_FILE, "--add-launcher"), testSpec().removeArgs("--name").addArgs("--name", "foo", "--add-launcher", "foo=" + Token.ADD_LAUNCHER_PROPERTY_FILE.token()) @@ -564,19 +676,201 @@ public final class ErrorTest { )); } - @Test - @ParameterSupplier("invalidNames") - public static void testInvalidAppName(String name) { - testSpec().removeArgs("--name").addArgs("--name", name) - .error("ERR_InvalidAppName", adjustTextStreamVerifierArg(name)).create().test(); + @Test(ifOS = MACOS) + @ParameterSupplier + @ParameterSupplier("testMacPkgSignWithoutIdentity") + public static void testMacSignWithoutIdentity(TestSpec spec) { + // The test called JPackage Command.useToolProviderBy Default(), + // which alters global variables in the test library, + // so run the test case with a new global state to isolate the alteration of the globals. + TKit.withNewState(() -> { + testMacSignWithoutIdentityWithNewTKitState(spec); + }); + } + + private static void testMacSignWithoutIdentityWithNewTKitState(TestSpec spec) { + final Token keychainToken = spec.expectedMessages().stream().flatMap(cannedStr -> { + return Stream.of(cannedStr.args()).filter(Token.class::isInstance).map(Token.class::cast).filter(token -> { + switch (token) { + case EMPTY_KEYCHAIN, KEYCHAIN_WITH_APP_IMAGE_CERT, KEYCHAIN_WITH_PKG_CERT -> { + return true; + } + default -> { + return false; + } + } + }); + }).distinct().reduce((a, b) -> { + throw new IllegalStateException(String.format( + "Error messages %s reference multiple keychains: %s and %s", spec.expectedMessages(), a, b)); + }).orElseThrow(); + + final ResolvedKeychain keychain; + + switch (keychainToken) { + case EMPTY_KEYCHAIN -> { + keychain = new ResolvedKeychain(new KeychainWithCertsSpec(MacSign.createEmptyKeychain(), List.of())); + } + case KEYCHAIN_WITH_APP_IMAGE_CERT, KEYCHAIN_WITH_PKG_CERT -> { + CertificateType existingCertType; + switch (keychainToken) { + case KEYCHAIN_WITH_APP_IMAGE_CERT -> { + existingCertType = CertificateType.CODE_SIGN; + } + case KEYCHAIN_WITH_PKG_CERT -> { + existingCertType = CertificateType.INSTALLER; + } + default -> { + throw new AssertionError(); + } + } + + keychain = Stream.of(SignEnvMock.SingleCertificateKeychain.values()).filter(k -> { + return k.certificateType() == existingCertType; + }).findFirst().orElseThrow().keychain(); + + var script = Script.build() + // Disable the mutation making mocks "run once". + .commandMockBuilderMutator(null) + // Replace "/usr/bin/security" with the mock bound to the keychain mock. + .map(MacSignMockUtils.securityMock(SignEnvMock.VALUE)) + // Don't mock other external commands. + .use(VerbatimCommandMock.INSTANCE) + .createLoop(); + + // Create jpackage tool provider using the /usr/bin/security mock. + var jpackage = JPackageMockUtils.createJPackageToolProvider(OperatingSystem.MACOS, script); + + // Override the default jpackage tool provider with the one using the /usr/bin/security mock. + JPackageCommand.useToolProviderByDefault(jpackage); + } + default -> { + throw new AssertionError(); + } + } + + MacSign.withKeychain(_ -> { + spec.mapExpectedMessages(cannedStr -> { + return cannedStr.mapArgs(arg -> { + switch (arg) { + case StandardCertificateNamePrefix certPrefix -> { + return certPrefix.value(); + } + case Token _ -> { + return keychain.name(); + } + default -> { + return arg; + } + } + }); + }).test(Map.of(keychainToken, _ -> keychain.name())); + }, keychain); + } + + public static Collection testMacSignWithoutIdentity() { + final List testCases = new ArrayList<>(); + + final var signArgs = List.of("--mac-sign", "--mac-signing-keychain", Token.EMPTY_KEYCHAIN.token()); + final var appImageArgs = List.of("--app-image", Token.APP_IMAGE_WITH_SHORT_NAME.token()); + + for (var withAppImage : List.of(true, false)) { + var builder = testSpec(); + if (withAppImage) { + builder.noAppDesc().addArgs(appImageArgs); + } + builder.addArgs(signArgs); + + for (var type: List.of(PackageType.IMAGE, PackageType.MAC_PKG, PackageType.MAC_DMG)) { + builder.setMessages().error("error.cert.not.found", + MacSign.StandardCertificateNamePrefix.CODE_SIGN, Token.EMPTY_KEYCHAIN); + switch (type) { + case MAC_PKG -> { + // jpackage must report two errors: + // 1. It can't find signing identity to sign the app image + // 2. It can't find signing identity to sign the PKG installer + builder.error("error.cert.not.found", + MacSign.StandardCertificateNamePrefix.INSTALLER, Token.EMPTY_KEYCHAIN); + } + default -> { + // NOP + } + } + var testSpec = builder.type(type).create(); + testCases.add(testSpec); + } + } + + return toTestArgs(testCases); + } + + public static Collection testMacPkgSignWithoutIdentity() { + final List testCases = new ArrayList<>(); + + final var appImageArgs = List.of("--app-image", Token.APP_IMAGE_WITH_SHORT_NAME.token()); + + for (var withAppImage : List.of(true, false)) { + for (var existingCertType : CertificateType.values()) { + Token keychain; + StandardCertificateNamePrefix missingCertificateNamePrefix; + switch (existingCertType) { + case INSTALLER -> { + keychain = Token.KEYCHAIN_WITH_PKG_CERT; + missingCertificateNamePrefix = StandardCertificateNamePrefix.CODE_SIGN; + } + case CODE_SIGN -> { + keychain = Token.KEYCHAIN_WITH_APP_IMAGE_CERT; + missingCertificateNamePrefix = StandardCertificateNamePrefix.INSTALLER; + } + default -> { + throw new AssertionError(); + } + } + + var builder = testSpec() + .type(PackageType.MAC_PKG) + .addArgs("--mac-sign", "--mac-signing-keychain", keychain.token()) + .error("error.cert.not.found", missingCertificateNamePrefix, keychain); + + if (withAppImage) { + builder.noAppDesc().addArgs(appImageArgs); + } else { + /* + * Use shorter name to avoid + * + * [03:08:55.623] --mac-package-name is set to 'MacSignWithoutIdentityErrorTest', which is longer than 16 characters. For a better Mac experience consider shortening it. + * + * in the output. + * The same idea is behind using the "APP_IMAGE_WITH_SHORT_NAME" token + * instead of the "APP_IMAGE" for the predefined app image. + */ + builder.removeArgs("--name"); + } + + testCases.add(builder); + } + } + + return toTestArgs(testCases); } @Test @ParameterSupplier("invalidNames") - public static void testInvalidAddLauncherName(String name) { + public static void testInvalidAppName(InvalidName name) { + testSpec().removeArgs("--name").addArgs("--name", name.value()) + .error("ERR_InvalidAppName", adjustTextStreamVerifierArg(name.value())) + .match(!name.isMessingUpConsoleOutput()) + .create() + .test(); + } + + @Test + @ParameterSupplier("invalidNames") + public static void testInvalidAddLauncherName(InvalidName name) { testAdditionLaunchers(testSpec() .addArgs("--add-launcher", name + "=" + Token.ADD_LAUNCHER_PROPERTY_FILE.token()) - .error("ERR_InvalidSLName", adjustTextStreamVerifierArg(name)) + .error("ERR_InvalidSLName", adjustTextStreamVerifierArg(name.value())) + .match(!name.isMessingUpConsoleOutput()) .create()); } @@ -586,7 +880,27 @@ public final class ErrorTest { if (TKit.isWindows()) { data.add("foo\\bar"); } - return toTestArgs(data.stream()); + return toTestArgs(data.stream().map(InvalidName::new)); + } + + record InvalidName(String value) { + InvalidName { + Objects.requireNonNull(value); + } + + boolean isMessingUpConsoleOutput() { + var controlChars = "\r\n\t".codePoints().toArray(); + return value.codePoints().anyMatch(cp -> { + return IntStream.of(controlChars).anyMatch(v -> { + return v == cp; + }); + }); + } + + @Override + public String toString() { + return value; + } } public static Collection testWindows() { @@ -640,7 +954,8 @@ public final class ErrorTest { testSpec().noAppDesc().addArgs("--app-image", Token.APP_IMAGE.token()) .error("error.app-image.mac-sign.required"), testSpec().type(PackageType.MAC_PKG).addArgs("--mac-package-identifier", "#1") - .error("message.invalid-identifier", "#1"), + .error("message.invalid-identifier", "#1") + .advice("message.invalid-identifier.advice"), // Bundle for mac app store should not have runtime commands testSpec().nativeType().addArgs("--mac-app-store", "--jlink-options", "--bind-services") .error("ERR_MissingJLinkOptMacAppStore", "--strip-native-commands"), @@ -658,21 +973,62 @@ public final class ErrorTest { new ArgumentGroup("--app-version", "2.0"), new ArgumentGroup("--name", "foo"), new ArgumentGroup("--mac-app-store") - ).map(argGroup -> { - return testSpec().noAppDesc().addArgs(argGroup.asArray()).addArgs("--app-image", Token.APP_IMAGE.token()) - .error("ERR_InvalidOptionWithAppImageSigning", argGroup.arg()); - // It should bail out with the same error message regardless of `--mac-sign` option. - }).mapMulti(ErrorTest::duplicateForMacSign).toList()); + ).flatMap(argGroup -> { + var withoutSign = testSpec() + .noAppDesc() + .addArgs(argGroup.asArray()) + .addArgs("--app-image", Token.APP_IMAGE.token()); + + var withSign = withoutSign.copy().addArgs("--mac-sign"); + + withoutSign.error("error.app-image.mac-sign.required"); + + // It should bail out with the same error message regardless of `--mac-sign` option. + return Stream.of(withoutSign, withSign).map(builder -> { + return builder.error("ERR_InvalidOptionWithAppImageSigning", argGroup.arg()); + }); + + }).map(TestSpec.Builder::create).toList()); testCases.addAll(createMutuallyExclusive( new ArgumentGroup("--mac-signing-key-user-name", "foo"), new ArgumentGroup("--mac-app-image-sign-identity", "bar") ).mapMulti(ErrorTest::duplicateForMacSign).toList()); - testCases.addAll(createMutuallyExclusive( - new ArgumentGroup("--mac-signing-key-user-name", "foo"), - new ArgumentGroup("--mac-installer-sign-identity", "bar") - ).map(TestSpec.Builder::nativeType).mapMulti(ErrorTest::duplicateForMacSign).toList()); + for (var packageType : PackageType.MAC) { + testCases.addAll(createMutuallyExclusive( + new ArgumentGroup("--mac-signing-key-user-name", "foo"), + new ArgumentGroup("--mac-installer-sign-identity", "bar") + ).map(builder -> { + return builder.type(packageType); + }).mapMulti(ErrorTest::duplicateForMacSign).map(testCase -> { + if (packageType != PackageType.MAC_PKG) { + /* + * This is a bit tricky. + * The error output should also contain + * + * Error: Option [--mac-installer-sign-identity] is not valid with type [dmg]" error message. + * + * The order of errors is defined by the order of options on the command line causing them. + * If "--mac-installer-sign-identity" goes before "--mac-signing-key-user-name", the error output will be: + * + * Error: Option [--mac-installer-sign-identity] is not valid with type [dmg] + * Error: Mutually exclusive options [--mac-signing-key-user-name] and [--mac-installer-sign-identity] + * + * otherwise errors in the output will be in reverse order. + */ + var expectedMessages = new ArrayList<>(testCase.expectedMessages()); + var invalidTypeOption = makeError("ERR_InvalidTypeOption", "--mac-installer-sign-identity", packageType.getType()); + if (testCase.addArgs().indexOf("--mac-installer-sign-identity") < testCase.addArgs().indexOf("--mac-signing-key-user-name")) { + expectedMessages.addFirst(invalidTypeOption); + } else { + expectedMessages.add(invalidTypeOption); + } + testCase = testCase.copyWithExpectedMessages(expectedMessages); + } + return testCase; + }).toList()); + } return toTestArgs(testCases.stream()); } @@ -707,8 +1063,7 @@ public final class ErrorTest { final var signingId = "foo"; final List errorMessages = new ArrayList<>(); - errorMessages.add(makeError(JPackageStringBundle.MAIN.cannedFormattedString( - "error.cert.not.found", "Developer ID Application: " + signingId, ""))); + errorMessages.add(makeError("error.cert.not.found", "Developer ID Application: " + signingId, "")); final var cmd = JPackageCommand.helloAppImage() .ignoreDefaultVerbose(true) @@ -720,9 +1075,9 @@ public final class ErrorTest { errorMessages.stream() .map(CannedFormattedString::getValue) .map(TKit::assertTextStream) - .map(TKit.TextStreamVerifier::negate).forEach(cmd::validateOutput); + .map(TKit.TextStreamVerifier::negate).forEach(cmd::validateErr); } else { - cmd.validateOutput(errorMessages.toArray(CannedFormattedString[]::new)); + cmd.validateErr(errorMessages.toArray(CannedFormattedString[]::new)); } cmd.execute(1); @@ -750,12 +1105,12 @@ public final class ErrorTest { } private static void macInvalidRuntime(Consumer accumulator) { - var runtimeWithBinDirErr = makeError(JPackageStringBundle.MAIN.cannedFormattedString( + var runtimeWithBinDirErr = makeError( "error.invalid-runtime-image-bin-dir", JPackageCommand.cannedArgument(cmd -> { return Path.of(cmd.getArgumentValue("--runtime-image")); - }, Token.JAVA_HOME.token()))); - var runtimeWithBinDirErrAdvice = makeAdvice(JPackageStringBundle.MAIN.cannedFormattedString( - "error.invalid-runtime-image-bin-dir.advice", "--mac-app-store")); + }, Token.JAVA_HOME.token())); + var runtimeWithBinDirErrAdvice = makeAdvice( + "error.invalid-runtime-image-bin-dir.advice", "--mac-app-store"); Stream.of( testSpec().nativeType().addArgs("--mac-app-store", "--runtime-image", Token.JAVA_HOME.token()) @@ -795,10 +1150,10 @@ public final class ErrorTest { } private CannedFormattedString expectedErrorMsg() { - return makeError(JPackageStringBundle.MAIN.cannedFormattedString( + return makeError( "error.invalid-runtime-image-missing-file", JPackageCommand.cannedArgument(cmd -> { return Path.of(cmd.getArgumentValue("--runtime-image")); - }, runtimeDir.token()), missingFile)); + }, runtimeDir.token()), missingFile); } } @@ -869,22 +1224,14 @@ public final class ErrorTest { ); } - private static void defaultInit(JPackageCommand cmd, List expectedMessages) { - - // Disable default logic adding `--verbose` option - // to jpackage command line. - // It will affect jpackage error messages if the command line is malformed. - cmd.ignoreDefaultVerbose(true); - - // Ignore external runtime as it will interfere - // with jpackage arguments in this test. - cmd.ignoreDefaultRuntime(true); - - cmd.validateOutput(expectedMessages.toArray(CannedFormattedString[]::new)); - } - - private static Collection toTestArgs(Stream stream) { - return stream.filter(v -> { + private static Collection toTestArgs(Stream stream) { + return stream.map(v -> { + if (v instanceof TestSpec.Builder builder) { + return builder.create(); + } else { + return v; + } + }).filter(v -> { if (v instanceof TestSpec ts) { return ts.isSupported(); } else { @@ -895,8 +1242,8 @@ public final class ErrorTest { }).toList(); } - private static Collection fromTestSpecBuilders(Stream stream) { - return toTestArgs(stream.map(TestSpec.Builder::create)); + private static Collection toTestArgs(Collection col) { + return toTestArgs(col.stream()); } private static String adjustTextStreamVerifierArg(String str) { @@ -904,4 +1251,40 @@ public final class ErrorTest { } private static final Pattern LINE_SEP_REGEXP = Pattern.compile("\\R"); + + private final class SignEnvMock { + + enum SingleCertificateKeychain { + FOO(CertificateType.CODE_SIGN), + BAR(CertificateType.INSTALLER), + ; + + SingleCertificateKeychain(CertificateType certificateType) { + this.keychain = KeychainWithCertsSpec.build() + .name(name().toLowerCase() + ".keychain") + .addCert(CertificateRequest.build() + .userName(name().toLowerCase()) + .type(Objects.requireNonNull(certificateType))) + .create(); + } + + static List signingEnv() { + return Stream.of(values()).map(v -> { + return v.keychain; + }).toList(); + } + + CertificateType certificateType() { + return keychain.certificateRequests().getFirst().type(); + } + + ResolvedKeychain keychain() { + return new ResolvedKeychain(keychain).toMock(VALUE.env()); + } + + private final KeychainWithCertsSpec keychain; + } + + static final MacSignMockUtils.SignEnv VALUE = new MacSignMockUtils.SignEnv(SingleCertificateKeychain.signingEnv()); + } } diff --git a/test/jdk/tools/jpackage/share/FileAssociationsTest.java b/test/jdk/tools/jpackage/share/FileAssociationsTest.java index cd4a0491532..c9bd690d73f 100644 --- a/test/jdk/tools/jpackage/share/FileAssociationsTest.java +++ b/test/jdk/tools/jpackage/share/FileAssociationsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,12 +22,9 @@ */ import static java.util.Map.entry; -import static jdk.jpackage.test.JPackageStringBundle.MAIN; import java.nio.file.Path; import java.util.List; -import java.util.Map; -import java.util.TreeMap; import jdk.jpackage.test.Annotations.Parameter; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.FileAssociations; @@ -123,9 +120,9 @@ public class FileAssociationsTest { )); }).addInitializer(cmd -> { cmd.addArguments("--file-associations", propFile); - cmd.validateOutput( - MAIN.cannedFormattedString("error.no-content-types-for-file-association", 1), - MAIN.cannedFormattedString("error.no-content-types-for-file-association.advice", 1)); + cmd.validateErr( + JPackageCommand.makeError("error.no-content-types-for-file-association", 1), + JPackageCommand.makeAdvice("error.no-content-types-for-file-association.advice", 1)); }).run(); } @@ -141,9 +138,9 @@ public class FileAssociationsTest { )); }).addInitializer(cmd -> { cmd.addArguments("--file-associations", propFile); - cmd.validateOutput( - MAIN.cannedFormattedString("error.too-many-content-types-for-file-association", 1), - MAIN.cannedFormattedString("error.too-many-content-types-for-file-association.advice", 1)); + cmd.validateErr( + JPackageCommand.makeError("error.too-many-content-types-for-file-association", 1), + JPackageCommand.makeAdvice("error.too-many-content-types-for-file-association.advice", 1)); }).run(); } diff --git a/test/jdk/tools/jpackage/share/InstallDirTest.java b/test/jdk/tools/jpackage/share/InstallDirTest.java index db22077cd62..81d1fb3556e 100644 --- a/test/jdk/tools/jpackage/share/InstallDirTest.java +++ b/test/jdk/tools/jpackage/share/InstallDirTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 +30,6 @@ import jdk.jpackage.test.Annotations.Parameter; import jdk.jpackage.test.Annotations.ParameterSupplier; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.JPackageCommand; -import jdk.jpackage.test.JPackageStringBundle; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.PackageType; import jdk.jpackage.test.RunnablePackageTest.Action; @@ -106,7 +105,7 @@ public class InstallDirTest { cmd.saveConsoleOutput(true); }) .addBundleVerifier((cmd, result) -> { - cmd.validateOutput(JPackageStringBundle.MAIN.cannedFormattedString("error.invalid-install-dir")); + cmd.validateErr(JPackageCommand.makeError("error.invalid-install-dir")); }) .run(); } diff --git a/test/jdk/tools/jpackage/share/MainClassTest.java b/test/jdk/tools/jpackage/share/MainClassTest.java index 72e77bbbff5..ab4dfe1e1fa 100644 --- a/test/jdk/tools/jpackage/share/MainClassTest.java +++ b/test/jdk/tools/jpackage/share/MainClassTest.java @@ -91,7 +91,7 @@ public final class MainClassTest { } Script expectedErrorMessage(String key, Object... args) { - expectedErrorMessage = JPackageStringBundle.MAIN.cannedFormattedString(key, args); + expectedErrorMessage = JPackageCommand.makeError(key, args); return this; } @@ -222,7 +222,7 @@ public final class MainClassTest { if (script.expectedErrorMessage != null) { // This is the case when main class is not found nor in jar // file nor on command line. - cmd.validateOutput(script.expectedErrorMessage).execute(1); + cmd.validateErr(script.expectedErrorMessage).execute(1); return; } diff --git a/test/jdk/tools/jpackage/share/ModulePathTest.java b/test/jdk/tools/jpackage/share/ModulePathTest.java index 5e053fc0fae..583dd1eb0c4 100644 --- a/test/jdk/tools/jpackage/share/ModulePathTest.java +++ b/test/jdk/tools/jpackage/share/ModulePathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2026, 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 @@ -125,14 +125,14 @@ public final class ModulePathTest { } else { final CannedFormattedString expectedErrorMessage; if (modulePathArgs.isEmpty()) { - expectedErrorMessage = JPackageStringBundle.MAIN.cannedFormattedString( + expectedErrorMessage = JPackageCommand.makeError( "ERR_MissingArgument2", "--runtime-image", "--module-path"); } else { - expectedErrorMessage = JPackageStringBundle.MAIN.cannedFormattedString( + expectedErrorMessage = JPackageCommand.makeError( "error.no-module-in-path", appDesc.moduleName()); } - cmd.validateOutput(expectedErrorMessage).execute(1); + cmd.validateErr(expectedErrorMessage).execute(1); } } diff --git a/test/jdk/tools/jpackage/share/OutputErrorTest.java b/test/jdk/tools/jpackage/share/OutputErrorTest.java index 110e86e67d9..28dca22a244 100644 --- a/test/jdk/tools/jpackage/share/OutputErrorTest.java +++ b/test/jdk/tools/jpackage/share/OutputErrorTest.java @@ -34,7 +34,6 @@ import jdk.internal.util.OperatingSystem; import jdk.jpackage.test.Annotations.Parameter; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.JPackageCommand; -import jdk.jpackage.test.JPackageStringBundle; import jdk.jpackage.test.JavaTool; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.TKit; @@ -62,8 +61,8 @@ public final class OutputErrorTest { cmd.setFakeRuntime(); cmd.setArgumentValue("--dest", TKit.createTempDirectory("output")); cmd.removeOldOutputBundle(false); - cmd.validateOutput(JPackageCommand.makeError(JPackageStringBundle.MAIN.cannedFormattedString( - "error.output-bundle-cannot-be-overwritten", cmd.outputBundle().toAbsolutePath()))); + cmd.validateErr(JPackageCommand.makeError( + "error.output-bundle-cannot-be-overwritten", cmd.outputBundle().toAbsolutePath())); var outputBundle = cmd.outputBundle(); diff --git a/test/jdk/tools/jpackage/windows/Win8365790Test.java b/test/jdk/tools/jpackage/windows/Win8365790Test.java index 6376a16cecc..5a690ea0146 100644 --- a/test/jdk/tools/jpackage/windows/Win8365790Test.java +++ b/test/jdk/tools/jpackage/windows/Win8365790Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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.nio.file.Files; import java.nio.file.Path; import java.time.Duration; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executors; import jdk.jpackage.test.AdditionalLauncher; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.CfgFile; @@ -101,13 +103,18 @@ public class Win8365790Test { private static String runLauncher(JPackageCommand cmd, String launcherName, Path traceFile, Path outputFile) throws IOException { // Launch the specified launcher and send Ctrl+C signal to it. - Thread.ofVirtual().start(() -> { - configureAndExecute(0, Executor.of("powershell", "-NonInteractive", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "Unrestricted") - .addArgument("-File").addArgument(TEST_PS1) - .addArguments("-TimeoutSeconds", Long.toString(Duration.ofSeconds(5).getSeconds())) - .addArgument("-Executable").addArgument(cmd.appLauncherPath(launcherName)) - .dumpOutput()); - }); + + var state = TKit.state(); + + var future = CompletableFuture.runAsync(() -> { + TKit.withState(() -> { + configureAndExecute(0, Executor.of("powershell", "-NonInteractive", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "Unrestricted") + .addArgument("-File").addArgument(TEST_PS1) + .addArguments("-TimeoutSeconds", Long.toString(Duration.ofSeconds(5).getSeconds())) + .addArgument("-Executable").addArgument(cmd.appLauncherPath(launcherName)) + .dumpOutput()); + }, state); + }, Executors.newVirtualThreadPerTaskExecutor()); TKit.waitForFileCreated(traceFile, Duration.ofSeconds(20), Duration.ofSeconds(2)); @@ -118,6 +125,10 @@ public class Win8365790Test { } TKit.assertFileExists(outputFile); + + // Call join() on the future to make the test fail if the future execution resulted in a throw. + future.join(); + return Files.readString(outputFile); } diff --git a/test/jdk/tools/jpackage/windows/WinOSConditionTest.java b/test/jdk/tools/jpackage/windows/WinOSConditionTest.java index 6a78f78e804..68f39426c32 100644 --- a/test/jdk/tools/jpackage/windows/WinOSConditionTest.java +++ b/test/jdk/tools/jpackage/windows/WinOSConditionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,6 +23,9 @@ import java.io.IOException; import java.nio.file.Files; +import java.util.Iterator; +import java.util.function.Consumer; +import java.util.stream.Stream; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.PackageTest; @@ -74,10 +77,13 @@ public class WinOSConditionTest { // MSI error code 1603 is generic. // Dig into the last msi log file for log messages specific to failed condition. try (final var lines = cmd.winMsiLogFileContents().orElseThrow()) { - TKit.TextStreamVerifier.group() - .add(TKit.assertTextStream("Doing action: LaunchConditions").predicate(String::endsWith)) - .add(TKit.assertTextStream("Not supported on this version of Windows").predicate(String::endsWith)) - .create().accept(lines.iterator()); + Stream.of( + "Doing action: LaunchConditions", + "Not supported on this version of Windows" + ).map(TKit::assertTextStream).map(v -> { + Consumer> consumer = v.predicate(String::endsWith)::apply; + return consumer; + }).reduce(Consumer::andThen).orElseThrow().accept(lines.iterator()); } }) .createMsiLog(true) diff --git a/test/jdk/tools/jpackage/windows/WinResourceTest.java b/test/jdk/tools/jpackage/windows/WinResourceTest.java index b22501ac6cc..6327b94b420 100644 --- a/test/jdk/tools/jpackage/windows/WinResourceTest.java +++ b/test/jdk/tools/jpackage/windows/WinResourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,17 +21,20 @@ * questions. */ +import static jdk.jpackage.test.WindowsHelper.getWixTypeFromVerboseJPackageOutput; +import static jdk.jpackage.test.WindowsHelper.WixType.WIX3; + import java.io.IOException; import java.nio.file.Path; -import jdk.jpackage.test.TKit; +import java.util.List; +import jdk.jpackage.test.Annotations.Parameters; +import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.CannedFormattedString; +import jdk.jpackage.test.JPackageOutputValidator; +import jdk.jpackage.test.JPackageStringBundle; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.PackageType; -import jdk.jpackage.test.JPackageCommand; -import jdk.jpackage.test.Annotations.Test; -import jdk.jpackage.test.Annotations.Parameters; -import java.util.List; -import static jdk.jpackage.test.WindowsHelper.WixType.WIX3; -import static jdk.jpackage.test.WindowsHelper.getWixTypeFromVerboseJPackageOutput; +import jdk.jpackage.test.TKit; /** * Test --resource-dir option. The test should set --resource-dir to point to @@ -52,7 +55,7 @@ import static jdk.jpackage.test.WindowsHelper.getWixTypeFromVerboseJPackageOutpu public class WinResourceTest { - public WinResourceTest(String wixSource, String expectedLogMessage) { + public WinResourceTest(String wixSource, CannedFormattedString expectedLogMessage) { this.wixSource = wixSource; this.expectedLogMessage = expectedLogMessage; } @@ -60,8 +63,10 @@ public class WinResourceTest { @Parameters public static List data() { return List.of(new Object[][]{ - {"main.wxs", "Using custom package resource [Main WiX project file]"}, - {"overrides.wxi", "Using custom package resource [Overrides WiX project file]"}, + {"main.wxs", JPackageStringBundle.MAIN.cannedFormattedString( + "message.using-custom-resource", "[Main WiX project file]", "main.wxs")}, + {"overrides.wxi", JPackageStringBundle.MAIN.cannedFormattedString( + "message.using-custom-resource", "[Overrides WiX project file]", "overrides.wxi")}, }); } @@ -81,6 +86,12 @@ public class WinResourceTest { // Create invalid WiX source file in a resource dir. TKit.createTextFile(resourceDir.resolve(wixSource), List.of( "any string that is an invalid WiX source file")); + + new JPackageOutputValidator() + .matchTimestamps() + .stripTimestamps() + .expectMatchingStrings(expectedLogMessage) + .applyTo(cmd); }) .addBundleVerifier((cmd, result) -> { // Assert jpackage picked custom main.wxs and failed as expected by @@ -92,17 +103,12 @@ public class WinResourceTest { expectedWixErrorMsg = "error WIX0104: Not a valid source file"; } - TKit.assertTextStream(expectedLogMessage) - .predicate(String::startsWith) - .apply(JPackageCommand.stripTimestamps( - result.getOutput().stream()).iterator()); - TKit.assertTextStream(expectedWixErrorMsg) - .apply(result.getOutput()); + TKit.assertTextStream(expectedWixErrorMsg).apply(result.stderr()); }) .setExpectedExitCode(1) .run(); } final String wixSource; - final String expectedLogMessage; + final CannedFormattedString expectedLogMessage; } diff --git a/test/jdk/tools/sincechecker/modules/java.naming/JavaNamingCheckSince.java b/test/jdk/tools/sincechecker/modules/java.naming/JavaNamingCheckSince.java new file mode 100644 index 00000000000..6d99ab9b727 --- /dev/null +++ b/test/jdk/tools/sincechecker/modules/java.naming/JavaNamingCheckSince.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2026, 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 Test for "@since" in java.naming module + * @library /test/lib /test/jdk/tools/sincechecker + * @run main SinceChecker java.naming + */ diff --git a/test/langtools/TEST.ROOT b/test/langtools/TEST.ROOT index 14636716882..434cf91b0ec 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=8.1+1 +requiredVersion=8.2.1+1 # Use new module options useNewOptions=true diff --git a/test/langtools/jdk/javadoc/doclet/testSpecTag/TestSpecTag.java b/test/langtools/jdk/javadoc/doclet/testSpecTag/TestSpecTag.java index e914f8022fd..1c3e8306d7b 100644 --- a/test/langtools/jdk/javadoc/doclet/testSpecTag/TestSpecTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSpecTag/TestSpecTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2026, 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 6251738 8226279 8297802 8305407 + * @bug 6251738 8226279 8297802 8305407 8309748 * @summary JDK-8226279 javadoc should support a new at-spec tag * @library /tools/lib ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -343,16 +343,15 @@ public class TestSpecTag extends JavadocTester { checkOutput("external-specs.html", true, """ -
    \ - \ - \ -
    + +
    +
    +
    External Specifications
    +
    Specification
    @@ -369,7 +368,25 @@ public class TestSpecTag extends JavadocTester { -
    """); +
    """, + """ + """); } @Test diff --git a/test/langtools/lib/combo/tools/javac/combo/JavacTemplateTestBase.java b/test/langtools/lib/combo/tools/javac/combo/JavacTemplateTestBase.java index dd3f5639c21..ed5936210a8 100644 --- a/test/langtools/lib/combo/tools/javac/combo/JavacTemplateTestBase.java +++ b/test/langtools/lib/combo/tools/javac/combo/JavacTemplateTestBase.java @@ -237,19 +237,17 @@ public abstract class JavacTemplateTestBase { if (classpaths.size() > 0) fm.setLocation(StandardLocation.CLASS_PATH, classpaths); JavacTask ct = (JavacTask) systemJavaCompiler.getTask(null, fm, diags, compileOptions, null, files); + File destDir; if (generate) { - File destDir = new File(root, Integer.toString(counter.incrementAndGet())); + destDir = new File(root, Integer.toString(counter.incrementAndGet())); // @@@ Assert that this directory didn't exist, or start counter at max+1 destDir.mkdirs(); fm.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(destDir)); - ct.generate(); - return destDir; - } - else { - ct.call(); - // Failed result will show up in diags - return nullDir; + } else { + destDir = nullDir; } + ct.generate(); // throws ISE if javac crashes + return destDir; } } diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/TypeAnnotationsPositionsOnRecords.java b/test/langtools/tools/javac/annotations/typeAnnotations/TypeAnnotationsPositionsOnRecords.java index dfa266ef035..b8ee32fcacd 100644 --- a/test/langtools/tools/javac/annotations/typeAnnotations/TypeAnnotationsPositionsOnRecords.java +++ b/test/langtools/tools/javac/annotations/typeAnnotations/TypeAnnotationsPositionsOnRecords.java @@ -78,6 +78,17 @@ public class TypeAnnotationsPositionsOnRecords { record Record6(String t1, @Nullable String t2) { public Record6 {} } + + class Test2 { + @Target(ElementType.TYPE_USE) + @Retention(RetentionPolicy.RUNTIME) + public @interface Anno {} + + class Foo {} + record Record7(Test2.@Anno Foo foo) { + public Record7 {} // compact constructor + } + } """; public static void main(String... args) throws Exception { @@ -100,6 +111,8 @@ public class TypeAnnotationsPositionsOnRecords { "Record5.class").toUri()), 1); checkClassFile(new File(Paths.get(System.getProperty("user.dir"), "Record6.class").toUri()), 1); + checkClassFile(new File(Paths.get(System.getProperty("user.dir"), + "Test2$Record7.class").toUri()), 0); } void compileTestClass() throws Exception { @@ -110,6 +123,7 @@ public class TypeAnnotationsPositionsOnRecords { void checkClassFile(final File cfile, int... taPositions) throws Exception { ClassModel classFile = ClassFile.of().parse(cfile.toPath()); + System.err.println("-----------loading " + cfile.getPath()); int accessorPos = 0; int checkedAccessors = 0; for (MethodModel method : classFile.methods()) { diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables-old.out b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables-old.out new file mode 100644 index 00000000000..2b447e4a842 --- /dev/null +++ b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables-old.out @@ -0,0 +1,7 @@ +VarVariables.java:34:36: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.deconstruction.patterns), 19, 21 +VarVariables.java:18:9: compiler.err.annotation.type.not.applicable +VarVariables.java:24:14: compiler.err.annotation.type.not.applicable +VarVariables.java:27:14: compiler.err.annotation.type.not.applicable +VarVariables.java:32:14: compiler.err.annotation.type.not.applicable +VarVariables.java:36:37: compiler.err.annotation.type.not.applicable +6 errors diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables.java b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables.java new file mode 100644 index 00000000000..a47b8b31da7 --- /dev/null +++ b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables.java @@ -0,0 +1,52 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8371683 + * @summary Test that type annotations cannot appears on 'var' variables + * @compile/fail/ref=VarVariables.out -XDrawDiagnostics VarVariables.java + * @compile/fail/ref=VarVariables-old.out --release 19 -XDrawDiagnostics -XDshould-stop.at=FLOW VarVariables.java + */ + +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; +import java.util.List; +import java.util.function.Consumer; + +class VarVariables { + private void test(Object o) { + @DA var v1 = ""; + @DTA var v2 = ""; + @TA var v3 = ""; + Consumer c1 = (@DA var v) -> {}; + Consumer c2 = (@DTA var v) -> {}; + Consumer c3 = (@TA var v) -> {}; + for (@DA var v = ""; !v.isEmpty(); ) {} + for (@DTA var v = ""; !v.isEmpty(); ) {} + for (@TA var v = ""; !v.isEmpty(); ) {} + for (@DA var v : List.of("")) {} + for (@DTA var v : List.of("")) {} + for (@TA var v : List.of("")) {} + try (@DA var v = open()) { + } catch (Exception ex) {} + try (@DTA var v = open()) { + } catch (Exception ex) {} + try (@TA var v = open()) { + } catch (Exception ex) {} + boolean b1 = o instanceof R(@DA var v); + boolean b2 = o instanceof R(@DTA var v); + boolean b3 = o instanceof R(@TA var v); + } + + private AutoCloseable open() { + return null; + } + record R(String str) {} + + @Target(ElementType.TYPE_USE) + @interface TA { } + + @Target({ElementType.TYPE_USE, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) + @interface DTA { } + + @Target({ElementType.LOCAL_VARIABLE, ElementType.PARAMETER}) + @interface DA { } +} diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables.out b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables.out new file mode 100644 index 00000000000..7f055040855 --- /dev/null +++ b/test/langtools/tools/javac/annotations/typeAnnotations/failures/target/VarVariables.out @@ -0,0 +1,7 @@ +VarVariables.java:18:9: compiler.err.annotation.type.not.applicable +VarVariables.java:21:32: compiler.err.annotation.type.not.applicable +VarVariables.java:24:14: compiler.err.annotation.type.not.applicable +VarVariables.java:27:14: compiler.err.annotation.type.not.applicable +VarVariables.java:32:14: compiler.err.annotation.type.not.applicable +VarVariables.java:36:37: compiler.err.annotation.type.not.applicable +6 errors diff --git a/test/langtools/tools/javac/api/TestGetScopeResult.java b/test/langtools/tools/javac/api/TestGetScopeResult.java index 533c640096e..adae4ccdb5a 100644 --- a/test/langtools/tools/javac/api/TestGetScopeResult.java +++ b/test/langtools/tools/javac/api/TestGetScopeResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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 8205418 8207229 8207230 8230847 8245786 8247334 8248641 8240658 8246774 8274347 8347989 + * @bug 8205418 8207229 8207230 8230847 8245786 8247334 8248641 8240658 8246774 8274347 8347989 8308637 * @summary Test the outcomes from Trees.getScope * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.comp @@ -100,6 +100,7 @@ public class TestGetScopeResult { new TestGetScopeResult().testNestedSwitchExpression(); new TestGetScopeResult().testModuleImportScope(); new TestGetScopeResult().testClassTypeSetInEnterGetScope(); + new TestGetScopeResult().testNotYetAttributedGetScope(); } public void run() throws IOException { @@ -966,6 +967,110 @@ public class TestGetScopeResult { } } + void testNotYetAttributedGetScope() throws IOException { //JDK-8308637 + JavacTool c = JavacTool.create(); + record TestCase(String code, List> expected) {} + TestCase[] cases = new TestCase[] { + new TestCase(""" + class B { + public class Test {} + void m() { + this.new Test() {}; + } + } + """, + List.of(List.of("super:java.lang.Object", + "this:B"))), + new TestCase(""" + class B { + public class Test {} + void m() { + int local1 = 0; + new Test() {}; + this.new Test() {}; + class Inner { + class InnerNested { + void m() { + int local2 = 0; + new Test() {}; + B.this.new Test() {}; + } + } + } + } + } + """, + List.of( + List.of("local1:int", + "super:java.lang.Object", + "this:B"), + List.of(":", + "local1:int", + "super:java.lang.Object", + "this:B"), + List.of("local2:int", + "super:java.lang.Object", + "this:Inner.InnerNested", + "super:java.lang.Object", + "this:Inner", + "Inner:Inner", + ":", + ":", + "local1:int", + "super:java.lang.Object", + "this:B"), + List.of(":", + "local2:int", + "super:java.lang.Object", + "this:Inner.InnerNested", + "super:java.lang.Object", + "this:Inner", + "Inner:Inner", + ":", + ":", + "local1:int", + "super:java.lang.Object", + "this:B") + )), + }; + try (StandardJavaFileManager fm = c.getStandardFileManager(null, null, null)) { + for (TestCase tc : cases) { + JavaFileObject input = + SimpleJavaFileObject.forSource(URI.create("myfo:///Test.java"), tc.code()); + JavacTask t = (JavacTask) c.getTask(null, fm, null, null, null, + List.of(input)); + Trees trees = Trees.instance(t); + List> actual = new ArrayList<>(); + + t.addTaskListener(new TaskListener() { + @Override + public void finished(TaskEvent e) { + if (e.getKind() == TaskEvent.Kind.ENTER) { + new TreePathScanner() { + @Override + public Void visitIdentifier(IdentifierTree node, Void p) { + if (node.getName().contentEquals("Test")) { + Scope scope = trees.getScope(getCurrentPath()); + actual.add(dumpScope(scope)); + } + return super.visitIdentifier(node, p); + } + }.scan(e.getCompilationUnit(), null); + } + } + + }); + + t.analyze(); + + if (!tc.expected().equals(actual)) { + throw new AssertionError("Unexpected Scope content: " + actual + + ", expected: " + tc.expected()); + } + } + } + } + private List dumpScope(Scope scope) { List content = new ArrayList<>(); while (scope.getEnclosingClass() != null) { diff --git a/test/langtools/tools/javac/lambda/LambdaSerializedClassCastException.java b/test/langtools/tools/javac/lambda/LambdaSerializedClassCastException.java new file mode 100644 index 00000000000..f63f4b64e79 --- /dev/null +++ b/test/langtools/tools/javac/lambda/LambdaSerializedClassCastException.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024, 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 8208752 + * @summary NPE generating serializedLambdaName for nested lambda + * @compile/ref=LambdaSerializedClassCastException.out -XDrawDiagnostics --debug=dumpLambdaDeserializationStats LambdaSerializedClassCastException.java + * @run main LambdaSerializedClassCastException + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.function.Function; + +public class LambdaSerializedClassCastException { + + public static void main(String[] args) throws Exception { + + Function lambda1 = + (Function & Serializable) Object::toString; + Function lambda2 = + (Function & Serializable) Object::toString; + + Function deserial = serialDeserial(lambda2); + deserial.apply(new Object()); + } + + @SuppressWarnings("unchecked") + static T serialDeserial(T object) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ObjectOutputStream oos = new ObjectOutputStream(baos)) { + oos.writeObject(object); + } + try (ObjectInputStream ois = + new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) { + return (T) ois.readObject(); + } + } +} diff --git a/test/langtools/tools/javac/lambda/LambdaSerializedClassCastException.out b/test/langtools/tools/javac/lambda/LambdaSerializedClassCastException.out new file mode 100644 index 00000000000..4ad61e5e00e --- /dev/null +++ b/test/langtools/tools/javac/lambda/LambdaSerializedClassCastException.out @@ -0,0 +1,2 @@ +LambdaSerializedClassCastException.java:44:59: compiler.note.lambda.deserialization.stat: java/util/function/Function, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, toString, ()Ljava/lang/String;, (Ljava/lang/String;)Ljava/lang/String; +LambdaSerializedClassCastException.java:46:59: compiler.note.lambda.deserialization.stat: java/util/function/Function, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, toString, ()Ljava/lang/String;, (Ljava/lang/Object;)Ljava/lang/String; diff --git a/test/langtools/tools/javac/lambda/SerializableObjectMethodReferencesOnInterfaces.java b/test/langtools/tools/javac/lambda/SerializableObjectMethodReferencesOnInterfaces.java new file mode 100644 index 00000000000..18d732fb0dd --- /dev/null +++ b/test/langtools/tools/javac/lambda/SerializableObjectMethodReferencesOnInterfaces.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2026, Google LLC 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 8374654 8208752 + * @summary test lambda deserialization for Object method references on interfaces + * @compile/ref=SerializableObjectMethodReferencesOnInterfaces.out -XDrawDiagnostics --debug=dumpLambdaDeserializationStats SerializableObjectMethodReferencesOnInterfaces.java + * @run main SerializableObjectMethodReferencesOnInterfaces + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +public class SerializableObjectMethodReferencesOnInterfaces { + + public static void main(String[] args) throws Exception { + new Test().run(); + } + + static class Test { + interface I1 extends Serializable {} + + interface I2 extends I1 { + @Override + public int hashCode(); + } + + interface F extends Serializable { + R apply(T t); + } + + enum E { + ONE + } + + void run() throws Exception { + F f1 = I1::hashCode; + F f2 = I2::hashCode; + F f3 = E::hashCode; + F f4 = Object::hashCode; + + serialDeserial(f1).apply(new I1() {}); + serialDeserial(f2).apply(new I2() {}); + serialDeserial(f3).apply(E.ONE); + serialDeserial(f4).apply(new Object()); + } + } + + @SuppressWarnings("unchecked") + static T serialDeserial(T object) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ObjectOutputStream oos = new ObjectOutputStream(baos)) { + oos.writeObject(object); + } + try (ObjectInputStream ois = + new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) { + return (T) ois.readObject(); + } + } +} diff --git a/test/langtools/tools/javac/lambda/SerializableObjectMethodReferencesOnInterfaces.out b/test/langtools/tools/javac/lambda/SerializableObjectMethodReferencesOnInterfaces.out new file mode 100644 index 00000000000..657235aa6fe --- /dev/null +++ b/test/langtools/tools/javac/lambda/SerializableObjectMethodReferencesOnInterfaces.out @@ -0,0 +1,4 @@ +SerializableObjectMethodReferencesOnInterfaces.java:61:33: compiler.note.lambda.deserialization.stat: SerializableObjectMethodReferencesOnInterfaces$Test$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, hashCode, ()I, (LSerializableObjectMethodReferencesOnInterfaces$Test$I1;)Ljava/lang/Integer; +SerializableObjectMethodReferencesOnInterfaces.java:62:33: compiler.note.lambda.deserialization.stat: SerializableObjectMethodReferencesOnInterfaces$Test$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, hashCode, ()I, (LSerializableObjectMethodReferencesOnInterfaces$Test$I2;)Ljava/lang/Integer; +SerializableObjectMethodReferencesOnInterfaces.java:63:32: compiler.note.lambda.deserialization.stat: SerializableObjectMethodReferencesOnInterfaces$Test$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Enum, hashCode, ()I, (LSerializableObjectMethodReferencesOnInterfaces$Test$E;)Ljava/lang/Integer; +SerializableObjectMethodReferencesOnInterfaces.java:64:37: compiler.note.lambda.deserialization.stat: SerializableObjectMethodReferencesOnInterfaces$Test$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, hashCode, ()I, (Ljava/lang/Object;)Ljava/lang/Integer; diff --git a/test/langtools/tools/javac/lambda/SerializableObjectMethods.out b/test/langtools/tools/javac/lambda/SerializableObjectMethods.out index d03cc145794..56caaabc6de 100644 --- a/test/langtools/tools/javac/lambda/SerializableObjectMethods.out +++ b/test/langtools/tools/javac/lambda/SerializableObjectMethods.out @@ -1,4 +1,4 @@ -SerializableObjectMethods.java:59:35: compiler.note.lambda.deserialization.stat: SerializableObjectMethods$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, hashCode, ()I -SerializableObjectMethods.java:60:35: compiler.note.lambda.deserialization.stat: SerializableObjectMethods$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 9, SerializableObjectMethods$I2, hashCode, ()I +SerializableObjectMethods.java:59:35: compiler.note.lambda.deserialization.stat: SerializableObjectMethods$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, hashCode, ()I, (LSerializableObjectMethods$I1;)Ljava/lang/Integer; +SerializableObjectMethods.java:60:35: compiler.note.lambda.deserialization.stat: SerializableObjectMethods$F, apply, (Ljava/lang/Object;)Ljava/lang/Object;, 5, java/lang/Object, hashCode, ()I, (LSerializableObjectMethods$I2;)Ljava/lang/Integer; - compiler.note.unchecked.filename: SerializableObjectMethods.java - compiler.note.unchecked.recompile diff --git a/test/langtools/tools/javac/launcher/SourceLauncherTest.java b/test/langtools/tools/javac/launcher/SourceLauncherTest.java index 37d50674855..c3c8fb19a1b 100644 --- a/test/langtools/tools/javac/launcher/SourceLauncherTest.java +++ b/test/langtools/tools/javac/launcher/SourceLauncherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, 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,7 @@ /* * @test * @bug 8192920 8204588 8246774 8248843 8268869 8235876 8328339 8335896 8344706 - * 8362237 + * 8362237 8376534 * @summary Test source launcher * @library /tools/lib * @modules jdk.compiler/com.sun.tools.javac.api @@ -890,6 +890,57 @@ public class SourceLauncherTest extends TestRunner { "correct\n"); } + @Test + public void testInheritedMain(Path base) throws IOException { + tb.writeJavaFiles(base, + """ + class Sub extends Super {} + """, + """ + class Super { + void main() { + System.out.println(getClass().getName()); + } + } + """); + testSuccess(base.resolve("Sub.java"), + "Sub\n"); + } + + @Test + public void testInheritedMainFromAbstract(Path base) throws IOException { + tb.writeJavaFiles(base, + """ + class Sub extends Super {} + """, + """ + abstract class Super { + void main() { + System.out.println(getClass().getName()); + } + } + """); + testSuccess(base.resolve("Sub.java"), + "Sub\n"); + } + + @Test + public void testInheritedMainFromInterface(Path base) throws IOException { + tb.writeJavaFiles(base, + """ + public class Sub implements Super {} + """, + """ + public interface Super { + default void main() { + System.out.println(getClass().getName()); + } + } + """); + testSuccess(base.resolve("Sub.java"), + "Sub\n"); + } + Result run(Path file, List runtimeArgs, List appArgs) { List args = new ArrayList<>(); args.add(file.toString()); diff --git a/test/langtools/tools/javac/lvti/VarAccessibility.java b/test/langtools/tools/javac/lvti/VarAccessibility.java new file mode 100644 index 00000000000..d39d706faea --- /dev/null +++ b/test/langtools/tools/javac/lvti/VarAccessibility.java @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2026, 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 Check behavior of var when the inferred type is inaccessible + * @library /tools/lib + * @modules java.logging + * java.sql + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.util + * @build toolbox.ToolBox toolbox.JavacTask + * @run junit VarAccessibility + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.Objects; + +import org.junit.jupiter.api.Test; + +import toolbox.JavacTask; +import toolbox.JavaTask; +import toolbox.Task; +import toolbox.ToolBox; + +public class VarAccessibility { + + private static final ToolBox tb = new ToolBox(); + + @Test + public void testInaccessibleInferredTypeLocalVariable() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + public class API { + public static PackagePrivate get() { + return new PackagePrivate(); + } + } + """, + """ + package p1; + class PackagePrivate { + public String toString() { + return "pass"; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + var v = API.get(); + System.out.println(v); + } + } + """); + + Files.createDirectories(classes); + + new JavacTask(tb) + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.SUCCESS) + .writeAll(); + + var out = new JavaTask(tb) + .classpath(classes.toString()) + .className("p2.Test") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + var expectedOut = List.of("pass"); + + if (!Objects.equals(expectedOut, out)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + out); + + } + } + + @Test + public void testInaccessibleInferredTypeForEachIterable() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + import java.util.List; + public class API { + public static Iterable get() { + return List.of(new PackagePrivate()); + } + } + """, + """ + package p1; + class PackagePrivate { + public String toString() { + return "pass"; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + for (var v : API.get()) { + System.out.println(v); + } + } + } + """); + + Files.createDirectories(classes); + + var out = new JavacTask(tb) + .options("-XDrawDiagnostics") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + var expectedOut = List.of( + "Test.java:5:22: compiler.err.not.def.public.cant.access: p1.PackagePrivate, p1", + "1 error"); + + if (!Objects.equals(expectedOut, out)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + out); + + } + } + + @Test + public void testInaccessibleInferredTypeForEachArray() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + import java.util.List; + public class API { + public static PackagePrivate[] get() { + return new PackagePrivate[] {new PackagePrivate()}; + } + } + """, + """ + package p1; + class PackagePrivate { + public String toString() { + return "pass"; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + for (var v : API.get()) { + System.out.println(v); + } + } + } + """); + + Files.createDirectories(classes); + + new JavacTask(tb) + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.SUCCESS) + .writeAll(); + + var out = new JavaTask(tb) + .classpath(classes.toString()) + .className("p2.Test") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + var expectedOut = List.of("pass"); + + if (!Objects.equals(expectedOut, out)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + out); + + } + } + + @Test + public void testInaccessibleInferredTypeLambda() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + import java.util.function.Consumer; + public class API { + public static void run(Consumer c) { + c.accept(new PackagePrivate()); + } + } + """, + """ + package p1; + class PackagePrivate { + public String toString() { + return "pass"; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + API.run(v -> System.out.println(v)); + API.run((var v) -> System.out.println(v)); + } + } + """); + + Files.createDirectories(classes); + + var out = new JavacTask(tb) + .options("-XDrawDiagnostics") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + var expectedOut = List.of( + "Test.java:5:17: compiler.err.not.def.public.cant.access: p1.PackagePrivate, p1", + "Test.java:6:17: compiler.err.not.def.public.cant.access: p1.PackagePrivate, p1", + "2 errors"); + + if (!Objects.equals(expectedOut, out)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + out); + + } + } + + @Test + public void testInaccessibleInferredTypeCanUse() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + public class API { + public static PackagePrivate get() { + return null; + } + } + """, + """ + package p1; + class PackagePrivate { + public String toString() { + return "pass"; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + var v = API.get(); + System.out.println(v.toString()); + } + } + """); + + Files.createDirectories(classes); + + List log = new JavacTask(tb) + .options("-XDrawDiagnostics") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + var expectedOut = List.of( + "Test.java:6:29: compiler.err.not.def.access.class.intf.cant.access: toString(), p1.PackagePrivate", + "1 error" + ); + + if (!Objects.equals(expectedOut, log)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + log); + + } + } + + @Test + public void testInaccessibleInferredBindingPattern() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + public record API(PackagePrivate p) { + public static API create() { + return new API(new PackagePrivate()); + } + } + """, + """ + package p1; + class PackagePrivate { + public String toString() { + return "pass"; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + Object o = API.create(); + if (o instanceof API(var v)) { + System.out.println(v.toString()); + } + } + } + """); + + Files.createDirectories(classes); + + List log = new JavacTask(tb) + .options("-XDrawDiagnostics") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + var expectedOut = List.of( + "Test.java:7:33: compiler.err.not.def.access.class.intf.cant.access: toString(), p1.PackagePrivate", + "1 error" + ); + + if (!Objects.equals(expectedOut, log)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + log); + + } + } +} diff --git a/test/langtools/tools/javac/lvti/VarWarnings.java b/test/langtools/tools/javac/lvti/VarWarnings.java new file mode 100644 index 00000000000..a1fbadc0393 --- /dev/null +++ b/test/langtools/tools/javac/lvti/VarWarnings.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2026, 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 Check behavior of warnings related to var + * @library /tools/lib + * @modules java.logging + * java.sql + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.util + * @build toolbox.ToolBox toolbox.JavacTask + * @run junit VarWarnings + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.Objects; + +import org.junit.jupiter.api.Test; + +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.ToolBox; + +public class VarWarnings { + + private static final ToolBox tb = new ToolBox(); + + @Test + public void testDeprecationWarning() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + import java.util.List; + import java.util.function.Consumer; + @SuppressWarnings("deprecation") + public class API { + public static DeprOutter get() { + return new DeprOutter<>(); + } + public static Iterable> getIterable() { + return null; + } + public static void run(Consumer> task) { + } + } + """, + """ + package p1; + @Deprecated + public class DeprInner { + } + """, + """ + package p1; + @Deprecated + public class DeprOutter { + public T get() { + return null; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + var v1 = API.get(); + API.run(v -> v.get().toString()); + API.run((var v) -> v.get().toString()); + for (var v2 : API.getIterable()) {} + } + } + """); + + Files.createDirectories(classes); + + var out = new JavacTask(tb) + .options("-XDrawDiagnostics", + "-Werror", + "-Xlint:deprecation") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.SUCCESS) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + var expectedOut = List.of(""); + + if (!Objects.equals(expectedOut, out)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + out); + + } + } + + @Test + public void testRawTypeWarning() throws Exception { + Path base = Paths.get("."); + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + """ + package p1; + import java.util.List; + import java.util.function.Consumer; + @SuppressWarnings("rawtypes") + public class API { + public static RawOutter get() { + return new RawOutter<>(); + } + public static Iterable> getIterable() { + return null; + } + public static void run(Consumer> task) { + } + } + """, + """ + package p1; + public class RawInner { + } + """, + """ + package p1; + public class RawOutter { + public T get() { + return null; + } + } + """, + """ + package p2; + import p1.API; + public class Test { + public static void main(String... args) { + var v1 = API.get(); + API.run(v -> v.get().toString()); + API.run((var v) -> v.get().toString()); + for (var v2 : API.getIterable()) {} + } + } + """); + + Files.createDirectories(classes); + + var out = new JavacTask(tb) + .options("-XDrawDiagnostics", + "-Werror", + "-Xlint:rawtypes") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run(Task.Expect.SUCCESS) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + var expectedOut = List.of(""); + + if (!Objects.equals(expectedOut, out)) { + throw new AssertionError("Incorrect Output, expected: " + expectedOut + + ", actual: " + out); + + } + } + +} diff --git a/test/langtools/tools/javac/parser/DeclarationEndPositions.java b/test/langtools/tools/javac/parser/DeclarationEndPositions.java index c61a92e80cd..fe4ca8c1652 100644 --- a/test/langtools/tools/javac/parser/DeclarationEndPositions.java +++ b/test/langtools/tools/javac/parser/DeclarationEndPositions.java @@ -86,10 +86,12 @@ public class DeclarationEndPositions { // For variable declarations using "var", verify the "var" position if (tree instanceof JCVariableDecl varDecl && varDecl.declaredUsingVar()) { - int vpos = varDecl.typePos; - if (!input.substring(vpos).startsWith("var")) { + int varStart = varDecl.vartype.getStartPosition(); + int varEnd = varDecl.vartype.getEndPosition(); + + if (!input.substring(varStart, varEnd).startsWith("var")) { throw new AssertionError(String.format( - "wrong %s pos %d for \"%s\" in \"%s\"", "var", vpos, tree, input)); + "wrong %s start pos %d end pos %d for \"%s\" in \"%s\"", "var", varStart, varEnd, tree, input)); } } } diff --git a/test/langtools/tools/javac/parser/JavacParserTest.java b/test/langtools/tools/javac/parser/JavacParserTest.java index 25aeb19f1bb..0bce1ef017c 100644 --- a/test/langtools/tools/javac/parser/JavacParserTest.java +++ b/test/langtools/tools/javac/parser/JavacParserTest.java @@ -87,7 +87,9 @@ import javax.tools.ToolProvider; import com.sun.source.tree.CaseTree; import com.sun.source.tree.DefaultCaseLabelTree; +import com.sun.source.tree.IdentifierTree; import com.sun.source.tree.ModuleTree; +import com.sun.source.tree.VarTypeTree; import com.sun.source.util.TreePathScanner; import com.sun.tools.javac.api.JavacTaskPool; import com.sun.tools.javac.api.JavacTaskPool.Worker; @@ -1070,8 +1072,8 @@ public class JavacParserTest extends TestCase { VariableTree stmt2 = (VariableTree) method.getBody().getStatements().get(1); Tree v1Type = stmt1.getType(); Tree v2Type = stmt2.getType(); - assertEquals("Implicit type for v1 is not correct: ", Kind.PRIMITIVE_TYPE, v1Type.getKind()); - assertEquals("Implicit type for v2 is not correct: ", Kind.PRIMITIVE_TYPE, v2Type.getKind()); + assertEquals("Implicit type for v1 is not correct: ", Kind.VAR_TYPE, v1Type.getKind()); + assertEquals("Implicit type for v2 is not correct: ", Kind.VAR_TYPE, v2Type.getKind()); } @Test @@ -3151,6 +3153,37 @@ public class JavacParserTest extends TestCase { codes); } + @Test + void testVarPositions() throws IOException { + String code = """ + public class Test { + void t() { + var v = + } + } + """; + DiagnosticCollector coll = + new DiagnosticCollector<>(); + JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, fm, coll, + null, + null, Arrays.asList(new MyFileObject(code))); + Trees trees = Trees.instance(ct); + SourcePositions sp = trees.getSourcePositions(); + CompilationUnitTree cut = ct.parse().iterator().next(); + new TreeScanner() { + @Override + public Void visitVarType(VarTypeTree node, Void p) { + long start = sp.getStartPosition(cut, node); + long end = sp.getEndPosition(cut, node); + String text = code.substring((int) start, (int) end); + assertEquals("var start pos", + "var", + text); + return null; + } + }; + } + void run(String[] args) throws Exception { int passed = 0, failed = 0; final Pattern p = (args != null && args.length > 0) diff --git a/test/langtools/tools/javac/patterns/BindingPatternVarTypeModel.java b/test/langtools/tools/javac/patterns/BindingPatternVarTypeModel.java index e63cbeb2008..01d742eb9e3 100644 --- a/test/langtools/tools/javac/patterns/BindingPatternVarTypeModel.java +++ b/test/langtools/tools/javac/patterns/BindingPatternVarTypeModel.java @@ -83,7 +83,7 @@ public class BindingPatternVarTypeModel { new TreeScanner() { @Override public Void visitBindingPattern(BindingPatternTree node, Void p) { - if (node.getVariable().getType().getKind() != Tree.Kind.PRIMITIVE_TYPE) { + if (node.getVariable().getType().getKind() != Tree.Kind.VAR_TYPE) { throw new AssertionError("Unexpected type for var: " + node.getVariable().getType().getKind() + ":" + node.getVariable().getType()); diff --git a/test/langtools/tools/javac/patterns/InstanceOfModelTest.java b/test/langtools/tools/javac/patterns/InstanceOfModelTest.java index b756c9263bd..288abec9659 100644 --- a/test/langtools/tools/javac/patterns/InstanceOfModelTest.java +++ b/test/langtools/tools/javac/patterns/InstanceOfModelTest.java @@ -79,7 +79,7 @@ public class InstanceOfModelTest { List expectedInstanceOf = List.of( "null:R", "R r:R", - "R(int v):null" + "R(var v):null" ); if (!Objects.equals(expectedInstanceOf, instanceOf)) { diff --git a/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsReproducibleTest.java b/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsReproducibleTest.java index ee3bb8c897d..334db17fe39 100644 --- a/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsReproducibleTest.java +++ b/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsReproducibleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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,6 +41,7 @@ import org.junit.jupiter.api.Test; * @summary verifies that the ct.sym file created by build.tools.symbolgenerator.CreateSymbols * is reproducible * @library /test/lib + * @requires os.arch != "s390x" * @modules java.compiler * jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.jvm diff --git a/test/langtools/tools/javac/records/RecordCompilationTests.java b/test/langtools/tools/javac/records/RecordCompilationTests.java index a8384ba4692..48b5cdd8588 100644 --- a/test/langtools/tools/javac/records/RecordCompilationTests.java +++ b/test/langtools/tools/javac/records/RecordCompilationTests.java @@ -2169,4 +2169,56 @@ class RecordCompilationTests extends CompilationTestCase { """ ); } + + @Test + void testDeprecatedJavadoc() { + String[] previousOptions = getCompileOptions(); + try { + setCompileOptions(new String[] {"-Xlint:deprecation"}); + assertOKWithWarning("compiler.warn.has.been.deprecated", + """ + record R( + /** + * @deprecated + */ + @Deprecated + int i + ) {} + class Client { + R r; + int j = r.i(); + } + """ + ); + assertOKWithWarning("compiler.warn.has.been.deprecated", + """ + record R( + @Deprecated + int i + ) {} + class Client { + R r; + int j = r.i(); + } + """ + ); + // javadoc tag only has no effect + assertOK( + """ + record R( + /** + * @deprecated + */ + int i + ) {} + class Client { + R r; + int j = r.i(); + } + """ + ); + } finally { + setCompileOptions(previousOptions); + } + } } diff --git a/test/langtools/tools/javac/tree/VarTree.java b/test/langtools/tools/javac/tree/VarTree.java index 6efd080bd4f..70caf66862e 100644 --- a/test/langtools/tools/javac/tree/VarTree.java +++ b/test/langtools/tools/javac/tree/VarTree.java @@ -52,27 +52,27 @@ public class VarTree { public static void main(String... args) throws Exception { VarTree test = new VarTree(); test.run("|var testVar = 0;| ", - "int testVar = 0"); + "var testVar = 0"); test.run("|var testVar = 0;| undef undef;", - "int testVar = 0"); + "var testVar = 0"); test.run("|final var testVar = 0;| ", - "final int testVar = 0"); + "final var testVar = 0"); test.run("for (|var testVar| : java.util.Arrays.asList(0, 1)) {}", - "java.lang.Integer testVar"); + "var testVar"); test.run("for (|final var testVar| : java.util.Arrays.asList(0, 1)) {}", - "final java.lang.Integer testVar"); + "final var testVar"); test.run("java.util.function.Consumer c = |testVar| -> {};", - "java.lang.String testVar"); + "/*missing*/ testVar"); //TODO: is the /*missing*/ here ideal? test.run("java.util.function.Consumer c = (|testVar|) -> {};", - "java.lang.String testVar"); + "/*missing*/ testVar"); //TODO: is the /*missing*/ here ideal? test.run("java.util.function.Consumer c = (|var testVar|) -> {};", - "java.lang.String testVar"); + "var testVar"); test.run("java.util.function.Consumer c = (|final var testVar|) -> {};", - "final java.lang.String testVar"); + "final var testVar"); test.run("record Rec(int x) { }; switch (null) { case Rec(|var testVar|) -> {} default -> {} };", - "int testVar"); + "var testVar"); test.run("record Rec(int x) { }; switch (null) { case Rec(|final var testVar|) -> {} default -> {} };", - "final int testVar"); + "final var testVar"); } void run(String code, String expected) throws IOException { @@ -136,11 +136,13 @@ public class VarTree { throw new AssertionError("Unexpected span: " + snip); } - int typeStart = (int) trees.getSourcePositions().getStartPosition(cut, node.getType()); - int typeEnd = (int) trees.getSourcePositions().getEndPosition(cut, node.getType()); + if (node.getType() != null) { + int typeStart = (int) trees.getSourcePositions().getStartPosition(cut, node.getType()); + int typeEnd = (int) trees.getSourcePositions().getEndPosition(cut, node.getType()); - if (typeStart != (-1) && typeEnd != (-1)) { - throw new AssertionError("Unexpected type position: " + typeStart + ", " + typeEnd); + if (typeStart + 3 != typeEnd) { + throw new AssertionError("Unexpected type position: " + typeStart + ", " + typeEnd); + } } found[0] = true; diff --git a/test/langtools/tools/javac/tree/VarWarnPosition.java b/test/langtools/tools/javac/tree/VarWarnPosition.java index f1d5f4346d0..5cdfa41d6ef 100644 --- a/test/langtools/tools/javac/tree/VarWarnPosition.java +++ b/test/langtools/tools/javac/tree/VarWarnPosition.java @@ -25,6 +25,9 @@ public class VarWarnPosition { // Test 4 Consumer c3 = (final var d) -> { }; + + // Test 5 + var d = deprecatedList.get(0); } } diff --git a/test/langtools/tools/javac/tree/VarWarnPosition.out b/test/langtools/tools/javac/tree/VarWarnPosition.out index 87a4ca3a1fd..0bd92acd035 100644 --- a/test/langtools/tools/javac/tree/VarWarnPosition.out +++ b/test/langtools/tools/javac/tree/VarWarnPosition.out @@ -1,8 +1,4 @@ -VarWarnPosition.java:18:14: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package VarWarnPosition.java:21:18: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package -VarWarnPosition.java:21:28: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package VarWarnPosition.java:24:18: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package -VarWarnPosition.java:24:30: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package VarWarnPosition.java:27:18: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package -VarWarnPosition.java:27:36: compiler.warn.has.been.deprecated: Depr, compiler.misc.unnamed.package -7 warnings +3 warnings \ No newline at end of file diff --git a/test/lib-test/TEST.ROOT b/test/lib-test/TEST.ROOT index ebdf3f1a334..f23d38c1e66 100644 --- a/test/lib-test/TEST.ROOT +++ b/test/lib-test/TEST.ROOT @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2026, 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 @@ keys=randomness # Minimum jtreg version -requiredVersion=8.1+1 +requiredVersion=8.2.1+1 # Allow querying of various System properties in @requires clauses requires.extraPropDefns = ../jtreg-ext/requires/VMProps.java diff --git a/test/lib-test/jdk/test/whitebox/vm_flags/Uint64Test.java b/test/lib-test/jdk/test/whitebox/vm_flags/Uint64Test.java index 64dd7544ebb..bf8bf0104ac 100644 --- a/test/lib-test/jdk/test/whitebox/vm_flags/Uint64Test.java +++ b/test/lib-test/jdk/test/whitebox/vm_flags/Uint64Test.java @@ -35,7 +35,7 @@ */ public class Uint64Test { - private static final String FLAG_NAME = "MaxRAM"; + private static final String FLAG_NAME = "StringDeduplicationHashSeed"; private static final Long[] TESTS = {0L, 100L, (long) Integer.MAX_VALUE, -1L, Long.MAX_VALUE, Long.MIN_VALUE}; diff --git a/test/lib/jdk/test/lib/SA/SATestUtils.java b/test/lib/jdk/test/lib/SA/SATestUtils.java index 63f522b3d62..50f5d71f1f1 100644 --- a/test/lib/jdk/test/lib/SA/SATestUtils.java +++ b/test/lib/jdk/test/lib/SA/SATestUtils.java @@ -40,6 +40,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.concurrent.TimeUnit; import java.util.List; +import java.util.NoSuchElementException; public class SATestUtils { /** @@ -334,6 +335,9 @@ public class SATestUtils { String file = buildID.substring(2); debuginfoPath = Path.of("/usr/lib/debug/.build_id", dir, file + ".debug"); exists = Files.exists(debuginfoPath); + } catch (NoSuchElementException _) { + // return null if vDSO not found. + return null; } } return exists ? debuginfoPath.toString() : null; diff --git a/test/lib/jdk/test/lib/apps/LingeredApp.java b/test/lib/jdk/test/lib/apps/LingeredApp.java index 13008e68c54..9a8395d7879 100644 --- a/test/lib/jdk/test/lib/apps/LingeredApp.java +++ b/test/lib/jdk/test/lib/apps/LingeredApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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,6 +46,7 @@ import java.util.UUID; import jdk.test.lib.JDKToolFinder; import jdk.test.lib.Utils; import jdk.test.lib.process.OutputBuffer; +import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.StreamPumper; import jdk.test.lib.util.CoreUtils; @@ -122,6 +123,12 @@ public class LingeredApp { this.forceCrash = forceCrash; } + private static Runnable crasher; + + public static void setCrasher(Runnable runnable) { + crasher = runnable; + } + native private static int crash(); /** @@ -445,6 +452,7 @@ public class LingeredApp { long t1 = System.currentTimeMillis(); theApp.createLock(); try { + ProcessTools.checkDuplicateAgentOpts(jvmOpts); theApp.runAppExactJvmOpts(jvmOpts); theApp.waitAppReadyOrCrashed(); } catch (Exception ex) { @@ -628,8 +636,12 @@ public class LingeredApp { synchronized(steadyStateObj) { startSteadyStateThread(steadyStateObj); if (forceCrash) { - System.loadLibrary("LingeredApp"); // location of native crash() method - crash(); + if (crasher == null) { + System.loadLibrary("LingeredApp"); // location of native crash() method + crash(); + } else { + crasher.run(); + } } while (Files.exists(path)) { // Touch the lock to indicate our readiness diff --git a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java index 8e28ea08365..a9ae57bca71 100644 --- a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java +++ b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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 @@ -107,7 +107,6 @@ public abstract class CommandLineOptionTest { List finalOptions = new ArrayList<>(); if (addTestVMOptions) { Collections.addAll(finalOptions, InputArguments.getVmInputArgs()); - Collections.addAll(finalOptions, Utils.getTestJavaOpts()); } Collections.addAll(finalOptions, options); finalOptions.add("-version"); diff --git a/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java index 7d03268cac4..fe9c1de9f30 100644 --- a/test/lib/jdk/test/lib/process/ProcessTools.java +++ b/test/lib/jdk/test/lib/process/ProcessTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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 @@ -43,8 +43,10 @@ import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; @@ -448,7 +450,7 @@ public final class ProcessTools { private static ProcessBuilder createJavaProcessBuilder(String... command) { String javapath = JDKToolFinder.getJDKTool("java"); - ArrayList args = new ArrayList<>(); + List args = new ArrayList<>(); args.add(javapath); String noCPString = System.getProperty("test.noclasspath", "false"); @@ -465,6 +467,8 @@ public final class ProcessTools { Collections.addAll(args, command); } + checkDuplicateAgentOpts(args); + // Reporting StringBuilder cmdLine = new StringBuilder(); for (String cmd : args) @@ -479,6 +483,30 @@ public final class ProcessTools { return pb; } + // 8377729: Check for duplicate VM JVMTI agent options, as it may + // cause test to fail + public static void checkDuplicateAgentOpts(List args) { + if (args == null || args.isEmpty()) { + return; + } + + Set seen = new HashSet<>(); + List dupArgs = args.stream() + .filter(arg -> (arg.startsWith("-agent") + || arg.startsWith("-javaagent:")) + && !seen.add(arg)) + .collect(Collectors.toList()); + + if (!dupArgs.isEmpty()) { + System.err.println("WARNING: Duplicate JVMTI agent options may" + + " cause test to fail:\n" + dupArgs); + } + } + + public static void checkDuplicateAgentOpts(String[] args) { + checkDuplicateAgentOpts(Arrays.asList(args)); + } + private static void printStack(Thread t, StackTraceElement[] stack) { System.out.println("\t" + t + " stack: (length = " + stack.length + ")"); if (t != null) { diff --git a/test/lib/jdk/test/lib/util/ZipUtils.java b/test/lib/jdk/test/lib/util/ZipUtils.java new file mode 100644 index 00000000000..a1568e51cc1 --- /dev/null +++ b/test/lib/jdk/test/lib/util/ZipUtils.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2023, 2026, 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 jdk.test.lib.util; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.FileChannel; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.EnumSet; +import java.util.HexFormat; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +/** + * This class consists exclusively of static utility methods that are useful + * for creating and manipulating ZIP files. + */ +public final class ZipUtils { + // Some ZipFile constants for manipulating the 'End of central directory record' (END header) + private static final int ENDHDR = ZipFile.ENDHDR; // End of central directory record size + private static final int ENDSIZ = ZipFile.ENDSIZ; // Offset of CEN size field within ENDHDR + private static final int ENDOFF = ZipFile.ENDOFF; // Offset of CEN offset field within ENDHDR + // Expected message when CEN size does not match file size + public static final String INVALID_CEN_BAD_SIZE = "invalid END header (bad central directory size)"; + // Expected message when CEN offset is too large + public static final String INVALID_CEN_BAD_OFFSET = "invalid END header (bad central directory offset)"; + // Expected message when CEN size is too large + public static final String INVALID_CEN_SIZE_TOO_LARGE = "invalid END header (central directory size too large)"; + // Expected message when total entry count is too large + public static final String INVALID_BAD_ENTRY_COUNT = "invalid END header (total entries count too large)"; + + private ZipUtils() { } + + /** + * Create an ZIP file with a single entry, then modify the CEN size + * in the 'End of central directory record' (END header) to the given size. + * + * The CEN is optionally "inflated" with trailing zero bytes such that + * its actual size matches the one stated in the END header. + * + * The CEN offset is optiontially adjusted by the given amount + * + * The resulting ZIP is technically not valid, but it does allow us + * to test that large or invalid CEN sizes are rejected + * @param cenSize the CEN size to put in the END record + * @param inflateCen if true, zero-pad the CEN to the desired size + * @param cenOffAdjust Adjust the CEN offset field of the END record with this amount + * @throws IOException if an error occurs + */ + public static Path zipWithModifiedEndRecord(int cenSize, + boolean inflateCen, + int cenOffAdjust, + Path zip) throws IOException { + // A byte buffer for reading the END + ByteBuffer buffer = ByteBuffer.wrap(templateZip()).order(ByteOrder.LITTLE_ENDIAN); + + // Offset of the END header + int endOffset = buffer.limit() - ENDHDR; + + // Modify the CEN size + int sizeOffset = endOffset + ENDSIZ; + int currentCenSize = buffer.getInt(sizeOffset); + buffer.putInt(sizeOffset, cenSize); + + // Optionally modify the CEN offset + if (cenOffAdjust != 0) { + int offOffset = endOffset + ENDOFF; + int currentCenOff = buffer.getInt(offOffset); + buffer.putInt(offOffset, currentCenOff + cenOffAdjust); + } + // When creating a sparse file, the file must not already exit + Files.deleteIfExists(zip); + + // Open a FileChannel for writing a sparse file + EnumSet options = EnumSet.of(StandardOpenOption.CREATE_NEW, + StandardOpenOption.WRITE, + StandardOpenOption.SPARSE); + + try (FileChannel channel = FileChannel.open(zip, options)) { + // Write everything up to END + channel.write(buffer.slice(0, buffer.limit() - ENDHDR)); + if (inflateCen) { + // Inject "empty bytes" to make the actual CEN size match the END + int injectBytes = cenSize - currentCenSize; + channel.position(channel.position() + injectBytes); + } + // Write the modified END + channel.write(buffer.slice(buffer.limit() - ENDHDR, ENDHDR)); + } + return zip; + } + + /** + * Create a small Zip64 ZIP file, then modify the Zip64 END header + * with a possibly very large total entry count + * + * @param zip file to write to + * @param totalEntries the number of entries wanted in the Zip64 END header + * @return the modified ZIP file + * @throws IOException if an unexpeced IO error occurs + */ + public static Path zip64WithModifiedTotalEntries(Path zip, long totalEntries) throws IOException { + /** + * A small ZIP using the ZIP64 format. + * + * ZIP created using: "echo -n hello | zip zip64.zip -" + * Hex encoded using: "cat zip64.zip | xxd -ps" + * + * The file has the following structure: + * + * 0000 LOCAL HEADER #1 04034B50 + * 0004 Extract Zip Spec 2D '4.5' + * 0005 Extract OS 00 'MS-DOS' + * 0006 General Purpose Flag 0000 + * 0008 Compression Method 0000 'Stored' + * 000A Last Mod Time 5947AB78 'Mon Oct 7 21:27:48 2024' + * 000E CRC 363A3020 + * 0012 Compressed Length FFFFFFFF + * 0016 Uncompressed Length FFFFFFFF + * 001A Filename Length 0001 + * 001C Extra Length 0014 + * 001E Filename '-' + * 001F Extra ID #0001 0001 'ZIP64' + * 0021 Length 0010 + * 0023 Uncompressed Size 0000000000000006 + * 002B Compressed Size 0000000000000006 + * 0033 PAYLOAD hello. + * + * 0039 CENTRAL HEADER #1 02014B50 + * 003D Created Zip Spec 1E '3.0' + * 003E Created OS 03 'Unix' + * 003F Extract Zip Spec 2D '4.5' + * 0040 Extract OS 00 'MS-DOS' + * 0041 General Purpose Flag 0000 + * 0043 Compression Method 0000 'Stored' + * 0045 Last Mod Time 5947AB78 'Mon Oct 7 21:27:48 2024' + * 0049 CRC 363A3020 + * 004D Compressed Length 00000006 + * 0051 Uncompressed Length FFFFFFFF + * 0055 Filename Length 0001 + * 0057 Extra Length 000C + * 0059 Comment Length 0000 + * 005B Disk Start 0000 + * 005D Int File Attributes 0001 + * [Bit 0] 1 Text Data + * 005F Ext File Attributes 11B00000 + * 0063 Local Header Offset 00000000 + * 0067 Filename '-' + * 0068 Extra ID #0001 0001 'ZIP64' + * 006A Length 0008 + * 006C Uncompressed Size 0000000000000006 + * + * 0074 ZIP64 END CENTRAL DIR 06064B50 + * RECORD + * 0078 Size of record 000000000000002C + * 0080 Created Zip Spec 1E '3.0' + * 0081 Created OS 03 'Unix' + * 0082 Extract Zip Spec 2D '4.5' + * 0083 Extract OS 00 'MS-DOS' + * 0084 Number of this disk 00000000 + * 0088 Central Dir Disk no 00000000 + * 008C Entries in this disk 0000000000000001 + * 0094 Total Entries 0000000000000001 + * 009C Size of Central Dir 000000000000003B + * 00A4 Offset to Central dir 0000000000000039 + * + * 00AC ZIP64 END CENTRAL DIR 07064B50 + * LOCATOR + * 00B0 Central Dir Disk no 00000000 + * 00B4 Offset to Central dir 0000000000000074 + * 00BC Total no of Disks 00000001 + * + * 00C0 END CENTRAL HEADER 06054B50 + * 00C4 Number of this disk 0000 + * 00C6 Central Dir Disk no 0000 + * 00C8 Entries in this disk 0001 + * 00CA Total Entries 0001 + * 00CC Size of Central Dir 0000003B + * 00D0 Offset to Central Dir FFFFFFFF + * 00D4 Comment Length 0000 + */ + + byte[] zipBytes = HexFormat.of().parseHex(""" + 504b03042d000000000078ab475920303a36ffffffffffffffff01001400 + 2d010010000600000000000000060000000000000068656c6c6f0a504b01 + 021e032d000000000078ab475920303a3606000000ffffffff01000c0000 + 00000001000000b011000000002d010008000600000000000000504b0606 + 2c000000000000001e032d00000000000000000001000000000000000100 + 0000000000003b000000000000003900000000000000504b060700000000 + 740000000000000001000000504b050600000000010001003b000000ffff + ffff0000 + """.replaceAll("\n","")); + + // Buffer to manipulate the above ZIP + ByteBuffer buf = ByteBuffer.wrap(zipBytes).order(ByteOrder.LITTLE_ENDIAN); + // Offset of the 'total entries' in the 'ZIP64 END CENTRAL DIR' record + // Update ZIP64 entry count to a value which cannot possibly fit in the small CEN + buf.putLong(0x94, totalEntries); + // The corresponding END field needs the ZIP64 magic value + buf.putShort(0xCA, (short) 0xFFFF); + // Write the ZIP to disk + Files.write(zip, zipBytes); + return zip; + } + + /** + * Produce a byte array of a ZIP with a single entry + * + * @throws IOException if an error occurs + */ + private static byte[] templateZip() throws IOException { + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + try (ZipOutputStream zo = new ZipOutputStream(bout)) { + ZipEntry entry = new ZipEntry("duke.txt"); + zo.putNextEntry(entry); + zo.write("duke".getBytes(StandardCharsets.UTF_8)); + } + return bout.toByteArray(); + } +} diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index cc570caef7c..c915cee41b0 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2026, 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 @@ -799,8 +799,6 @@ public class WhiteBox { public native boolean cdsMemoryMappingFailed(); public native boolean isSharingEnabled(); public native boolean isSharedClass(Class c); - public native boolean areSharedStringsMapped(); - public native boolean isSharedInternedString(String s); public native boolean isCDSIncluded(); public native boolean isJFRIncluded(); public native boolean isDTraceIncluded(); diff --git a/test/micro/org/openjdk/bench/java/lang/FPComparison.java b/test/micro/org/openjdk/bench/java/lang/FPComparison.java index e6b2ab2d39a..63cbb6db911 100644 --- a/test/micro/org/openjdk/bench/java/lang/FPComparison.java +++ b/test/micro/org/openjdk/bench/java/lang/FPComparison.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2026, 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,7 +32,7 @@ import java.util.random.RandomGenerator; @OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Thread) @Warmup(iterations = 5, time = 1) -@Measurement(iterations = 5, time = 1) +@Measurement(iterations = 5, time = 5) @Fork(3) public class FPComparison { static final int INVOCATIONS = 1024; @@ -75,331 +75,673 @@ public class FPComparison { } } + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + static int callI() { + return 1; + } + @Benchmark - public void isNanFloat() { + public void cMoveIsNanFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = Float.isNaN(f1[i]) ? 1 : 2; } } @Benchmark - public void isNanDouble() { + public void cMoveIsNanDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = Double.isNaN(d1[i]) ? 1 : 2; } } @Benchmark - public void isInfiniteFloat() { + public void cMoveIsInfiniteFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = Float.isInfinite(f1[i]) ? 1 : 2; } } @Benchmark - public void isInfiniteDouble() { + public void cMoveIsInfiniteDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = Double.isInfinite(d1[i]) ? 1 : 2; } } @Benchmark - public void isFiniteFloat() { + public void cMoveIsFiniteFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = Float.isFinite(f1[i]) ? 1 : 2; } } @Benchmark - public void isFiniteDouble() { + public void cMoveIsFiniteDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = Double.isFinite(d1[i]) ? 1 : 2; } } @Benchmark - public void equalFloat() { + public void cMoveEqualFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (f1[i] == f2[i]) ? 1 : 2; } } @Benchmark - public void equalDouble() { + public void cMoveEqualDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (d1[i] == d2[i]) ? 1 : 2; } } @Benchmark - public void lessFloat() { + public void cMoveLessFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (f1[i] < f2[i]) ? 1 : 2; } } @Benchmark - public void lessDouble() { + public void cMoveLessDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (d1[i] < d2[i]) ? 1 : 2; } } @Benchmark - public void lessEqualFloat() { + public void cMoveLessEqualFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (f1[i] <= f2[i]) ? 1 : 2; } } @Benchmark - public void lessEqualDouble() { + public void cMoveLessEqualDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (d1[i] <= d2[i]) ? 1 : 2; } } @Benchmark - public void greaterFloat() { + public void cMoveGreaterFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (f1[i] > f2[i]) ? 1 : 2; } } @Benchmark - public void greaterDouble() { + public void cMoveGreaterDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (d1[i] > d2[i]) ? 1 : 2; } } @Benchmark - public void greaterEqualFloat() { + public void cMoveGreaterEqualFloat() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (f1[i] >= f2[i]) ? 1 : 2; } } @Benchmark - public void greaterEqualDouble() { + public void cMoveGreaterEqualDouble() { for (int i = 0; i < INVOCATIONS; i++) { res[i] = (d1[i] >= d2[i]) ? 1 : 2; } } - // --------- result: long --------- + @Benchmark + public void branchIsNanFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = Float.isNaN(f1[i]) ? callI() : 2; + } + } @Benchmark - public void equalFloatResLong() { + public void branchIsNanDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = Double.isNaN(d1[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchIsInfiniteFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = Float.isInfinite(f1[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchIsInfiniteDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = Double.isInfinite(d1[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchIsFiniteFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = Float.isFinite(f1[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchIsFiniteDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = Double.isFinite(d1[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchEqualFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (f1[i] == f2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchEqualDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (d1[i] == d2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchLessFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (f1[i] < f2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchLessDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (d1[i] < d2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchLessEqualFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (f1[i] <= f2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchLessEqualDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (d1[i] <= d2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchGreaterFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (f1[i] > f2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchGreaterDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (d1[i] > d2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchGreaterEqualFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (f1[i] >= f2[i]) ? callI() : 2; + } + } + + @Benchmark + public void branchGreaterEqualDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + res[i] = (d1[i] >= d2[i]) ? callI() : 2; + } + } + + // --------- result: long --------- + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + static long callL() { + return Long.MAX_VALUE; + } + + @Benchmark + public void cMoveEqualFloatResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (f1[i] == f2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void equalDoubleResLong() { + public void cMoveEqualDoubleResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (d1[i] == d2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void lessFloatResLong() { + public void cMoveLessFloatResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (f1[i] < f2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void lessDoubleResLong() { + public void cMoveLessDoubleResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (d1[i] < d2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void lessEqualFloatResLong() { + public void cMoveLessEqualFloatResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (f1[i] <= f2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void lessEqualDoubleResLong() { + public void cMoveLessEqualDoubleResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (d1[i] <= d2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void greaterFloatResLong() { + public void cMoveGreaterFloatResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (f1[i] > f2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void greaterDoubleResLong() { + public void cMoveGreaterDoubleResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (d1[i] > d2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void greaterEqualFloatResLong() { + public void cMoveGreaterEqualFloatResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (f1[i] >= f2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } @Benchmark - public void greaterEqualDoubleResLong() { + public void cMoveGreaterEqualDoubleResLong() { for (int i = 0; i < INVOCATIONS; i++) { resLong[i] = (d1[i] >= d2[i]) ? Long.MAX_VALUE : Long.MIN_VALUE; } } - // --------- result: float --------- + @Benchmark + public void branchEqualFloatResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (f1[i] == f2[i]) ? callL() : Long.MIN_VALUE; + } + } @Benchmark - public void equalFloatResFloat() { + public void branchEqualDoubleResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (d1[i] == d2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchLessFloatResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (f1[i] < f2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchLessDoubleResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (d1[i] < d2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchLessEqualFloatResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (f1[i] <= f2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchLessEqualDoubleResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (d1[i] <= d2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchGreaterFloatResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (f1[i] > f2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchGreaterDoubleResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (d1[i] > d2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchGreaterEqualFloatResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (f1[i] >= f2[i]) ? callL() : Long.MIN_VALUE; + } + } + + @Benchmark + public void branchGreaterEqualDoubleResLong() { + for (int i = 0; i < INVOCATIONS; i++) { + resLong[i] = (d1[i] >= d2[i]) ? callL() : Long.MIN_VALUE; + } + } + + // --------- result: float --------- + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + static float callF() { + return 0.1f; + } + + @Benchmark + public void cMoveEqualFloatResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (f1[i] == f2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void equalDoubleResFloat() { + public void cMoveEqualDoubleResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (d1[i] == d2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void lessFloatResFloat() { + public void cMoveLessFloatResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (f1[i] < f2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void lessDoubleResFloat() { + public void cMoveLessDoubleResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (d1[i] < d2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void lessEqualFloatResFloat() { + public void cMoveLessEqualFloatResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (f1[i] <= f2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void lessEqualDoubleResFloat() { + public void cMoveLessEqualDoubleResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (d1[i] <= d2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void greaterFloatResFloat() { + public void cMoveGreaterFloatResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (f1[i] > f2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void greaterDoubleResFloat() { + public void cMoveGreaterDoubleResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (d1[i] > d2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void greaterEqualFloatResFloat() { + public void cMoveGreaterEqualFloatResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (f1[i] >= f2[i]) ? 0.1f : 0.2f; } } @Benchmark - public void greaterEqualDoubleResFloat() { + public void cMoveGreaterEqualDoubleResFloat() { for (int i = 0; i < INVOCATIONS; i++) { resFloat[i] = (d1[i] >= d2[i]) ? 0.1f : 0.2f; } } - // --------- result: double --------- + @Benchmark + public void branchEqualFloatResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (f1[i] == f2[i]) ? callF() : 0.2f; + } + } @Benchmark - public void equalFloatResDouble() { + public void branchEqualDoubleResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (d1[i] == d2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchLessFloatResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (f1[i] < f2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchLessDoubleResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (d1[i] < d2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchLessEqualFloatResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (f1[i] <= f2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchLessEqualDoubleResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (d1[i] <= d2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchGreaterFloatResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (f1[i] > f2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchGreaterDoubleResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (d1[i] > d2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchGreaterEqualFloatResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (f1[i] >= f2[i]) ? callF() : 0.2f; + } + } + + @Benchmark + public void branchGreaterEqualDoubleResFloat() { + for (int i = 0; i < INVOCATIONS; i++) { + resFloat[i] = (d1[i] >= d2[i]) ? callF() : 0.2f; + } + } + + // --------- result: double --------- + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + static double callD() { + return 0.1; + } + + @Benchmark + public void cMoveEqualFloatResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (f1[i] == f2[i]) ? 0.1 : 0.2; } } @Benchmark - public void equalDoubleResDouble() { + public void cMoveEqualDoubleResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (d1[i] == d2[i]) ? 0.1 : 0.2; } } @Benchmark - public void lessFloatResDouble() { + public void cMoveLessFloatResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (f1[i] < f2[i]) ? 0.1 : 0.2; } } @Benchmark - public void lessDoubleResDouble() { + public void cMoveLessDoubleResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (d1[i] < d2[i]) ? 0.1 : 0.2; } } @Benchmark - public void lessEqualFloatResDouble() { + public void cMoveLessEqualFloatResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (f1[i] <= f2[i]) ? 0.1 : 0.2; } } @Benchmark - public void lessEqualDoubleResDouble() { + public void cMoveLessEqualDoubleResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (d1[i] <= d2[i]) ? 0.1 : 0.2; } } @Benchmark - public void greaterFloatResDouble() { + public void cMoveGreaterFloatResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (f1[i] > f2[i]) ? 0.1 : 0.2; } } @Benchmark - public void greaterDoubleResDouble() { + public void cMoveGreaterDoubleResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (d1[i] > d2[i]) ? 0.1 : 0.2; } } @Benchmark - public void greaterEqualFloatResDouble() { + public void cMoveGreaterEqualFloatResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (f1[i] >= f2[i]) ? 0.1 : 0.2; } } @Benchmark - public void greaterEqualDoubleResDouble() { + public void cMoveGreaterEqualDoubleResDouble() { for (int i = 0; i < INVOCATIONS; i++) { resDouble[i] = (d1[i] >= d2[i]) ? 0.1 : 0.2; } } + + @Benchmark + public void branchEqualFloatResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (f1[i] == f2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchEqualDoubleResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (d1[i] == d2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchLessFloatResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (f1[i] < f2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchLessDoubleResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (d1[i] < d2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchLessEqualFloatResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (f1[i] <= f2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchLessEqualDoubleResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (d1[i] <= d2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchGreaterFloatResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (f1[i] > f2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchGreaterDoubleResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (d1[i] > d2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchGreaterEqualFloatResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (f1[i] >= f2[i]) ? callD() : 0.2; + } + } + + @Benchmark + public void branchGreaterEqualDoubleResDouble() { + for (int i = 0; i < INVOCATIONS; i++) { + resDouble[i] = (d1[i] >= d2[i]) ? callD() : 0.2; + } + } } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/vector/ArrayMismatchBenchmark.java b/test/micro/org/openjdk/bench/jdk/incubator/vector/ArrayMismatchBenchmark.java index 2d327958594..876ed43b32e 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/vector/ArrayMismatchBenchmark.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/vector/ArrayMismatchBenchmark.java @@ -26,6 +26,7 @@ package org.openjdk.bench.jdk.incubator.vector; import jdk.incubator.vector.ByteVector; +import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.DoubleVector; import jdk.incubator.vector.IntVector; import jdk.incubator.vector.LongVector; @@ -59,6 +60,9 @@ public class ArrayMismatchBenchmark { byte[] byteData1; byte[] byteData2; + short[] shortData1; + short[] shortData2; + int[] intData1; int[] intData2; @@ -69,6 +73,7 @@ public class ArrayMismatchBenchmark { double[] doubleData2; static final VectorSpecies BYTE_SPECIES_PREFERRED = ByteVector.SPECIES_PREFERRED; + static final VectorSpecies SHORT_SPECIES_PREFERRED = ShortVector.SPECIES_PREFERRED; static final VectorSpecies INT_SPECIES_PREFERRED = IntVector.SPECIES_PREFERRED; static final VectorSpecies FLOAT_SPECIES_PREFERRED = DoubleVector.SPECIES_PREFERRED; static final VectorSpecies LONG_SPECIES_PREFERRED = LongVector.SPECIES_PREFERRED; @@ -89,6 +94,16 @@ public class ArrayMismatchBenchmark { System.arraycopy(commonBytes, 0, byteData1, 0, common); System.arraycopy(commonBytes, 0, byteData2, 0, common); + } else if (params.getBenchmark().endsWith("Short")) { + shortData1 = new short[size]; + shortData2 = new short[size]; + Arrays.fill(shortData1, (short)random.nextInt()); + Arrays.fill(shortData2, (short)random.nextInt()); + + short[] commonShorts = new short[common]; + Arrays.fill(commonShorts, (short)random.nextInt()); + System.arraycopy(commonShorts, 0, shortData1, 0, common); + System.arraycopy(commonShorts, 0, shortData2, 0, common); } else if (params.getBenchmark().endsWith("Int")) { intData1 = random.ints(size).toArray(); intData2 = random.ints(size).toArray(); @@ -141,6 +156,34 @@ public class ArrayMismatchBenchmark { return mismatch; } + @Benchmark + public int mismatchIntrinsicShort() { + return Arrays.mismatch(shortData1, shortData2); + } + + @Benchmark + public int mismatchVectorShort() { + int length = Math.min(shortData1.length, shortData2.length); + int index = 0; + for (; index < SHORT_SPECIES_PREFERRED.loopBound(length); index += SHORT_SPECIES_PREFERRED.length()) { + ShortVector vector1 = ShortVector.fromArray(SHORT_SPECIES_PREFERRED, shortData1, index); + ShortVector vector2 = ShortVector.fromArray(SHORT_SPECIES_PREFERRED, shortData2, index); + VectorMask mask = vector1.compare(VectorOperators.NE, vector2); + if (mask.anyTrue()) { + return index + mask.firstTrue(); + } + } + // process the tail + int mismatch = -1; + for (int i = index; i < length; ++i) { + if (shortData1[i] != shortData2[i]) { + mismatch = i; + break; + } + } + return mismatch; + } + @Benchmark public int mismatchIntrinsicInt() { return Arrays.mismatch(intData1, intData2); diff --git a/test/micro/org/openjdk/bench/jdk/incubator/vector/Float16OperationsBenchmark.java b/test/micro/org/openjdk/bench/jdk/incubator/vector/Float16OperationsBenchmark.java index ebbfbb01cc6..cbfe9958924 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/vector/Float16OperationsBenchmark.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/vector/Float16OperationsBenchmark.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.openjdk.bench.java.lang; +package org.openjdk.bench.jdk.incubator.vector; import java.util.stream.IntStream; import java.util.concurrent.TimeUnit; diff --git a/test/micro/org/openjdk/bench/vm/compiler/VectorSubword.java b/test/micro/org/openjdk/bench/vm/compiler/VectorSubword.java new file mode 100644 index 00000000000..5ade452b875 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/VectorSubword.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2026, 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 org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.*; + +import java.util.concurrent.TimeUnit; +import java.util.Random; + +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +@Warmup(iterations = 2, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(value = 3) +public class VectorSubword { + @Param({"1024"}) + public int SIZE; + + private byte[] bytes; + private short[] shorts; + private char[] chars; + private int[] ints; + private long[] longs; + + @Setup + public void init() { + bytes = new byte[SIZE]; + shorts = new short[SIZE]; + chars = new char[SIZE]; + ints = new int[SIZE]; + longs = new long[SIZE]; + } + + // Narrowing + + @Benchmark + public void shortToByte() { + for (int i = 0; i < SIZE; i++) { + bytes[i] = (byte) shorts[i]; + } + } + + @Benchmark + public void shortToChar() { + for (int i = 0; i < SIZE; i++) { + chars[i] = (char) shorts[i]; + } + } + + @Benchmark + public void charToByte() { + for (int i = 0; i < SIZE; i++) { + bytes[i] = (byte) chars[i]; + } + } + + @Benchmark + public void charToShort() { + for (int i = 0; i < SIZE; i++) { + shorts[i] = (short) chars[i]; + } + } + + @Benchmark + public void intToByte() { + for (int i = 0; i < SIZE; i++) { + bytes[i] = (byte) ints[i]; + } + } + + @Benchmark + public void intToShort() { + for (int i = 0; i < SIZE; i++) { + shorts[i] = (short) ints[i]; + } + } + + @Benchmark + public void intToChar() { + for (int i = 0; i < SIZE; i++) { + chars[i] = (char) ints[i]; + } + } + + @Benchmark + public void longToByte() { + for (int i = 0; i < SIZE; i++) { + bytes[i] = (byte) longs[i]; + } + } + + @Benchmark + public void longToShort() { + for (int i = 0; i < SIZE; i++) { + shorts[i] = (short) longs[i]; + } + } + + @Benchmark + public void longToChar() { + for (int i = 0; i < SIZE; i++) { + chars[i] = (char) longs[i]; + } + } + + @Benchmark + public void longToInt() { + for (int i = 0; i < SIZE; i++) { + ints[i] = (int) longs[i]; + } + } + + // Widening + + @Benchmark + public void byteToShort() { + for (int i = 0; i < SIZE; i++) { + shorts[i] = bytes[i]; + } + } + + @Benchmark + public void byteToChar() { + for (int i = 0; i < SIZE; i++) { + chars[i] = (char) bytes[i]; + } + } + + @Benchmark + public void byteToInt() { + for (int i = 0; i < SIZE; i++) { + ints[i] = bytes[i]; + } + } + + @Benchmark + public void byteToLong() { + for (int i = 0; i < SIZE; i++) { + longs[i] = bytes[i]; + } + } + + @Benchmark + public void shortToInt() { + for (int i = 0; i < SIZE; i++) { + ints[i] = shorts[i]; + } + } + + @Benchmark + public void shortToLong() { + for (int i = 0; i < SIZE; i++) { + longs[i] = shorts[i]; + } + } + + @Benchmark + public void charToInt() { + for (int i = 0; i < SIZE; i++) { + ints[i] = chars[i]; + } + } + + @Benchmark + public void charToLong() { + for (int i = 0; i < SIZE; i++) { + longs[i] = chars[i]; + } + } + + @Benchmark + public void intToLong() { + for (int i = 0; i < SIZE; i++) { + longs[i] = ints[i]; + } + } + +}